*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #1a1b26; --bg-surface: #24283b; --bg-highlight: #292e42;
  --fg: #c8d1f5; --fg-dim: #828db5; --fg-bright: #a9b1d6;
  --accent: #7aa2f7; --green: #9ece6a; --red: #f7768e;
  --yellow: #e0af68; --cyan: #7dcfff; --magenta: #bb9af7;
  --border: #3b4261; --code-bg: #1f2335;
  --radius: 8px;
  --dash-grid: 72px 120px 100px 1fr 60px 48px;
}
[data-theme="light"] {
  --bg: #f5f5f5; --bg-surface: #ffffff; --bg-highlight: #e8e8ec;
  --fg: #1a1a2e; --fg-dim: #4b5563; --fg-bright: #374151;
  --accent: #1d4ed8; --green: #15803d; --red: #b91c1c;
  --yellow: #92400e; --cyan: #0e7490; --magenta: #7e22ce;
  --border: #d1d5db; --code-bg: #eaeaef;
}
html, body { height: 100%; background: var(--bg); color: var(--fg); font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 14px; }
body { display: flex; flex-direction: column; }

/* Header */
#header { padding: 8px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#header h1 { font-size: 16px; color: var(--accent); font-weight: 600; }
#status-bar { font-size: 12px; color: var(--fg-dim); margin-left: auto; }
.skip-permissions-warning { font-size: 12px; color: var(--yellow); font-weight: 600; padding: 2px 8px; border: 1px solid var(--yellow); border-radius: var(--radius); }

/* Hamburger menu */
#hamburger-wrap { position: relative; }
#hamburger-btn { background:none; border:1px solid var(--border); color:var(--fg); border-radius:var(--radius); width:32px; height:32px; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:0; flex-shrink:0; }
#hamburger-btn:hover { background:var(--bg-highlight); border-color:var(--fg-dim); }
#hamburger-btn:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#hamburger-btn span { display:block; width:14px; height:2px; background:var(--fg); border-radius:1px; }
#hamburger-menu { display:none; position:absolute; top:calc(100% + 6px); left:0; background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius); min-width:180px; box-shadow:0 4px 16px rgba(0,0,0,0.3); z-index:40; overflow:hidden; }
[data-theme="light"] #hamburger-menu { box-shadow:0 4px 16px rgba(0,0,0,0.12); }
#hamburger-menu.open { display:block; }
.hmenu-item { display:flex; align-items:center; gap:10px; width:100%; padding:10px 14px; background:none; border:none; color:var(--fg); font:inherit; font-size:13px; cursor:pointer; text-align:left; white-space:nowrap; }
.hmenu-item:hover { background:var(--bg-highlight); }
.hmenu-item:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.hmenu-item .hmenu-icon { width:16px; text-align:center; font-size:14px; opacity:0.8; }
.hmenu-sep { height:1px; background:var(--border); margin:4px 0; }
@media (max-width:600px) {
  #hamburger-btn { width:40px; height:40px; }
  .hmenu-item { padding:12px 14px; }
}

