/* ===========================================================================
   kjerr design system — MindMarket reference
   Cream canvas, white elevation, pill geometry, one structural accent.
   No shadows, no gradients: elevation is the cream -> white surface shift.
   =========================================================================== */

:root {
  --cream:    #f5f1e4;   /* page canvas, never white */
  --white:    #ffffff;   /* elevated cards + floating pill nav only */
  --recess:   #e0dbce;   /* recessed surfaces: inputs, wells, track */
  --ink:      #2c2e2a;   /* text, icons, borders — warm near-black */
  --muted:    #80827f;   /* secondary text */
  --hairline: #d5d5d4;   /* dividers */
  --green:    #8ed462;   /* structural accent: strokes, fills of controls */
  --coral:    #ff705d;   /* ONE prominent action per view */
  --blue:     #2ba0ff;   /* decorative only */
  --yellow:   #f5e211;   /* decorative only */

  --r-card: 50px;
  --r-mid:  28px;
  --r-chip: 10px;
  --nav-h:  64px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* accent overrides written by the workspace settings page */
[data-accent="blue"]   { --green: var(--blue); }
[data-accent="yellow"] { --green: var(--yellow); }
[data-accent="ink"]    { --green: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

.muted   { color: var(--muted); }
.small   { font-size: 13px; }
.tiny    { font-size: 12px; }
.center  { text-align: center; }
.mono-num { font-variant-numeric: tabular-nums; }
.hidden  { display: none !important; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--white); padding: 10px 18px;
  border-radius: var(--r-chip); z-index: 100; }

/* ---------------------------------------------------------------- layout -- */

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 620px; }
.wrap-wide { max-width: 1360px; }

.page { padding: calc(var(--nav-h) + 28px) 0 72px; }

/* -------------------------------------------------------------- pill nav -- */

.nav {
  position: fixed; inset: 14px 0 auto; z-index: 40;
  display: flex; justify-content: center; pointer-events: none;
}
.nav-pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  width: calc(100% - 32px); max-width: 1120px;
  height: var(--nav-h);
  padding: 0 10px 0 22px;
  background: var(--white);
  border: 1px solid var(--green);
  border-radius: var(--r-card);
}
.nav-brand { font-size: 17px; font-weight: 500; letter-spacing: -0.03em; white-space: nowrap; }
.nav-brand-logo { height: 26px; width: auto; border-radius: 6px; vertical-align: middle; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 9px 14px; border-radius: var(--r-card); font-size: 14px; color: var(--ink);
  border: 1px solid transparent;
}
.nav-link:hover { border-color: var(--hairline); }
.nav-link[aria-current="page"] { border-color: var(--green); }
.nav-sep { width: 1px; height: 24px; background: var(--hairline); margin: 0 6px; }

/* --------------------------------------------------------------- surface -- */

.card {
  background: var(--white);
  border-radius: var(--r-card);
  padding: 28px 30px;
  border: 1px solid transparent;
}
.card-mid { border-radius: var(--r-mid); padding: 20px 22px; }
.card-outline { border-color: var(--hairline); }
.card-accent { border-color: var(--green); }
.well { background: var(--recess); border-radius: var(--r-mid); padding: 18px 20px; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  border-radius: var(--r-card);
  border: 1px solid var(--ink);
  background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--ink); color: var(--cream); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--ink); }

/* the single prominent action per view */
.btn-primary { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }

.btn-quiet { border-color: var(--hairline); color: var(--muted); }
.btn-quiet:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- inputs -- */

.field { display: block; margin-bottom: 16px; }
.label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; background: var(--white); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-mid);
  padding: 13px 18px; font-size: 15px;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--green); }
.textarea { min-height: 104px; resize: vertical; line-height: 1.55; border-radius: var(--r-mid); }
.select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%232c2e2a' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 18px center; }
.input-sunken { background: var(--recess); border-color: transparent; }
.field-error { color: var(--ink); font-size: 13px; margin-top: 6px; }
.field-error::before { content: "— "; }
.input-invalid { border-color: var(--coral); }

