/* roadmaps design system — modern SaaS app shell (Linear/Height/Vercel-grade).
   Inter variable, sidebar app shell for admin, polished public portal, inline
   SVG icon set. Class names from the views are preserved. */
:root {
  --bg: #f7f7f9; --surface: #ffffff; --raised: #ffffff;
  --ink: #15171c; --ink-2: #51555e; --muted: #8b8f99;
  --line: #ececed; --line-2: #f3f3f5; --hover: #f5f5f7;
  --brand: #5b5bd6; --brand-ink: #18181b;
  --green: #157f48; --green-bg: #e3f4ea; --amber: #976a16; --amber-bg: #f6eed8;
  --purple: #6d4ad6; --red: #c2362a; --red-bg: #fbe7e4;
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px; --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(18,18,23,.05);
  --shadow: 0 1px 2px rgba(18,18,23,.04), 0 2px 6px -2px rgba(18,18,23,.06);
  --shadow-md: 0 6px 16px -4px rgba(18,18,23,.12), 0 2px 6px -2px rgba(18,18,23,.06);
  --shadow-lg: 0 20px 48px -16px rgba(18,18,23,.24);
  --sidebar-w: 246px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.55; letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; font-feature-settings: 'cv02','cv03','cv04','cv11';
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
h1,h2,h3 { letter-spacing: -0.025em; line-height: 1.2; font-weight: 650; color: var(--ink); margin: 0; }
h1 { font-weight: 700; }
.serif { font-weight: 700; letter-spacing: -0.035em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
code { font-family: ui-monospace,'SF Mono',Menlo,monospace; font-size: .86em; background: var(--line-2); padding: .14em .44em; border-radius: 5px; }
.ico { display: inline-block; vertical-align: -0.18em; flex: none; }

/* simple sticky header (onboarding / fallback pages) */
.topbar { background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .wrap { display: flex; align-items: center; gap: 14px; height: 56px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 640px; }
.brand { font-weight: 700; font-size: 16.5px; letter-spacing: -.03em; color: var(--ink); }
.brand:hover { text-decoration: none; }

/* ============ APP SHELL (admin) ============ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 12px; gap: 6px; }
.side-top { padding: 2px; }
.ws-switch { position: relative; display: flex; align-items: center; gap: 9px; padding: 8px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: background .12s; }
.ws-switch:hover { background: var(--hover); }
.ws-name { font-weight: 650; font-size: 13.5px; letter-spacing: -.01em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chevron { color: var(--muted); display: flex; }
.ws-switch form { position: absolute; inset: 0; margin: 0; }
.ws-switch select { width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.side-nav { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px; transition: background .1s, color .1s; }
.side-nav a .ico { color: var(--muted); transition: color .1s; }
.side-nav a:hover { background: var(--hover); color: var(--ink); }
.side-nav a:hover .ico { color: var(--ink-2); }
.side-nav a.active { background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--brand); font-weight: 600; }
.side-nav a.active .ico { color: var(--brand); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.side-link .ico { color: var(--muted); }
.side-link:hover { background: var(--hover); color: var(--ink); }
.side-user { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.side-email { flex: 1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user form { margin: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: .12s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.canvas { min-width: 0; background: var(--bg); }
.inner { padding: 10px 40px 56px; max-width: 1040px; }
/* Inside the canvas, legacy .wrap becomes a passthrough (the canvas controls width). */
.canvas .wrap { max-width: none; padding: 0; margin: 0; }

/* ============ PORTAL HEADER ============ */
.portal-bar { background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.portal-bar-in { max-width: 940px; margin: 0 auto; padding: 0 22px; height: 60px; display: flex; align-items: center; gap: 20px; }
.portal-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.03em; color: var(--ink); }
.portal-logo img { height: 26px; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; }
.portal-nav { display: flex; gap: 2px; }
.portal-nav a { padding: 7px 13px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.portal-nav a:hover { background: var(--hover); color: var(--ink); }
.portal-nav a.active { color: var(--ink); font-weight: 600; }
.portal-bar-in .avatar { margin-left: auto; }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font);
  font-size: 13.5px; font-weight: 550; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .04s; box-shadow: var(--shadow-xs); white-space: nowrap; }
.btn .ico { color: currentColor; opacity: .85; }
.btn:hover { border-color: #dadade; background: #fcfcfd; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn.primary { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.brand { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 1px 2px color-mix(in srgb,var(--brand) 40%,transparent); }
.btn.brand:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--red); border-color: var(--red-bg); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; gap: 5px; }
.btn.lg { padding: 11px 18px; font-size: 14.5px; border-radius: var(--radius); }
.btn:disabled { opacity: .5; cursor: default; }

/* ============ CARDS / PANELS ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card.flat { box-shadow: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel > .panel-row { padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.panel > .panel-row:last-child { border-bottom: none; }
a.panel-row:hover { background: var(--hover); }

/* ============ FORMS ============ */
label { display: block; font-weight: 550; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=url], input[type=search], select, textarea {
  width: 100%; font-family: var(--font); font-size: 13.5px; color: var(--ink); padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline: none;
  transition: border-color .12s, box-shadow .12s; box-shadow: var(--shadow-xs); }
input::placeholder, textarea::placeholder { color: #aeb2bb; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb,var(--brand) 16%,transparent); }
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ============ CHIPS / STATUS ============ */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 550; padding: 2.5px 9px; border-radius: 7px; background: var(--line-2); color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 7px;
  color: var(--sc, var(--muted)); background: color-mix(in srgb, var(--sc, #888) 12%, transparent); }
.status .dot { background: var(--sc, var(--muted)); }

/* ============ VOTE ============ */
.vote { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; gap: 1px;
  padding: 7px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink-2); cursor: pointer; line-height: 1.1; transition: .12s; user-select: none; box-shadow: var(--shadow-xs); }
.vote:hover { border-color: var(--brand); color: var(--brand); }
.vote.voted { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 3px color-mix(in srgb,var(--brand) 40%,transparent); }
.vote .ico { opacity: .95; }
.vote .count { font-weight: 700; font-size: 14px; letter-spacing: -.02em; }
.vote .lbl { font-size: 10px; opacity: .7; font-weight: 500; }

/* ============ POST LIST ============ */
.post-item { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); transition: background .1s; }
.post-item:hover { background: var(--hover); }
.post-item:last-child { border-bottom: none; }
.post-item h3 { margin: 0 0 5px; font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.post-item h3 a { color: var(--ink); }
.post-item .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.post-item .meta .ico { color: var(--muted); }

/* ============ KANBAN ============ */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 14px; }
.kanban-col { background: var(--line-2); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 140px; }
.kanban-col > .col-head { padding: 12px 14px 10px; font-weight: 650; font-size: 12.5px; letter-spacing: -.01em; display: flex; justify-content: space-between; align-items: center; color: var(--ink-2); }
.kanban-col > .col-head .count-pill { background: var(--surface); color: var(--muted); border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.kanban-col > .col-body { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.kanban-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; background: var(--surface); cursor: grab; box-shadow: var(--shadow-xs); transition: box-shadow .12s, transform .04s, border-color .12s; }
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: #dcdce1; }
.kanban-card:active { cursor: grabbing; }
.kanban-card a { color: var(--ink); }
.kanban-card.drag-over { outline: 2px dashed var(--brand); }
.kanban-col.drag-over { background: color-mix(in srgb, var(--brand) 9%, var(--line-2)); }

/* ============ CHANGELOG ============ */
.cl-entry { padding: 26px 0; border-bottom: 1px solid var(--line); }
.cl-labels { display: flex; gap: 6px; margin-bottom: 10px; }
.lbl-new { background: var(--green-bg); color: var(--green); }
.lbl-improved { background: color-mix(in srgb,var(--brand) 14%,transparent); color: var(--brand); }
.lbl-fixed { background: var(--amber-bg); color: var(--amber); }

/* ============ PUBLIC ROADMAP ============ */
.rm-page { max-width: 1120px; margin: 0 auto; padding: 46px 24px 72px; }
.rm-head { margin-bottom: 34px; }
.rm-head h1 { font-size: 30px; font-weight: 760; letter-spacing: -.04em; }
.rm-sub { color: var(--muted); font-size: 15px; margin-top: 7px; max-width: 540px; }
.rm-cols { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 26px; align-items: start; }
.rm-col { min-width: 0; }
.rm-col-head { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.rm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 16%, transparent); }
.rm-col-title { font-weight: 650; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.rm-col-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.rm-col-list { display: flex; flex-direction: column; gap: 11px; }
.rm-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 16px; box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s, transform .06s; overflow: hidden; }
.rm-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sc); opacity: 0; transition: opacity .15s; }
.rm-card:hover { box-shadow: var(--shadow-md); border-color: #dbdbe1; transform: translateY(-1px); }
.rm-card:hover::before { opacity: .65; }
.rm-card-title { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.012em; color: var(--ink); }
.rm-card-title:hover { color: var(--brand); }
.rm-card-desc { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rm-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.rm-vote { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 20px; padding: 3px 11px 3px 8px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); cursor: pointer; transition: .12s; }
.rm-vote .ico { opacity: .9; }
.rm-vote:hover { border-color: var(--brand); color: var(--brand); }
.rm-vote.voted { background: var(--brand); border-color: var(--brand); color: #fff; }
.rm-tag { font-size: 11px; font-weight: 550; padding: 2px 8px; border-radius: 6px; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); }
.rm-empty { font-size: 12.5px; color: var(--muted); padding: 16px 4px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
@media (max-width: 900px) { .rm-cols { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 560px) { .rm-cols { grid-template-columns: 1fr !important; } }

/* ============ MISC ============ */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; font-weight: 500; border: 1px solid transparent; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.err { background: var(--red-bg); color: var(--red); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .serif { font-size: 19px; color: var(--ink); display: block; margin-bottom: 6px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 26px 0 22px; }
.page-head h1 { font-size: 22px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: -.035em; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 9px 13px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
/* segmented control (sort tabs reuse .btn.sm groups; this refines a run of them) */
.seg { display: inline-flex; background: var(--line-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.seg a:hover { color: var(--ink); }
.seg a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 650; font-size: 12px; flex: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .side-nav a span { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; border: none; padding-top: 0; }
  .side-link span { display: none; }
  .inner { padding: 16px 20px 48px; }
  .page-head { flex-direction: column; align-items: stretch; }
}