/* Tab bar */
#tab-bar { display: flex; align-items: center; gap: 2px; padding: 4px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; }
#tab-bar::-webkit-scrollbar { height: 4px; }
#tab-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.ws-tab { padding: 5px 10px; border-radius: 6px 6px 0 0; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-bottom: none; color: var(--fg-dim); white-space: nowrap; user-select: none; position: relative; }
.ws-tab:hover { background: var(--bg-highlight); color: var(--fg-bright); }
.ws-tab.active { background: var(--bg-highlight); color: var(--fg-bright); border-bottom: 2px solid var(--accent); }
.ws-tab .tab-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ws-tab .tab-indicator[data-state="idle"] { background: var(--fg-dim); opacity: 0.3; }
.ws-tab .tab-indicator[data-state="thinking"] { background: var(--cyan); animation: pulse 1.5s ease-in-out infinite; }
.ws-tab .tab-indicator[data-state="running"] { background: var(--green); border-radius: 2px; animation: pulse 1s ease-in-out infinite; }
.ws-tab .tab-indicator[data-state="attention"] { background: var(--yellow); border-radius: 1px; transform: rotate(45deg); animation: pulse 1s ease-in-out infinite; }
.ws-tab .tab-indicator[data-state="error"] { background: var(--red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .ws-tab .tab-indicator[data-state="thinking"],
  .ws-tab .tab-indicator[data-state="running"],
  .ws-tab .tab-indicator[data-state="attention"],
  .dash-state-dot[data-state="running"],
  .dash-state-dot[data-state="thinking"],
  .dash-state-dot[data-state="attention"] { animation: none; opacity: 1; }
  .thinking-indicator::after { animation: none; content: '...'; }
}
.ws-tab .tab-close { background: none; border: none; color: var(--fg-dim); font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1; opacity:0; transition:opacity 0.15s; }
.ws-tab:hover .tab-close, .ws-tab:focus-within .tab-close, .ws-tab .tab-close:focus-visible { opacity:1; }
.ws-tab .tab-close:hover { color: var(--red); }
#new-tab-btn { background: none; border: 1px dashed var(--border); color: var(--fg-dim); border-radius: 6px 6px 0 0; padding: 5px 10px; cursor: pointer; font-family: inherit; font-size: 14px; line-height: 1; }
#new-tab-btn:hover { background: var(--bg-highlight); color: var(--fg-bright); border-color: var(--accent); }

/* Messages */
#messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 10px 14px; border-radius: var(--radius); max-width: 95%; line-height: 1.55; word-wrap: break-word; overflow-wrap: break-word; }
.msg-user { background: var(--bg-highlight); border: 1px solid var(--border); align-self: flex-end; color: var(--fg-bright); }
.msg-assistant { align-self: flex-start; }
.msg-info { color: var(--cyan); font-size: 13px; padding: 4px 14px; white-space: pre-wrap; font-family: inherit; }
.msg-error { color: var(--red); font-size: 13px; padding: 4px 14px; }
.msg-tool { background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--yellow); font-size: 13px; padding: 8px 12px; align-self: flex-start; max-width: 95%; }
.msg-tool .tool-header { color: var(--yellow); font-weight: 600; margin-bottom: 4px; }
.msg-tool .tool-preview { color: var(--fg-dim); white-space: pre-wrap; font-size: 12px; max-height: 300px; overflow-y: auto; }

/* Streaming content */
.reasoning { color: var(--fg-dim); font-style: italic; }
.thinking-indicator { color: var(--fg-dim); font-size: 13px; padding: 6px 14px; }
.thinking-indicator::after { content: '...'; animation: dots 1.5s steps(3, end) infinite; }
@keyframes dots { 0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; } }

/* Markdown styling */
.msg-assistant h1, .msg-assistant h2, .msg-assistant h3 { color: var(--accent); margin: 8px 0 4px; }
.msg-assistant h1 { font-size: 18px; } .msg-assistant h2 { font-size: 16px; } .msg-assistant h3 { font-size: 14px; }
.msg-assistant strong { color: var(--fg-bright); }
.msg-assistant em { color: var(--magenta); }
.msg-assistant code { background: var(--code-bg); padding: 2px 5px; border-radius: 3px; font-size: 13px; }
.msg-assistant pre { background: var(--code-bg); padding: 10px 12px; border-radius: var(--radius); overflow-x: auto; margin: 6px 0; border: 1px solid var(--border); }
.msg-assistant pre code { background: none; padding: 0; }
.msg-assistant ul, .msg-assistant ol { margin: 4px 0 4px 20px; }
.msg-assistant li { margin: 2px 0; }
.msg-assistant a { color: var(--accent); text-decoration: underline; }
.msg-assistant blockquote { border-left: 3px solid var(--border); padding-left: 10px; color: var(--fg-dim); margin: 4px 0; }
.msg-assistant hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.msg-assistant p { margin: 4px 0; }

