/* Contract Engine Hub. Sendero brand: sage, deep sage, sun yellow for small highlights. */
:root {
  --sage: #91AE81;
  --sage-light: #B5C9A7;
  --sage-deep: #4F6F45;
  --sun: #F6E0A6;
  --ink: #1C1C1C;
  --muted: #6B6F68;
  --bg: #F8F7F3;
  --card: #FFFFFF;
  --line: #E6E5DE;
  --soft: #EFF3EB;
  --red: #C0392B;
  --red-soft: #FBEAE7;
  --amber: #A9781A;
  --amber-soft: #FBF3DD;
  --blue: #3E6D8E;
  --blue-soft: #E7F0F6;
  --btn: var(--sage-deep);
  --btn-text: #FFFFFF;
  --focus: #91AE81;
  --shadow: 0 1px 2px rgba(28, 28, 28, .04), 0 4px 16px rgba(28, 28, 28, .04);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ECEDE8; --muted: #A2A79D; --bg: #121411; --card: #1B1E1A; --line: #2C312A; --soft: #222820;
    --red: #E8735F; --red-soft: #3A1F1A; --amber: #E2B85C; --amber-soft: #352C17; --blue: #8DB8D6; --blue-soft: #1B2A33;
    --btn: #6E9561; --sage-deep: #9FC08F; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ECEDE8; --muted: #A2A79D; --bg: #121411; --card: #1B1E1A; --line: #2C312A; --soft: #222820;
  --red: #E8735F; --red-soft: #3A1F1A; --amber: #E2B85C; --amber-soft: #352C17; --blue: #8DB8D6; --blue-soft: #1B2A33;
  --btn: #6E9561; --sage-deep: #9FC08F; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: Archivo, Inter, sans-serif; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
a { color: var(--sage-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 16px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--btn); color: var(--btn-text); font-weight: 600; cursor: pointer; white-space: nowrap;
  text-decoration: none; font-size: 14px;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); filter: none; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--line); }
.link { background: none; border: 0; padding: 0; color: var(--sage-deep); cursor: pointer; font-weight: 500; }

/* shell, laid out like HQ: sidebar, top bar with the bell, page scrolls under it */
#app.in-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); flex: 1; min-height: 0; }
.side { height: 100%; overflow-y: auto; padding: 18px 12px 14px; border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 2px; }
.brand { display: block; padding: 2px 6px 12px; }
.logo { display: block; width: 172px; height: auto; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.side a.nav svg { color: var(--muted); flex: none; }
.side a.nav:hover { background: var(--soft); }
.side a.nav.on { background: var(--soft); color: var(--sage-deep); font-weight: 600; }
.side a.nav.on svg { color: var(--sage-deep); }
.side .grow { flex: 1; min-height: 16px; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 14px 4px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); color: var(--sage-deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.me-txt { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); line-height: 1.3; }
.me-txt b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; position: relative; text-decoration: none; flex: none; padding: 0; }
.icon-btn:hover, .icon-btn.on { background: var(--soft); }
.env-pill { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--sun); color: #4a3b10; vertical-align: 2px; }
.mainwrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 40px; min-height: 64px; border-bottom: 1px solid var(--line); background: var(--card); }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .here { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { opacity: .5; }
.bell .count { position: absolute; top: -7px; right: -7px; margin: 0; }
.count[hidden] { display: none !important; }
.menu-btn, .side-scrim { display: none; }
.main { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; padding: 28px 40px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--ink); white-space: nowrap; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--soft); color: var(--sage-deep); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.gray { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--sage); }
.dot.red { background: var(--red); }

/* clients list */
.table-wrap { overflow-x: auto; }
.clist { width: 100%; border-collapse: collapse; min-width: 760px; }
.clist th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.clist td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.clist tr:last-child td { border-bottom: 0; }
.clist tbody tr { cursor: pointer; }
.clist tbody tr:hover td { background: var(--soft); }
.cname { font-weight: 600; min-width: 150px; }
.clist td.nw { white-space: nowrap; }
.clist .pill { white-space: normal; }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; width: 110px; }
.bar > i { display: block; height: 100%; background: var(--sage); border-radius: 99px; }
.next { max-width: 320px; }
.next .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--sage-deep); font-weight: 600; }

