    :root {
      --bg: #f3efe6;
      --ink: #161411;
      --muted: #6d675e;
      --line: #ddd6c8;
      --surface: #fffcf6;
      --surface-2: #ebe4d6;
      --sidebar: #14120f;
      --sidebar-ink: #f6f1e7;
      --sidebar-muted: #a39b8d;
      --accent: #1e4d3a;
      --accent-2: #c45c26;
      --text: var(--ink);
      --card: var(--surface);
      --border: var(--line);
      --danger: #9b2c1d;
      --ok: #1e4d3a;
      --warn: #c27c0e;
      --shadow: 0 1px 0 rgba(22,20,17,.04), 0 18px 40px -24px rgba(22,20,17,.28);
      --sans: "Instrument Sans", "Segoe UI", sans-serif;
      --serif: "Newsreader", "Times New Roman", serif;
    }
    * { box-sizing: border-box; }
    html, body { height: 100%; }
    body {
      margin: 0;
      font-family: var(--sans);
      background: var(--bg);
      color: var(--ink);
      letter-spacing: -0.011em;
    }
    button, input, select, textarea { font-family: inherit; }
    #app {
      display: grid;
      grid-template-columns: 248px 1fr;
      min-height: 100vh;
      height: 100vh;
    }
    .sidebar {
      background: var(--sidebar);
      color: var(--sidebar-ink);
      display: flex;
      flex-direction: column;
      padding: 22px 16px 16px;
      overflow: auto;
    }
    .brand { padding: 0 8px 18px; border-bottom: 1px solid rgba(246,241,231,.08); margin-bottom: 16px; }
    .brand-mark { font-family: var(--serif); font-size: 28px; font-weight: 560; letter-spacing: -0.03em; line-height: 1; }
    .brand-mark em { font-style: italic; color: #e8c4a0; font-weight: 400; }
    .brand p { margin: 6px 0 0; color: var(--sidebar-muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
    #globalSearch {
      width: 100%;
      margin: 0 0 16px;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid rgba(246,241,231,.12);
      background: rgba(255,255,255,.04);
      color: var(--sidebar-ink);
    }
    #globalSearch::placeholder { color: var(--sidebar-muted); }
    nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
    .nav-label {
      margin: 14px 8px 6px;
      font-size: 10px;
      letter-spacing: .16em;
      text-transform: uppercase;
      color: var(--sidebar-muted);
    }
    nav button {
      appearance: none;
      background: transparent;
      border: 0;
      color: #d8d0c4;
      text-align: left;
      padding: 8px 10px;
      border-radius: 9px;
      cursor: pointer;
      font-size: 13.5px;
      font-weight: 500;
    }
    nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
    nav button.active { background: var(--bg); color: var(--ink); }
    .sidebar-foot {
      margin-top: 16px;
      padding-top: 14px;
      border-top: 1px solid rgba(246,241,231,.08);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    #agentIdentity { font-size: 12px; color: var(--sidebar-muted); padding: 0 8px; }
    .nav-toggle { display: none; }
    .workspace { min-width: 0; min-height: 0; height: 100vh; overflow: hidden; background: var(--bg); }
    .list { border-right: 1px solid var(--line); overflow: auto; background: var(--surface); }
    .item { padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
    .item:hover { background: #f8f3ea; }
    .item.active { background: #efe7d8; box-shadow: inset 3px 0 0 var(--accent); }
    .item .title { font-weight: 600; font-size: 14px; }
    .item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
    .badge { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
    .badge.pending_agent { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
    .badge.assigned { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }
    .detail { padding: 20px; overflow: auto; }
    .msg { margin: 8px 0; padding: 10px 12px; border-radius: 12px 12px 12px 4px; max-width: 74%; font-size: 14px; }
    .msg.in { background: #efe7d8; }
    .msg.out { background: var(--accent); color: var(--sidebar-ink); margin-left: auto; border-radius: 12px 12px 4px 12px; }
    .msg .who { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
    .msg.out .who { color: #d5c7b0; }
    .app-top-bar {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      padding: 8px 14px;
      border-bottom: 1px solid var(--line);
      background: var(--surface);
    }
    .app-top-bar select { width: auto; margin: 0; max-width: 140px; }
    .pwa-ios-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 16px;
      background: var(--surface-2);
      border-bottom: 1px solid var(--line);
      font-size: 13px;
    }
    .pwa-ios-banner.hidden { display: none; }
    #agentIdentity { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
    .workspace-switch { display: flex; gap: 6px; margin: 0 8px 12px; }
    .workspace-switch button {
      flex: 1;
      padding: 7px 8px;
      border-radius: 8px;
      border: 1px solid rgba(246,241,231,.14);
      background: rgba(255,255,255,.05);
      color: var(--sidebar-muted);
      cursor: pointer;
      font-size: 12px;
      font-weight: 600;
    }
    .workspace-switch button.active { background: var(--bg); color: var(--ink); border-color: transparent; }
    .desk-inbox {
      display: grid;
      grid-template-columns: 240px minmax(360px, 1.2fr) minmax(280px, 1fr);
      height: calc(100vh - 41px);
      min-height: 0;
    }
    .desk-col { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
    .desk-col:last-child { border-right: none; }
    .desk-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
    .desk-ticket-header { border-bottom: 1px solid var(--line); }
    .desk-breadcrumb { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; font-size: 12px; color: var(--muted); }
    .desk-crumb { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
    .desk-crumb:hover { text-decoration: underline; }
    .desk-crumb-sep { opacity: .5; }
    .desk-crumb-current { color: var(--ink); font-weight: 600; }
    .desk-ticket-titlebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-bottom: 0; padding-top: 8px; }
    .desk-ticket-id { font-size: 13px; color: var(--muted); font-weight: 600; }
    .desk-ticket-subject { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.3; flex: 1 1 12rem; }
    .desk-props { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .desk-prop-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
    .desk-prop-field span { font-weight: 600; letter-spacing: .02em; }
    .desk-prop-field input, .desk-prop-field select { width: 100%; color: var(--ink); font-size: 13px; }
    .desk-props-update { width: 100%; margin-top: 4px; }
    .desk-contact-card { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .desk-contact-wa { margin-bottom: 8px; font-size: 12px; }
    .desk-contact-block { margin-top: 10px; display: flex; gap: 6px; }
    .desk-contact-block button { width: 100%; font-size: 12px; }
    .desk-muted { color: var(--muted); font-size: 12px; }
    .desk-other-tickets { list-style: none; margin: 0; padding: 0; }
    .desk-other-tickets li { padding: 6px 0; border-bottom: 1px solid var(--line); }
    .desk-other-tickets li:last-child { border-bottom: 0; }
    .desk-scroll { flex: 1; overflow: auto; }
    .desk-view-btn {
      display: flex;
      justify-content: space-between;
      width: 100%;
      text-align: left;
      padding: 10px 14px;
      border: 0;
      border-bottom: 1px solid var(--line);
      background: transparent;
      cursor: pointer;
      font-size: 13px;
    }
    .desk-view-btn:hover { background: #f8f3ea; }
    .desk-view-btn.active { background: #efe7d8; box-shadow: inset 3px 0 0 var(--accent); }
    .desk-view-count { color: var(--muted); font-size: 12px; }
    .desk-filters { padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .desk-filters input, .desk-filters select { margin: 0; font-size: 13px; }
    .desk-filter-panel { display: flex; flex-direction: column; gap: 10px; border-bottom: 0; flex: 1; overflow: auto; }
    .desk-filter-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
    .desk-filter-field span { font-weight: 600; letter-spacing: .02em; }
    .desk-filter-field input, .desk-filter-field select { width: 100%; color: var(--ink); }
    .desk-view-btns { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
    .desk-list-toolbar { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: center; }
    .desk-list-toolbar input { flex: 1; margin: 0; }
    .desk-bulk-bar { display: none; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
    .desk-bulk-bar.has-selection { display: flex; }
    .desk-bulk-count { font-size: 12px; color: var(--muted); min-width: 4em; }
    .desk-bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
    .desk-list-table-host { flex: 1; min-height: 0; padding: 10px 12px 14px; }
    .desk-list-table-host .ui-datatable { height: 100%; display: flex; flex-direction: column; }
    .desk-list-table-host .ui-datatable-scroll { flex: 1; }
    .desk-subject-link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-weight: 600; text-align: left; }
    .desk-subject-link:hover { text-decoration: underline; }
    .desk-row-active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
    .ui-datatable tbody tr { cursor: pointer; }
    .desk-ticket-row { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
    .desk-ticket-row:hover { background: #f8f3ea; }
    .desk-ticket-row.active { background: #efe7d8; }
    .desk-ticket-title { font-weight: 600; font-size: 13px; }
    .desk-ticket-meta { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.4; }
    .desk-sla-ok { color: var(--ok); font-size: 10px; font-weight: 600; }
    .desk-sla-warn { color: var(--warn); font-size: 10px; font-weight: 600; }
    .desk-sla-bad { color: var(--danger); font-size: 10px; font-weight: 600; }
    .desk-ticket-main { display: grid; grid-template-columns: 1fr 260px; min-height: 0; flex: 1; }
    @media (max-width: 900px) { .desk-ticket-main { grid-template-columns: 1fr; } .desk-side { border-left: 0; border-top: 1px solid var(--line); } }
    .desk-thread { padding: 14px; overflow: auto; background: #faf6ee; }
    .desk-bubble { margin: 8px 0; max-width: 78%; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
    .desk-bubble.in { background: #efe7d8; }
    .desk-bubble.out { background: var(--accent); color: var(--sidebar-ink); margin-left: auto; }
    .desk-bubble.note { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); max-width: 90%; }
    .desk-bubble.system { background: transparent; color: var(--muted); font-size: 12px; text-align: center; max-width: 100%; }
    .desk-tick { font-size: 11px; margin-top: 4px; text-align: right; opacity: .9; }
    .desk-tick.read { color: var(--ok); }
    .desk-tick.failed { color: var(--danger); }
    .desk-compose { border-top: 1px solid var(--line); padding: 10px 14px; background: var(--surface); }
    .desk-compose-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
    .desk-compose-tabs button { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 12px; }
    .desk-compose-tabs button.active { background: var(--accent); color: var(--sidebar-ink); border-color: var(--accent); }
    .desk-compose-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-top: 4px; font-size: 11px; color: var(--muted); }
    .desk-char-count { font-variant-numeric: tabular-nums; }
    .desk-char-count.desk-char-over { color: var(--warn); font-weight: 600; }
    .desk-char-hint { color: var(--muted); }
    .desk-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .desk-actions button { font-size: 12px; padding: 7px 11px; }
    .desk-side { border-left: 1px solid var(--line); padding: 12px 14px; overflow: auto; font-size: 13px; }
    .desk-side h4 { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
    .desk-event { border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 12px; }
    .desk-back { display: none; margin: 8px 14px 0; }
    #deskPaneTicket { display: flex; flex-direction: column; min-height: 0; }
    .desk-chip { display: inline-block; background: var(--surface-2); border-radius: 999px; padding: 2px 8px; margin: 2px; font-size: 11px; }
    .access-modal { position: fixed; inset: 0; background: rgba(22,20,17,.45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px; }
    .access-modal-panel { background: var(--surface); border-radius: 14px; padding: 20px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
    .ref-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr); gap: 16px; min-height: 420px; }
    @media (max-width: 900px) { .ref-layout { grid-template-columns: 1fr; } }
    .ref-list, .ref-detail { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: auto; max-height: calc(100vh - 180px); }
    .ref-row { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
    .ref-row.active { background: var(--surface-2); }
    .ref-toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
    .ref-muted { color: var(--muted); font-size: 13px; padding: 16px; }
    .ref-transcript { border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 320px; overflow: auto; font-size: 13px; }
    .ref-bubble { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
    .ref-bubble.in { background: #eef6ff; }
    .ref-bubble.out { background: #f5f0e8; margin-left: 12%; }
    .comp-disclaimer { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 12px; padding: 14px 16px; margin: 12px 0 20px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
    .comp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; max-width: 1100px; }
    .comp-ev-chip { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); margin: 2px; cursor: pointer; background: var(--surface-2); }
    .comp-ev-chip:hover { border-color: var(--accent); }
    .comp-pre { background: #1e1e1e; color: #e8e8e8; padding: 12px; border-radius: 8px; overflow: auto; max-height: 360px; font-size: 11px; white-space: pre-wrap; word-break: break-word; }
    .comp-fw-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
    .wf-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 20px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
    .wf-tabs button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; }
    .wf-tabs button.active { background: var(--accent); color: var(--sidebar-ink); border-color: var(--accent); }
    .wf-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); max-width: 1100px; }
    .wf-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
    .wf-hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; max-width: 72ch; line-height: 1.45; }
    .wf-err { color: var(--danger); font-size: 12px; }
    .wf-ok { color: var(--ok); font-size: 13px; }
    .wf-table input, .wf-table select { margin: 0; font-size: 12px; max-width: 100%; }
    .wf-table td { vertical-align: top; }
    .wf-preview { font-size: 11px; color: var(--muted); max-width: 200px; white-space: pre-wrap; word-break: break-word; }
    .wf-step-actions { display: flex; flex-direction: column; gap: 4px; }
    .wf-step-actions button { padding: 4px 8px; font-size: 11px; }
    .wf-tpl-group { margin-top: 16px; }
    .wf-tpl-group h4 { font-size: 13px; margin: 0 0 8px; color: var(--muted); }
    .wf-tpl-row { border-bottom: 1px solid var(--line); padding: 12px 0; }
    .wf-tpl-row textarea { width: 100%; min-height: 72px; font-size: 13px; }
    .wf-tpl-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 8px; }
    .wf-char-count { font-size: 11px; color: var(--muted); }
    .dash-page { max-width: 1200px; }
    .dash-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 0; }
    .dash-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
    .dash-seg button { border: none; background: var(--surface); padding: 7px 14px; cursor: pointer; font-size: 13px; }
    .dash-seg button.active { background: var(--accent); color: var(--sidebar-ink); }
    .dash-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
    .dash-date input { margin: 0; font-size: 12px; }
    .dash-sort { border: none; background: transparent; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
    .dash-badge { font-size: 11px; background: var(--surface-2); border-radius: 999px; padding: 4px 10px; cursor: help; }
    .dash-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 20px; }
    .dash-kpi { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: default; }
    .dash-kpi.dash-kpi-click { cursor: pointer; }
    .dash-kpi.dash-kpi-click:hover { background: #f8f3ea; }
    .dash-kpi.status-green { border-left: 4px solid var(--ok); }
    .dash-kpi.status-amber { border-left: 4px solid var(--warn); }
    .dash-kpi.status-red { border-left: 4px solid var(--danger); }
    .dash-kpi.status-grey { border-left: 4px solid var(--muted); }
    .dash-kpi-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; line-height: 1.35; }
    .dash-kpi-value { font-size: 22px; font-weight: 700; }
    .dash-kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
    .dash-kpi-status { font-size: 10px; font-weight: 600; margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }
    .dash-section { margin-bottom: 24px; }
    .dash-section h3 { font-size: 14px; margin: 0 0 10px; }
    .dash-trend-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
    .dash-trend-svg { width: 100%; max-width: 640px; height: auto; display: block; }
    .dash-sr-toggle { font-size: 12px; margin-top: 8px; }
    .dash-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
    .dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .dash-table th, .dash-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
    .dash-table th { background: var(--surface-2); font-weight: 600; }
    .dash-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
    .dash-dot-green { background: var(--ok); }
    .dash-dot-amber { background: var(--warn); }
    .dash-dot-red { background: var(--danger); }
    .dash-dot-grey { background: var(--muted); }
    .dash-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 80; display: flex; justify-content: flex-end; }
    .dash-drawer-backdrop.hidden { display: none; }
    .dash-drawer { width: min(420px, 100vw); background: var(--surface); height: 100%; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.12); }
    .dash-drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
    .dash-drawer-scroll { flex: 1; overflow: auto; }
    .dash-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
    @media (max-width: 900px) {
      .desk-inbox { grid-template-columns: 1fr; }
      .desk-inbox.desk-pane-list .desk-views,
      .desk-inbox.desk-pane-ticket .desk-views,
      .desk-inbox.desk-pane-ticket .desk-list { display: none; }
      .desk-inbox.desk-pane-views .desk-list,
      .desk-inbox.desk-pane-views .desk-ticket,
      .desk-inbox.desk-pane-list .desk-ticket { display: none; }
      .desk-back { display: inline-block; }
    }
    @media (max-width: 480px) {
      .dash-kpis { grid-template-columns: 1fr 1fr; }
      .dash-toolbar { flex-direction: column; align-items: stretch; }
      .ref-layout .ref-list table { display: block; overflow-x: auto; white-space: nowrap; }
      .ref-toolbar { flex-direction: column; align-items: stretch; }
    }
    #login {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 1.05fr .95fr;
      background: var(--bg);
    }
    .login-stage {
      padding: 56px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      background:
        radial-gradient(900px 500px at 10% 10%, rgba(196,92,38,.18), transparent 55%),
        var(--sidebar);
      color: var(--sidebar-ink);
    }
    .login-stage h1 { font-family: var(--serif); font-size: clamp(42px, 6vw, 72px); font-weight: 560; letter-spacing: -.035em; line-height: .92; margin: 48px 0 16px; }
    .login-stage h1 em { font-style: italic; color: #e8c4a0; }
    .login-stage .lede { max-width: 26rem; color: #c9c0b2; font-size: 16px; line-height: 1.5; }
    .login-meta { font-size: 12px; color: #8d8578; letter-spacing: .08em; text-transform: uppercase; }
    .login-card { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
    .login-card form, .login-card .stack { width: min(400px, 100%); }
    .login-card h2 { font-family: var(--serif); font-size: 34px; font-weight: 560; margin: 0 0 8px; }
    .login-card .hint { color: var(--muted); margin: 0 0 28px; font-size: 14px; }
    #login label, label.setting { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 14px 0 6px; }
    input, select, textarea {
      width: 100%;
      padding: 11px 12px;
      margin: 0 0 4px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: var(--surface);
      color: var(--ink);
      font-size: 14px;
    }
    input:focus, select:focus, textarea:focus { outline: 2px solid rgba(30,77,58,.25); border-color: var(--accent); }
    button.primary {
      background: var(--accent);
      color: var(--sidebar-ink);
      border: none;
      padding: 11px 16px;
      border-radius: 999px;
      cursor: pointer;
      font-weight: 600;
      font-size: 14px;
    }
    button.primary:hover { filter: brightness(1.08); }
    button.danger {
      background: transparent;
      color: var(--danger);
      border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
      padding: 7px 12px;
      border-radius: 999px;
      cursor: pointer;
      font-weight: 600;
    }
    table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
    th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
    th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #f8f3ea; }
    .hidden { display: none !important; }
    .page { padding: 32px 36px 48px; overflow: auto; height: 100vh; }
    .page h2 { font-family: var(--serif); font-size: 34px; font-weight: 560; letter-spacing: -.03em; margin: 0 0 6px; }
    .page > p { max-width: 62ch; }
    .contacts-layout { display: grid; grid-template-columns: 320px 1fr; height: 100vh; }
    .contact-detail { padding: 28px 32px; overflow: auto; }
    .tag { display: inline-block; background: var(--surface-2); border-radius: 999px; padding: 3px 10px; margin: 2px 4px 2px 0; font-size: 12px; }
    .tag button { border: none; background: transparent; color: var(--muted); cursor: pointer; }
    .timeline-item { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
    .row { display: flex; gap: 8px; align-items: center; max-width: 720px; margin-bottom: 12px; }
    .row input, .row select { margin: 0; }
    .board { display: flex; gap: 14px; overflow-x: auto; padding: 20px; height: calc(100vh - 88px); align-items: stretch; }
    .col { min-width: 250px; max-width: 290px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
    .col-h { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 13px; }
    .col-b { flex: 1; overflow: auto; padding: 8px; min-height: 120px; }
    .deal-card { background: #f8f3ea; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: grab; }
    .deal-card:active { cursor: grabbing; }
    .col-b.dragover { outline: 2px dashed var(--accent); }
    .drawer, .modal { position: fixed; inset: 0; background: rgba(20,18,15,.46); z-index: 20; display: flex; justify-content: flex-end; }
    .modal { justify-content: center; align-items: center; }
    .drawer-panel, .modal-panel { background: var(--surface); border-left: 1px solid var(--line); width: min(420px, 100%); padding: 24px; overflow: auto; }
    .modal-panel { border: 1px solid var(--line); border-radius: 18px; width: min(480px, 94%); max-height: 90vh; box-shadow: var(--shadow); }
    @media (max-width: 980px) {
      #app { grid-template-columns: 1fr; }
      .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); z-index: 30; transform: translateX(-105%); transition: transform .2s ease; }
      #app.nav-open .sidebar { transform: none; }
      #app.nav-open .workspace::before {
        content: '';
        position: fixed;
        inset: 0;
        background: transparent;
        z-index: 29;
      }
      .nav-toggle { display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 31; }
      #login { grid-template-columns: 1fr; }
      .login-stage { display: none; }
      .contacts-layout { grid-template-columns: 1fr; grid-template-rows: 240px 1fr; }
      .list { border-right: none; border-bottom: 1px solid var(--line); }
      .page { padding: 64px 18px 32px; }
    }
    @media (max-width: 812px) {
      .desk-reply-sticky {
        position: sticky;
        bottom: 0;
        background: var(--surface);
        z-index: 3;
      }
    }
    .table-scroll, .dash-table-wrap, .ui-table-wrap { overflow-x: auto; max-width: 100%; }

