/* LAINE design system.
   Concept: "the lane" — a calm workspace built around forward pace.
   Palette is cool paper + indigo ink (deliberately not the cream/serif/terracotta
   default). Signature = the pace lane: progress rendered as a track you move along. */

:root {
  --ink: #191c2b;         /* near-black indigo — text + dark surfaces */
  --ink-2: #2b3047;
  --paper: #f5f6f9;       /* cool paper background */
  --surface: #ffffff;
  --line: #e5e8ef;        /* hairlines */
  --muted: #737a8c;
  --accent: #4338ca;      /* indigo — primary action + pace marker */
  --accent-2: #6d6af5;    /* lighter indigo — the AI accent in L·AI·NE */
  --accent-soft: #ecebfb;
  --todo: #94a0b8;
  --doing: #d98a2b;
  --done: #23a06a;
  --blocked: #d9483b;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(25, 28, 43, .06), 0 8px 24px rgba(25, 28, 43, .06);
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }
h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-family: var(--font-display); font-weight: 600; }

/* ---- brand mark ---- */
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: .02em;
  color: var(--ink);
}
.brand-mark .ai, .brand-mark small { color: var(--accent-2); }
.brand-mark.small { font-size: 20px; }

/* ---- buttons ---- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 600;
  font-size: 13px;
  transition: background .12s, border-color .12s, transform .04s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3a30b3; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: transparent; border-color: var(--blocked); color: var(--blocked); }
.btn-danger:hover { background: #fdf1f0; }
.link-btn { background: none; border: none; color: var(--muted); font-size: 12px; text-decoration: underline; }
.link-btn:hover { color: var(--ink); }

/* ---- auth ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 400px at 50% -10%, var(--accent-soft), transparent),
    var(--paper); }
.auth-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow); text-align: center;
}
.auth-tagline { color: var(--muted); margin: 12px 0 28px; font-size: 14px; }
.auth-card label { display: block; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px; }
.auth-card input {
  width: 100%; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 14px; background: var(--paper);
}
.auth-card input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.auth-card .btn-primary { width: 100%; padding: 12px; }
.auth-hint { color: var(--muted); font-size: 12px; margin-top: 12px; }
.sent-check { font-size: 40px; color: var(--done); margin-bottom: 12px; }

/* ---- app shell ---- */
.app { display: grid; grid-template-columns: 240px 1fr 320px; height: 100vh; }