.search { position: relative; }
.search .input { padding-left: 42px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); }

/* ----------------------------------------------------------------- chips -- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-chip); border: 1px solid var(--hairline);
  padding: 3px 9px; font-size: 12px; line-height: 1.6; color: var(--ink);
  background: transparent; white-space: nowrap;
}
.chip-ink { border-color: var(--ink); }
.chip-solid { background: var(--recess); border-color: transparent; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
/* Status chips are typographic, not colour-coded: the accents are not a
   semantic system. Weight and border carry the difference. */
.status-open       { border-color: var(--hairline); color: var(--muted); }
.status-planned    { border-color: var(--ink); }
.status-in_progress{ border-color: var(--ink); font-weight: 500; }
.status-done       { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.status-declined   { border-color: var(--hairline); color: var(--muted); text-decoration: line-through; }

.tag-chip { border-radius: var(--r-chip); border: 1px dashed var(--hairline); padding: 3px 9px;
  font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------ vote pill --- */

.vote {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 58px; padding: 8px 10px; gap: 1px;
  border: 1px solid var(--hairline); border-radius: var(--r-card);
  background: var(--white); cursor: pointer; color: var(--ink);
  transition: border-color .12s ease, background-color .12s ease;
}
.vote:hover { border-color: var(--ink); }
.vote[data-voted="1"] { border-color: var(--green); background: var(--white); }
.vote[data-voted="1"] .vote-caret { color: var(--green); }
.vote-caret { font-size: 11px; line-height: 1; }
.vote-count { font-size: 17px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vote-label { font-size: 10px; color: var(--muted); letter-spacing: 0.02em; }

/* ------------------------------------------------------------- idea list -- */

.board-grid { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--nav-h) + 28px); }
.sidebar-title { font-size: 12px; color: var(--muted); padding: 0 14px 8px; letter-spacing: .04em;
  text-transform: uppercase; }
.sidebar-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-card); border: 1px solid transparent; font-size: 14px; }
.sidebar-item[aria-current="page"] { background: var(--white); border-color: var(--green); }
.sidebar-item:hover { border-color: var(--hairline); }

.idea-list { display: flex; flex-direction: column; gap: 10px; }
.idea-row {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--white); border: 1px solid transparent; border-radius: var(--r-mid);
  padding: 18px 22px;
}
.idea-row:hover { border-color: var(--green); }
.idea-title { font-size: 17px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 4px; }
.idea-snippet { color: var(--muted); font-size: 14px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.idea-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); }

.sort-bar { display: flex; align-items: center; gap: 6px; }
.sort-opt { padding: 7px 14px; border-radius: var(--r-card); border: 1px solid transparent;
  font-size: 13px; color: var(--muted); cursor: pointer; }
.sort-opt[aria-current="true"] { border-color: var(--green); color: var(--ink); background: var(--white); }

/* --------------------------------------------------- duplicate suggester -- */

.similar { margin-top: 14px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.similar-head { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.similar-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--r-chip); border: 1px solid var(--hairline); margin-bottom: 6px; }
.similar-item:hover { border-color: var(--green); }
.similar-item .grow { font-size: 14px; }

/* -------------------------------------------------------------- comments -- */