/* stat tiles */
.stat { padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .v { font-family: Archivo, sans-serif; font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat .s { font-size: 13px; color: var(--muted); }

/* timeline */
.tl { position: relative; padding: 8px 0 4px; }
.tl-row { display: grid; grid-template-columns: 190px 1fr 240px; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-label { font-weight: 600; font-size: 14px; }
.tl-label .small { font-weight: 400; }
.tl-track { position: relative; height: 26px; }
.tl-track::before { content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--line); border-radius: 2px; }
.tl-mark { position: absolute; top: 6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--sage); background: var(--card); z-index: 2; }
.tl-mark.done { background: var(--sage); }
.tl-mark.late { border-color: var(--red); background: var(--red-soft); }
.tl-mark.est { opacity: .55; }
.tl-span { position: absolute; top: 11px; height: 4px; background: var(--sage-light); border-radius: 4px; z-index: 1; }
.tl-span.late { background: var(--red); opacity: .35; }
.tl-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--sun); z-index: 3; border-radius: 2px; }
.tl-axis { display: grid; grid-template-columns: 190px 1fr 240px; gap: 14px; font-size: 12px; color: var(--muted); }
.tl-axis .ticks { position: relative; height: 18px; }
.tl-axis .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-dates { font-size: 13px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-dates input { padding: 5px 8px; font-size: 13px; width: 140px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--sage); vertical-align: -1px; margin-right: 5px; }
.legend i.done { background: var(--sage); }
.legend i.late { border-color: var(--red); background: var(--red-soft); }
.legend i.today { border: 0; width: 3px; border-radius: 2px; background: var(--sun); height: 13px; }

.all-tl .tl-row { grid-template-columns: 200px 1fr; }
.all-tl .tl-axis { grid-template-columns: 200px 1fr; }
.all-tl .tl-mark { cursor: default; }
.tl-mark .tip { display: none; }
.tl-mark:hover .tip { display: block; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }

.agenda li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.agenda li:last-child { border-bottom: 0; }
.agenda ul { list-style: none; margin: 0; padding: 0; }