/* Input area */
#input-area { padding: 12px 16px; background: var(--bg-surface); border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; }
#input-area textarea { flex: 1; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-family: inherit; font-size: 14px; resize: none; outline: none; min-height: 40px; max-height: 200px; }
#input-area textarea:focus { border-color: var(--accent); }
#input-area button { background: var(--accent); color: var(--bg); border: none; border-radius: var(--radius); padding: 8px 16px; font-family: inherit; font-size: 14px; cursor: pointer; font-weight: 600; }
#input-area button:hover { opacity: 0.9; }
#input-area button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Inline approval blocks */
.approval-block { background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--yellow); border-radius: var(--radius); padding: 0; align-self: flex-start; max-width: 95%; font-size: 13px; }
.approval-block.approved { border-left-color: var(--green); }
.approval-block.denied { border-left-color: var(--red); }
.approval-tool { padding: 6px 12px; border-bottom: 1px solid var(--border); }
.approval-tool:last-of-type { border-bottom: none; }
.approval-tool .tool-name { color: var(--yellow); font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.approval-tool .tool-cmd { color: var(--fg-bright); white-space: pre-wrap; word-break: break-all; }
.approval-tool .tool-cmd .dollar { color: var(--green); }
.approval-tool .tool-diff { white-space: pre-wrap; font-size: 12px; margin-top: 4px; }
.approval-tool .tool-diff .diff-del { color: var(--red); }
.approval-tool .tool-diff .diff-add { color: var(--green); }
.approval-tool .tool-diff .diff-warn { color: var(--yellow); }
.approval-prompt { padding: 8px 12px; font-size: 12px; border-top: 1px solid var(--border); background: var(--bg-highlight); }
.approval-actions { display: flex; gap: 6px; margin-bottom: 6px; }
.approval-btn { background: var(--bg); border: 1px solid var(--border); color: var(--fg-bright); border-radius: 4px; padding: 4px 12px; font-family: inherit; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.approval-btn:hover { background: var(--bg-highlight); }
.approval-btn .key { display: inline-block; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; font-size: 11px; color: var(--accent); font-weight: 600; min-width: 18px; text-align: center; }
.btn-approve:hover { border-color: var(--green); color: var(--green); }
.btn-deny:hover { border-color: var(--red); color: var(--red); }
.btn-always:hover { border-color: var(--accent); color: var(--accent); }
.approval-feedback-input { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; font-family: inherit; font-size: 12px; outline: none; }
.approval-feedback-input:focus { border-color: var(--accent); }
.approval-feedback-input::placeholder { color: var(--fg-dim); }
.approval-badge { padding: 6px 12px; font-size: 12px; font-weight: 600; border-top: 1px solid var(--border); }
.approval-badge.badge-approved { color: var(--green); }
.approval-badge.badge-denied { color: var(--red); }
.tool-output { padding: 6px 12px; background: var(--code-bg); border-top: 1px solid var(--border); white-space: pre-wrap; font-size: 12px; color: var(--fg-dim); max-height: 300px; overflow-y: auto; }
.tool-output.collapsed { max-height: 150px; position: relative; }
.tool-output.collapsed::after { content: 'click to expand'; position: absolute; bottom: 0; left: 0; right: 0; text-align: center; padding: 4px; background: linear-gradient(transparent, var(--code-bg) 60%); color: var(--fg-dim); font-size: 11px; cursor: pointer; }

/* Plan review dialog */
#plan-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; justify-content: center; align-items: center; }
#plan-overlay.active { display: flex; }
#plan-dialog { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 700px; width: 90%; max-height: 80vh; overflow-y: auto; }
#plan-dialog h3 { color: var(--accent); margin-bottom: 12px; font-size: 15px; }
#plan-content { white-space: pre-wrap; font-size: 13px; color: var(--fg-bright); margin-bottom: 16px; max-height: 50vh; overflow-y: auto; background: var(--code-bg); padding: 12px; border-radius: var(--radius); }
#plan-feedback { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; font-family: inherit; font-size: 13px; margin-bottom: 12px; }
#plan-buttons { display: flex; gap: 8px; justify-content: flex-end; }
#plan-buttons button { padding: 8px 20px; border: none; border-radius: var(--radius); font-family: inherit; font-size: 13px; cursor: pointer; font-weight: 600; }
#btn-plan-approve { background: var(--green); color: var(--bg); }
#btn-plan-reject { background: var(--red); color: var(--bg); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-dim); }

/* Focus indicators */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#input-area textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.approval-btn:focus-visible { outline-offset: 1px; }

/* Empty state */
.empty-state { color: var(--fg-dim); text-align: center; padding: 48px 16px; font-size: 13px; }

/* Disconnected status */
#status-bar.disconnected { color: var(--red); }

/* Dashboard overlay */
.dashboard-overlay { display:none; position:fixed; inset:0; background:var(--bg); z-index:50; overflow-y:auto; }
.dashboard-overlay.active { display:flex; justify-content:center; align-items:flex-start; }
.dashboard-content { width:100%; max-width:960px; padding:32px 16px 24px; }
.dashboard-input-row { display:flex; gap:8px; margin-bottom:24px; }
.dashboard-input { flex:1; background:var(--bg-surface); color:var(--fg); border:1px solid var(--border); border-radius:var(--radius); padding:12px 16px; font:inherit; font-size:15px; outline:none; }
.dashboard-input:focus { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 30%,transparent); }
.dashboard-input::placeholder { color:var(--fg-dim); }
.dashboard-new-btn { background:var(--accent); color:var(--bg); border:none; border-radius:var(--radius); padding:12px 20px; font:inherit; font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap; }
.dashboard-new-btn:hover { opacity:0.9; }
.dashboard-new-btn:disabled { opacity:0.4; cursor:not-allowed; }
.dashboard-section { margin-bottom:24px; }
.dashboard-section-title { font-size:12px; text-transform:uppercase; letter-spacing:0.05em; color:var(--fg-dim); margin-bottom:10px; font-weight:600; }
.dashboard-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; }
.dashboard-card { background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; cursor:pointer; transition:border-color 0.15s; }
.dashboard-card:hover { border-color:var(--accent); }
.dashboard-card:active { background:var(--bg-highlight); border-color:var(--accent); }
.dashboard-card:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.dashboard-card .card-title { font-size:13px; color:var(--fg-bright); font-weight:600; margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-card .card-meta { font-size:11px; color:var(--fg-dim); }
.dashboard-empty { color:var(--fg-dim); font-size:13px; padding:8px 0; }

/* Dashboard header bar */
.dash-header { display:flex; justify-content:space-between; align-items:center; padding:8px 16px; background:var(--code-bg); border-radius:var(--radius) var(--radius) 0 0; }
.dash-header-title { color:var(--accent); font-size:12px; font-weight:bold; letter-spacing:0.05em; }
.dash-header-summary { color:var(--fg-dim); font-size:11px; }

/* Dashboard column headers */
.dash-colheaders { display:grid; grid-template-columns:var(--dash-grid); padding:4px 16px; background:var(--bg-surface); border-bottom:1px solid var(--border); font-size:11px; color:var(--fg-dim); text-transform:uppercase; letter-spacing:0.03em; }
.dash-col-tokens,.dash-col-ctx { text-align:right; }

/* Dashboard table */
.dash-table { min-height:40px; }
.dash-row { position:relative; border-left:3px solid transparent; cursor:pointer; transition:background 0.15s; }
.dash-row:nth-child(odd) { background:var(--bg); }
.dash-row:nth-child(even) { background:var(--bg-surface); }
.dash-row:hover { background:var(--bg-highlight); box-shadow:inset 0 0 0 1px var(--border); }
.dash-row:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.dash-row[data-state="running"]   { border-left-color:var(--green); }
.dash-row[data-state="thinking"]  { border-left-color:var(--accent); }
.dash-row[data-state="attention"] { border-left-color:var(--yellow); }
.dash-row[data-state="idle"]      { border-left-color:var(--fg-dim); opacity:0.7; }
.dash-row[data-state="error"]     { border-left-color:var(--red); }
.dash-row-main { display:grid; grid-template-columns:var(--dash-grid); padding:8px 16px 2px; align-items:center; font-size:12px; }
.dash-row-sub { padding:0 16px 8px 88px; font-size:11px; color:var(--fg-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dash-row-sub.sub-attention { color:var(--yellow); }

/* State indicator cell */
.dash-cell-state { display:flex; align-items:center; gap:6px; font-size:11px; }
.dash-state-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.dash-state-dot[data-state="running"]   { background:var(--green); border-radius:2px; animation:pulse 2s infinite; }
.dash-state-dot[data-state="thinking"]  { background:var(--accent); animation:pulse 2.2s infinite; }
.dash-state-dot[data-state="attention"] { background:var(--yellow); border-radius:1px; transform:rotate(45deg); animation:pulse 1.8s infinite; }
.dash-state-dot[data-state="idle"]      { background:var(--fg-dim); }
.dash-state-dot[data-state="error"]     { background:var(--red); border-radius:0; }
.dash-state-label { white-space:nowrap; }
.dash-state-label[data-state="running"]   { color:var(--green); }
.dash-state-label[data-state="thinking"]  { color:var(--accent); }
.dash-state-label[data-state="attention"] { color:var(--yellow); }
.dash-state-label[data-state="idle"]      { color:var(--fg-dim); }
.dash-state-label[data-state="error"]     { color:var(--red); }

/* Table cells */
.dash-cell-name { font-weight:bold; color:var(--fg-bright); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dash-row[data-state="idle"] .dash-cell-name { color:var(--fg-dim); }
.dash-cell-node { color:var(--fg-dim); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dash-cell-task { color:var(--fg-bright); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dash-row[data-state="idle"] .dash-cell-task { color:var(--fg-dim); }
.dash-cell-tokens { text-align:right; color:var(--fg-dim); font-size:11px; }
.dash-cell-ctx { text-align:right; font-size:11px; }
.dash-cell-ctx.ctx-low    { color:var(--green); }
.dash-cell-ctx.ctx-mid    { color:var(--yellow); }
.dash-cell-ctx.ctx-high   { color:var(--red); }
.dash-cell-ctx.ctx-danger { color:var(--red); font-weight:bold; }
.dash-cell-ctx.ctx-idle   { color:var(--fg-dim); }

/* Dashboard footer */
.dash-footer { display:flex; justify-content:space-between; align-items:center; padding:8px 16px; background:var(--code-bg); border-top:1px solid var(--border); border-radius:0 0 var(--radius) var(--radius); font-size:11px; margin-bottom:24px; }
.dash-footer-nodes { color:var(--fg-dim); display:flex; align-items:center; gap:6px; }
.dash-footer-node-dot { width:6px; height:6px; border-radius:50%; background:var(--green); display:inline-block; flex-shrink:0; }
.dash-footer-stats { color:var(--fg-dim); }

/* Dashboard responsive */
@media (max-width:700px) {
  :root { --dash-grid:68px 110px 1fr 56px 44px; }
  .dash-col-node,.dash-cell-node { display:none; }
  .dash-row-sub { padding-left:76px; }
}
@media (max-width:600px) {
  .dashboard-input-row { flex-direction:column; }
  .dashboard-new-btn { width:100%; }
}
@media (max-width:480px) {
  .dashboard-content { padding:24px 12px 16px; }
  .dashboard-cards { grid-template-columns:1fr; }
  :root { --dash-grid:50px 1fr 50px; }
  .dash-col-node,.dash-cell-node,.dash-col-task,.dash-cell-task,.dash-col-ctx,.dash-cell-ctx { display:none; }
  .dash-row-sub { padding-left:66px; }
}

/* Login overlay */
#login-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
#login-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 320px; max-width: 90vw; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
#login-box h2 { color: var(--accent); font-size: 16px; margin-bottom: 16px; }
#login-box input { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--fg); font: inherit; font-size: 13px; margin-bottom: 12px; }
#login-box input:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
#login-box input::placeholder { color: var(--fg-dim); }
#login-box button { width: 100%; padding: 12px; background: var(--accent); color: var(--bg); border: none; border-radius: 4px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
#login-box button:hover { opacity: 0.9; }
#login-box button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
#login-box button:disabled { opacity: 0.5; cursor: not-allowed; }
#login-error { color: var(--red); font-size: 12px; margin-bottom: 8px; display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 380px) { #login-box { padding: 24px 20px; } }

/* Keyboard shortcuts overlay */
#kb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 999; }
#kb-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; width: 360px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
#kb-box h2 { color: var(--accent); font-size: 14px; margin-bottom: 14px; }
.kb-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.kb-key { color: var(--fg-bright); background: var(--bg-highlight); border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; font-family: inherit; font-size: 11px; white-space: nowrap; }
.kb-desc { color: var(--fg-dim); }
.kb-section { color: var(--fg-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 12px; margin-bottom: 4px; }
.kb-section:first-child { margin-top: 0; }
#kb-box .kb-hint { color: var(--fg-dim); font-size: 11px; text-align: center; margin-top: 14px; }