.comment { padding: 16px 0; border-top: 1px solid var(--hairline); }
.comment:first-child { border-top: none; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.comment-author { font-weight: 500; }
.comment-body { white-space: pre-wrap; word-wrap: break-word; }
.comment-admin { background: var(--white); border: 1px solid var(--green); border-radius: var(--r-mid);
  padding: 18px 20px; margin: 14px 0; }
.comment-admin .comment-head { color: var(--ink); }
.comment-internal { background: var(--recess); border-radius: var(--r-mid); padding: 16px 18px;
  margin: 12px 0; border: 1px dashed var(--muted); }

/* ----------------------------------------------------------- admin inbox -- */

.inbox { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 18px;
  align-items: start; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 190px);
  overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.inbox-row { display: block; background: var(--white); border: 1px solid transparent;
  border-radius: var(--r-mid); padding: 14px 18px; cursor: pointer; text-align: left; width: 100%; }
.inbox-row:hover { border-color: var(--hairline); }
.inbox-row[aria-selected="true"] { border-color: var(--green); }
.inbox-row-title { font-size: 15px; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 4px; }
.inbox-row-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  flex-wrap: wrap; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.detail { position: sticky; top: calc(var(--nav-h) + 24px); }
.detail-empty { color: var(--muted); text-align: center; padding: 80px 20px; }
.status-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.status-opt { padding: 6px 12px; border-radius: var(--r-chip); border: 1px solid var(--hairline);
  font-size: 13px; cursor: pointer; background: transparent; }
.status-opt:hover { border-color: var(--ink); }
.status-opt[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--hairline);
  border-radius: 6px; font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 7px 14px; border-radius: var(--r-card); font-size: 13px; color: var(--muted);
  border: 1px solid transparent; cursor: pointer; }
.tab[aria-current="page"] { background: var(--white); border-color: var(--green); color: var(--ink); }

/* ---------------------------------------------------------------- notice -- */

.notice { border: 1px solid var(--ink); border-radius: var(--r-mid); padding: 14px 18px;
  margin-bottom: 18px; background: var(--white); font-size: 14px; }
.notice-quiet { border-color: var(--hairline); color: var(--muted); background: transparent; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); padding: 12px 22px; border-radius: var(--r-card);
  font-size: 14px; z-index: 60; opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.toast.show { opacity: 1; }

/* --------------------------------------------------------------- landing -- */

.hero { padding: 40px 0 24px; }
.hero h1 {
  font-size: clamp(52px, 11.2vw, 140px);
  font-weight: 500; letter-spacing: -0.06em; line-height: 0.95;
  margin: 0 0 28px; max-width: 14ch;
}
.hero-sub { font-size: clamp(17px, 2.2vw, 21px); color: var(--muted); max-width: 46ch;
  letter-spacing: -0.01em; line-height: 1.45; margin-bottom: 32px; }
.section-h { font-size: clamp(34px, 5.6vw, 81px); font-weight: 500; letter-spacing: -0.05em;
  line-height: 1.0; margin: 0 0 28px; }
.section-h-sm { font-size: clamp(28px, 4.2vw, 53px); }
.section { padding: 72px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature { background: var(--white); border-radius: var(--r-card); padding: 34px 32px; min-height: 250px;
  display: flex; flex-direction: column; }
.feature-num { font-size: 12px; color: var(--muted); margin-bottom: auto; }
.feature h3 { font-size: 26px; letter-spacing: -0.03em; margin: 24px 0 10px; }
.feature p { color: var(--muted); font-size: 15px; }
.loop { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.loop-step { background: var(--white); border: 1px solid var(--green); border-radius: var(--r-card);
  padding: 12px 22px; font-size: 15px; }
.loop-arrow { color: var(--muted); }
.marquee-rule { height: 1px; background: var(--hairline); margin: 0; border: 0; }
.footer { padding: 44px 0 56px; color: var(--muted); font-size: 13px; }

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
  .board-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar-list { display: flex; gap: 8px; overflow-x: auto; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { max-height: none; }
  .detail { position: static; }
  .inbox-detail-pane { display: none; }
  body.detail-open .inbox-list { display: none; }
  body.detail-open .inbox-detail-pane { display: block; }
}

@media (max-width: 620px) {
  .card { padding: 22px 20px; border-radius: var(--r-mid); }
  .feature { padding: 26px 24px; border-radius: var(--r-mid); min-height: 0; }
  .nav-pill { padding: 0 8px 0 16px; height: 56px; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .nav-links { gap: 2px; }
  .hero { padding: 24px 0 8px; }
  .section { padding: 48px 0; }
  .idea-row { padding: 16px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
