:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-2: #edf1ee;
  --ink: #18201b;
  --muted: #69736c;
  --line: #dce2dd;
  --green: #18794e;
  --green-dark: #0e5d3a;
  --green-soft: #e0f2e8;
  --amber: #9a5d00;
  --amber-soft: #fff1d5;
  --danger: #b42318;
  --sidebar: #111713;
  --sidebar-muted: #9ba79f;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; height: 100%; overflow: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body { width: 100%; height: 100%; }
body { background: var(--bg); color: var(--ink); overflow: hidden; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button, input, textarea, select { max-width: 100%; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 0; }

.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); width: 100%; height: var(--app-height, 100dvh); }
.sidebar { display: flex; flex-direction: column; background: var(--sidebar); color: white; padding: 18px 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #2bb673; color: #07170e; }
.brand-mark svg { width: 20px; }
.brand span:last-child, .page-identity span:last-child { min-width: 0; display: flex; flex-direction: column; }
.brand strong { font-size: 15px; }
.brand small, .page-identity small { margin-top: 2px; color: var(--sidebar-muted); font-size: 11px; }
.main-nav { display: grid; gap: 4px; }
.nav-button { position: relative; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--sidebar-muted); text-align: left; }
.nav-button:hover, .nav-button.active { background: #243029; color: white; }
.nav-button svg { width: 18px; }
.nav-button b { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: #2bb673; color: #07170e; font-size: 11px; text-align: center; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 6px 0; border-top: 1px solid #2b342e; }
.page-identity { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.page-identity strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.avatar-page { background: #263a2f !important; color: #75d6a4; }

.workspace { display: grid; grid-template-columns: minmax(260px, 340px) minmax(380px, 1fr) 260px; min-width: 0; height: 100dvh; }
.conversation-panel, .chat-panel, .details-panel { min-width: 0; min-height: 0; background: var(--surface); }
.conversation-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.panel-header, .chat-header, .content-header { display: flex; align-items: center; justify-content: space-between; }
.panel-header { height: 76px; padding: 14px 16px; }
.icon-button { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; }
.icon-button:hover { background: var(--surface-2); }
.sidebar .icon-button:hover { background: #243029; }
.icon-button svg { width: 18px; }
.search-box { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; padding: 0 10px; height: 38px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--muted); }
.search-box svg { width: 16px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.page-switcher-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 7px; margin: 0 12px 10px; }
.page-switcher-row label { display: grid; gap: 3px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 700; }
.page-switcher-row select { width: 100%; height: 36px; padding: 0 30px 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 11px; font-weight: 650; }
.page-switcher-row .icon-button { align-self: end; border: 1px solid var(--line); background: var(--green-soft); color: var(--green-dark); }
.filter-row { display: flex; gap: 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.filter-button, .mode-button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-button { padding: 6px 10px; }
.filter-button.active, .filter-button:hover { background: var(--green-soft); color: var(--green-dark); }
.conversation-list { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; touch-action: pan-y; }
.conversation-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid #edf0ee; background: white; color: var(--ink); text-align: left; }
.conversation-item:hover, .conversation-item.active { background: #f0f6f2; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: #dfe9e2; color: var(--green-dark); font-size: 13px; font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.conversation-body { min-width: 0; }
.conversation-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conversation-top time, .conversation-body p { color: var(--muted); font-size: 11px; }
.conversation-body p { margin: 5px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge { align-self: center; min-width: 20px; padding: 3px 6px; border-radius: 999px; background: var(--green); color: white; font-size: 10px; text-align: center; }

.chat-panel { position: relative; display: flex; flex-direction: column; background: #f7f8f7; }
.empty-state { display: grid; place-content: center; justify-items: center; height: 100%; padding: 30px; text-align: center; }
.empty-state p, .details-empty p { color: var(--muted); font-size: 13px; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 14px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.active-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-header { min-height: 68px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: white; gap: 10px; }
.chat-heading { min-width: 0; flex: 1; }
.chat-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.chat-heading p.closed { color: var(--danger); }
.message-list { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; touch-action: pan-y; padding: 24px clamp(14px, 4vw, 52px); }
.message-row { display: flex; margin: 8px 0; }
.message-row.outbound { justify-content: flex-end; }
.message-bubble { max-width: min(74%, 560px); padding: 9px 11px 6px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 1px 1px rgb(20 34 24 / 4%); }
.outbound .message-bubble { border-color: #b8dbc8; background: #dff3e7; }
.message-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.message-bubble a { color: var(--green-dark); }
.message-audio { display: grid; gap: 6px; min-width: min(280px, 68vw); }
.message-audio > span { display: flex; align-items: center; gap: 5px; color: var(--green-dark); font-size: 10px; font-weight: 700; }
.message-audio > span svg { width: 14px; }
.message-audio audio { width: 100%; height: 36px; }
.message-meta { display: flex; justify-content: flex-end; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 9px; }
.attachment-link { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; }
.composer { padding: 10px 16px 14px; border-top: 1px solid var(--line); background: white; }
.compose-mode { display: flex; gap: 4px; margin-bottom: 8px; }
.mode-button { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.mode-button svg { width: 14px; }
.mode-button.active { background: var(--surface-2); color: var(--ink); }
.voice-tools { margin-bottom: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #f6f8f6; }
.voice-picker-row { display: grid; grid-template-columns: auto minmax(120px, 1fr) 30px auto; align-items: center; gap: 7px; margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.voice-picker-row label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 650; }
.voice-picker-row label svg { width: 14px; }
.voice-picker-row select { width: 100%; min-width: 0; height: 32px; padding: 0 28px 0 8px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: white; color: var(--ink); font-size: 11px; }
.voice-picker-row select:focus { border-color: #6aaa86; box-shadow: 0 0 0 2px rgb(24 121 78 / 10%); }
.voice-render-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr); gap: 8px; margin-bottom: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.voice-render-row label { display: flex; min-width: 0; flex-direction: column; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.voice-render-row select { width: 100%; min-width: 0; height: 32px; padding: 0 28px 0 8px; border: 1px solid var(--line); border-radius: 5px; outline: 0; background: white; color: var(--ink); font-size: 11px; }
.voice-render-row .volume-control input { height: 26px; }
.compact-icon { width: 30px; height: 30px; border: 1px solid var(--line); background: white; }
.compact-icon svg { width: 14px; }
.model-badge { padding: 4px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 700; }
.voice-tools-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.voice-tools-heading > span:first-child { display: flex; min-width: 0; flex-direction: column; }
.voice-tools-heading strong { font-size: 11px; }
.voice-tools-heading small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.voice-tool-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.tool-button { display: inline-flex; align-items: center; gap: 5px; min-height: 29px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--ink); font-size: 10px; font-weight: 650; }
.tool-button svg { width: 13px; }
.tool-button-accent { border-color: #a8d4bb; background: var(--green-soft); color: var(--green-dark); }
.tool-button:disabled { opacity: .55; cursor: wait; }
.tag-row { display: flex; gap: 5px; margin-top: 9px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tag-row button { flex: 0 0 auto; min-height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 9px; }
.tag-row button:hover { border-color: #91bca2; color: var(--green-dark); }
.compose-row { display: flex; align-items: flex-end; gap: 8px; }
.compose-row textarea { width: 100%; min-height: 42px; max-height: 112px; resize: none; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--bg); color: var(--ink); }
.compose-row textarea:focus { border-color: #6aaa86; box-shadow: 0 0 0 3px rgb(24 121 78 / 10%); }
.send-button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 8px; background: var(--green); color: white; }
.send-button:hover, .primary-button:hover { background: var(--green-dark); }
.send-button:disabled { opacity: .5; cursor: wait; }
.send-button svg { width: 18px; }
.composer-help { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.voice-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid #ebd49f; background: var(--amber-soft); }
.voice-preview audio { width: min(350px, 100%); height: 36px; }
.preview-actions { display: flex; gap: 6px; }

.details-panel { padding: 22px 18px; border-left: 1px solid var(--line); }
.details-empty { display: grid; justify-items: center; padding-top: 120px; color: var(--muted); text-align: center; }
.details-empty svg { width: 28px; }
.contact-card { display: grid; justify-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); text-align: center; }
.avatar-large { width: 68px; height: 68px; margin-bottom: 10px; font-size: 20px; }
.contact-card p { max-width: 210px; overflow: hidden; text-overflow: ellipsis; margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.details-list { margin: 0; }
.details-list div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.details-list dt { color: var(--muted); }
.details-list dd { max-width: 130px; margin: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.notice { display: flex; gap: 9px; margin-top: 18px; padding: 10px; border-radius: 6px; background: var(--green-soft); color: var(--green-dark); }
.notice svg { width: 18px; flex: 0 0 auto; }
.notice p { margin: 0; font-size: 11px; line-height: 1.4; }

.content-view { height: 100dvh; overflow-y: auto; padding: 28px clamp(20px, 4vw, 52px); }
.content-header { margin-bottom: 26px; }
.content-header p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 124px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.metric-head { display: flex; justify-content: space-between; color: var(--muted); }
.metric-head svg { width: 18px; }
.metric strong { display: block; margin-top: 24px; font-size: 28px; }
.metric small { color: var(--muted); }
.section-block { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.section-heading { margin-bottom: 14px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.action-item { display: grid; grid-template-columns: 40px 1fr 20px; align-items: center; gap: 12px; min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: white; color: var(--ink); text-align: left; }
.action-item:hover { border-color: #98baa6; }
.action-item > svg:first-child { width: 20px; color: var(--green); }
.action-item > svg:last-child { width: 16px; color: var(--muted); }
.action-item span { display: flex; flex-direction: column; }
.action-item small { margin-top: 3px; color: var(--muted); }
.status-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.status-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; background: white; }
.status-item > svg { width: 20px; color: var(--green); }
.status-item span { flex: 1; }
.status-item span strong, .status-item span small { display: block; }
.status-item span small { margin-top: 3px; color: var(--muted); }
.status-pill { padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; font-weight: 700; }
.status-pill.off { background: #fee4e2; color: var(--danger); }

.studio-model { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 700; }
.studio-model svg { width: 14px; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; align-items: start; }
.studio-editor { display: grid; gap: 18px; }
.studio-section { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.studio-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.studio-section-heading > span { display: flex; align-items: center; gap: 10px; min-width: 0; }
.studio-section-heading > span > b { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-size: 11px; }
.studio-section-heading > span > span { display: flex; min-width: 0; flex-direction: column; }
.studio-section-heading strong { font-size: 13px; }
.studio-section-heading small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.studio-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.studio-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 650; }
.studio-fields select { width: 100%; min-width: 0; height: 40px; padding: 0 34px 0 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: var(--bg); color: var(--ink); font-size: 12px; }
.studio-fields input[type="range"] { width: 100%; height: 40px; accent-color: var(--green); }
.studio-fields select:focus, #studio-text:focus { border-color: #6aaa86; box-shadow: 0 0 0 3px rgb(24 121 78 / 10%); }
.studio-note { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.studio-note.closed { color: var(--danger); }
.upload-sound-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); cursor: pointer; font-size: 10px; font-weight: 650; }
.upload-sound-button:hover { background: var(--surface-2); }
.upload-sound-button svg { width: 14px; }
.upload-sound-button input { display: none; }
.sound-controls { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) 36px; align-items: end; gap: 12px; }
.sound-controls > label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 650; }
.sound-controls select { width: 100%; height: 38px; padding: 0 32px 0 9px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: var(--bg); color: var(--ink); font-size: 11px; }
.volume-control > span { display: flex; justify-content: space-between; }
.volume-control input { width: 100%; height: 38px; accent-color: var(--green); }
.sound-delete { width: 36px; height: 38px; border: 1px solid #f1c0bc; background: #fff7f6; color: var(--danger); }
.studio-editor-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.studio-editor-actions .primary-button, .studio-editor-actions .secondary-button { min-height: 34px; font-size: 11px; }
.studio-categories { display: flex; gap: 5px; margin-bottom: 8px; overflow-x: auto; padding-bottom: 2px; }
.studio-categories button { flex: 0 0 auto; min-height: 29px; padding: 0 10px; border: 0; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 650; }
.studio-categories button.active { background: var(--green-soft); color: var(--green-dark); }
.studio-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 31px; margin-bottom: 10px; }
.studio-tags button { min-height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 9px; }
.studio-tags button:hover { border-color: #91bca2; color: var(--green-dark); }
#studio-text { width: 100%; resize: vertical; min-height: 170px; max-height: 380px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: var(--bg); color: var(--ink); font-size: 13px; line-height: 1.5; }
.studio-text-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.studio-preview { position: sticky; top: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.preview-stage { display: grid; justify-items: center; min-height: 270px; align-content: center; padding: 18px 0; text-align: center; }
.preview-stage-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.preview-stage-icon svg { width: 23px; }
.preview-stage h2 { font-size: 16px; }
.preview-stage > p:not(.eyebrow) { max-width: 230px; margin: 7px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.preview-stage audio { width: 100%; height: 38px; margin-top: 10px; }
.audio-preview-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--green-dark); font-size: 10px; font-weight: 650; }
.audio-preview-link svg { width: 13px; }
.generation-status { width: 100%; margin-top: 14px; }
.generation-status > span { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--green-dark); font-size: 10px; }
.generation-status svg { width: 14px; animation: spin 1s linear infinite; }
.generation-status > div { height: 4px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.generation-status > div span { display: block; width: 75%; height: 100%; border-radius: inherit; background: var(--green); animation: progress-pulse 1.4s ease-in-out infinite; }
.studio-primary-action, .studio-send-action { width: 100%; margin-top: 8px; }
.studio-send-action:disabled { opacity: .5; cursor: not-allowed; }
.studio-safety { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.studio-safety svg { width: 14px; flex: 0 0 auto; color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress-pulse { 0% { transform: translateX(-80%); } 100% { transform: translateX(120%); } }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 6px; font-weight: 650; }
.primary-button { border: 0; background: var(--green); color: white; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.primary-button svg, .secondary-button svg { width: 16px; }
.secondary-button:hover { background: var(--surface-2); }

.login-shell { display: grid; width: 100%; min-height: var(--app-height, 100dvh); place-items: center; padding: 20px; background: #111713; }
.login-panel { width: min(400px, 100%); padding: 28px; border-radius: 8px; background: white; box-shadow: 0 24px 80px rgb(0 0 0 / 25%); }
.brand-login { padding: 0 0 30px; color: var(--ink); }
.brand-login small { color: var(--muted); }
.login-panel h1 { font-size: 26px; }
.login-panel .muted { margin: 6px 0 0; font-size: 13px; }
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.login-form input { height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--ink); }
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(24 121 78 / 10%); }
.form-error { min-height: 16px; margin: 0; color: var(--danger); font-size: 11px; }

dialog { width: min(390px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 8px; color: var(--ink); box-shadow: 0 24px 90px rgb(0 0 0 / 30%); }
dialog::backdrop { background: rgb(8 13 10 / 60%); backdrop-filter: blur(2px); }
dialog form { padding: 24px; text-align: center; }
.dialog-icon { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.dialog-icon svg { width: 19px; }
dialog h2 { font-size: 18px; }
dialog p { margin: 8px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; max-width: min(380px, calc(100vw - 36px)); transform: translateY(20px); padding: 11px 14px; border-radius: 6px; background: #172019; color: white; opacity: 0; pointer-events: none; transition: .2s ease; font-size: 12px; box-shadow: 0 8px 30px rgb(0 0 0 / 20%); }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #7a271a; }
.list-empty { padding: 30px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.loading { opacity: .55; pointer-events: none; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr); }
  .details-panel { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-layout { grid-template-columns: 1fr; }
  .studio-preview { position: static; }
}

@media (max-width: 900px) {
  body { overflow: hidden; }
  input, textarea, select { font-size: 16px !important; }
  input, select { min-height: 44px; }
  textarea { line-height: 1.4; }
  button, a, label { touch-action: manipulation; }
  .mobile-only { display: grid !important; }
  .app-shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 62px; }
  .sidebar { grid-row: 2; flex-direction: row; align-items: center; padding: 6px max(10px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .sidebar .brand, .sidebar-footer { display: none; }
  .main-nav { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .nav-button { grid-template-columns: 1fr; justify-items: center; gap: 2px; min-height: 48px; padding: 3px; font-size: 10px; }
  .nav-button b { position: absolute; top: 1px; right: calc(50% - 24px); min-width: 16px; padding: 1px 4px; font-size: 9px; }
  .workspace, .content-view { grid-row: 1; height: 100%; min-height: 0; }
  .workspace { grid-template-columns: 1fr; }
  .conversation-panel, .chat-panel { height: 100%; }
  .conversation-item { touch-action: pan-y; }
  .workspace.chat-open .conversation-panel { display: none; }
  .workspace:not(.chat-open) .chat-panel { display: none; }
  .panel-header { padding-top: calc(14px + env(safe-area-inset-top)); height: calc(76px + env(safe-area-inset-top)); }
  .chat-header { padding-top: calc(10px + env(safe-area-inset-top)); min-height: calc(68px + env(safe-area-inset-top)); }
  .message-list { padding: 16px 12px; }
  .message-bubble { max-width: 84%; }
  .voice-preview { align-items: stretch; flex-direction: column; }
  .preview-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .content-view { padding: calc(20px + env(safe-area-inset-top)) 14px 20px; }
  .content-header { align-items: flex-start; gap: 12px; }
  .metric-grid, .action-grid { grid-template-columns: 1fr 1fr; }
  .login-panel { padding: 22px; }
  .keyboard-open .app-shell { grid-template-rows: minmax(0, 1fr); }
  .keyboard-open .sidebar { display: none; }
  .keyboard-open .content-view { padding-bottom: 12px; }
}

@media (max-width: 460px) {
  .metric-grid, .action-grid { grid-template-columns: 1fr; }
  .studio-fields { grid-template-columns: 1fr; }
  .sound-controls { grid-template-columns: 1fr 36px; }
  .volume-control { grid-column: 1 / -1; grid-row: 2; }
  .studio-section { padding: 14px; }
  .studio-section-heading { align-items: flex-start; flex-direction: column; }
  .studio-editor-actions { width: 100%; }
  .studio-editor-actions button { flex: 1; }
  .studio-text-meta { align-items: flex-start; flex-direction: column; }
  .voice-picker-row { grid-template-columns: auto minmax(90px, 1fr) 30px; }
  .voice-render-row { grid-template-columns: 1fr; }
  .model-badge { display: none; }
}

@media (max-width: 380px) {
  .sidebar { padding-left: 5px; padding-right: 5px; }
  .nav-button { font-size: 9px; }
  .nav-button svg { width: 17px; }
  .panel-header { padding-left: 12px; padding-right: 12px; }
  .chat-header { padding-left: 8px; padding-right: 8px; }
  .composer { padding-left: 9px; padding-right: 9px; }
  .voice-tools-heading { align-items: flex-start; flex-direction: column; }
  .voice-tool-actions { width: 100%; }
  .voice-tool-actions button { flex: 1; }
  .message-bubble { max-width: 90%; }
  dialog form { padding: 20px; }
}