/* checklist */
.phase { margin-bottom: 20px; }
.phase-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; }
.phase-head h3 { font-size: 15px; }
.step { display: grid; grid-template-columns: 26px 1fr auto auto auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--sage-light); background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; color: #fff; }
.step .check.on { background: var(--sage); border-color: var(--sage); }
.step .check.skip { border-style: dashed; color: var(--muted); }
.step .check:disabled { cursor: default; opacity: .6; }
.step .title { font-weight: 500; }
.step.done .title, .step.skip .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.step .meta { font-size: 12px; color: var(--muted); }
.step select { width: auto; padding: 5px 8px; font-size: 13px; border-radius: 8px; }
.step .due { font-size: 13px; color: var(--muted); white-space: nowrap; }
.step .due.late { color: var(--red); font-weight: 600; }
.step-more { grid-column: 2 / -1; display: grid; gap: 10px; padding-top: 4px; }
.howto { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; }
.owner { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--soft); white-space: nowrap; }
.owner.Client { background: var(--sun); color: #4a3b10; }
.owner.Claude { background: var(--blue-soft); color: var(--blue); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13px; font-weight: 500; }
.chip.on { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.banner { padding: 12px 14px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.banner.sun { background: var(--amber-soft); color: var(--ink); }

/* files */
.file { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.ficon { width: 36px; height: 36px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--sage-deep); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--sage); background: var(--soft); }

/* notes / activity */
.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.act { font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: 0; }
.act .when { color: var(--muted); font-size: 12px; }
.diff { color: var(--muted); font-size: 12px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(18, 20, 17, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin-bottom: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--red); color: #fff; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(400px, 100%); padding: 32px; }
.login .logo-tile { display: block; width: fit-content; margin: 0 auto 24px; }
.login .logo { width: 220px; }
.login h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.login p.sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.login form { display: grid; gap: 14px; }

/* "Contract" in the logo is white, so on light pages it sits on a dark tile (never recolored) */
.logo-tile { display: inline-block; background: #1C1C1C; border-radius: 12px; padding: 12px 14px; line-height: 0; }
:root[data-theme="dark"] .logo-tile { background: transparent; padding: 6px 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-tile { background: transparent; padding: 6px 0; } }

/* client preview */
.preview-bar { position: sticky; top: 0; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--sun); color: #2b2205; font-size: 14px; }
.preview-bar .btn { background: #1C1C1C; color: #fff; }

/* onboarding */
.pill.sun { background: var(--sun); color: #4a3b10; }
.ob-top { position: sticky; top: 0; z-index: 5; margin-bottom: 16px; }
.ob-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.ob-chip { font-size: 13px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); white-space: nowrap; }
.ob-chip.done { background: var(--soft); color: var(--sage-deep); border-color: transparent; font-weight: 600; }
.ob-sec { margin-bottom: 16px; scroll-margin-top: 150px; }
.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 8px 22px; cursor: pointer; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--sage-deep); color: #fff; }
.login-list { display: grid; gap: 12px; margin-top: 16px; }
.login-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg); }
.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.login-grid .full { grid-column: 1 / -1; }
.pw-wrap { display: flex; gap: 6px; }
.reveal { margin-top: 6px; }
.reveal code { background: var(--sun); color: #2b2205; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.logo-prev { height: 60px; max-width: 200px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.check-row { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin: 0; cursor: pointer; }
.check-row input { width: auto; }
input.bad, textarea.bad { border-color: var(--red); outline-color: var(--red); }


/* v1 extras */
.count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; align-items: center; justify-content: center; margin-left: auto; }
.side a.nav { display: flex; }
.new-version { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 70; border: 0; cursor: pointer; background: var(--sage-deep); color: #fff; font-weight: 600; padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; }
.choice.on { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
/* to-dos inside each onboarding section */
.todo-list { margin: -4px 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.todo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.todo + .todo { border-top: 1px solid var(--line); }
.todo > div { flex: 1; min-width: 0; }
.todo.is-done b { color: var(--muted); }

/* onboarding list + chat on the right */
.ob-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ob-chat { position: sticky; top: 0; height: calc(100vh - 180px); display: flex; flex-direction: column; overflow: hidden; }
/* wide screens: the list scrolls on its own and the chat always fits the screen */
@media (min-width: 1101px) {
  .main.fill { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; }
  .main.fill #tabBody { flex: 1; min-height: 0; }
  .main.fill .ob-layout { height: 100%; }
  .main.fill .ob-main { height: 100%; overflow-y: auto; padding-right: 6px; }
  .main.fill .ob-chat { position: static; height: 100%; }
}
.chat-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 17px; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { margin: auto 0; text-align: center; }
.msg { max-width: 88%; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.msg .bubble { display: inline-block; text-align: left; white-space: pre-wrap; word-break: break-word; background: var(--soft); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.msg.mine .bubble { background: var(--sage-deep); color: #fff; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); }
.chat-jump { display: none; font-weight: 600; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; }
@media (max-width: 1100px) {
  .ob-layout { grid-template-columns: 1fr; }
  .ob-chat { position: static; height: 480px; scroll-margin-top: 16px; }
  .chat-jump { display: inline; }
}
.cmts { display: grid; gap: 10px; margin-top: 6px; }
.cmt { background: var(--soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.cmt .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cmt-form { display: grid; gap: 8px; }
.cmt-form textarea { min-height: 60px; }
.small-chip { padding: 3px 9px; font-size: 12px; }
.notif { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--soft); }
.notif.unread b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 8px; vertical-align: 1px; }
.nw { white-space: nowrap; }
.late-by { color: var(--red); font-weight: 600; }
.print-only { display: none; }
.soon .pill.gray { font-weight: 500; }
@media print {
  body, .card, .clist td, .clist th { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .card { border: 1px solid #999 !important; }
  .clist th, .clist td { border-bottom: 1px solid #bbb !important; padding: 6px 8px !important; }
  .late-by { color: #000 !important; }
  .print-only { display: block; font-weight: 700; margin: 0 0 10px; }
  .page-head p, .new-version, .toast, .preview-bar { display: none !important; }
}

/* phones */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 80%; max-width: 300px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .side-scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; min-height: 56px; }
  .main { padding: 20px 16px 80px; }
  .grid2, .grid3, .form-grid { grid-template-columns: 1fr; }
  .clist thead { display: none; }
  .clist, .clist tbody, .clist tr, .clist td { display: block; width: 100%; min-width: 0; }
  .clist tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .clist td { padding: 3px 0; border: 0; }
  .clist td[data-k]::before { content: attr(data-k) ': '; color: var(--muted); font-size: 12px; }
  .tl-row, .tl-axis { grid-template-columns: 110px 1fr; }
  .tl-dates { grid-column: 1 / -1; justify-content: flex-start; }
  .all-tl .tl-row, .all-tl .tl-axis { grid-template-columns: 90px 1fr; }
  .step { grid-template-columns: 26px 1fr auto; }
  .step .due, .step .owner-col { grid-column: 2; }
  .file { grid-template-columns: auto 1fr; }
  .login-grid { grid-template-columns: 1fr; }
  .ob-top { position: static; }
}

@media print {
  .side, .top, .tabs, .btn, .filters { display: none !important; }
  #app.in-shell { height: auto; display: block; }
  .shell { display: block; }
  .main { padding: 0; overflow: visible; }
}
