@font-face { font-family: Poppins; src: url("/assets/poppins-400.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url("/assets/poppins-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url("/assets/poppins-700.woff2") format("woff2"); font-weight: 650 800; font-style: normal; font-display: swap; }

:root {
    color-scheme: light;
    --ink: #202120;
    --muted: #5d5c54;
    --paper: #ffffff;
    --ground: #f4f3ef;
    --line: #e0dfda;
    --deep: #202120;
    --accent: #ebca14;
    --accent-ink: #594c02;
    --font: Poppins, "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-family: var(--font);
    color: var(--ink);
    background: var(--ground);
    line-height: 1.5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p, ul, ol { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid #806c05; outline-offset: 3px; }
[disabled] { opacity: .63; cursor: wait; }
img { display: block; max-width: 100%; }

h1 { font-size: clamp(2.1rem, 5.5vw, 3.65rem); font-weight: 740; line-height: 1.02; letter-spacing: -.062em; }
h2 { font-size: clamp(1.18rem, 2.8vw, 1.5rem); line-height: 1.2; letter-spacing: -.035em; }
h3 { font-size: 1.08rem; line-height: 1.3; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent-ink); font-size: .78rem; letter-spacing: .12em; font-weight: 750; margin-bottom: .7rem; }
.caption, .helper { font-size: .9rem; }
.stack { display: grid; gap: 1rem; align-content: start; }
.align-start { justify-self: start; }
.fill { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { background: white; color: var(--ink); border-bottom: 1px solid var(--line); border-top: 4px solid var(--accent); padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); }
.topbar-inner { min-height: 72px; max-width: 1260px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand, .login-brand { display: inline-flex; color: var(--ink); align-items: center; gap: .65rem; text-decoration: none; }
.brand img, .login-brand img { height: auto; }
.login-brand { justify-self: start; background: var(--accent); border-radius: .45rem; padding: .82rem 1rem; }
.brand-divider { margin-left: .4rem; padding-left: .95rem; border-left: 1px solid #bab8ab; color: var(--muted); font-size: .9rem; font-weight: 600; }
.logout { border: 1px solid #bab8ab; background: transparent; color: var(--ink); padding: .48rem .75rem; border-radius: .5rem; min-height: 44px; font-size: .9rem; font-weight: 650; }
.logout:hover { background: #f0eee6; }
.workspace { max-width: 1260px; min-height: calc(100vh - 72px); margin: 0 auto; display: grid; grid-template-columns: 205px minmax(0, 1fr); }
.nav { display: flex; flex-direction: column; gap: .3rem; padding: 1.6rem .85rem 1.6rem 1rem; border-right: 1px solid var(--line); }
.nav-button { display: flex; align-items: center; gap: .8rem; min-height: 46px; padding: .55rem .7rem; text-align: left; color: var(--muted); background: transparent; border-radius: .55rem; border: 1px solid transparent; font-weight: 650; font-size: .91rem; white-space: nowrap; }
.nav-short { display: none; }
.nav-button.selected { color: var(--accent-ink); background: #f9efb6; border-color: #f1e39b; }
.nav-button:hover { color: var(--accent-ink); background: #f4ecd1; }
.nav-icon { display: inline-block; flex: 0 0 auto; height: 17px; width: 17px; color: inherit; position: relative; }
.nav-overview { border: 1.7px solid currentColor; border-radius: 3px; width: 13px; margin: 0 2px; }
.nav-overview::before, .nav-overview::after { content: ""; position: absolute; height: 1.5px; width: 6px; background: currentColor; left: 2px; top: 4px; }
.nav-overview::after { top: 8px; width: 5px; }
.nav-add::before, .nav-add::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; width: 14px; height: 2px; top: 7px; left: 2px; }
.nav-add::after { transform: rotate(90deg); }
.nav-phone { border: 1.7px solid currentColor; border-radius: 3px; width: 11px; margin: 0 3px; }
.nav-phone::after { content: ""; position: absolute; height: 1.4px; width: 3px; left: 2.3px; bottom: 2px; background: currentColor; }

#main { width: 100%; min-width: 0; padding: clamp(1.1rem, 4.4vw, 3.3rem) clamp(1rem, 4vw, 3.45rem); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.6rem; margin: 0 0 1.65rem; }
.page-head .muted { margin-top: .62rem; }
.page-head .button { flex: 0 0 auto; }
.card { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); padding: clamp(1rem, 3vw, 1.55rem); box-shadow: 0 6px 18px #36311a09; min-width: 0; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(240px, 1fr); align-items: start; gap: 1rem; }
.side-card { display: grid; align-content: start; gap: .75rem; }
.side-card .button { justify-self: start; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; min-height: 45px; padding: .56rem .91rem; border: 1px solid transparent; border-radius: .54rem; background: transparent; font-weight: 690; font-size: .94rem; line-height: 1.25; text-decoration: none; }
.button > span[aria-hidden] { font-size: 1.3em; line-height: 1; }
.primary { color: var(--ink); background: var(--accent); border-color: #d9ba0b; }
.primary:hover { background: #dfbf0f; }
.secondary { color: var(--accent-ink); border-color: #c9c4ab; background: white; }
.secondary:hover { background: #faf6de; }
.ghost { color: var(--muted); }
.ghost:hover { background: var(--ground); color: var(--ink); }
.danger-button { color: #a13b32; }
.danger-button:hover { background: #fbece8; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 0 0 1.15rem; }
.stat { display: grid; grid-template-columns: 1fr; gap: .28rem; min-width: 0; background: #f8efc4; border: 1px solid #eee1a0; padding: .75rem 1rem; border-radius: .75rem; color: var(--accent-ink); }
.stat:nth-child(2) { background: #ebe9e2; border-color: #dfddd3; color: var(--ink); }
.stat:nth-child(3) { background: #e4eee6; border-color: #cddfce; color: #225c45; }
.stat span { font-size: .87rem; font-weight: 650; }
.stat strong { font-size: 1.75rem; letter-spacing: -.045em; line-height: 1.1; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.section-heading p { font-size: .89rem; margin-top: .28rem; }
.search { min-width: min(235px, 100%); }
.search input { min-height: 42px; padding: .45rem .65rem; }
.job-list, .device-list { padding: 0; list-style: none; display: grid; }
.job-list:not(:empty) { margin-top: .7rem; }
.job-list li, .device-list li { border-bottom: 1px solid var(--line); }
.job-list li:last-child, .device-list li:last-child { border-bottom: 0; }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: .2rem; column-gap: 1rem; align-items: center; width: 100%; border: 0; background: transparent; color: var(--ink); text-align: left; padding: .9rem .3rem; }
.job-row:hover { background: #fbf8ea; }
.job-row strong, .job-row small { overflow-wrap: anywhere; }
.job-row small { grid-row: 2; color: var(--muted); font-size: .86rem; }
.job-row .badge { grid-row: span 2; justify-self: end; }
.empty { display: grid; place-items: center; gap: .55rem; padding: 2.1rem .7rem 1.3rem; text-align: center; }
.empty p { max-width: 420px; }
.empty .button { margin-top: .4rem; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #f9eeb2; color: var(--accent-ink); }
.empty-icon .nav-icon { transform: scale(1.1); }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: .12rem .5rem; border-radius: 6px; color: #514500; background: #f7edbc; font-size: .81rem; font-weight: 720; white-space: nowrap; }
.badge.agreed, .badge.sent { color: #215b40; background: #dcefe4; }
.badge.open, .badge.pending { color: #72510c; background: #fff0c9; }
.badge.check, .badge.failed { color: #8b3d32; background: #fceae4; }

label { display: grid; gap: .32rem; color: var(--ink); font-size: .925rem; font-weight: 640; }
input, textarea, select { display: block; width: 100%; min-width: 0; border: 1px solid #c6c3b7; border-radius: .53rem; min-height: 46px; padding: .58rem .72rem; background: #fff; color: var(--ink); font-size: 1rem; font-weight: 450; }
textarea { min-height: 94px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #67655b; opacity: 1; }
.dropzone { position: relative; min-height: 148px; place-items: center; align-content: center; text-align: center; border: 1.5px dashed #b6a044; border-radius: .62rem; background: #fcf8e8; padding: .8rem; cursor: pointer; }
.dropzone:hover, .dropzone.drag, .dropzone:focus-within { background: #f9eeb2; }
.dropzone:focus-within { outline: 3px solid #806c05; outline-offset: 3px; }
.dropzone .empty-icon { margin-bottom: .15rem; background: white; }
.dropzone > strong { overflow-wrap: anywhere; font-size: 1.03rem; }
.dropzone > span:not(.empty-icon) { color: var(--muted); font-size: .85rem; font-weight: 500; }
.dropzone input { position: absolute; inset: 0; min-height: 0; opacity: 0; cursor: pointer; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { accent-color: var(--accent); appearance: auto; width: 20px; height: 20px; min-height: auto; margin: 0; }
progress { accent-color: var(--accent); width: 100%; }
.notice { padding: .72rem .83rem; border-radius: .55rem; background: #fff3d4; border: 1px solid #efdeb1; color: #664b18; font-size: .92rem; overflow-wrap: anywhere; }
.notice.danger { background: #fbece8; border-color: #eecbc3; color: #8e352b; }
#app-alert, #setup-status { margin-bottom: 1rem; }
.setup-steps { padding-left: 1.4rem; display: grid; gap: .65rem; overflow-wrap: anywhere; }
.setup-steps li { padding-left: .2rem; }
code { color: #4d4106; background: #f7f1d8; border-radius: 4px; padding: .14em .3em; font-size: .92em; }
.device-list li { padding: .65rem 0; display: flex; justify-content: space-between; gap: .5rem; align-items: center; overflow-wrap: anywhere; }
.device-list .muted { font-size: .84rem; display: block; }

.detail-head { margin-bottom: 1rem; align-items: center; }
.detail-head h1 { overflow-wrap: anywhere; }
.detail-head .eyebrow { margin-top: .75rem; }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; margin-top: .7rem; color: var(--muted); overflow-wrap: anywhere; }
.detail-audio { width: 100%; display: block; min-height: 42px; }
.detail-grid { display: grid; gap: 1rem; }
.detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.report-list { list-style: none; padding: 0; display: grid; gap: .55rem; }
.report-item { padding: .77rem .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #fbfaf4; overflow-wrap: anywhere; }
.report-item .item-head { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }
.report-item p { margin-top: .35rem; }
.report-item .play-link { margin-top: .3rem; }
.preline { white-space: pre-wrap; overflow-wrap: anywhere; }
.discussion { padding-left: 1.25rem; }
.transcript-scroll { max-height: 430px; padding-right: .4rem; overflow: auto; display: grid; gap: .4rem; }
.transcript-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem; align-items: start; border-top: 1px solid var(--line); padding: .3rem 0; overflow-wrap: anywhere; }
.play-link { background: transparent; padding: .17rem .28rem; min-height: 33px; color: var(--accent-ink); border: 1px solid #c9c4ab; border-radius: .4rem; text-align: left; font-size: .85rem; font-weight: 700; width: fit-content; }
.play-link:hover { background: #f9eeb2; }
.editor-item { display: grid; gap: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: .65rem; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.toast { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); max-width: min(390px, calc(100% - 2rem)); border-radius: .55rem; padding: .75rem 1rem; background: var(--deep); color: white; box-shadow: 0 12px 26px #24211c30; font-weight: 650; z-index: 1; }

.login-body { background: var(--deep); min-height: 100dvh; display: grid; place-items: center; padding: max(1.4rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.4rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
.login-layout { width: min(100%, 450px); display: grid; gap: 1.1rem; }
.login-card { background: white; padding: clamp(1.25rem, 5.6vw, 2.05rem); border-radius: 1rem; display: grid; gap: .8rem; box-shadow: 0 22px 50px #0005; }
.login-card .eyebrow { margin: 0; }
.login-card .stack { margin-top: .25rem; }
.login-card h1 { font-size: clamp(2.4rem, 7vw, 3.7rem); }

@media (max-width: 900px) {
    .workspace { grid-template-columns: 1fr; }
    .nav { flex-direction: row; padding: .55rem clamp(.75rem, 4vw, 3.35rem); border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
}
@media (max-width: 670px) {
    .form-layout { grid-template-columns: 1fr; }
    .page-head { flex-wrap: wrap; }
    .section-heading { align-items: stretch; flex-direction: column; }
}
@media (max-width: 430px) {
    .nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .2rem; padding-inline: .55rem; }
    .nav-button { font-size: .8rem; gap: .3rem; padding-inline: .25rem; justify-content: center; text-align: center; white-space: normal; }
    .nav-full { display: none; }
    .nav-short { display: inline; }
    .topbar-inner { min-height: 62px; }
    .brand { gap: .45rem; }
    .brand img { width: 116px; height: auto; }
    .brand-divider { margin-left: .15rem; padding-left: .55rem; font-size: .82rem; }
    .stat { padding: .68rem .55rem; }
    .stat span { font-size: .79rem; }
    .job-row { column-gap: .4rem; }
    .job-row .badge { font-size: .72rem; padding-inline: .31rem; }
    .editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
    .nav .nav-icon { display: none; }
}
@media print {
    @font-face { font-family: Poppins; src: url("/assets/poppins-400.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url("/assets/poppins-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url("/assets/poppins-700.woff2") format("woff2"); font-weight: 650 800; font-style: normal; font-display: swap; }

:root { background: #fff; }
    .topbar, .nav, .detail-actions, .detail-audio, .play-link, .transcript-card, .toast, .detail-top, .notice { display: none !important; }
    .workspace { display: block; }
    #main { padding: 0; }
    .card { box-shadow: none; border: 0; padding: .5rem 0; }
    .report-item { break-inside: avoid; background: #fff; }
    .detail-head h1 { font-size: 26pt; }
}
