/* Bidly console. Builds on bidly.css tokens. */
body.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.main:focus { outline: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Sidebar — navy file cover */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; background: var(--ink); color: var(--paper-on-navy); border-top: 3px solid var(--saffron); }
.side :focus-visible { outline-color: var(--saffron); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--paper-on-navy); }
.side-brand span { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; font-size: 14px; color: rgba(241,236,224,.72); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
@media (hover: hover) and (pointer: fine) { .side-nav a:hover { background: rgba(241,236,224,.06); color: #fff; } }
.side-nav a[aria-current='page'] { background: rgba(241,236,224,.1); color: #fff; }
.side-nav a[aria-current='page']::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--saffron); }
.side-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--saffron); color: var(--ink); font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: 16px; padding: 0 4px; }
.side-org { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; background: rgba(241,236,224,.06); font-size: 13px; }
.side-org .muted { color: rgba(241,236,224,.62); font-size: 12px; }
.org-dot { width: 32px; height: 32px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--saffron); color: var(--ink); font-size: 12px; font-weight: 700; }
.side-db { padding-left: 6px; color: rgba(241,236,224,.75); }

/* Main */
.main { min-width: 0; padding: 18px clamp(16px, 3vw, 36px) 40px; }
.demo-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; background: var(--saffron-soft); color: var(--saffron-deep); font-size: 13px; font-weight: 500; margin-bottom: 18px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.top-kicker { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.top-title { font-family: var(--font-display); font-weight: 500; font-size: 42px; line-height: 1.08; letter-spacing: -.02em; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view[data-entering] { animation: viewIn 320ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

.box { padding: 20px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.box-head h3 { font-size: 15px; font-weight: 700; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ink); }
.kpi p { font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 40px; line-height: 1.1; }
.kpi span { font-size: 12px; color: var(--muted); }

/* Tools */
.m-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); flex: 1 1 260px; max-width: 360px; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,31,61,.08); }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 14px; color: var(--ink); }
.seg { display: flex; padding: 3px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-2); }
.seg button { padding: 6px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper-on-navy); }
.sel select { height: 40px; padding: 0 34px 0 12px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%230F1F3D' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center no-repeat; appearance: none; -webkit-appearance: none; font-size: 13.5px; font-weight: 500; max-width: 100%; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 500; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.chip:active { transform: scale(.97); }
.chip b { font-weight: 500; font-size: 12px; color: var(--muted); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--paper-on-navy); border-color: var(--ink); }
.chip[aria-pressed='true'] b { color: rgba(241,236,224,.7); }

