/* АИСТ ПТО «Контур». Layout and components. No inline styles are used anywhere (CSP style-src 'self'). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-md); line-height: 1.4; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.lg { width: 20px; height: 20px; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.txt { overflow-wrap: anywhere; min-width: 0; }
.dim { color: var(--dim); }
.muted { color: var(--muted); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: grid; gap: 12px; }
.login-card .logo { width: 140px; height: auto; }
.login-card input { width: 100%; min-height: var(--tap); background: var(--raised-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; }
.login-card label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pw-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.login-error { color: var(--alert); min-height: 1.4em; }

/* Shell */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--nav); border-right: 1px solid var(--border-soft); padding: 16px 10px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 0 7px 6px; }
.logo { display: block; width: 133px; height: auto; }
.brand small { display: block; letter-spacing: 3px; color: #d7bd84; font-size: var(--fs-xs); margin-top: 6px; }
.nav { display: grid; gap: 2px; }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; background: none; border: 0; border-radius: var(--radius-sm); color: #d0d0d4; text-align: left; font-size: var(--fs-md); }
.nav-btn:hover { background: #25262b; }
.nav-btn.active { background: #393126; color: var(--gold-bright); box-shadow: inset 2px 0 #cdb17a; }
.nav-btn .count { margin-left: auto; background: #303137; color: #cdced2; border-radius: 99px; padding: 0 7px; font-size: var(--fs-xs); }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.snapshot-note { background: var(--raised-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 10px; color: var(--muted); font-size: var(--fs-sm); }
.work { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: #18191c; border-bottom: 1px solid #34353a; position: sticky; top: 0; z-index: 20; }
.mobile-brand { display: none; }
.mobile-brand .logo { width: 70px; }
.search-wrap { position: relative; flex: 1; max-width: 560px; min-width: 0; }
.search { display: flex; align-items: center; gap: 8px; background: var(--raised-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; min-height: 38px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #d0d0d4; font-size: var(--fs-lg); }
.search:focus-within { border-color: var(--gold-deep); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 8px; max-height: 70vh; overflow-y: auto; z-index: 30; display: grid; gap: 6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.status-pill.ok i { background: var(--ok); }
.status-pill.warn i, .status-pill.stale i { background: var(--warn); }
.status-pill.alert i, .status-pill.offline i { background: var(--alert); }
.date-box { text-align: right; line-height: 1.2; }
.date-box strong { display: block; font-size: var(--fs-md); font-weight: 500; }
.date-box span { color: var(--dim); font-size: var(--fs-xs); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid #44464c; background: #24262b; color: #e0ded8; font-size: var(--fs-md); }
.btn:hover { border-color: var(--gold-deep); }
.btn.primary { background: linear-gradient(115deg, #d9bd83, #b89153); border-color: #c5a56c; color: #201c15; }
.btn.icon-only { width: 34px; padding: 0; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link { background: none; border: 0; color: #ead3a4; padding: 4px 2px; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); min-height: 28px; }

/* Main with gold waves under opaque cards */
.main { position: relative; isolation: isolate; overflow: clip; padding: 15px 18px 28px; flex: 1; }
.main::before, .main::after { content: ""; position: absolute; z-index: -1; pointer-events: none; left: -15%; width: 130%; height: 270px; border: 1px solid var(--gold-line); border-radius: 50%; transform: rotate(-12deg); opacity: var(--wave-opacity); top: 120px; box-shadow: 0 12px 0 -11px #b28d4e, 0 27px 0 -26px #b28d4e, 0 43px 0 -42px #b28d4e; }
.main::after { top: 620px; transform: rotate(17deg); height: 300px; opacity: calc(var(--wave-opacity) * .65); }
.view { display: grid; gap: var(--gap); min-width: 0; }
.greeting { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.greeting h1 { font-size: var(--fs-xl); font-weight: 500; letter-spacing: -.25px; }
.greeting-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards: opaque */
.panel, .kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 5px 22px #00000016; }
.panel { padding: var(--pad); min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-title { font-size: var(--fs-lg); font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text); }
.panel-title .icon { color: var(--gold); }
.meta-line { color: var(--dim); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.kpi { padding: 12px 14px; text-align: left; display: grid; gap: 2px; min-height: 86px; align-content: start; width: 100%; }
.kpi:hover { border-color: var(--gold-deep); }
.kpi-label { color: var(--muted); font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; }
.kpi-label .icon { color: var(--gold); }
.kpi-value { font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -.5px; line-height: 1.15; }
.kpi-value.unknown { color: var(--dim); }
.kpi-hint { color: var(--dim); font-size: var(--fs-xs); }
.attention { display: grid; gap: 8px; background: var(--gold-bg); border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 12px 14px; }
.attention-head { display: flex; align-items: center; gap: 10px; color: #f0d7a8; font-weight: 600; font-size: var(--fs-lg); }
.attention-head .icon { color: #e4c588; }
.attention-list { display: grid; gap: 6px; }
.attention-item { display: flex; align-items: center; gap: 10px; background: #382f22; border: 1px solid #54452f; border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; text-align: left; min-height: 40px; color: #eadfc6; }
.attention-item:hover { border-color: var(--gold-deep); }
.attention-item .num { font-weight: 700; font-size: var(--fs-lg); min-width: 24px; color: #f0d7a8; }
.attention-item small { display: block; color: #c7b999; font-size: var(--fs-sm); }
.attention-empty { color: #c7b999; font-size: var(--fs-md); }
.grid-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap); }
.grid-mid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.grid-bot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.seg { display: none; }

/* Common components */
.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 1px 8px; font-size: var(--fs-xs); border: 1px solid var(--border); color: var(--muted); background: var(--raised); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: #2f5b49; }
.badge.warn { color: var(--warn); border-color: #6d5a33; }
.badge.alert { color: var(--alert); border-color: #6d3c3e; }
.badge.info { color: var(--info); border-color: #3b4c63; }
.badge.gold { color: var(--gold-bright); border-color: var(--gold-border); background: #2c271f; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 28px; padding: 0 10px; border-radius: 99px; background: none; border: 1px solid var(--border-soft); color: #b7b8bd; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 6px; }
.chip.active { color: #e5d0a3; background: #393228; border-color: var(--gold-border); }
.chip span { background: #44403a; color: #ead9b8; border-radius: 99px; padding: 0 6px; font-size: var(--fs-xs); }
.list { display: grid; gap: 6px; min-width: 0; }
.item { background: var(--raised); border: 1px solid #3b3e46; border-radius: 10px; min-width: 0; }
.item-head { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; background: none; border: 0; text-align: left; min-height: 44px; }
.item-head:hover { background: #2a2c32; border-radius: 10px; }
.item-icon { width: 28px; height: 28px; border-radius: 8px; background: #39352d; color: #dec48f; display: grid; place-items: center; flex: none; }
.item-title { font-size: var(--fs-md); font-weight: 600; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.item-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; max-width: 40%; text-align: right; }
.item-body { padding: 4px 10px 10px 48px; display: grid; gap: 6px; color: #cbccd0; font-size: var(--fs-sm); border-top: 1px solid #34363c; }
.item-body .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--muted); min-height: 38px; white-space: nowrap; }
.tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
.state { display: grid; gap: 6px; justify-items: start; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: var(--fs-sm); }
.state.error { border-color: #6d3c3e; color: var(--alert); }
.state.offline, .state.stale { border-color: #6d5a33; color: var(--warn); }
.skeleton { height: 44px; border-radius: 10px; background: linear-gradient(90deg, #24262b, #2c2e34, #24262b); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid #6d5a33; background: #2b2619; color: var(--warn); font-size: var(--fs-sm); }
.banner.alert { border-color: #6d3c3e; background: #2d1f20; color: var(--alert); }

/* Team, events, finance, server */
.agents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.agent { background: #24262c; border: 1px solid #3b3e46; border-radius: 10px; padding: 9px; text-align: left; display: grid; gap: 5px; align-content: start; min-height: 96px; }
.agent:hover { border-color: var(--gold-deep); }
.agent-title { font-size: var(--fs-md); font-weight: 600; overflow-wrap: anywhere; }
.agent-state { font-size: var(--fs-xs); color: #b4b5bc; display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #8c9698; flex: none; display: inline-block; }
.dot.running, .dot.ok, .dot.active { background: var(--ok); }
.dot.queued, .dot.waiting_owner, .dot.blocked, .dot.warn { background: var(--warn); }
.dot.failed, .dot.alert, .dot.inactive { background: var(--alert); }
.agent-task { color: #bbbcc3; font-size: var(--fs-xs); overflow-wrap: anywhere; }
.events { display: grid; gap: 6px; }
.event { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 9px; align-items: start; }
.event-body { font-size: var(--fs-sm); color: #cbccd0; overflow-wrap: anywhere; }
.event-body strong { color: #eeeae1; display: block; font-size: var(--fs-md); }
.event time { color: #c0b293; font-size: var(--fs-xs); white-space: nowrap; }
.fin-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: start; background: #24262a; border: 1px solid #3b3d42; border-radius: 9px; padding: 10px; width: 100%; text-align: left; }
.fin-row:hover { border-color: var(--gold-deep); }
.provider-mark { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: #39352d; color: #dfc48e; font-weight: 700; font-size: var(--fs-md); }
.fin-amount { font-weight: 600; font-size: var(--fs-lg); text-align: right; }
.fin-list { display: grid; gap: 8px; }
.cal-group { display: grid; gap: 6px; }
.meter { display: grid; gap: 4px; }
.meter-bar { height: 6px; border-radius: 99px; background: #2d2f35; overflow: hidden; }
.meter-fill { height: 100%; width: var(--v, 0%); background: linear-gradient(90deg, #b89153, #e4c588); border-radius: 99px; }
.meter-fill.warn { background: var(--warn); }
.meter-fill.alert { background: var(--alert); }
.meters { display: grid; gap: 10px; }
.services { display: flex; gap: 6px 12px; flex-wrap: wrap; }
.services span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: var(--fs-sm); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; background: var(--raised); border: 1px solid #3b3e46; border-radius: 10px; color: var(--text); text-align: left; }
.quick:hover:not(:disabled) { border-color: var(--gold-deep); }
.quick:disabled { opacity: .55; cursor: not-allowed; }
.note-title { font-weight: 600; }

/* Drawer */
.overlay { position: fixed; inset: 0; background: #000a; z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(520px, 100%); height: 100%; background: var(--panel); border-left: 1px solid var(--gold-border); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.drawer-head h2 { font-size: var(--fs-lg); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.eyebrow { color: var(--dim); font-size: var(--fs-xs); letter-spacing: 1px; text-transform: uppercase; }
.drawer-body { padding: 14px 16px 24px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.section-title { font-size: var(--fs-sm); color: var(--gold); text-transform: uppercase; letter-spacing: .6px; }

/* Mobile nav */
.mobile-nav { display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 56px; background: var(--panel); border-top: 1px solid var(--gold-border); padding: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; z-index: 45; }

@media (max-width: 1180px) {
  .grid-mid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-bot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-mid > :first-child, .grid-bot > :last-child { grid-column: 1 / -1; }
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* the team block is ~440px wide here: 4 columns broke names mid-word */
}
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 6px; }
  .date-box { display: none; }
  .topbar { padding: 8px 12px; }
  .main { padding: 12px 12px 84px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi:last-child { grid-column: 1 / -1; }
  .grid-top, .grid-mid, .grid-bot { grid-template-columns: minmax(0, 1fr); }
  .grid-mid > :first-child, .grid-bot > :last-child { grid-column: auto; }
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
  .seg button { min-height: 36px; border: 0; background: none; color: var(--muted); border-radius: 8px; }
  .seg button.active { background: #393228; color: var(--gold-bright); }
  .home[data-group="overview"] [data-group]:not([data-group="overview"]),
  .home[data-group="team"] [data-group]:not([data-group="team"]),
  .home[data-group="control"] [data-group]:not([data-group="control"]) { display: none; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #18191c; border-top: 1px solid #34353a; z-index: 40; }
  .mobile-nav button { background: none; border: 0; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; font-size: var(--fs-xs); min-width: 0; padding: 0 2px; }
  .mobile-nav button.active { color: var(--gold-bright); }
  .status-pill .label { display: none; }
  .drawer { width: 100%; border-left: 0; }
  .item-body { padding-left: 10px; }
}
@media (max-width: 400px) {
  .main { padding-left: 8px; padding-right: 8px; }
  .kpi-value { font-size: 22px; }
  .agents { gap: 6px; }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .event { grid-template-columns: 28px minmax(0, 1fr); }
  .event time { grid-column: 2; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .item-side { max-width: 46%; }
  .panel { padding: 12px 10px; }
}

/* B1R: compact attention strip, compact finance, order form and dialog. No fixed heights: long texts wrap, nothing is clipped. */
.attention.compact { padding: 8px 12px; gap: 6px; }
.attention.compact .attention-head { font-size: var(--fs-md); }
.attention-head .grow { flex: 1; min-width: 0; }
.attention-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.attention-total { color: #c7b999; font-size: var(--fs-sm); }
.attention-chip { display: inline-flex; align-items: center; gap: 4px; background: #382f22; border: 1px solid #54452f; border-radius: 99px; padding: 4px 10px; min-height: 30px; color: #eadfc6; font-size: var(--fs-sm); text-align: left; overflow-wrap: anywhere; }
.attention-chip:hover { border-color: var(--gold-deep); }
.attention-chip b { color: #f0d7a8; }
.fin-list.compact { gap: 6px; }
.fin-list.compact .fin-row { padding: 8px 10px; }
.quota-lines { display: grid; gap: 4px; }
.quota-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.fin-foot { justify-content: space-between; align-items: center; }
.order-form textarea { width: 100%; min-height: 120px; resize: vertical; background: var(--raised-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); line-height: 1.45; }
.order-form textarea:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.order-form .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.file-chip { gap: 4px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.msg-files { display: flex; gap: 6px; flex-wrap: wrap; }
.form-msg { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.form-msg.ok { color: var(--ok); }
.form-msg.alert { color: var(--alert); }
.msgs { display: grid; gap: 10px; }
.msg { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.msg.reminder { border-color: var(--gold-border); background: var(--gold-bg); }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-head time { margin-left: auto; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); }
.msg-note { color: var(--warn); font-size: var(--fs-sm); }
.msg-answer { border-left: 2px solid var(--gold-border); padding-left: 10px; display: grid; gap: 4px; }
.msg-error { color: var(--alert); font-size: var(--fs-sm); overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .order-form .btn { flex: 1 1 140px; min-height: 44px; }
  .order-form textarea { font-size: 16px; }
  .attention-chip { flex: 1 1 100%; }
}

.fin-edit { display: grid; gap: 8px; margin-top: 8px; }
.fe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.fe-grid[hidden] { display: none; }
.fe-row { display: grid; gap: 2px; min-width: 0; }
.fe-row.wide, .fe-grid > .wide { grid-column: 1 / -1; }
.fe-row input, .fe-row select { width: 100%; min-height: var(--tap); background: var(--raised-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; color: var(--text); }
.fe-row input:focus-visible, .fe-row select:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.fin-history summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 600px) { .fe-grid { grid-template-columns: minmax(0, 1fr); } }

/* C: notebook compose / addendum forms and long notes. Wrap, never clip; touch targets >= 44px on small screens. */
.note-form { display: grid; gap: 8px; }
.note-form .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.note-text { width: 100%; min-height: 120px; resize: vertical; background: var(--raised-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); line-height: 1.45; font: inherit; }
.note-text:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.note-compose[hidden] { display: none; }
.note-detail .note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-add { border-top: 1px solid var(--border); padding-top: 10px; }
.msg.addendum { background: var(--raised-2); }
@media (max-width: 900px) {
  .note-form .btn { flex: 1 1 140px; min-height: 44px; }
  .note-text { font-size: 16px; min-height: 160px; }
  .view > .row .btn { min-height: 44px; }
}
