/* ATYA web view: "Notebook" design. White ground, near-black text, gray, one blue. */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --text: #111418; --text-2: #2a2f36; --text-3: #3d434b; --muted: #5f6670;
  --line: #eceef1; --line-2: #dfe2e6; --soft: #f6f7f9; --chip: #f2f3f5;
  --blue: #1f5fbf; --blue-dark: #174a95; --blue-soft: #eef3fb;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: #fff; color: var(--text); }
body { margin: 0; font: 15px/1.5 var(--sans); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 16px 32px; border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-size: 24px; color: var(--text); letter-spacing: .02em; }
.brand:hover { color: var(--text); }
.top nav { display: flex; gap: 22px; font-size: 14px; }
.top nav a { color: var(--muted); }
.top nav a.on { color: var(--text); font-weight: 600; }
.top .spacer { flex: 1; }
.top form { margin: 0; }

/* page */
main { max-width: 880px; margin: 0 auto; padding: 48px 24px 80px; display: flex; flex-direction: column; gap: 44px; }
main.narrow { max-width: 760px; gap: 24px; }
main.wide { max-width: none; padding: 32px; gap: 20px; }
h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1.15; }
h1.big { font-size: 44px; line-height: 1.1; }
h1.mono { font-family: var(--mono); font-size: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2, .label-caps { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
section { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.crumbs { margin: 0; font-size: 14px; color: var(--muted); }
.ref { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
code { font-family: var(--mono); font-size: 13px; background: var(--soft); padding: 1px 6px; border-radius: 4px; }

/* controls */
input, select, textarea { font: inherit; color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font: 500 14px var(--sans); color: var(--text); cursor: pointer; }
.btn:hover { border-color: #c9cdd3; color: var(--text); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.linkbtn:hover { color: var(--blue-dark); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.searchbox { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 56px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(17,20,24,.04); margin: 0; }
.searchbox:focus-within { border-color: var(--blue); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 16px; background: transparent; }
.searchbox.compact { height: 44px; border-radius: 12px; }

/* rows, cards */
.box { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 16px; padding: 15px 20px; color: var(--text); border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
a.row:hover { background: var(--soft); color: var(--text); }
.row .grow { flex: 1; min-width: 0; }
.row .side { font-size: 13px; color: var(--muted); max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { width: 18px; height: 18px; border: 1.5px solid #9aa1aa; border-radius: 5px; flex: none; }
.pill { display: inline-block; font-size: 13px; font-weight: 500; border-radius: 999px; padding: 3px 10px; background: var(--chip); color: var(--text-3); white-space: nowrap; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.dark { background: #fff; border: 1px solid var(--text); color: var(--text); padding: 2px 9px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); }
.card:hover { border-color: var(--line-2); background: var(--soft); color: var(--text); }
.card .n { font-family: var(--serif); font-size: 30px; line-height: 1.2; }
.card .t { font-size: 14px; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: 14px; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.chip:hover { background: var(--soft); color: var(--text); }
.reflink { display: inline-flex; gap: 6px; align-items: center; min-height: 28px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text); background: #fff; }
.reflink:hover { background: var(--soft); color: var(--text); }

.lately { display: flex; flex-direction: column; }
.lately .item { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid #f0f1f3; align-items: baseline; }
.lately .item:first-child { border-top: 0; }
.lately .when { width: 120px; flex: none; font-size: 13px; color: var(--muted); }
.lately .what { flex: 1; min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lately .how { font-size: 13px; color: var(--muted); white-space: nowrap; }

.page-foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.page-foot form { margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { border-top: 0; background: var(--soft); font-size: 12px; font-weight: 500; color: var(--muted); }
tbody tr:hover td { background: #fafbfc; }
td.title a { color: var(--text); }
td.title a:hover { color: var(--blue); }
td.num { text-align: right; color: var(--muted); }
table.raw { font-family: var(--mono); font-size: 12px; width: max-content; min-width: 100%; }
table.raw td { white-space: pre-wrap; max-width: 420px; overflow-wrap: anywhere; }
table.raw td.null { color: #9aa1aa; }
table.raw th { white-space: nowrap; position: sticky; top: 0; }
.pager { display: flex; gap: 20px; margin: 0; }

/* record */
.record-head { display: flex; flex-direction: column; gap: 12px; }
.props { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin: 0; }
.prop { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f1f3; }
.prop > .k { font-size: 14px; color: var(--muted); }
.prop > .k em { display: block; font-style: normal; font-size: 12px; font-weight: 500; color: var(--blue); }
.prop .v { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.prop input[type=text], .prop input[type=number], .prop input[type=date], .prop select, .prop textarea { width: 100%; max-width: 420px; min-height: 38px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: var(--soft); }
.prop input[type=number], .prop input[type=date] { max-width: 200px; }
.prop textarea { max-width: none; resize: vertical; }
.prop input:hover, .prop select:hover, .prop textarea:hover { border-color: var(--line-2); }
.prop input:focus, .prop select:focus, .prop textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.prop input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.title-input { width: 100%; border: 1px solid transparent; border-radius: 10px; padding: 4px 8px; margin-left: -9px; font-family: var(--serif); font-weight: 500; font-size: 38px; line-height: 1.2; background: transparent; }
.title-input:hover { border-color: var(--line-2); }
.title-input:focus { outline: none; border-color: var(--blue); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills label { position: relative; }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pills span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 500; color: var(--text-3); cursor: pointer; }
.pills label:hover span { border-color: #c9cdd3; }
.pills input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.pills input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.pills span.none { color: var(--muted); font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; }
.quote { margin: 0; padding: 4px 0 4px 20px; border-left: 2px solid #c9cdd3; font-family: var(--serif); font-size: 21px; line-height: 1.45; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.body-text { margin: 0; white-space: pre-wrap; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.timeline .dot { width: 8px; height: 8px; border-radius: 4px; background: #c9cdd3; flex: none; }
.timeline .dot.you { background: var(--blue); }
.timeline .what { flex: 1; min-width: 200px; font-size: 14px; }
.timeline .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--blue-soft); color: var(--text-2); font-size: 14px; }
.problem { padding: 10px 14px; border: 1px solid var(--text); border-radius: 10px; font-size: 14px; }
.problem ul { margin: 6px 0 0; padding-left: 18px; }

/* messages */
.msg-tools { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--chip); border-radius: 12px; }
.seg a { height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.seg a:hover { color: var(--text); }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(17,20,24,.08); }
.day { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.turn { display: flex; flex-direction: column; gap: 14px; }
.me, .bot { display: flex; flex-direction: column; gap: 6px; }
.me { align-items: flex-end; }
.bot { align-items: flex-start; }
.bubble { max-width: 78%; padding: 11px 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.me .bubble { border-radius: 18px 18px 4px 18px; background: var(--blue); color: #fff; }
.me .bubble.cmd { font-family: var(--mono); font-size: 14px; }
.me .bubble.failed { background: #fff; color: var(--text); border: 1px solid var(--text); }
.bot .bubble { border-radius: 18px 18px 18px 4px; background: var(--chip); color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; font-size: 12px; color: var(--muted); max-width: 78%; text-align: right; }
.bot .meta { justify-content: flex-start; text-align: left; }
.meta form { display: inline; margin: 0; }
.meta .reflink { font-size: 12px; min-height: 26px; }

/* sign-in and message pages */
.center { max-width: 480px; margin: 12vh auto 0; padding: 0 24px 64px; display: flex; flex-direction: column; gap: 18px; }
.center p { margin: 0; color: var(--text-3); }
.center form { margin: 0; }

@media (max-width: 640px) {
  .top { padding: 14px 18px; }
  main { padding: 32px 18px 64px; gap: 36px; }
  h1, h1.big, .title-input { font-size: 32px; }
  .prop { grid-template-columns: 1fr; gap: 4px; }
  .lately .item { flex-wrap: wrap; gap: 4px 12px; }
  .lately .when { width: auto; }
  .bubble, .meta { max-width: 92%; }
  .row { padding: 14px 16px; }
  .row .side { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px; }
  .card .n { font-size: 26px; }
}
.flush { margin: 0; } .nowrap { white-space: nowrap; }
.stack-form { display: flex; flex-direction: column; gap: 32px; margin: 0; }

/* --- v2 polish: header search, icons, quick edits, forms ----------------- */
.top { position: sticky; top: 0; z-index: 10; background: #fff; }
.topsearch { flex: 1; max-width: 420px; margin-left: auto !important; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--soft); color: var(--muted); }
.topsearch:focus-within { background: #fff; border-color: var(--blue); }
.topsearch input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 14px; }
kbd { font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; background: #fff; }
.topsearch:focus-within kbd { display: none; }
.searchbox svg, .topsearch svg { color: var(--muted); flex: none; }

.hero { gap: 18px; }
.head-links { display: flex; gap: 18px; }
.empty { margin: 0; padding: 22px 20px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--muted); text-align: center; }
.spacer { flex: 1; }

.badge { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--soft); color: var(--text-3); flex: none; }
.badge.big { width: 44px; height: 44px; border-radius: 12px; }
.ico { flex: none; }
.card { gap: 14px; padding: 16px 18px 18px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { background: #fff; border-color: var(--line-2); box-shadow: 0 6px 18px rgba(17,20,24,.06); transform: translateY(-1px); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card:hover .badge { background: var(--blue-soft); color: var(--blue); }
.chip { display: inline-flex; align-items: center; gap: 7px; }
h1.with-icon { display: flex; align-items: center; gap: 14px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }

.row.task, .box .row { min-height: 56px; }
.rowlink { color: var(--text); overflow-wrap: anywhere; }
.rowlink:hover { color: var(--blue); }
.done-form, .status-form { margin: 0; display: flex; align-items: center; gap: 6px; flex: none; }
.checkbtn { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #9aa1aa; background: #fff; color: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: all .12s; }
.checkbtn:hover { border-color: var(--blue); color: var(--blue); }
.checkbtn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.status-select { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 500; color: var(--text-3); cursor: pointer; }
.status-select:hover { border-color: #c9cdd3; }
.js .nojs { display: none; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.searchbox.inline { flex: 1 1 240px; max-width: 340px; height: 42px; padding: 0 14px; }
.search-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.filters select { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }

.picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 168px; overflow-y: auto; padding: 2px; }
.picker label { display: inline-flex; }
.picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.picker span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; color: var(--text-3); cursor: pointer; }
.picker label:hover span { border-color: #c9cdd3; }
.picker input:checked + span { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); font-weight: 500; }
.picker input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.prop.top { align-items: start; }
.prop.top .k { padding-top: 8px; }

.form-actions { align-items: center; }
.btn.ghost { border-color: transparent; background: transparent; }
.danger-link { color: var(--muted); }
.danger-link:hover { color: var(--text); border-color: var(--line-2); }
.btn.danger { background: var(--text); border-color: var(--text); color: #fff; }
.btn.danger:hover { background: #000; color: #fff; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.button-row { display: flex; gap: 10px; }
.notice { border: 1px solid #d6e3f6; }

@media (max-width: 640px) {
  .topsearch { order: 3; flex-basis: 100%; max-width: none; margin-left: 0 !important; }
  .topsearch kbd { display: none; }
  .row { flex-wrap: wrap; }
  .status-form { margin-left: auto; }
  .page-head .btn { width: 100%; }
}
.pills input:checked + span.none { background: var(--chip); border-color: var(--line-2); color: var(--text-3); }
@media (max-width: 640px) { .top { gap: 10px 14px; } .top nav { gap: 14px; } }
.center-text { justify-content: center; }
.thread-end { height: 1px; scroll-margin-bottom: 24px; }

/* Messages: sticky filter + search bar, scroll affordances */
.page-messages main.narrow { padding-top: 0; }
.msg-bar { position: sticky; top: var(--top-h, 71px); z-index: 9; display: flex; flex-direction: column; gap: 12px; padding: 20px 0 14px; background: #fff; border-bottom: 1px solid var(--line); margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
.msg-bar h1 { font-size: 30px; }
.msg-bar .searchbox { height: 42px; }
.scroll-hint { align-self: center; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; margin-bottom: -30px; transform: translateY(22px); border: 1px solid var(--line-2); border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(17,20,24,.08); font: 500 12px var(--sans); color: var(--text-3); cursor: pointer; }
.scroll-hint:hover { color: var(--text); border-color: #c9cdd3; }
.scroll-hint[hidden], .jump-latest[hidden] { display: none; }
.thread { padding-top: 28px; }
.thread-start { align-self: center; font-size: 13px; color: var(--muted); padding: 4px 0 8px; }
.jump-latest { position: fixed; right: max(24px, calc(50vw - 380px + 12px)); bottom: 24px; z-index: 9; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--text); color: #fff; font-size: 13px; font-weight: 500; box-shadow: 0 4px 14px rgba(17,20,24,.18); }
.jump-latest:hover { color: #fff; background: #000; }
@media (max-width: 640px) { .msg-bar { margin: 0 -18px; padding-left: 18px; padding-right: 18px; } .msg-bar h1 { font-size: 26px; } }
@media (max-width: 640px) {
  .page-messages .topsearch { display: none; }          /* the page has its own search */
  .msg-bar { padding-top: 12px; gap: 10px; }
  .msg-bar .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .msg-bar .seg a { flex: none; }
}

/* --- Messages as a chat: slim top bar, composer at the bottom ----------- */
.msg-bar { padding-top: 14px; padding-bottom: 12px; gap: 6px; }
.msg-bar h1 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.filter-tag { font: 500 13px var(--sans); color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 3px 10px; }
.msg-tools { flex-wrap: nowrap; }
.msg-actions { display: flex; gap: 6px; }
.pop { position: relative; }
.pop > summary { list-style: none; }
.pop > summary::-webkit-details-marker { display: none; }
.iconbtn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--text-3); cursor: pointer; }
.iconbtn:hover, .pop[open] > .iconbtn { border-color: #c9cdd3; color: var(--text); background: var(--soft); }
.iconbtn.on { color: var(--blue); border-color: #c8daf3; background: var(--blue-soft); }
.pop-panel { position: absolute; right: 0; top: 44px; z-index: 12; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(17,20,24,.12); padding: 8px; }
.search-pop { display: flex; align-items: center; gap: 10px; width: min(420px, calc(100vw - 36px)); }
.search-pop input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; outline: none; }
.search-pop input:focus { border-color: var(--blue); }
.menu { display: flex; flex-direction: column; min-width: 170px; }
.menu a { padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.menu a:hover { background: var(--soft); color: var(--text); }
.menu a.on { color: var(--blue); font-weight: 600; background: var(--blue-soft); }

main.chat { padding-bottom: 0; }
.composer { position: sticky; bottom: 0; z-index: 9; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 8px -24px 0; padding: 12px 24px 18px; background: #fff; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; min-height: 46px; max-height: 200px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 22px; resize: none; font: 15px/1.45 var(--sans); outline: none; background: var(--soft); }
.composer textarea:focus { border-color: var(--blue); background: #fff; }
.sendbtn { width: 46px; height: 46px; flex: none; border-radius: 23px; border: 0; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sendbtn:hover { background: var(--blue-dark); }
.sendbtn:disabled { background: #b9c6dc; cursor: default; }
.composer-note { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--text-3); background: var(--soft); border-radius: 10px; padding: 8px 12px; }
.jump-latest { bottom: 96px; }
.typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 4px; background: #9aa1aa; animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; opacity: .6; } }
@media (max-width: 640px) {
  .composer { margin: 8px -18px 0; padding: 10px 18px 14px; }
  .jump-latest { bottom: 86px; right: 18px; }
}
.thread-end { scroll-margin-bottom: 110px; }

/* attachments */
.attachbtn { position: relative; width: 46px; height: 46px; flex: none; border-radius: 23px; border: 1px solid var(--line-2); background: #fff; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.attachbtn:hover { color: var(--text); border-color: #c9cdd3; }
.attachbtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.attachbtn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.composer-file { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--text-2); display: flex; gap: 10px; align-items: center; }
.composer-file[hidden] { display: none; }
.composer-file span::before { content: "📎 "; }
.reflink.file { background: #fff; }
.me .meta .reflink.file { border-color: #c8daf3; }
.prop input[type=datetime-local] { max-width: 240px; }

/* Long-form text (privacy policy) */
main.prose { gap: 12px; line-height: 1.6; color: var(--text-2); }
main.prose h2 { margin-top: 20px; }
main.prose p, main.prose ul { margin: 0; }
main.prose ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Model test report */
.evalrow { display: block; }
.evalrow summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.evalrow summary::-webkit-details-marker { display: none; }
.evalbody { padding: 12px 0 4px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.evalbody h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.evalbody ul { margin: 0; padding-left: 18px; }
.evalbody p { margin: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }
.pre { white-space: pre-wrap; }
.pad { padding: 16px; margin: 0; }

/* Voice notes in Messages */
.bubble.voice { display: flex; flex-direction: column; gap: 8px; }
.bubble.voice audio { width: 260px; max-width: 100%; height: 36px; }
.bubble.voice .transcript { margin: 0; white-space: pre-wrap; }

/* Users (cohort) page */
.cohort .crow { display: grid; grid-template-columns: minmax(180px, 1.4fr) auto repeat(5, 56px); gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.cohort .crow:first-child { border-top: 0; }
.cohort .head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cohort .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cohort .num { text-align: right; font-variant-numeric: tabular-nums; }
.cohort .strip { display: flex; gap: 3px; }
.cohort .strip i { width: 10px; height: 10px; border-radius: 2px; background: var(--chip); }
.cohort .strip i.on { background: var(--blue); }
.cohort .strip i.before { background: transparent; border: 1px solid var(--line); }
.small { font-size: 12px; }
@media (max-width: 760px) { .cohort .crow { grid-template-columns: 1fr repeat(3, 40px); } .cohort .crow > .num:nth-last-child(-n+2) { display: none; } .cohort .strip { grid-column: 1 / -1; order: 9; } }

/* Connect page */
.connect .row.static { cursor: default; align-items: flex-start; gap: 16px; }
.connect .row.static:hover { background: none; }
.connect .actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: none; }
.connect .actions form { margin: 0; }
.notice { padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--soft); margin: 0; }