/* Ring on light */
.main .ring { width: 48px; height: 48px; background: conic-gradient(var(--c) calc(var(--v) * 360deg), rgba(15,31,61,.1) 0); --c: var(--saffron); }
.main .ring::before { inset: 5px; background: var(--surface); }
.main .ring b { font-size: 14px; font-weight: 600; color: var(--ink); }
.main .ring-low { --c: #9AA1B2; }
.main .ring-lg { width: 72px; height: 72px; }
.main .ring-lg::before { inset: 7px; }
.main .ring-lg b { font-family: var(--font-display); font-size: 28px; font-weight: 500; }

/* Tender list */
.tlist { display: grid; gap: 8px; }
.tcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .tcard:hover { border-color: var(--line-2); box-shadow: 0 12px 30px -22px rgba(15,31,61,.5); } }
.tcard.is-low { background: transparent; }
.tcard.is-low .tc-title { color: var(--ink-2); }
.tc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ptag, .band, .sl { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 3px; }
.ptag { background: var(--ink); color: var(--paper-on-navy); }
.b-hi { background: var(--saffron-soft); color: var(--saffron-deep); }
.b-mid { background: var(--bg-2); color: var(--ink-2); }
.b-lo { border: 1px solid var(--line-2); color: var(--muted); }
.sl { border: 1px solid var(--green); color: var(--green); }
.tc-title { font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.25; }
.tc-buyer { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.tc-why { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.pos, .neg { position: relative; padding-left: 14px; }
.pos::before, .neg::before { position: absolute; left: 0; top: 0; font-family: var(--font-mono); font-weight: 600; }
.tc-why .pos::before { content: '+'; color: var(--green); }
.tc-why .neg::before { content: '−'; color: var(--red); }
.tc-why .pos { color: var(--ink-2); }
.tc-why .neg { color: var(--ink-2); }
.tc-facts { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; margin: 0; text-align: right; }
.tc-facts dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tc-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; white-space: nowrap; }
.tc-facts dd span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.tc-facts .soon span { color: var(--red); font-weight: 600; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 8px; }

/* Tender detail */
.td-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding: 22px 24px; margin-bottom: 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--saffron); }
.td-ref { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.td-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; margin-top: 6px; max-width: 40ch; letter-spacing: -.01em; }
.td-buyer { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.td-fit { display: flex; gap: 14px; align-items: center; flex: none; }
.td-band { font-weight: 700; font-size: 15px; }
.td-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; align-items: start; }
.td-col { display: grid; gap: 12px; min-width: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.facts div { padding: 12px 14px; background: var(--surface); }
.facts .wide, .facts div:last-child:nth-child(even) { grid-column: 1 / -1; }
.facts dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-size: 14.5px; font-weight: 500; }
.reasons { display: grid; gap: 8px; }
.reasons li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.sgn { width: 22px; height: 22px; flex: none; border-radius: 4px; display: grid; place-items: center; font-weight: 700; }
.reasons .pos { padding: 0; } .reasons .neg { padding: 0; }
.reasons .pos::before, .reasons .neg::before { content: none; }
.reasons .pos .sgn { background: var(--green-soft); color: var(--green); }
.reasons .neg .sgn { background: var(--red-soft); color: var(--red); }
.tally { font-size: 12px; color: var(--ink-2); padding: 2px 8px; border-radius: 3px; background: var(--bg-2); }
.elig, .docs { display: grid; }
.el { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line); }
.el:first-child { border-top: 0; padding-top: 0; }
.el p { font-size: 14.5px; font-weight: 500; }
.el span { font-size: 13px; color: var(--muted); }
.el-met svg, .doc-ic.ok svg { color: var(--green); }
.el-miss svg { color: var(--red); }
.el-partial svg { color: var(--saffron-deep); }
.st { font-style: normal; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.st-met { background: var(--green-soft); color: var(--green); }
.st-miss { background: var(--red-soft); color: var(--red); }
.st-part { background: var(--saffron-soft); color: var(--saffron-deep); }
.docbar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; margin-bottom: 8px; }
.docbar i { display: block; height: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); transition: transform 600ms var(--ease-out); }
.doc { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 68px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.doc:first-child { border-top: 0; }
.doc > :last-child { justify-self: end; }
.doc-ic { display: grid; }
.doc:has(.st-met) .doc-ic svg { color: var(--green); }
.doc:has(.st-miss) .doc-ic svg { color: var(--red); }
.doc:has(.st-part) .doc-ic svg { color: var(--saffron-deep); }
.doc-ic.miss svg { color: var(--red); } .doc-ic.warn svg { color: var(--saffron-deep); }
.verify-note { margin-top: 14px; font-size: 13px; color: var(--ink-2); padding-left: 12px; border-left: 3px solid var(--saffron); max-width: 90ch; }

/* Draft editor */
.dr-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.dr-pick select { min-width: 280px; }
.dr-progress { display: flex; align-items: center; gap: 12px; }
.dr-progress .docbar { width: 160px; margin: 0; }
.dr-progress .docbar i { background: var(--saffron); }
.dr-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; align-items: start; }
.sections { display: grid; gap: 4px; padding: 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); position: sticky; top: 16px; }
.sec { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) 18px; gap: 8px; align-items: center; padding: 10px; border-radius: 5px; text-align: left; font-size: 14px; transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .sec:hover { background: var(--bg); } }
.sec[aria-current='true'] { background: var(--ink); color: var(--paper-on-navy); }
.sec[aria-current='true'] .sec-no { color: var(--saffron); }
.sec-no { font-size: 12px; color: var(--muted); }
.sec-st { width: 18px; height: 18px; border-radius: 4px; border: 1.5px dashed var(--line-2); }
.sec-st.done { border: 0; color: var(--green); }
.sec[aria-current='true'] .sec-st { border-color: rgba(241,236,224,.35); }
.sec[aria-current='true'] .sec-st.done { color: #7FD39A; }
.editor { padding: 22px 24px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-paper); min-width: 0; scroll-margin-top: 12px; }
.ed-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 3px double var(--line-2); }
.ed-title { font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.2; }
.ed-state { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border: 1.5px solid var(--red); color: var(--red); border-radius: 3px; white-space: nowrap; }
.ed-state.is-rev { border-color: var(--green); color: var(--green); }
.ed-src { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; font-size: 12.5px; color: var(--muted); }
.ed-src span { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 3px; background: var(--bg-2); color: var(--ink-2); }
.ed-text { width: 100%; min-height: 360px; padding: 14px 18px; background-position: 0 14px !important; border: 1px solid var(--line-2); border-radius: 6px; background: repeating-linear-gradient(to bottom, #FFFEFA 0 27px, #F4F0E6 27px 28px); background-attachment: local; font-family: var(--font-display); font-size: 16px; line-height: 28px; color: var(--ink); resize: vertical; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.ed-text:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,31,61,.1); }
.ed-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.ed-foot p { max-width: 56ch; }
.ed-actions { display: flex; gap: 8px; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.cal-month { font-family: var(--font-display); font-weight: 500; font-size: 26px; max-width: none; line-height: 1.2; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--bg); } }
.cal-legend { display: flex; gap: 16px; margin-bottom: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.lg-close { background: var(--ink); }
.lg-pre { background: var(--saffron-soft); border: 1px solid var(--saffron); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cal-dow { padding: 8px; background: var(--bg); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-cell { min-height: 96px; padding: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell.is-pad { background: var(--bg); }
.cal-cell.is-past .cal-n { color: #8A91A3; }
.cal-n { font-size: 12.5px; font-weight: 600; min-width: 24px; height: 24px; padding: 0 4px; display: inline-flex; align-items: center; gap: 4px; justify-content: center; align-self: flex-start; border-radius: 4px; }
.cal-n small { font-size: 10.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; }
.is-today .cal-n { background: var(--saffron); color: var(--ink); }
.ev { display: block; font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: filter var(--t-fast) ease; }
.ev-close { background: var(--ink); color: var(--paper-on-navy); }
.ev-pre { background: var(--saffron-soft); color: var(--saffron-deep); box-shadow: inset 2px 0 0 var(--saffron); }
@media (hover: hover) and (pointer: fine) { .ev:hover { filter: brightness(1.15); } }
.agenda { display: grid; }
.ag { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-top: 1px solid var(--line); border-radius: 4px; transition: background-color var(--t-fast) ease; }
.agenda li:first-child .ag { border-top: 0; }
@media (hover: hover) and (pointer: fine) { .ag:hover { background: var(--bg); } }
.ag-date { display: grid; justify-items: center; line-height: 1.1; padding: 4px 0; border-radius: 4px; background: var(--bg); }
.ag-date b { font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.ag-date span { font-size: 11px; color: var(--muted); }
.ag-main { display: grid; min-width: 0; }
.ag-kind { font-size: 11.5px; font-weight: 600; }
.k-close { color: var(--ink); } .k-pre { color: var(--saffron-deep); }
.ag-t { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-in { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ag-in.soon { color: var(--red); font-weight: 600; }

/* Profile */
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pf-wide { grid-column: 1 / -1; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label, .pref-time { display: grid; gap: 5px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.form input, .form select, .pref-time select, .tag-add input { height: 40px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); font-family: var(--font-ui); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); min-width: 0; width: 100%; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.form input.mono { font-family: var(--font-mono); font-size: 13px; }
.form input:focus, .form select:focus, .pref-time select:focus, .tag-add input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,31,61,.1); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; border-top: 3px double var(--line-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 4px; background: var(--ink); color: var(--paper-on-navy); font-size: 13px; }
.tags-plain li { padding: 5px 10px; background: var(--bg-2); color: var(--ink); }
.tag-x { width: 20px; height: 20px; border-radius: 3px; display: grid; place-items: center; color: rgba(241,236,224,.75); transition: background-color var(--t-fast) ease; }
.tag-x:focus-visible { outline-color: var(--saffron); }
@media (hover: hover) and (pointer: fine) { .tag-x:hover { background: rgba(241,236,224,.15); color: #fff; } }
.tag-add { display: flex; gap: 8px; margin-top: 12px; }
.tag-add .btn { height: 40px; }
.pf-h { font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.certs { display: grid; }
.cert { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.cert:first-child { border-top: 0; padding-top: 0; }
.cert p { font-size: 14.5px; font-weight: 500; }
.cert span { font-size: 13px; color: var(--muted); }
.cert:has(.warn) span, .cert:has(.miss) span { color: var(--red); font-weight: 600; }
.prefs { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: end; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); transition: background-color var(--t-fast) ease; flex: none; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--t-ui) var(--ease-out); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.pref-time { min-width: 150px; }
.pf-save { margin-top: 18px; display: flex; justify-content: flex-end; }

.demo-note { margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); text-align: center; }
.skip { z-index: 200; }

/* Responsive */
@media (max-width: 1240px) {
  .tcard { grid-template-columns: auto minmax(0, 1fr); }
  .tc-facts { grid-column: 2; justify-content: start; text-align: left; }
  .cal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .td-grid { grid-template-columns: 1fr; }
  .dr-grid { grid-template-columns: 1fr; }
  .sections { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  body.app { grid-template-columns: 1fr; padding-bottom: 76px; }
  .side { position: fixed; z-index: 60; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 3px solid var(--saffron); }
  .side-brand, .side-foot { display: none; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .side-nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11px; }
  .side-nav a[aria-current='page']::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .side-badge { position: absolute; top: 2px; right: calc(50% - 24px); min-width: 18px; height: 16px; font-size: 10px; padding: 0 4px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .pf-grid { grid-template-columns: 1fr; }
  .toasts { bottom: 88px; }
}
@media (max-width: 680px) {
  .top-title { font-size: 32px; }
  .top-actions { width: 100%; }
  .top-actions .btn { flex: 1 1 auto; }
  .kpi b { font-size: 32px; }
  .search { max-width: none; flex-basis: 100%; }
  .seg { flex: 1; }
  .seg button { flex: 1; padding: 6px 4px; }
  .sel, .sel select { width: 100%; }
  .m-tools .sel { flex-basis: 100%; }
  .tcard { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; }
  .tcard .ring { width: 42px; height: 42px; }
  .tc-title { font-size: 17px; }
  .tc-facts { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
  .tc-facts dd { font-size: 14px; white-space: normal; }
  .td-head { flex-direction: column; gap: 14px; padding: 18px; }
  .facts { grid-template-columns: 1fr; }
  .el { grid-template-columns: 18px minmax(0, 1fr); }
  .el .st { grid-column: 2; justify-self: start; }
  .doc { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .doc .st { grid-column: 2; grid-row: 2; justify-self: start; }
  .doc > :last-child { justify-self: end; }
  .doc .btn { grid-column: 3; grid-row: 1 / span 2; }
  .dr-pick, .dr-pick select { width: 100%; min-width: 0; }
  .sections { grid-template-columns: 1fr; }
  .editor { padding: 16px; }
  .ed-text { min-height: 320px; font-size: 15px; padding: 14px 12px; }
  .ed-actions { width: 100%; }
  .ed-actions .btn { flex: 1; }
  .cal-cell { min-height: 58px; padding: 4px; }
  .cal-dow { padding: 6px 2px; text-align: center; font-size: 10px; }
  .ev { height: 6px; padding: 0; font-size: 0; border-radius: 2px; }
  .ev-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cal-n { min-width: 22px; height: 22px; font-size: 12px; padding: 0 2px; }
  .cal-n small { display: none; }
  .cal-month { font-size: 22px; }
  .form { grid-template-columns: 1fr; }
  .toasts { left: 12px; right: 12px; }
  .toast { max-width: none; }
}
