/* Callwren call console, wide screens first. The phone layout is in mobile.css. */
.app-body { --bar: 40px; }
.app-body .demo-bar { position: sticky; top: 0; z-index: 15; height: var(--bar); flex-wrap: nowrap; white-space: nowrap; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.005em; }
.noscript { padding: 40px 20px; text-align: center; }

/* Sidebar */
.shell { --side: 232px; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--bar)); }
.sidebar { position: sticky; top: var(--bar); align-self: start; display: flex; flex-direction: column; height: calc(100vh - var(--bar)); padding: 16px 12px 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { padding: 0 8px; }
.side-org { padding: 8px 8px 14px; color: var(--ink-2); font-size: 13px; border-bottom: 1px solid var(--line); }
.sidebar nav { margin-top: 12px; }
.sidebar nav ul { display: grid; gap: 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 11px; border-radius: var(--radius); color: #3d3739; font-weight: 500; font-size: 14.5px; line-height: 1.2; text-decoration: none; }
.sidebar nav a:hover { background: var(--soft); }
.sidebar nav a.is-active { background: var(--accent-tint); color: #7d1b21; font-weight: 700; }
.sidebar nav a span { flex: 1; min-width: 0; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; font-style: normal; font-weight: 700; line-height: 1; }
.sidebar-foot { display: grid; gap: 6px; margin-top: auto; padding-top: 14px; }
.whoami { display: flex; align-items: center; gap: 10px; padding: 12px 6px; border-top: 1px solid var(--line); }
.whoami div { display: grid; min-width: 0; line-height: 1.3; }
.whoami strong { font-size: 14px; }
.whoami span { color: var(--ink-2); font-size: 12.5px; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 99px; background: var(--navy); color: #fff !important; font-size: 13px !important; font-weight: 700; }
.side-btn { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 0 11px; border: 0; border-radius: var(--radius); background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; }
.side-btn:hover { background: var(--soft); color: var(--ink); }

/* Page frame */
.content { min-width: 0; width: 100%; max-width: 1260px; padding: 22px 26px 48px; }
.content > * + * { margin-top: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.page-head h1 { font-size: 26px; line-height: 1.2; }
.page-head p { color: var(--ink-2); }
.page-actions { display: flex; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; font-weight: 600; font-size: 14px; text-decoration: none; }
.content > .back + * { margin-top: 8px; }
.actionbar { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }
.card { min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.card-head a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 16px; align-items: stretch; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 16px; align-items: start; }
.with-aside > div > * + * { margin-top: 12px; }
.with-aside > .stack > * + * { margin-top: 0; }
.with-aside > .testbox { position: sticky; top: calc(var(--bar) + 12px); }
.detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .detail { grid-template-columns: minmax(0, 1fr); } }

/* Numbers: one joined strip, not separate tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat { display: grid; gap: 1px; padding: 13px 18px 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.stat:hover { background: #fdf6f6; }
.stat-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.stat-value { font: 600 30px/1.2 var(--head); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--ink-2); }

/* Badges and small parts */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.tone-info { background: var(--info-tint); color: var(--info); }
.tone-wait, .tone-warn { background: var(--warn-tint); color: var(--warn); }
.tone-urgent { background: var(--danger); color: #fff; }
.tone-ok { background: var(--ok-tint); color: var(--ok); }
.tone-ink { background: var(--navy); color: #fff; }
.tone-plain { background: var(--soft); color: var(--ink-2); }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 7px; padding: 0 6px; border-radius: 99px; background: var(--soft); color: var(--ink-2); font: 700 12px/1 var(--font); }
.ch { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--radius); background: var(--soft); color: #433c3e; }
.ch .icon { width: 16px; height: 16px; }
.hint { color: var(--ink-2); font-size: 13px; }
.card .hint { margin-top: 10px; }
.late { color: var(--danger); font-size: 13px; font-weight: 700; white-space: nowrap; }
.when { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.empty { padding: 28px 18px; text-align: center; color: var(--ink-2); }
.empty h3 { color: var(--ink); font-size: 16px; }
.empty .btn { margin-top: 12px; }
.locked { display: grid; justify-items: center; gap: 10px; max-width: 480px; margin: 60px auto !important; padding: 32px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); text-align: center; }
.locked > .icon { width: 30px; height: 30px; color: var(--accent); }
.locked h1 { font-size: 22px; line-height: 1.25; }
.locked p { color: var(--ink-2); }
blockquote { margin: 0; padding: 12px 14px; background: var(--soft); border-radius: var(--radius); font-size: 15.5px; }

/* Lists inside cards */
.rowlist > li + li { border-top: 1px solid var(--line); }
.rowlist > li > a, .rowlist > li > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; color: var(--ink); text-decoration: none; }
.rowlist > li > a:hover b { color: var(--accent-dark); }
.rowlist li span:first-child { display: grid; min-width: 0; line-height: 1.4; }
.rowlist b { font-weight: 600; }
.rowlist small { color: var(--ink-2); font-size: 13px; }
.rowlist .btn { flex: none; }

/* Queue rows */
.q-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius); color: var(--ink); text-decoration: none; border: 1px solid transparent; }
.q-item:hover { background: var(--soft); }
.q-item.is-selected { background: #fdf1f2; border-color: var(--accent); }
.q-item.is-urgent .ch { background: var(--danger-tint); color: var(--danger); }
.q-main { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.q-main strong { font-size: 14.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.q-main > span { font-size: 13px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.q-main small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.pulse { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.q-flat { display: grid; gap: 2px; margin: 0 -8px; }
.q-flat .q-item { padding-inline: 8px; }

/* The console: queue, transcript, caller */
.content.content-console { display: grid; max-width: none; height: calc(100vh - var(--bar)); padding: 0; overflow: hidden; }
.content-console > * + * { margin: 0; }
.console { display: grid; grid-template-columns: 296px minmax(0, 1fr) 292px; grid-template-rows: minmax(0, 1fr); min-height: 0; height: 100%; }
.console > .empty { grid-column: 2 / -1; }
.queue { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.queue-head { display: grid; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.queue-head h1 { font-size: 21px; line-height: 1.2; }
.queue-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 16px; }
.q-group h2 { display: flex; align-items: center; padding: 12px 6px 6px; font: 700 13px/1.3 var(--font); color: var(--ink-2); }
.q-group ul { display: grid; gap: 4px; }
.q-none { padding: 0 6px 2px; font-size: 13px; color: var(--ink-2); }

.talk { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.talk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 66px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.talk-head > div:not(.talk-actions) { min-width: 0; margin-right: auto; }
.talk-head :is(h1, h2) { font-size: 19px; line-height: 1.25; }
.talk-head p { color: var(--ink-2); font-size: 13px; }
.talk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-note { display: flex; gap: 8px; align-items: flex-start; padding: 7px 18px; background: var(--info-tint); color: #123d61; font-size: 12.5px; line-height: 1.45; }
.sim-note .icon { width: 15px; height: 15px; margin-top: 1px; }
.lines { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; padding: 16px 18px 20px; overflow-y: auto; }
.lines > li { flex: none; }
.ln { max-width: min(82%, 520px); }
.ln-meta { display: flex; gap: 9px; align-items: baseline; padding: 0 2px 3px; font-size: 12.5px; }
.ln-meta time, .ln-system time { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.ln p { padding: 10px 13px; border-radius: 4px 12px 12px 12px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.ln-assistant, .ln-agent, .ln-note { align-self: flex-end; }
.ln-assistant .ln-meta, .ln-agent .ln-meta, .ln-note .ln-meta { justify-content: flex-end; }
.ln-assistant p { border-radius: 12px 4px 12px 12px; background: #eeebeb; border-color: #ded9da; }
.ln-agent p { border-radius: 12px 4px 12px 12px; background: var(--accent-tint); border-color: #efc4c7; }
.ln-note p { border-radius: var(--radius); background: #fff6d5; border: 1px dashed #b8942f; }
.source { display: flex; align-items: center; gap: 7px; margin: 5px 0 0 auto; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); font-size: 12.5px; line-height: 1.4; text-align: left; cursor: pointer; }
.source:hover { border-color: var(--accent); }
.source .icon { width: 14px; height: 14px; color: var(--accent); }
.ln-system { display: flex; align-items: baseline; justify-content: center; gap: 10px; align-self: center; max-width: 100%; font-size: 13px; color: var(--ink-2); text-align: center; }
.ln-system b { font-weight: 600; }
.ln-system.is-esc { align-self: stretch; align-items: flex-start; justify-content: flex-start; text-align: left; padding: 10px 14px; background: var(--warn-tint); border: 1px solid #e3c766; border-radius: var(--radius); color: #4a3300; }
.ln-system.is-esc > span { display: grid; flex: 1; }
.ln-system.is-esc > .icon { margin-top: 2px; }
.ln-system.is-esc time { color: inherit; }
.ln-typing { display: flex; align-items: center; gap: 9px; align-self: flex-start; font-size: 13px; color: var(--ink-2); }
.ln-typing > span { display: inline-flex; gap: 4px; padding: 9px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.ln-typing i { width: 6px; height: 6px; border-radius: 99px; background: var(--ink-2); animation: pulse 1s ease-in-out infinite; }
.ln-typing i:nth-child(2) { animation-delay: .18s; } .ln-typing i:nth-child(3) { animation-delay: .36s; }
@media (prefers-reduced-motion: no-preference) { .ln.is-new { animation: line-in .35s ease-out both; } }
@keyframes line-in { from { opacity: 0; transform: translateY(8px); } }

.composer { display: grid; gap: 8px; padding: 10px 18px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.composer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.composer-row { display: flex; gap: 8px; align-items: stretch; }
.composer textarea { flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); resize: none; }
.composer.is-note textarea { background: #fffbea; border-color: #b8942f; }
.composer-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.insert select { max-width: 220px; min-height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; }
.composer-idle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.composer-idle p { flex: 1 1 220px; font-size: 14px; color: var(--ink-2); }
.composer-idle p span { display: block; color: var(--ink); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius); background: var(--soft); }
.segmented button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(35, 31, 32, .18); }

.ctx { min-width: 0; min-height: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); }
.ctx-block { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ctx-block h2 { margin-bottom: 8px; font: 700 13px/1.3 var(--font); color: var(--ink-2); }
.ctx-why { background: #fffaf0; }
.ctx-why strong { font: 600 17px/1.3 var(--head); }
.ctx-why p { font-size: 13.5px; color: var(--ink-2); }
.ctx-why.prio-urgent { background: var(--danger-tint); }
.ctx-why.prio-urgent p { color: #4d2200; }
.ctx-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 13px; font-weight: 600; }
.ctx-who { display: flex; align-items: center; gap: 10px; }
.ctx-who div { display: grid; line-height: 1.35; }
.ctx-who span { color: var(--ink-2); font-size: 13.5px; }
.kv > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.kv dt { color: var(--ink-2); }
.kv dd { font-weight: 500; overflow-wrap: anywhere; }
.ctx-who + .kv { margin-top: 10px; }
.detail .kv > div { grid-template-columns: 150px minmax(0, 1fr); padding: 10px 0; font-size: 14.5px; }
.detail .kv > div:first-child { border-top: 0; }
.ctx-list li + li { margin-top: 4px; }
.ctx-list :is(a, button) { display: flex; gap: 9px; align-items: flex-start; width: 100%; padding: 6px; margin-inline: -6px; border: 0; border-radius: 6px; background: none; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.ctx-list :is(a, button):hover { background: var(--soft); }
.ctx-list .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.ctx-list span { display: grid; min-width: 0; line-height: 1.35; font-size: 13.5px; }
.ctx-list b { font-weight: 600; }
.ctx-list small { color: var(--ink-2); font-size: 12.5px; }
.ctx-none { font-size: 13.5px; color: var(--ink-2); }
.ctx-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.record { display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: max(560px, calc(100vh - var(--bar) - 92px)); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.record .ctx, .record .talk { min-height: 0; }

/* Filters */
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.searchfield { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; max-width: 340px; min-height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.searchfield:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.searchfield input { flex: 1; min-width: 0; height: 36px; border: 0; background: none; color: var(--ink); outline: none; text-overflow: ellipsis; }
.filter-selects { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { display: grid; gap: 2px; }
.filter span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.filter select { min-height: 40px; min-width: 128px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.tabs { display: flex; gap: 4px; max-width: max-content; padding: 4px; overflow-x: auto; background: var(--soft); border-radius: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(35, 31, 32, .16); }
.list-count { color: var(--ink-2); font-size: 13.5px; }
.list-count + * { margin-top: 8px; }
.more-row { margin-top: 12px; text-align: center; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 9px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); font-size: 12.5px; font-weight: 700; text-align: left; white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #fdf6f6; }
.table td > a { color: inherit; text-decoration: none; display: block; }
.table td:first-child { min-width: 150px; }
.table .sub { display: block; color: var(--ink-2); font-size: 12.5px; }
.cell-who { display: flex; align-items: center; gap: 10px; }
.cell-who > span:last-child { display: grid; line-height: 1.35; }
.cell-who small { color: var(--ink-2); font-size: 12.5px; }
.day h2 { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 8px; font-size: 16px; font-weight: 600; }
.day h2 span { color: var(--ink-2); font: 500 13px var(--font); }
.day + .day { margin-top: 14px; }
.day .table th:first-child, .day .table td:first-child { width: 130px; min-width: 110px; }
.day .table th:nth-child(2) { width: 24%; }
.day .table th:nth-child(3) { width: 22%; }
.day .table th:nth-child(4) { width: 24%; }

/* Rules, phrases, test box, hours */
.rules { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto 96px; align-items: center; gap: 14px; padding: 6px 14px 6px 6px; }
.rule + .rule { border-top: 1px solid var(--line); }
.rule a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.rule a:hover { background: var(--soft); }
.rule-main { display: grid; line-height: 1.4; }
.rule-main b { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.rule-main b .icon { width: 13px; height: 13px; color: var(--ink-2); }
.rule-main i { display: inline-flex; font-style: normal; }
.rule-main small { color: var(--ink-2); font-size: 13px; }
.rule.is-off .rule-main b { color: var(--ink-2); }
.always { color: var(--ink-2); font-size: 13px; text-align: right; }
.switch { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 40px; border: 0; background: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.switch i { position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; transition: transform .16s; }
.switch[aria-checked="true"] i { background: var(--accent); }
.switch[aria-checked="true"] i::after { transform: translateX(16px); }
.fallback { display: flex; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); font-size: 13.5px; color: var(--ink-2); }
.fallback .icon { margin-top: 2px; }
.fallback b { color: var(--ink); }
.phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.phrases li { padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 13.5px; }
.phrases li.is-base { background: var(--soft); border-color: var(--soft); }
.testbox .field input { width: 100%; }
.test-tries { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.test-tries button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); font-size: 13px; cursor: pointer; }
.test-tries button:hover { border-color: var(--accent); }
.test-hint { margin-top: 12px; color: var(--ink-2); font-size: 13.5px; }
.test-out { display: grid; gap: 7px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.test-out b { display: flex; gap: 8px; line-height: 1.4; }
.test-out b .icon { margin-top: 1px; }
.test-out small { color: var(--ink-2); font-size: 12.5px; }
.test-out.is-answer { background: #f3faf4; border-color: #bcd9c2; }
.test-out.is-esc { background: #fffaf0; border-color: #e3c766; }
.hours-row { display: grid; grid-template-columns: 104px 76px 132px 20px 132px; align-items: center; gap: 4px 10px; padding: 8px 0; border: 0; border-top: 1px solid var(--line); }
.hours-day { font-weight: 600; }
.hours-row input[type="time"] { width: 100%; min-height: 38px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.hours-row input:disabled { background: var(--soft); color: #8a8486; }
.hours-row .to { color: var(--ink-2); font-size: 13px; text-align: center; }
.hours-row > .field-error { grid-column: 2 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.formbar { display: flex; justify-content: flex-end; padding-top: 12px; }

/* Role choice */
.signin { max-width: 760px; margin: 0 auto; padding: 44px 20px 64px; text-align: center; }
.signin h1 { margin-top: 28px; font-size: clamp(28px, 4vw, 38px); line-height: 1.12; }
.signin-sub { max-width: 56ch; margin: 10px auto 0; color: var(--ink-2); }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 26px; text-align: left; }
.role { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; height: 100%; padding: 22px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.role:hover { border-color: var(--accent); transform: translateY(-2px); }
.role-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-dark); }
.role-icon .icon { width: 24px; height: 24px; }
.role-title { margin-top: 10px; font: 600 22px/1.2 var(--head); }
.role-name { color: var(--accent-dark); font-weight: 600; }
.role-short { display: none; }
.role-points { display: grid; gap: 7px; margin-top: 12px; color: var(--ink-2); }
.role-points > span { display: flex; gap: 8px; }
.role-points .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }

/* Popups: the title and buttons stay in view while the fields scroll */
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--ink); background: var(--surface); overflow: hidden; box-shadow: 0 30px 70px -20px rgba(35, 31, 32, .55); }
dialog::backdrop { background: rgba(30, 24, 26, .55); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.modal-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; font-weight: 600; line-height: 1.25; }
.modal-body { min-height: 0; padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > * + * { margin-top: 12px; }
.modal-foot { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal-note { color: var(--ink-2); }
.modal-note strong { color: var(--ink); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius); background: none; cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 4px; align-content: start; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 600; }
.field :is(input, select, textarea) { width: 100%; min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.field textarea { resize: vertical; }
.field input[readonly] { background: var(--soft); }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger); }
.field-error, .form-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.form-error { padding: 9px 12px; background: var(--danger-tint); border-radius: var(--radius); }
.scenarios { border: 1px solid var(--line); border-radius: var(--radius); }
.scenarios li + li { border-top: 1px solid var(--line); }
.scenarios button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.scenarios button:hover { background: #fdf1f2; }
.scenarios button > span:nth-child(2) { display: grid; flex: 1; min-width: 0; line-height: 1.4; }
.scenarios small { color: var(--ink-2); font-size: 13px; }

.toasts { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 11px 15px; border-radius: var(--radius); background: var(--navy); color: #fff; box-shadow: 0 12px 28px -12px rgba(35, 31, 32, .6); }
.toast .icon { margin-top: 2px; color: #9fd6a6; }
.toast-warn .icon { color: #ffc35c; }

/* Narrower desktops: the caller panel moves under the transcript */
@media (max-width: 1220px) {
  .shell { --side: 206px; }
  .console { grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 200px); }
  .console .composer textarea { height: 44px; }
  .console .lines { padding-block: 10px; }
  .console .talk-head { min-height: 0; padding-block: 8px; }
  .console > .queue { grid-row: 1 / 3; }
  .console > .ctx, .record > .ctx { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; border-left: 0; border-top: 2px solid var(--line-2); }
  .record { grid-template-columns: minmax(0, 1fr); height: auto; }
  .record > .talk { height: 600px; }
  .talk-head > .badge { order: 2; }
  .grid-2, .with-aside { grid-template-columns: minmax(0, 1fr); }
  .with-aside > .testbox { position: static; grid-row: 1; }
  .content { padding-inline: 20px; }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2.even { grid-template-columns: minmax(0, 1fr); }
}
/* Tablet widths: the sidebar becomes an icon rail with names on hover */
@media (min-width: 761px) and (max-width: 899px) {
  .shell { --side: 68px; }
  .sidebar { padding-inline: 10px; align-items: stretch; }
  .sidebar .brand { justify-content: center; padding: 0 0 12px; }
  .sidebar .brand span, .side-org, .sidebar nav a span, .side-btn span, .whoami div { display: none; }
  .sidebar nav a, .side-btn { position: relative; justify-content: center; padding: 0; min-height: 42px; }
  .sidebar nav .count { position: absolute; top: -2px; right: -3px; min-width: 17px; height: 17px; font-size: 11px; }
  .whoami { justify-content: center; }
  .console { grid-template-columns: 224px minmax(0, 1fr); }
  .console > .ctx, .record > .ctx { grid-template-columns: minmax(0, 1fr); }
  .composer-row .btn { padding: 0 11px; }
  .table th, .table td { padding-inline: 9px; }
  .table td:first-child { min-width: 120px; }
  .ch + .cell-who, .table .cell-who .ch { display: none; }
  .hours-row { grid-template-columns: 90px 70px minmax(0, 1fr) 20px minmax(0, 1fr); }
}
/* Loading placeholder shown while a screen opens */
.page-skel { display: grid; grid-column: 1 / -1; align-content: start; gap: 14px; width: 100%; min-width: 0; padding: 2px; }
.page-skel i { display: block; height: 96px; border-radius: var(--radius-lg, 8px); background: linear-gradient(90deg, rgba(100, 112, 128, .13) 25%, rgba(100, 112, 128, .05) 50%, rgba(100, 112, 128, .13) 75%); background-size: 200% 100%; animation: skel-shimmer 1s linear infinite; }
.page-skel .sk-title { width: min(280px, 70%); height: 30px; }
.page-skel .sk-line { width: min(420px, 90%); height: 14px; }
.page-skel > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.page-skel .sk-block { height: 280px; }
@keyframes skel-shimmer { to { background-position: -200% 0; } }
@media (max-width: 760px) { .page-skel > div { grid-template-columns: minmax(0, 1fr); } .page-skel > div i { height: 68px; } }
.page-in > * { animation: page-in .3s ease-out both; }
@keyframes page-in { from { opacity: 0; } }
.page-skel.is-flush { box-sizing: border-box; padding: 22px 24px; }