/* ---- sidebar ---- */
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 16px; gap: 16px; overflow: hidden;
}
.ws-switch select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--paper); font-weight: 600;
}
.ws-actions { display: flex; gap: 10px; margin-top: 4px; padding-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav-item {
  flex: 1; background: transparent; border: none; padding: 8px; border-radius: var(--radius-sm);
  font-weight: 600; color: var(--muted); font-size: 13px;
}
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.project-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.proj-pill {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--radius-sm); border: none; background: transparent;
  text-align: left; width: 100%; color: var(--ink); font-size: 13px; font-weight: 500;
}
.proj-pill:hover { background: var(--paper); }
.proj-pill.active { background: var(--accent-soft); color: var(--accent); }
.proj-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.add-project { font-size: 13px; }
.side-foot { display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 12px; }
.user-chip { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- main ---- */
.main { overflow-y: auto; padding: 24px 28px; }
.proj-head, .cal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.proj-client { color: var(--muted); font-size: 13px; }
.view-tabs, .cal-nav { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 3px; }
.tab {
  background: transparent; border: none; padding: 7px 13px; border-radius: 5px;
  font-weight: 600; font-size: 13px; color: var(--muted);
}
.tab.active { background: var(--accent); color: #fff; }

/* ---- Three Answers: the pace lane (signature) ---- */
.answers { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.answer {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.answer .a-label { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.answer .a-big { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.answer .a-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* the lane itself */
.lane {
  position: relative; height: 12px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 20px; margin-top: 14px; overflow: hidden;
}
.lane-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 20px; transition: width .5s cubic-bezier(.2,.7,.2,1);
}
.lane-marker {
  position: absolute; top: -3px; width: 4px; height: 18px; border-radius: 2px;
  background: var(--ink); transition: left .5s cubic-bezier(.2,.7,.2,1);
}
.a-block-item, .a-next-item {
  display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px;
  padding: 5px 0; border-bottom: 1px dashed var(--line);
}
.a-block-item:last-child, .a-next-item:last-child { border-bottom: none; }
.a-block-item .who { color: var(--blocked); font-weight: 600; }
.a-next-item .due { color: var(--muted); font-variant-numeric: tabular-nums; }
.a-next-item .due.over { color: var(--blocked); font-weight: 600; }
.a-empty { color: var(--muted); font-size: 12.5px; font-style: italic; }

/* ---- board ---- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.col-head .name { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.col-head .count { font-size: 11px; color: var(--muted); background: var(--paper); border-radius: 10px; padding: 1px 8px; }
.col.doing .name { color: var(--doing); }
.col.done .name { color: var(--done); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 11px; margin-bottom: 8px; cursor: pointer;
}
.card:hover { border-color: var(--accent-2); }
.card.blocked { border-left: 3px solid var(--blocked); }
.card .c-title { font-weight: 500; margin-bottom: 6px; }
.card .c-meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.pill { border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.pill.wt { background: var(--accent-soft); color: var(--accent); }
.pill.due { background: #fff; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pill.due.over { color: var(--blocked); border-color: var(--blocked); }
.pill.blk { background: #fdecea; color: var(--blocked); }
.card .who { font-size: 11px; }
.col-add { width: 100%; background: transparent; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 8px; color: var(--muted); font-weight: 600; font-size: 12px; }
.col-add:hover { border-color: var(--accent-2); color: var(--accent); }

/* ---- list ---- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--paper); }
.list-row .lr-status { width: 9px; height: 9px; border-radius: 50%; }
.lr-title { display: flex; align-items: center; gap: 9px; }

/* ---- decisions ---- */
.dec-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 16px; }
.dec-add input { padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.dec-list { display: flex; flex-direction: column; gap: 8px; }
.dec-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 14px; }
.dec-card .d-title { font-weight: 600; }
.dec-card .d-detail { color: var(--muted); font-size: 13px; margin-top: 3px; }
.dec-card .d-meta { color: var(--muted); font-size: 11.5px; margin-top: 6px; }

/* ---- brief ---- */
.brief { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: 680px; }
.brief h2 { font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; }
.brief .b-section { margin-top: 18px; }
.brief .b-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.brief .b-line { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13px; display: flex; justify-content: space-between; }

/* ---- calendar ---- */
.cal-nav { align-items: center; padding: 4px; }
.cal-nav span { font-weight: 600; min-width: 150px; text-align: center; }
.cal-grid-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-grid-head span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.other { background: var(--paper); opacity: .55; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-date { font-size: 11px; font-weight: 600; color: var(--muted); }
.cal-ev { font-size: 11px; padding: 2px 6px; border-radius: 4px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.done { opacity: .5; text-decoration: line-through; }

/* ---- chat ---- */
.chat { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.chat-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between;
  align-items: center; font-weight: 700; font-size: 13px; }
.presence { font-size: 11px; color: var(--done); font-weight: 600; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg .m-author { font-size: 11px; font-weight: 700; color: var(--accent); }
.msg .m-body { font-size: 13px; }
.msg .m-time { font-size: 10px; color: var(--muted); }
.msg.me .m-author { color: var(--ink); }
.chat-empty { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 20px; }
.chat-input { display: flex; gap: 6px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.chat-input input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; background: rgba(25,28,43,.35); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-card { background: var(--surface); border-radius: 14px; padding: 24px; width: 100%; max-width: 460px; position: relative;
  box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto; }
.modal-x { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 22px; color: var(--muted); }
.modal-card h3 { margin-bottom: 16px; }
.modal-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
.modal-card input, .modal-card textarea, .modal-card select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.modal-card .row { display: grid; grid-template-columns: 1fr 80px 1fr; gap: 10px; }
.tm-block { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.tm-blockers { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.tm-blocker { display: flex; justify-content: space-between; align-items: center; background: #fdecea;
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12.5px; }
.tm-blocker .clear { background: none; border: none; color: var(--blocked); font-weight: 700; }
.tm-block-add { display: flex; gap: 6px; }
.modal-actions { display: flex; justify-content: space-between; margin-top: 22px; }

/* ---- toast ---- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; z-index: 100; box-shadow: var(--shadow); }

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 200px 1fr; }
  .chat { display: none; }
  .answers { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .board { grid-template-columns: 1fr; }
}
