:root {
  color-scheme: light;
  --ink: #14212b;
  --muted: #77838d;
  --line: #dfe5e9;
  --paper: #f7f9fa;
  --panel: #ffffff;
  --accent: #1f7a70;
  --accent-soft: #e6f2ef;
  --warm: #c56a3b;
  --danger: #b34e4e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar-brand, .topbar-actions, .detail-heading, .section-heading, .device-row, .composer-actions, .file-card, .message-meta { display: flex; align-items: center; }
.topbar-brand, .topbar-actions { gap: 10px; }
.topbar-brand strong { font-size: 17px; letter-spacing: .02em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--ink); color: white; font-size: 22px; font-weight: 800; border-radius: 12px; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 12px; }
.agent-badge { padding: 4px 7px; border: 1px solid #e6d6c7; border-radius: 4px; color: var(--warm); font-size: 10px; }
.agent-badge.ready { border-color: #b9ded7; color: var(--accent); }
.agent-restart { font-size: 17px; padding: 0 2px; }
.agent-error { max-width: 230px; overflow: hidden; color: var(--danger); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.muted, small, .fine-print { color: var(--muted); }
.device-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.workspace { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 250px minmax(420px, 1fr) 280px; }
.sidebar { background: #fbfcfc; padding: 26px 16px; }
.left-sidebar { border-right: 1px solid var(--line); }
.right-sidebar { border-left: 1px solid var(--line); }
.section-heading { justify-content: space-between; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 700; margin-bottom: 10px; }
.count-badge { min-width: 20px; padding: 2px 6px; background: var(--accent-soft); color: var(--accent); border-radius: 10px; text-align: center; font-size: 10px; }
.device-row { width: 100%; gap: 10px; border: 0; border-radius: 6px; background: transparent; padding: 11px 10px; text-align: left; color: var(--ink); margin-bottom: 3px; }
.device-row:hover, .device-row.active { background: var(--accent-soft); }
.device-row strong, .device-row small, .share-row strong, .share-row small, .detail-heading strong, .detail-heading small { display: block; }
.device-row strong, .share-row strong { font-size: 13px; }
.device-row small, .share-row small { margin-top: 3px; font-size: 11px; }
.avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: #d8e3e6; color: #49616a; font-size: 12px; font-weight: 700; }
.avatar.online { background: var(--accent); color: white; }
.avatar.large { width: 42px; height: 42px; margin-right: 10px; border-radius: 12px; }
.shares-heading { margin-top: 36px; }
.plain-action, .icon-button { border: 0; background: transparent; color: var(--muted); }
.plain-action { font-size: 22px; line-height: 1; padding: 0 5px; }
.icon-button:hover, .plain-action:hover { color: var(--accent); }
.share-row { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px; border: 0; border-bottom: 1px solid #edf0f1; background: transparent; color: var(--ink); text-align: left; }
.share-row:hover { background: var(--accent-soft); }
.folder-icon { color: var(--warm); font-size: 18px; }
.empty-note { color: var(--muted); font-size: 12px; line-height: 1.6; padding: 4px 10px; }
.conversation { min-width: 0; display: flex; flex-direction: column; background: var(--panel); }
.conversation-header { min-height: 95px; display: flex; align-items: center; justify-content: space-between; padding: 22px 34px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 42px; margin-bottom: 12px; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 15px; margin-bottom: 7px; }
.status-label { color: var(--accent); font-size: 12px; }
.message-list { flex: 1; overflow: auto; padding: 32px 10%; }
.message { max-width: 78%; margin-bottom: 22px; }
.message.own { margin-left: auto; }
.message-meta { gap: 9px; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.message.own .message-meta { justify-content: flex-end; }
.message-bubble { display: inline-block; padding: 11px 14px; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; background: #f8fafb; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.own .message-bubble { border-color: var(--accent); background: var(--accent); color: white; border-radius: 12px 4px 12px 12px; }
.file-card { min-width: 250px; gap: 10px; color: var(--ink); }
.message.own .file-card { color: var(--ink); }
.file-card strong, .file-card small { display: block; }
.file-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.file-symbol { width: 32px; height: 32px; display: grid; place-items: center; background: #e9f0f0; color: var(--accent); border-radius: 8px; font-size: 18px; }
.download-button { margin-left: auto; border: 1px solid var(--accent); background: white; color: var(--accent); border-radius: 4px; padding: 6px 8px; font-size: 11px; }
.empty-state { min-height: 280px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-symbol { color: var(--accent); font-size: 36px; letter-spacing: .18em; margin-bottom: 12px; }
.empty-state h3 { color: var(--ink); }
.empty-state p { font-size: 13px; }
.composer { margin: 0 10% 28px; padding: 10px 12px 10px 16px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 8px 26px rgba(20, 33, 43, .05); }
.composer textarea { width: 100%; resize: vertical; min-height: 30px; max-height: 130px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.composer-actions { justify-content: space-between; margin-top: 6px; }
.attach-button { color: var(--muted); font-size: 12px; cursor: pointer; }
.attach-button input { display: none; }
.send-button, .primary-button { border: 0; border-radius: 5px; background: var(--ink); color: white; padding: 9px 15px; }
.send-button:hover, .primary-button:hover { background: var(--accent); }
.detail-heading { padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.detail-heading strong { font-size: 13px; }
.detail-heading small { margin-top: 4px; font-size: 11px; }
.detail-section { padding-top: 26px; }
.transfer-row { padding: 12px 0; border-bottom: 1px solid #edf0f1; }
.transfer-name { display: flex; justify-content: space-between; gap: 8px; }
.transfer-name strong { max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.transfer-name small { font-size: 10px; }
.progress-track { height: 4px; margin: 9px 0 5px; border-radius: 2px; background: #e8edef; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--accent); }
.transfer-status { font-size: 10px; }
.transfer-footer { display: flex; align-items: center; justify-content: space-between; }
.transfer-cancel { border: 0; background: transparent; color: var(--danger); padding: 0; font-size: 10px; }
.tip-block { margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--line); }
.tip-label { color: var(--warm); font-size: 11px; font-weight: 700; }
.tip-block p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef3f3; }
.login-panel { width: min(100%, 420px); padding: 44px; background: white; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(20, 33, 43, .08); }
.stack-form { display: grid; gap: 16px; }
.stack-form label { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 700; }
.stack-form input, .stack-form select { width: 100%; border: 1px solid var(--line); border-radius: 4px; outline: 0; padding: 11px 12px; color: var(--ink); background: white; }
.stack-form input:focus, .stack-form select:focus { border-color: var(--accent); }
.device-access { display: grid; gap: 7px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; }
.device-access legend { padding: 0 4px; color: var(--ink); font-size: 12px; font-weight: 700; }
.device-access label, .permission-list label { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 500; }
.device-access small { margin-left: auto; font-size: 10px; }
.fine-print { margin: 25px 0 0; font-size: 11px; line-height: 1.6; }
.error-text { margin: 15px 0 0; color: var(--danger); font-size: 12px; }
dialog { width: min(100% - 32px, 420px); border: 0; padding: 0; box-shadow: 0 18px 60px rgba(20, 33, 43, .22); }
dialog::backdrop { background: rgba(20, 33, 43, .35); }
dialog form { padding: 26px; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; }
.dialog-header h3 { margin: 0 0 18px; }
.share-browser { min-height: 260px; padding: 26px; }
.browser-path { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 4px 0 12px; padding: 7px 9px; border: 1px solid var(--line); background: #fbfcfc; }
.browser-path .plain-action { padding: 0; font-size: 11px; }
.browser-path .plain-action:disabled { opacity: .35; cursor: default; }
.browser-path code { color: var(--muted); font-size: 11px; }
.browser-loading, .browser-empty { padding: 35px 8px; color: var(--muted); text-align: center; font-size: 12px; }
.entry-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf0f1; }
.entry-row strong, .entry-row small { display: block; }
.entry-row strong { font-size: 13px; }
.entry-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.entry-icon { width: 28px; color: var(--warm); font-size: 18px; }
.entry-action { margin-left: auto; border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; background: white; color: var(--accent); font-size: 11px; }
.entry-meta { margin-left: auto; color: var(--muted); font-size: 10px; }
.admin-body { min-height: 100vh; background: var(--paper); }
.admin-shell { min-height: 100vh; }
.admin-topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px max(20px, calc((100% - 1240px) / 2)); border-bottom: 1px solid var(--line); background: var(--panel); }
.admin-topbar > div { display: flex; align-items: center; gap: 11px; }
.admin-topbar strong { font-size: 17px; }
.admin-topbar small { color: var(--muted); font-size: 12px; }
.text-link { color: var(--accent); font-size: 12px; text-decoration: none; }
.admin-content { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 44px; }
.metrics-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric-card { min-height: 104px; display: grid; align-content: center; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.metric-card small, .metric-card span { color: var(--muted); font-size: 11px; }
.metric-card strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.admin-section { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 20px 15px; border-bottom: 1px solid var(--line); }
.admin-section-head h2 { margin: 0; font-size: 17px; }
.admin-section-head .eyebrow { margin-bottom: 5px; }
.inline-form { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(160px, 1.4fr) auto; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.inline-form input { min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 9px 10px; }
.admin-list { max-height: 470px; overflow: auto; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-bottom: 1px solid #edf0f1; }
.admin-row:last-child { border-bottom: 0; }
.admin-row > div:first-child { min-width: 0; }
.admin-row strong, .admin-row small { display: block; }
.admin-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.admin-row small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.row-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.subtle-button, .danger-button { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; background: white; color: var(--accent); font-size: 11px; white-space: nowrap; }
.danger-button { border-color: #e8c9c9; color: var(--danger); }
.subtle-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.danger-button:hover { background: #fff4f4; }
.share-admin-row { align-items: flex-start; }
.permission-list { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 10px; }
.permission-list label { min-width: 100px; }
.audit-list { max-height: 470px; overflow: auto; }
.audit-list article { padding: 13px 20px; border-bottom: 1px solid #edf0f1; }
.audit-list strong, .audit-list small { display: block; }
.audit-list strong { font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.audit-list small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.notice-text { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.system-note { margin: -8px 0 20px; padding: 9px 12px; border-left: 3px solid #c8d6da; color: var(--muted); background: #f1f5f6; font-size: 11px; line-height: 1.55; }
@media (max-width: 1000px) { .workspace { grid-template-columns: 220px minmax(0, 1fr); } .right-sidebar { display: none; } }
@media (max-width: 1000px) { .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .admin-topbar { padding: 10px 16px; } .admin-topbar small { display: none; } .admin-content { width: min(100% - 28px, 1240px); padding-top: 18px; } .metrics-grid, .admin-grid { grid-template-columns: 1fr; } .inline-form { grid-template-columns: 1fr; } .admin-row { padding: 13px 14px; } .admin-section-head { padding: 16px 14px 13px; } .inline-form { padding: 12px 14px; } .admin-topbar .text-link { display: none; } }
@media (max-width: 680px) { .topbar { padding: 0 15px; } .topbar-brand .muted, .agent-error { display: none; } .workspace { display: block; } .left-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; } .left-sidebar .device-row { width: auto; display: inline-flex; min-width: 145px; } .share-list { display: none; } .shares-heading { display: none; } .conversation-header { padding: 18px 20px; } .message-list { padding: 24px 20px; } .composer { margin: 0 20px 20px; } .login-panel { padding: 32px 25px; } }
