/* strata-ctl web GUI — mobile-first. Single column on phones; a persistent session sidebar appears on wide screens. Touch-friendly targets, 16px inputs (avoids iOS focus zoom), safe-area insets for notched phones. */ :root { --bg: #0f1115; --panel: #171a21; --panel-2: #1f2430; --border: #2a3040; --text: #e6e9ef; --muted: #9aa4b2; --accent: #4f8cff; --accent-press: #3a6fd6; --user: #2b3a55; --danger: #e5534b; --radius: 14px; --sidebar-w: 280px; } * { box-sizing: border-box; } /* The `hidden` attribute must always win over author `display` rules (e.g. the stats modal uses display:flex); otherwise toggling .hidden has no effect. */ [hidden] { display: none !important; } html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.5; } #app { display: flex; height: 100dvh; overflow: hidden; } /* ---- Buttons ---- */ .btn { appearance: none; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: 0.95rem; cursor: pointer; min-height: 44px; transition: background 0.12s ease, transform 0.05s ease; } .btn:active { transform: scale(0.97); } .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:active { background: var(--accent-press); } .btn.ghost { background: transparent; } .btn.icon { padding: 8px 12px; font-size: 1.2rem; line-height: 1; } .btn.danger { color: var(--danger); } .btn:disabled { opacity: 0.5; cursor: default; } /* ---- Drawer / sidebar ---- */ #drawer { position: fixed; inset: 0 auto 0 0; width: min(82vw, var(--sidebar-w)); background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 0.2s ease; z-index: 30; padding-top: env(safe-area-inset-top); } #drawer.open { transform: translateX(0); } #scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 20; } /* Resizable sidebar/chat separator: desktop only (mobile uses a drawer). */ #splitter { display: none; } body.resizing { cursor: col-resize; user-select: none; } .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); } .brand { font-weight: 700; letter-spacing: 0.3px; } #session-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; } #session-list li { padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--muted); min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; } #session-list li:hover { background: var(--panel-2); } #session-list li.active { background: var(--panel-2); color: var(--text); } .session-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .session-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; } #session-list li:hover .session-actions, #session-list li.active .session-actions { opacity: 1; } .sess-btn { background: transparent; border: none; cursor: pointer; font-size: 0.9rem; padding: 4px 6px; min-height: 32px; border-radius: 6px; line-height: 1; } .sess-btn:hover { background: var(--border); } .sess-btn.danger:hover { background: var(--danger); } @media (hover: none) { .session-actions { opacity: 1; } } .drawer-foot { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; } /* ---- Main column ---- */ #main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100dvh; } #topbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--border); background: var(--panel); } .title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; } #session-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .muted { color: var(--muted); font-size: 0.8rem; } #transcript { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; } .empty { color: var(--muted); text-align: center; margin: auto; max-width: 28ch; } /* ---- Message bubbles ---- */ .msg { max-width: 860px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; } .msg .role { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; } .msg.user { align-items: flex-end; } .msg.user .bubble { background: var(--user); border-radius: var(--radius) var(--radius) 4px var(--radius); padding: 10px 14px; max-width: 85%; } .msg.assistant .bubble { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) var(--radius) 4px; padding: 10px 14px; width: 100%; } .bubble .content { white-space: pre-wrap; word-wrap: break-word; } .bubble .content:empty::after { content: "…"; color: var(--muted); } details.thinking { margin-bottom: 8px; } details.thinking summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; user-select: none; } details.thinking .reasoning { white-space: pre-wrap; word-wrap: break-word; color: var(--muted); font-size: 0.9rem; border-left: 2px solid var(--border); padding-left: 10px; margin-top: 6px; } .usage { color: var(--muted); font-size: 0.72rem; margin-top: 6px; } /* ---- Agent tool blocks ---- */ .msg.tool .bubble { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; } .tool-cmd { display: block; white-space: pre-wrap; word-wrap: break-word; font-size: 0.9rem; } .tool-out { margin: 8px 0 0; max-height: 300px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; color: var(--muted); font-size: 0.82rem; background: var(--bg); border-radius: 8px; padding: 8px; } .tool-out:empty { display: none; } #agent-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; } /* ---- Composer ---- */ #composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--panel); } #input { flex: 1; resize: none; max-height: 40dvh; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-family: inherit; line-height: 1.4; } #input:focus { outline: none; border-color: var(--accent); } #send { min-width: 52px; font-size: 1.3rem; } #attach { min-width: 44px; font-size: 1.2rem; } /* ---- Attachment chips (composer + sent user turn) ---- */ .attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: var(--panel); } .attach-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 4px 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; font-size: 0.8rem; color: var(--text); } .attach-chip .attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .attach-chip .attach-kind { color: var(--muted); } .attach-chip button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0 2px; } .attach-chip button:hover { color: var(--danger); } .msg-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } /* ---- Stats modal ---- */ #stats-modal, #dialog, #settings-modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 20px; } .modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; max-width: 420px; width: 100%; } .modal-card h2 { margin: 0 0 12px; font-size: 1.1rem; } /* ---- Stats dashboard ---- */ .stats-card { width: min(940px, 100%); max-width: 940px; max-height: 88dvh; display: flex; flex-direction: column; padding: 0; overflow: hidden; } .stats-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--panel); flex: 0 0 auto; } .stats-head h2 { margin: 0; font-size: 1.15rem; } .stats-live { flex: 1; font-size: 0.72rem; text-align: right; font-variant-numeric: tabular-nums; } .stats-head .btn.icon { min-height: 36px; padding: 6px 10px; font-size: 1rem; } .stats-content { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; } /* Overview cards: 2-up on phones, 3-up from 700px. */ .stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .stat-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-width: 0; } .stat-card .label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); } .stat-card .value { font-size: 1.5rem; font-weight: 600; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; } .stat-card .sub { font-size: 0.73rem; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; } .stat-card.engine .value { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; } .stat-card .model { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; } .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; } .dot.idle { background: #3fb950; } .dot.busy { background: #d29922; } /* Section headings inside the dashboard. */ .stat-section > h3 { margin: 0; font-size: 0.95rem; } .stat-section > .sub { font-size: 0.73rem; color: var(--muted); margin: 2px 0 12px; } .stat-empty { color: var(--muted); font-size: 0.85rem; padding: 10px 0; } /* Daily activity chart: stacked prompt/completion bars (pure CSS, responsive). */ .chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 132px; } .chart-bars .bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; } .chart-bars .bar i { display: block; width: 100%; } .chart-bars .bar i.prompt { background: var(--accent-press); } .chart-bars .bar i.completion { background: var(--accent); border-radius: 3px 3px 0 0; } .chart-bars .bar:hover i { filter: brightness(1.18); } .chart-x { display: flex; justify-content: space-between; gap: 8px; font-size: 0.66rem; color: var(--muted); margin-top: 6px; } .chart-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 0.72rem; color: var(--muted); } .chart-legend span { display: inline-flex; align-items: center; gap: 6px; } .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; } .swatch.prompt { background: var(--accent-press); } .swatch.completion { background: var(--accent); } /* Per-session breakdown: relative token-share bars, busiest first. */ .sess-stats { display: flex; flex-direction: column; gap: 12px; } .sess-stat { min-width: 0; } .sess-stat.current .name { color: var(--accent); } .sess-stat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; } .sess-stat-top .name { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sess-stat-top .tok { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; } .sess-bar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: var(--bg); margin: 5px 0 4px; } .sess-bar i { display: block; height: 100%; } .sess-bar i.prompt { background: var(--accent-press); } .sess-bar i.completion { background: var(--accent); } .sess-stat-sub { font-size: 0.7rem; color: var(--muted); } @media (min-width: 700px) { .stat-cards { grid-template-columns: repeat(3, 1fr); } } #dialog-msg { margin: 0 0 16px; } #dialog-input { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-family: inherit; margin: 0 0 16px; } #dialog-input:focus { outline: none; border-color: var(--accent); } .dialog-actions { display: flex; gap: 8px; justify-content: flex-end; } /* ---- Settings modal ---- */ .settings-card { width: min(560px, 100%); max-height: 85vh; overflow-y: auto; } /* Scope switch reads as a segmented control so the two scopes are unmistakable. */ .scope-toggle { display: flex; gap: 3px; margin: 0 0 12px; padding: 3px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; } .scope-toggle .btn { flex: 1; border: none; background: transparent; min-height: 38px; border-radius: 8px; } .scope-toggle .btn.active { background: var(--accent); color: #fff; } #set-hint { margin: 0 0 12px; } #set-name-hint { margin: -8px 0 12px; } .small { font-size: 0.8rem; } .field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; } .field > span { font-size: 0.85rem; color: var(--muted); } .field input, .field textarea { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 16px; font-family: inherit; } .field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); } .field input:disabled { opacity: 0.6; } .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } .sess-btn:disabled { opacity: 0.35; cursor: default; } /* ---- Wide screens: persistent sidebar ---- */ @media (min-width: 900px) { #drawer { position: static; transform: none; width: var(--sidebar-w); flex-shrink: 0; } #scrim { display: none !important; } #menu { display: none; } .msg.user .bubble { max-width: 70%; } #splitter { display: block; flex: 0 0 6px; width: 6px; cursor: col-resize; position: relative; background: transparent; touch-action: none; } #splitter::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 2px; background: var(--border); transition: background 0.12s ease; } #splitter:hover::after, #splitter:focus-visible::after, body.resizing #splitter::after { background: var(--accent); } #splitter:focus-visible { outline: none; } }