/* Content Studio -- Primary Web Design admin language, modernized (2026-12-04).
   Tokens copied from Primary-Web-Design/site/admin/includes/admin.css so both tools read as one family. */
:root {
  --ink: #15141b; --ink-2: #1e1d27; --ink-3: #2b2938;
  --paper: #fff; --bg: #f4f3f8; --bg-2: #ecebf3;
  --text: #15141b; --text-2: #4a4958; --text-3: #6f6e80;
  --rule: #e2e1ea; --rule-2: #d0cfdc;
  --g1: #c43ef6; --g2: #7a52f4; --g3: #2b64f5;
  --grad: linear-gradient(135deg, var(--g1) 0%, var(--g2) 50%, var(--g3) 100%);
  /* Buttons and bubbles with white text: every stop is >= 5.6:1 against #fff (WCAG AA). --grad's #c43ef6 is only 3.91:1. */
  --grad-btn: linear-gradient(135deg, #9b2fd0 0%, #6542e0 50%, #2456e0 100%);
  --violet: #6d3fe0; --violet-tint: #f1ecff;
  --ok: #127a4b; --ok-tint: #e6f6ee; --warn: #9a5b00; --warn-tint: #fdf3e1; --bad: #b42318; --bad-tint: #fdecea; --blue-tint: #e8efff;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif; --display: "Plus Jakarta Sans", "Inter", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 14px; --r-sm: 9px; --gap: 24px; --half: 12px; --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 1px 2px rgba(21,20,27,.04), 0 8px 24px rgba(21,20,27,.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); min-height: 100vh; font-variant-numeric: tabular-nums; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(900px 500px at 100% -10%, rgba(122,82,244,.10), transparent 60%), radial-gradient(700px 400px at -10% 110%, rgba(196,62,246,.07), transparent 60%); }
a { color: var(--violet); }
button, input, textarea, select { font: inherit; color: inherit; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* top bar + nav */
.top { background: var(--ink); height: 66px; padding: 0 var(--gap); display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 30; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand__name { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; background: linear-gradient(90deg, #c77dff, #8f7bff 55%, #6f9bff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand__tag { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #cfc8ff; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 3px 9px; }
.top__right { display: flex; align-items: center; gap: 22px; color: #b9b7c8; font-size: 13.5px; }
.top__right button { background: none; border: 0; color: #b9b7c8; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; }
.top__right button:hover { color: #fff; }
.top__right .ico { width: 17px; height: 17px; }
.who { display: inline-flex; align-items: center; gap: 9px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-btn); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.nav { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 0 var(--gap); display: flex; overflow-x: auto; scrollbar-width: none; position: sticky; top: 66px; z-index: 29; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 15px 20px 14px; font-size: 14px; font-weight: 600; color: var(--text-3); text-decoration: none; white-space: nowrap; }
.nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); opacity: 0; transition: opacity .2s; }
.nav a:hover, .nav a.on { color: var(--text); }
.nav a.on::after { opacity: 1; }
.nav .ico { width: 18px; height: 18px; opacity: .8; }

.main { width: 100%; max-width: clamp(1100px, 88vw, 1680px); margin: 0 auto; padding: var(--gap); display: grid; gap: var(--gap); align-content: start; }

/* hero */
.hero { background: var(--ink); color: #fff; border-radius: var(--r); padding: 28px 32px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: auto -8% -70% auto; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(122,82,244,.42), rgba(43,100,245,0) 70%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 40%, #000); }
.hero > * { position: relative; z-index: 1; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #b3a8ff; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.hero h1 { font-family: var(--display); font-size: clamp(24px, 2.2vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.hero p { color: #b9b7c8; font-size: 14.5px; margin-top: 6px; max-width: 760px; }
.hero__meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; color: #cfcbe0; font-size: 13.5px; }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta .ico { width: 16px; height: 16px; color: #a99cff; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--sans); padding: 10px 18px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--text); text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(21,20,27,.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn--grad { background: var(--grad-btn); color: #fff; border-color: transparent; }
.btn--grad .ico { color: #fff; }
.btn--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.btn--ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--sm .ico { width: 15px; height: 15px; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--quiet:hover:not(:disabled) { background: var(--bg-2); box-shadow: none; transform: none; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.kpi { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 22px; display: grid; gap: 4px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.kpi__label { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.kpi__label .ico { width: 16px; height: 16px; color: var(--violet); }
.kpi__val { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi__sub { font-size: 13px; color: var(--text-3); }
.meter { height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width .6s var(--ease); }

/* section heading */
.sec { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sec h2 { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.sec h2 .ico { color: var(--violet); }
.muted { color: var(--text-3); font-size: 13.5px; }

/* project cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--gap); }
.pcard { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 22px; display: grid; gap: var(--half); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; position: relative; overflow: hidden; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(21,20,27,.10); border-color: #cbbcff; }
.pcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pcard h3 { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.pcard__sme { font-size: 13.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.pcard__sme .ico { width: 16px; height: 16px; color: var(--text-3); }
.pcard__foot { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-3); border-top: 1px solid var(--rule); padding-top: var(--half); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--violet-tint); color: var(--violet); white-space: nowrap; }
.chip .ico { width: 13px; height: 13px; }
.chip--client { background: #fff1e8; color: #b54708; }
.chip--locked, .chip--soon { background: var(--bg-2); color: var(--text-3); }
.chip--ready { background: var(--blue-tint); color: #2448b8; }
.chip--review { background: var(--warn-tint); color: var(--warn); }
.chip--approved { background: var(--ok-tint); color: var(--ok); }
.chip--stale { background: var(--bad-tint); color: var(--bad); }
.chip--running { background: var(--violet-tint); color: var(--violet); }
.dots { display: flex; gap: 6px; align-items: center; }
.dots i { width: 22px; height: 6px; border-radius: 6px; background: var(--bg-2); }
.dots i.approved { background: var(--grad); }
.dots i.review, .dots i.ready { background: #c9b8ff; }
.dots i.stale { background: #f3b4ad; }
.empty { background: var(--paper); border: 1.5px dashed var(--rule-2); border-radius: var(--r); padding: 48px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--text-2); }
.empty > .ico { width: 40px; height: 40px; color: var(--violet); }

/* conveyor track */
.track { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 22px 26px 18px; box-shadow: var(--shadow); position: sticky; top: 118px; z-index: 20; }
.track__rail { display: grid; grid-template-columns: repeat(7, 1fr); position: relative; }
.track__line { position: absolute; left: calc(100% / 14); right: calc(100% / 14); top: 21px; height: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.track__line i { display: block; height: 100%; background: var(--grad); transition: width .7s var(--ease); position: relative; }
.track__line i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 8px, transparent 8px 18px); animation: belt 1.2s linear infinite; }
@keyframes belt { to { background-position: 18px 0; } }
.station { display: grid; justify-items: center; gap: 8px; background: none; border: 0; cursor: pointer; position: relative; z-index: 1; padding: 0 4px; }
.station__dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--rule-2); color: var(--text-3); transition: all .3s var(--ease); }
.station__dot .ico { width: 20px; height: 20px; }
.station__name { font-size: 12.5px; font-weight: 700; color: var(--text-3); letter-spacing: .01em; }
.station__state { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.station.approved .station__dot { background: var(--grad-btn); border-color: transparent; color: #fff; }
.station.approved .station__name { color: var(--text); }
.station.ready .station__dot, .station.review .station__dot { border-color: var(--g2); color: var(--violet); box-shadow: 0 0 0 6px rgba(122,82,244,.13); }
.station.ready .station__name, .station.review .station__name { color: var(--text); }
.station.stale .station__dot { border-color: #f1a39a; color: var(--bad); }
.station.current .station__dot { animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px rgba(122,82,244,.05); } }
.station.soon { cursor: default; opacity: .55; }

/* stage cards */
.stage { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 270px; transition: border-color .3s; }
.stage.is-active { border-color: #c7b6ff; box-shadow: 0 0 0 4px rgba(122,82,244,.08), var(--shadow); }
.stage__head { display: flex; align-items: center; gap: 16px; padding: 18px 24px; cursor: pointer; user-select: none; }
.stage__num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 16px; background: var(--bg-2); color: var(--text-3); flex: none; }
.stage.approved .stage__num, .stage.is-active .stage__num { background: var(--grad-btn); color: #fff; }
.stage__title { flex: 1; min-width: 0; }
.stage__title h3 { font-family: var(--display); font-size: 17.5px; font-weight: 800; letter-spacing: -.01em; }
.stage__title p { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage__head .chev { color: var(--text-3); transition: transform .25s var(--ease); }
.stage.open .stage__head .chev { transform: rotate(180deg); }
.stage__body { display: none; border-top: 1px solid var(--rule); }
.stage.open .stage__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.stage__left { padding: var(--gap); display: grid; gap: var(--gap); align-content: start; border-right: 1px solid var(--rule); background: linear-gradient(180deg, #faf9fd, var(--paper)); }
.stage__right { padding: var(--gap); display: grid; gap: var(--half); align-content: start; min-width: 0; }
.panel { display: grid; gap: var(--half); }
.panel__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.label .ico { width: 15px; height: 15px; color: var(--violet); }
.instr { font-size: 14.5px; color: var(--text-2); }
.good { display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.good li { list-style: none; display: flex; gap: 8px; align-items: flex-start; }
.good .ico { width: 16px; height: 16px; color: var(--ok); margin-top: 2px; }
.prompt { background: var(--ink); color: #dcd8ee; border-radius: var(--r-sm); font: 12.5px/1.6 var(--mono); padding: 14px 16px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; position: relative; }
.prompt.tall { max-height: 560px; }
.prompt textarea { width: 100%; min-height: 360px; background: transparent; border: 0; color: inherit; font: inherit; resize: vertical; outline: none; }
.prompt__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row--end { justify-content: flex-end; }
.sel { appearance: none; border: 1px solid var(--rule-2); border-radius: 999px; padding: 8px 34px 8px 14px; font-size: 13.5px; font-weight: 600; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6e80' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
.out { width: 100%; min-height: 460px; border: 1px solid var(--rule-2); border-radius: var(--r-sm); padding: 16px 18px; font: 13.5px/1.65 var(--mono); resize: vertical; background: #fdfdff; outline: none; transition: border-color .2s, box-shadow .2s; }
.out:focus { border-color: var(--g2); box-shadow: 0 0 0 4px rgba(122,82,244,.12); }
.preview { border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 18px 22px; min-height: 460px; max-height: 820px; overflow: auto; font-size: 14.5px; }
.preview h1, .preview h2, .preview h3 { font-family: var(--display); letter-spacing: -.01em; margin: 18px 0 6px; line-height: 1.25; }
.preview h1 { font-size: 21px; } .preview h2 { font-size: 17px; } .preview h3 { font-size: 15px; color: var(--violet); }
.preview > :first-child { margin-top: 0; }
.preview p, .preview li { color: var(--text-2); } .preview ul, .preview ol { padding-left: 22px; margin: 4px 0; }
.preview hr { border: 0; height: 2px; background: var(--grad); opacity: .35; margin: 22px 0; }
.preview .art { border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 14px 16px; margin: 10px 0; position: relative; }
.preview .art.bad { border-color: #f1c4bf; background: #fffafa; }
.preview .kv { display: grid; grid-template-columns: 140px 1fr auto; gap: 4px 12px; font-size: 13.5px; align-items: baseline; }
.preview .kv b { color: var(--text-3); font-weight: 600; }
.cnt { font: 600 11.5px var(--mono); padding: 1px 7px; border-radius: 999px; background: var(--ok-tint); color: var(--ok); white-space: nowrap; }
.cnt.bad { background: var(--bad-tint); color: var(--bad); } .cnt.warn { background: var(--warn-tint); color: var(--warn); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-3); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--text); box-shadow: 0 1px 3px rgba(21,20,27,.12); }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--ok-tint); color: var(--ok); }
.check .ico { width: 14px; height: 14px; }
.check.bad { background: var(--bad-tint); color: var(--bad); } .check.warn { background: var(--warn-tint); color: var(--warn); }
.locked-note { padding: 28px var(--gap); display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 14px; border-top: 1px solid var(--rule); }
.locked-note .ico { color: var(--text-3); }
.runs { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.runs div { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; padding: 6px 10px; border-radius: 8px; align-items: center; }
.runs div:nth-child(odd) { background: var(--bg); }
.runs .err { color: var(--bad); }
.paste { display: none; gap: var(--half); }
.paste.on { display: grid; }
.paste textarea { min-height: 180px; }

/* setup card */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--half) var(--gap); }
.field { display: grid; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.inp { border: 1px solid var(--rule-2); border-radius: var(--r-sm); padding: 10px 13px; font-size: 14.5px; background: var(--paper); outline: none; width: 100%; transition: border-color .2s, box-shadow .2s; }
.inp:focus { border-color: var(--g2); box-shadow: 0 0 0 4px rgba(122,82,244,.12); }
textarea.inp { resize: vertical; min-height: 84px; }
.drop { border: 2px dashed #cbbcff; border-radius: var(--r); padding: 34px 20px; text-align: center; display: grid; justify-items: center; gap: 8px; background: linear-gradient(180deg, #fbf9ff, #f6f2ff); cursor: pointer; transition: all .2s; }
.drop.over { border-color: var(--g2); background: #efe8ff; transform: scale(1.005); }
.drop .ico { width: 34px; height: 34px; color: var(--violet); }
.drop b { font-family: var(--display); font-size: 16px; }
.tstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--half); }
.tstat { background: var(--bg); border-radius: var(--r-sm); padding: 12px 14px; }
.tstat b { display: block; font-family: var(--display); font-size: 22px; font-weight: 800; }
.tstat span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.tpreview { background: var(--bg); border-radius: var(--r-sm); padding: 14px 16px; font: 12.5px/1.6 var(--mono); max-height: 320px; overflow: auto; white-space: pre-wrap; color: var(--text-2); }

/* ask drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--paper); box-shadow: -20px 0 60px rgba(21,20,27,.18); z-index: 60; display: grid; grid-template-rows: auto 1fr auto; transform: translateX(105%); transition: transform .35s var(--ease); }
.drawer.on { transform: none; }
.drawer__head { background: var(--ink); color: #fff; padding: 18px 22px; display: grid; gap: 10px; position: relative; }
.drawer__head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad); }
.drawer__head h3 { font-family: var(--display); font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.drawer__head .row { justify-content: space-between; }
.drawer__head .sel { background-color: var(--ink-2); color: #fff; border-color: rgba(255,255,255,.2); }
.msgs { overflow: auto; padding: 20px 22px; display: grid; gap: 14px; align-content: start; background: var(--bg); }
.msg { max-width: 92%; padding: 12px 15px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.user { justify-self: end; background: var(--grad-btn); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { justify-self: start; background: var(--paper); border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.msg__tools { display: flex; gap: 6px; margin-top: 8px; }
.msg.typing { color: var(--text-3); font-style: italic; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; }
.suggest button { border: 1px solid #d9cdff; background: var(--violet-tint); color: var(--violet); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; }
.drawer__foot { padding: 14px 18px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.drawer__foot textarea { min-height: 70px; }
.scrim { position: fixed; inset: 0; background: rgba(21,20,27,.35); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; background: rgba(21,20,27,.45); padding: 20px; }
.modal.on { display: grid; }
.modal__box { background: var(--paper); border-radius: 18px; width: min(720px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(21,20,27,.35); }
.modal__head { padding: 22px 26px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.modal__head h3 { font-family: var(--display); font-size: 20px; font-weight: 800; }
.modal__body { padding: 22px 26px; display: grid; gap: var(--half); }
.modal__foot { padding: 16px 26px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: 10px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login__art { background: var(--ink); position: relative; overflow: hidden; display: grid; align-content: end; padding: 56px; color: #fff; }
.login__art::before { content: ""; position: absolute; width: 760px; height: 760px; right: -220px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(122,82,244,.55), rgba(43,100,245,0) 65%); }
.login__art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 20px 20px; }
.login__art > * { position: relative; z-index: 1; }
.login__art h1 { font-family: var(--display); font-size: clamp(34px, 3.2vw, 54px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; max-width: 640px; }
.login__art h1 em { font-style: normal; background: linear-gradient(90deg, #d68bff, #9d8bff 55%, #7aa5ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login__art p { color: #b9b7c8; margin-top: 14px; max-width: 520px; font-size: 16px; }
.belt { display: flex; gap: 10px; margin-top: 34px; flex-wrap: wrap; }
.belt span { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: #dcd8ee; display: inline-flex; gap: 8px; align-items: center; }
.belt span b { color: #b3a8ff; font-family: var(--display); }
.login__form { display: grid; place-items: center; padding: 40px; }
.login__form form { width: min(400px, 100%); display: grid; gap: 16px; }
.login__form h2 { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login__err { color: var(--bad); font-size: 14px; min-height: 20px; }

/* prompt library */
.lib { display: grid; grid-template-columns: 280px 1fr; gap: var(--gap); align-items: start; }
.lib__list { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 8px; display: grid; gap: 4px; position: sticky; top: 130px; }
.lib__list button { text-align: left; border: 0; background: none; padding: 12px 14px; border-radius: 10px; cursor: pointer; display: grid; gap: 2px; }
.lib__list button b { font-size: 14px; }
.lib__list button span { font-size: 12px; color: var(--text-3); }
.lib__list button.on { background: var(--violet-tint); }
.lib__list button.on b { color: var(--violet); }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--gap); display: grid; gap: var(--gap); box-shadow: var(--shadow); }
.code { width: 100%; border: 1px solid var(--rule-2); border-radius: var(--r-sm); padding: 14px 16px; font: 12.5px/1.6 var(--mono); min-height: 140px; resize: vertical; background: #fdfdff; outline: none; }
.code.big { min-height: 520px; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.vars code { font: 12px var(--mono); background: var(--bg-2); padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.hist { display: grid; gap: 4px; font-size: 13px; }
.hist div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; background: var(--bg); align-items: center; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 40px rgba(21,20,27,.3); opacity: 0; pointer-events: none; transition: all .3s var(--ease); z-index: 90; display: flex; gap: 8px; align-items: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Sticky footer: #app fills the viewport, .main grows, footer sits at the bottom on short pages. */
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > .main { flex: 1 0 auto; }
.foot { text-align: center; font-size: 12.5px; color: var(--text-3); padding: 10px 0 28px; margin-top: auto; flex: none; }
.foot a { color: var(--text-2); }

@media (max-width: 1100px) {
  .stage.open .stage__body { grid-template-columns: 1fr; }
  .stage__left { border-right: 0; border-bottom: 1px solid var(--rule); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .lib { grid-template-columns: 1fr; } .lib__list { position: static; }
}
@media (max-width: 760px) {
  :root { --gap: 16px; }
  .login { grid-template-columns: 1fr; } .login__art { padding: 32px; min-height: 280px; }
  .kpis { grid-template-columns: 1fr 1fr; } .form { grid-template-columns: 1fr; }
  .track { position: static; padding: 16px 10px; } .station__dot { width: 36px; height: 36px; } .track__line { top: 17px; }
  .station__name { font-size: 10.5px; } .station__state { display: none; }
  .top__right .who span, .brand__tag { display: none; }
  .hero { padding: 22px; }
  .tstats { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---- article lanes (Phase 2, 2026-12-04) ---- */
.lanes { display: grid; gap: var(--half); }
.lane { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 270px; position: relative; }
.lane::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bg-2); }
.lane.is-active::before, .lane.open::before { background: var(--grad); }
.lane.ready::before { background: var(--ok); }
.lane.is-active { border-color: #c7b6ff; }
.lane__head { display: flex; align-items: center; gap: 16px; padding: 16px 22px 16px 26px; cursor: pointer; user-select: none; }
.lane__num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; background: var(--ink); color: #fff; flex: none; }
.lane.ready .lane__num { background: var(--ok); }
.lane__title { flex: 1; min-width: 0; display: grid; gap: 6px; }
.lane__title h3 { font-family: var(--display); font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.lane__title p { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.lane__minis { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mini { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg-2); color: var(--text-3); }
.mini .ico { width: 13px; height: 13px; }
.mini.ready, .mini.review { background: var(--violet-tint); color: var(--violet); }
.mini.approved { background: var(--ok-tint); color: var(--ok); }
.mini.stale { background: var(--bad-tint); color: var(--bad); }
.lane__head .chev { color: var(--text-3); transition: transform .25s var(--ease); }
.lane.open .lane__head .chev { transform: rotate(180deg); }
.lane__body { display: grid; gap: var(--half); padding: 0 var(--half) var(--half) calc(var(--half) + 4px); }
.stage--sub { box-shadow: none; border-color: var(--rule); }
.stage--sub .stage__head { padding: 14px 20px; }
.stage--sub .stage__num { width: 34px; height: 34px; border-radius: 10px; }
.stage--sub .stage__num .ico { width: 17px; height: 17px; }
.stage--sub .stage__title h3 { font-size: 15.5px; }
.stage__body--one { display: block !important; }
.lanes-empty { padding: 34px 24px; }
.kv--hdr { grid-template-columns: 230px 1fr 0; }
.kv--hdr b { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
mark.br { background: var(--warn-tint); color: var(--warn); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.exp { display: grid; gap: 4px; border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 8px; }
.exp__row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.exp__row:nth-child(odd) { background: var(--bg); }
.exp__row.muted { grid-template-columns: auto 1fr; }
.mono { font-family: var(--mono); font-size: 12.5px; }
@media (max-width: 760px) {
  .lane__head { flex-wrap: wrap; padding: 14px 16px 14px 20px; }
  .lane__minis { width: 100%; justify-content: flex-start; }
  .kv--hdr { grid-template-columns: 1fr; }
  .exp__row { grid-template-columns: auto 1fr; } .exp__row .mono { grid-column: 2; }
}

/* Apply fixes: what changed (2026-12-04) */
.revnotes { border: 1px solid #b7e4cd; background: var(--ok-tint); border-radius: var(--r-sm); padding: 10px 14px; font-size: 13.5px; }
.revnotes summary { cursor: pointer; font-weight: 700; color: var(--ok); display: flex; align-items: center; gap: 8px; }
.revnotes summary .ico { width: 16px; height: 16px; }
.revnotes ul { margin: 6px 0 2px; padding-left: 20px; } .revnotes li { color: var(--text-2); }

/* confirm modal (2026-12-04) */
.modal__box--confirm { width: min(520px, 100%); }
.modal__head h3 { display: flex; align-items: center; gap: 12px; }
.confirm__icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.confirm__icon .ico { width: 20px; height: 20px; }
.confirm__icon--ok { background: var(--ok-tint); color: var(--ok); }
.confirm__icon--warn { background: var(--warn-tint); color: var(--warn); }
.confirm__icon--danger { background: var(--bad-tint); color: var(--bad); }
.confirm__body { font-size: 14.5px; color: var(--text-2); gap: 10px; }
.confirm__body ul { padding-left: 20px; display: grid; gap: 4px; }
.btn--danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.modal.on { animation: cmFade .18s var(--ease); } .modal.on .modal__box { animation: cmPop .22s var(--ease); }
@keyframes cmFade { from { opacity: 0; } } @keyframes cmPop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
/* delete pill on project cards (2026-12-04) */
.pcard__meta { display: inline-flex; align-items: center; gap: 10px; }
.pill-del { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px var(--sans); line-height: 1; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--text-3); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.pill-del .ico { width: 13px; height: 13px; }
.pill-del:hover, .pill-del:focus-visible { color: var(--bad); background: var(--bad-tint); border-color: #f1b8b2; outline: none; }
.pill-del:disabled { opacity: .5; cursor: default; }

/* ================= Notes + Calendar (asks #907/#908, 2026-12-05) ================= */
.k-meeting { --k: #6d3fe0; --kt: #f1ecff; } .k-interview { --k: #b54708; --kt: #fff1e8; } .k-call { --k: #2448b8; --kt: #e8efff; }
.k-deadline { --k: #b42318; --kt: #fdecea; } .k-personal { --k: #127a4b; --kt: #e6f6ee; } .k-project { --k: #8a5a00; --kt: #fdf3e1; }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--rule-2); display: inline-block; }
mark { background: #ffe9a8; color: inherit; border-radius: 3px; padding: 0 2px; }

/* notes list */
.notes { width: min(100%, clamp(560px, 54vw, 940px)); margin: 0 auto; display: grid; gap: var(--gap); }
.note-new { position: relative; overflow: hidden; display: grid; place-items: center; gap: 10px; padding: 30px 20px; border-radius: 18px; background: var(--ink); color: #fff; text-decoration: none; box-shadow: var(--shadow); transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.note-new::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 220px at 50% 120%, rgba(122,82,244,.55), transparent 70%), radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: auto, 18px 18px; pointer-events: none; }
.note-new::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad); }
.note-new > * { position: relative; }
.note-new__plus { width: 64px; height: 64px; border-radius: 50%; background: var(--grad-btn); display: grid; place-items: center; box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 10px 30px rgba(101,66,224,.5); transition: transform .25s var(--ease); }
.note-new__plus .ico { width: 30px; height: 30px; stroke-width: 2; color: #fff; }
.note-new__label { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.note-new:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(21,20,27,.18); }
.note-new:hover .note-new__plus { transform: rotate(90deg) scale(1.05); }
.note-new:focus-visible, .note-item:focus-visible, .mcell:focus-visible { outline: 3px solid var(--g2); outline-offset: 3px; }
.note-search { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 999px; padding: 0 20px; height: 54px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.note-search:focus-within { border-color: var(--g2); box-shadow: 0 0 0 4px var(--violet-tint); }
.note-search > .ico { color: var(--text-3); }
.note-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 100%; }
.note-search input::-webkit-search-cancel-button { cursor: pointer; }
.note-search__count { font-size: 12.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.note-list { display: grid; gap: var(--half); }
.note-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; padding: 16px 20px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); text-decoration: none; color: var(--text); transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s; }
.note-item:hover { transform: translateY(-1px); border-color: var(--rule-2); box-shadow: var(--shadow); }
.note-item__ico { width: 40px; height: 40px; border-radius: 11px; background: var(--violet-tint); color: var(--violet); display: grid; place-items: center; }
.note-item__main { display: grid; gap: 3px; min-width: 0; }
.note-item__main b { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item__snip { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item__date { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.note-item__go { width: 18px; height: 18px; color: var(--text-3); }
.note-empty { background: var(--paper); border: 1.5px dashed var(--rule-2); border-radius: var(--r); padding: 44px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--text-2); }
.note-empty > .ico { width: 36px; height: 36px; color: var(--violet); }
.note-empty b { font-family: var(--display); font-size: 17px; color: var(--text); }
.note-empty span { font-size: 14px; max-width: 420px; }

/* note editor */
.note-ed { width: min(100%, clamp(560px, 58vw, 1000px)); margin: 0 auto; display: grid; gap: var(--half); }
.note-ed__bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 118px; z-index: 5; background: rgba(244,243,248,.92); backdrop-filter: blur(8px); padding: 8px 0; }
.note-ed__status { flex: 1; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); min-width: 0; }
.note-ed__status .ico { width: 15px; height: 15px; }
.note-ed__status.ok { color: var(--ok); } .note-ed__status.bad { color: var(--bad); }
.note-ed__actions { display: flex; gap: 8px; }
.note-ed__paper { background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); padding: clamp(22px, 3vw, 48px) clamp(20px, 4vw, 64px); display: grid; gap: var(--half); position: relative; overflow: hidden; }
.note-ed__paper::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.note-ed__title { border: 0; outline: 0; background: transparent; font-family: var(--display); font-weight: 800; font-size: clamp(24px, 2.1vw, 34px); letter-spacing: -.02em; line-height: 1.2; width: 100%; }
.note-ed__title::placeholder, .note-ed__body::placeholder { color: #b4b3c2; }
.note-ed__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); padding-bottom: var(--half); border-bottom: 1px solid var(--rule); }
.note-ed__meta .ico { width: 15px; height: 15px; }
.note-ed__body { border: 0; outline: 0; resize: none; background: transparent; font-size: 16.5px; line-height: 1.75; min-height: 360px; width: 100%; overflow: hidden; }

/* calendar shell */
.cal { display: grid; gap: var(--gap); }
.cal__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: var(--r); padding: 22px 28px; position: relative; overflow: hidden; }
.cal__head::before { content: ""; position: absolute; right: -6%; top: -120%; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(122,82,244,.42), transparent 70%); pointer-events: none; }
.cal__head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad); }
.cal__head > * { position: relative; }
.cal__title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cal__title h1 { font-family: var(--display); font-size: clamp(26px, 2.4vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.cal__title > span { color: #b9b7c8; font-size: 17px; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.cal__title em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--grad-btn); border-radius: 999px; padding: 4px 10px; }
.cal__ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal__arrows { display: flex; gap: 6px; }
.cal__head .btn:not(.btn--grad) { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); text-decoration: none; }
.cal__head .btn:not(.btn--grad):hover { background: rgba(255,255,255,.16); }
.cal__head .btn--grad { text-decoration: none; }
.vseg { display: inline-flex; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 3px; }
.vseg a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #cfcbe0; text-decoration: none; }
.vseg a .ico { width: 15px; height: 15px; }
.vseg a.on { background: #fff; color: var(--ink); }
.cal__body { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 18vw, 360px); gap: var(--gap); align-items: start; }
.cal__side { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); position: sticky; top: 142px; min-width: 0; }
.side-card { min-width: 0; }
.side-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 20px; display: grid; gap: var(--half); box-shadow: var(--shadow); }
.side-card__h { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.side-card__h .ico { width: 16px; height: 16px; color: var(--violet); }
.side-card--legend { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.lg { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.lg i, .mev i, .ag__ev > i, .kind i { width: 9px; height: 9px; border-radius: 50%; background: var(--k); flex: none; }

/* mini month */
.mmini { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; min-width: 0; }
.mmini__dow { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 4px 0; }
.mmini__d { position: relative; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none; }
.mmini__d:hover { background: var(--bg-2); }
.mmini__d.is-out { color: #b4b3c2; }
.mmini__d.is-has::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--violet); }
.mmini__d.is-today { color: var(--violet); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--violet); }
.mmini__d.is-sel { background: var(--grad-btn); color: #fff; font-weight: 700; box-shadow: none; }
.mmini__d.is-sel::after { background: #fff; }

/* agenda */
.ag { display: grid; gap: 14px; max-height: 46vh; overflow: auto; }
.ag__day { display: grid; gap: 6px; }
.ag__date { font-size: 12.5px; font-weight: 700; color: var(--text); text-decoration: none; }
.ag__date:hover { color: var(--violet); }
.ag__ev { display: flex; align-items: flex-start; gap: 10px; text-align: left; border: 0; background: var(--kt); border-radius: 10px; padding: 9px 12px; cursor: pointer; transition: filter .15s; }
.ag__ev:hover { filter: brightness(.97); }
.ag__ev > i { margin-top: 6px; }
.ag__ev span { display: grid; min-width: 0; }
.ag__ev b { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag__ev small { font-size: 12px; color: var(--k); font-weight: 600; }
.ag__none { font-size: 13.5px; }

/* month grid */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--rule); gap: 1px; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); min-height: calc(100vh - 330px); }
.mgrid__dow { background: var(--paper); padding: 10px 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.mcell { background: var(--paper); padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); min-width: 0; transition: background .12s; position: relative; }
.mcell.wkend { background: #fbfbfd; }
.mcell:hover { background: #f7f5ff; }
.mcell.is-out { background: #f8f8fb; }
.mcell.is-out .mcell__n { color: #b4b3c2; }
.mcell__n { font-size: 13.5px; font-weight: 700; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.mcell.is-today .mcell__n { background: var(--grad-btn); color: #fff; }
.mcell.is-today { box-shadow: inset 0 0 0 2px var(--g2); }
.mcell__dots { display: none; gap: 3px; padding-left: 4px; }
.mcell__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--k); }
.mev { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: var(--kt); border-radius: 6px; padding: 3px 7px; font-size: 12px; text-align: left; cursor: pointer; color: var(--text); min-width: 0; }
.mev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mev b { color: var(--k); font-weight: 700; }
.mev:hover { filter: brightness(.96); }
.mcell__more { font-size: 11.5px; font-weight: 700; color: var(--violet); padding-left: 7px; }

/* day view */
.dayv { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.dayv__allday { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: #fbfbfd; flex-wrap: wrap; }
.dayv__lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); width: 96px; flex: none; }
.dayv__lbl .ico { width: 16px; height: 16px; color: var(--violet); }
.dayv__chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; font-size: 13.5px; }
.dayv__chips .mev { width: auto; font-size: 13px; padding: 5px 10px; }
.dayv__scroll { height: calc(100vh - 360px); min-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.dayv__grid { position: relative; }
.hslot { position: absolute; left: 0; right: 0; border: 0; border-top: 1px solid var(--rule); background: transparent; text-align: left; cursor: pointer; display: flex; align-items: flex-start; }
.hslot.is-off { background: #fbfbfd; }
.hslot:first-child { border-top: 0; }
.hslot__lbl { width: 76px; flex: none; padding: 6px 12px 0 0; text-align: right; font-size: 12px; font-weight: 600; color: var(--text-3); }
.hslot__add { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--violet); opacity: 0; transition: opacity .12s; }
.hslot__add .ico { width: 15px; height: 15px; }
.hslot:hover { background: #f7f5ff; }
.hslot:hover .hslot__add { opacity: 1; }
.dayv__evs { position: absolute; top: 0; bottom: 0; left: 84px; right: 12px; pointer-events: none; }
.dev { position: absolute; pointer-events: auto; border: 0; border-left: 4px solid var(--k); background: var(--kt); border-radius: 8px; padding: 6px 10px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1px; overflow: hidden; box-shadow: 0 1px 2px rgba(21,20,27,.06); transition: box-shadow .15s, transform .15s; }
.dev:hover { box-shadow: 0 8px 22px rgba(21,20,27,.14); transform: translateY(-1px); z-index: 2; }
.dev b { font-size: 13.5px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev span { font-size: 12px; font-weight: 600; color: var(--k); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev--short { flex-direction: row; align-items: center; gap: 8px; padding: 2px 10px; }
.nowline { position: absolute; left: 76px; right: 0; height: 2px; background: #e5484d; pointer-events: none; z-index: 3; }
.nowline i { position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; }

/* event modal */
.modal__box--event { width: min(640px, 100%); }
.modal__box--event .modal__head h3 { display: flex; align-items: center; gap: 10px; }
.modal__box--event .modal__head h3 .ico { color: var(--violet); }
.inp--lg { font-size: 17px; padding: 12px 14px; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.kind { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule-2); font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .12s; }
.kind input { position: absolute; opacity: 0; pointer-events: none; }
.kind:has(input:checked) { background: var(--kt); border-color: var(--k); color: var(--k); box-shadow: 0 0 0 3px var(--kt); }
.kind:has(input:focus-visible) { outline: 2px solid var(--g2); outline-offset: 2px; }
.ad { display: inline-flex !important; align-items: center; gap: 10px; height: 44px; font-size: 14.5px !important; color: var(--text) !important; cursor: pointer; }
.ad input { width: 18px; height: 18px; accent-color: var(--g2); }
.modal.is-allday .ev-time { display: none; }

@media (max-width: 1100px) {
  .cal__body { grid-template-columns: 1fr; }
  .cal__side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
}
@media (max-width: 720px) {
  .note-item { grid-template-columns: auto 1fr auto; padding: 14px 16px; gap: 12px; }
  .note-item__go { display: none; }
  .note-ed__bar { top: 112px; flex-wrap: wrap; }
  .note-ed__title { font-size: 24px; }
  .cal__head { padding: 18px; }
  .cal__ctrl { width: 100%; justify-content: space-between; }
  .cal__ctrl .btn--grad { width: 100%; justify-content: center; }
  .mgrid { min-height: 0; }
  .mgrid__dow { padding: 8px 0; text-align: center; letter-spacing: 0; font-size: 10.5px; }
  .mcell { padding: 4px 2px 6px; align-items: center; min-height: 58px; }
  .mcell .mev, .mcell__more { display: none; }
  .mcell__dots { display: flex; padding: 0; }
  .dayv__lbl { width: auto; }
  .hslot__lbl { width: 56px; padding-right: 8px; font-size: 11px; }
  .dayv__evs { left: 62px; right: 6px; }
  .nowline { left: 56px; }
  .dayv__scroll { height: calc(100vh - 300px); }
  .dev--short span { display: none; }
  .inp, .inp--lg { font-size: 16px; }
}

@media (max-width: 760px) {
  .nav { padding: 0; overflow: visible; }
  .nav a { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 2px 9px; font-size: 12px; text-align: center; }
  .nav a::after { left: 18%; right: 18%; }
  .nav .ico { width: 20px; height: 20px; }
}

/* ===== Mobile hardening (2026-12-05, Aaron's Android: larger text pushed cards past the right edge) =====
   Root cause: .main and several grids used auto/1fr tracks, which grow to the widest child's min-content.
   With larger phone text, one wide child (step rail, KPI labels, long words) widened the whole column. */
.main { grid-template-columns: minmax(0, 1fr); }
.main > *, .grid > *, .kpis > *, .lib > *, .card, .panel { min-width: 0; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.track__rail { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .main { padding: 16px; gap: 16px; }
  .top { padding: 0 16px; }
  .brand { min-width: 0; }
  .brand__name { font-size: 17px; white-space: nowrap; }
  .top__right button { white-space: nowrap; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px 14px; }
  .kpi__label { letter-spacing: .04em; font-size: 10.5px; overflow-wrap: anywhere; }
  .kpi__val { font-size: clamp(22px, 7vw, 30px); }
  .track { overflow-x: auto; }
}
@media (max-width: 400px) {
  .top__right button span { display: none; }
  .brand img { width: 30px; height: 30px; }
}

@media (max-width: 1100px) {
  .stage.open .stage__body { grid-template-columns: minmax(0, 1fr); }
  .lib { grid-template-columns: minmax(0, 1fr); }
}
.stage__left, .stage__right, .stage__title, .lane__title, .pcard, .kpi { min-width: 0; }
.panel__h { flex-wrap: wrap; }
@media (max-width: 760px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .pcard { padding: 18px; }
  .pcard__foot { flex-wrap: wrap; gap: 8px; }
  .stage__head { padding: 14px 16px; gap: 12px; }
  .stage__left, .stage__right { padding: 16px; }
  .empty { padding: 32px 16px; }
  .hero h1 { overflow-wrap: break-word; }
}

/* single-column grids: tracks may not grow past their container (textareas, nowrap buttons, status dots) */
.panel, .stage__left, .stage__right, .pcard, .card, .lane__body { grid-template-columns: minmax(0, 1fr); }
textarea, select, input, .inp, .sel { max-width: 100%; }
.vars code, .chip { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .pcard__top { flex-wrap: wrap; }
  .dots { flex-wrap: wrap; }
  .row > .btn, .panel__h .btn { white-space: normal; max-width: 100%; text-align: left; }
  .row > .btn--ok, .row > .btn--grad { justify-content: center; text-align: center; }
}
.sel { min-width: 0; }
@media (max-width: 760px) { .row > .sel { flex: 1 1 100%; width: 100%; } }
@media (max-width: 760px) {
  .stage__head { flex-wrap: wrap; row-gap: 8px; }
  .stage__title { flex: 1 1 150px; }
  .stage__title h3, .station__name { overflow-wrap: normal; word-break: normal; hyphens: none; }
}
@media (max-width: 440px) {
  .track { overflow-x: auto; scrollbar-width: none; }
  .track__rail { min-width: 400px; }
}
/* nav labels wrap at large phone text (live check 2026-12-05: "Prompt library" pushed layout 2-9px wide) */
@media (max-width: 760px) {
  .nav { overflow: hidden; }
  .nav a { white-space: normal; line-height: 1.15; overflow-wrap: normal; }
}
/* notes list at large text */
.note-item { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.note-search { min-width: 0; }
@media (max-width: 720px) {
  .note-item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .note-item__date { font-size: 12px; }
}
@media (max-width: 400px) {
  .note-search__count { display: none; }
  .note-item { grid-template-columns: auto minmax(0, 1fr); }
  .note-item__date { grid-column: 2; margin-top: -6px; }
}

/* ===== Article archive + honest home counts (2026-12-05) ===== */
.lane__arch { flex: none; border: 0; background: transparent; color: var(--text-3); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.lane__arch:hover { background: var(--bg-2); color: var(--bad); }
.lane__arch:focus-visible { outline: 2px solid var(--g2); outline-offset: 2px; }
.lane__arch .ico { width: 18px; height: 18px; }
.arch { display: grid; gap: var(--half); }
.arch__toggle { justify-self: start; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600; padding: 6px 4px; cursor: pointer; }
.arch__toggle:hover { color: var(--violet); }
.arch__toggle .ico { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.arch__toggle.on .ico--chev { transform: rotate(180deg); }
.arch__row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--paper); border: 1.5px dashed var(--rule-2); border-radius: var(--r); color: var(--text-2); }
.arch__num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--text-3); }
.arch__row b { flex: 1; min-width: 0; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch__when { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.kpi__split { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.kpi__split span { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); }
.kpi__split span.r { background: #e6f6ee; color: var(--ok); }
.kpi__split span.q { background: #e8efff; color: #2448b8; }
@media (max-width: 720px) { .arch__when { display: none; } .arch__row { padding: 10px 12px; gap: 10px; } }
