/* Patient's cabinet. Builds on styles.css: same tokens, nav, buttons and both page states. */

.cab-tag { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; }

/* signed in / signed out */
:root[data-auth="in"] .login { display: none; }
:root[data-auth="out"] .cab { display: none; }

/* ---------- layout ---------- */
.cab { display: grid; grid-template-columns: 252px minmax(0, 1fr); align-items: start; gap: clamp(20px, 3.4vw, 48px); padding-block: clamp(24px, 4vh, 48px) 110px; }
.cab__side { position: sticky; top: 92px; display: grid; gap: 14px; }
.cab__main { min-width: 0; }
.cab__view { display: none; gap: clamp(20px, 3vh, 30px); }
.cab__view.is-on { display: grid; }
.cab__view.is-on > * { animation: view-in .55s cubic-bezier(.2, .8, .2, 1) backwards; }
.cab__view.is-on > :nth-child(2) { animation-delay: .06s; }
.cab__view.is-on > :nth-child(3) { animation-delay: .12s; }
.cab__view.is-on > :nth-child(4) { animation-delay: .18s; }
@keyframes view-in { from { opacity: 0; translate: 0 18px; } }

.cab__head { display: grid; gap: 10px; max-width: 720px; }
.cab__head h1 { font: 600 clamp(28px, 4.2vw, 54px)/1.02 "Unbounded", sans-serif; letter-spacing: -.045em; }
.cab__head p { color: var(--muted); font-size: 16px; max-width: 56ch; }
.cab__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; gap: 16px; }

/* ---------- side: medical card, tabs ---------- */
.medcard { position: relative; overflow: hidden; display: grid; gap: 14px; padding: 18px 18px 18px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); }
.medcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: var(--accent); }
.medcard__top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.medcard__top .pill-ico { width: 22px; height: 10px; transition: rotate .6s cubic-bezier(.2, 1.5, .4, 1); }
.medcard:hover .pill-ico { rotate: 145deg; }
.medcard__no { font: 800 34px/1 "Unbounded", sans-serif; letter-spacing: -.05em; }
.medcard__rows { display: grid; gap: 6px; font-size: 10px; }
.medcard__rows div { display: flex; justify-content: space-between; gap: 10px; }
.medcard__rows dt { color: var(--muted); }
:root[data-dose="on"] #patientState { color: var(--accent); }

.cab__tabs { display: grid; gap: 4px; }
.cab__tabs button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 12px; background: none; font-size: 15px; color: var(--muted); text-align: left; transition: background-color .2s, color .2s; }
.cab__tabs button:hover { color: var(--ink); }
.cab__tabs button[aria-pressed="true"] { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.cab__tabs svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cab__out { justify-self: start; padding: 10px 14px; border: 0; background: none; color: var(--muted); font-size: 11px; transition: color .2s; }
.cab__out:hover { color: var(--danger); }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }
.tile span { color: var(--muted); font-size: 10px; }
.tile b { font: 600 clamp(22px, 2.6vw, 32px)/1 "Unbounded", sans-serif; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
:root[data-dose="on"] .tile--hot b { color: var(--accent); text-shadow: 0 0 40px var(--glow); }
.tile--warn b { color: var(--danger); }

/* ---------- course cards ---------- */
.rx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.rx { position: relative; overflow: hidden; display: grid; gap: 16px; padding: 20px 20px 20px 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); transition: border-color .2s, translate .35s cubic-bezier(.2, .8, .2, 1); }
.rx::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 12px; background: var(--accent); }
.rx:hover { border-color: var(--ink); translate: 0 -4px; }
.rx[data-state="update"]::before { background: #ffb020; }
.rx[data-ended]::before { background: var(--muted); }
.rx[data-ended] { border-style: dashed; }
.rx__top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.rx__name { font: 600 clamp(20px, 2.2vw, 26px)/1.05 "Unbounded", sans-serif; letter-spacing: -.04em; }
.rx__name small { display: block; margin-bottom: 8px; font: 400 10px/1.4 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* one cell per day of the pack: a capsule while the day is ahead, an empty socket after */
.rx__blister { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--ink) 12%, transparent), color-mix(in srgb, var(--ink) 3%, transparent) 45%, color-mix(in srgb, var(--ink) 9%, transparent)); }
.rx__blister i { aspect-ratio: 2.2 / 1; border-radius: 99px; background: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 3px rgba(0, 0, 0, .22); transition: transform .4s cubic-bezier(.2, 1.7, .4, 1); transition-delay: calc(var(--i) * 14ms); }
.rx__blister i.is-used { background: none; box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 4px rgba(0, 0, 0, .25); }
.rx:hover .rx__blister i:not(.is-used) { transform: translateY(-3px) scale(1.08); }
:root[data-dose="on"] .rx__blister i:not(.is-used) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 3px rgba(0, 0, 0, .22), 0 0 10px var(--glow); }

.rx__left { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rx__left span { color: var(--muted); font-size: 10px; }
.rx__left b { flex: none; white-space: nowrap; font: 600 20px/1 "Unbounded", sans-serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.rx[data-ended] .rx__left b { color: var(--muted); }
.rx__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rx__plans { display: none; flex-wrap: wrap; gap: 8px; }
.rx.is-extending .rx__plans { display: flex; animation: view-in .3s ease backwards; }
.rx.is-extending .rx__actions { display: none; }
.chip { height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: none; font-size: 13px; transition: border-color .2s, background-color .2s, color .2s; }
.chip:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chip--quiet { color: var(--muted); }
.chip--quiet:hover { border-color: var(--ink); background: none; color: var(--ink); }

/* ---------- panels, fields ---------- */
.panel { display: grid; align-content: start; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); }
.panel--flush { padding: 6px 0; overflow-x: auto; }
.panel h2 { font: 600 20px/1.1 "Unbounded", sans-serif; letter-spacing: -.04em; }
.panel__sub { color: var(--muted); font-size: 14px; }
.panel__note { color: var(--muted); font-size: 13px; }
.panel__note[data-kind="ok"] { color: var(--signal); }
.panel__note[data-kind="fail"] { color: var(--danger); }
.panel__row { display: flex; flex-wrap: wrap; gap: 8px; }
.panel > .btn { justify-self: start; }

.field { display: grid; gap: 7px; }
.field > span { color: var(--muted); font-size: 10px; }
.field input, .field select { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); font: 400 14px/1 "JetBrains Mono", monospace; letter-spacing: .06em; transition: border-color .2s; }
.field select { font-family: "Onest", sans-serif; letter-spacing: 0; }
.field select option { background: var(--bg-2); color: var(--ink); }
.field input::placeholder { color: var(--muted); opacity: .6; }
.field input:focus-visible, .field select:focus-visible { outline: 0; border-color: var(--signal); }
.field.is-bad input { border-color: var(--danger); animation: nudge .35s; }
@keyframes nudge { 25% { translate: -5px 0; } 50% { translate: 4px 0; } 75% { translate: -2px 0; } }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); font-size: 12px; }
.kv div { display: grid; gap: 5px; padding: 10px 12px; background: var(--bg-2); }
.kv dt { color: var(--muted); font-size: 10px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 14px; }

.news { margin: 0; padding: 0; list-style: none; display: grid; }
.news li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; padding-bottom: 0; }
.news li:first-child { padding-top: 0; }
.news i { grid-row: span 2; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--signal); }
.news li[data-kind="update"] i { background: #ffb020; }
.news b { font-weight: 600; font-size: 15px; }
.news span { color: var(--muted); font-size: 13px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.table th { padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font: 400 10px/1.4 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; text-align: left; }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td b { font-weight: 600; }
.table .muted { color: var(--muted); }
:root[data-dose="on"] .status[data-state="ok"] i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status[data-state="update"] i { background: #ffb020; }
.status[data-state="ended"] i { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }

/* ---------- switches ---------- */
.switches { display: grid; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sw:last-child { border-bottom: 0; }
.sw:first-child { padding-top: 0; }
.sw b { display: block; font-weight: 600; font-size: 15px; }
.sw small { display: block; color: var(--muted); font-size: 13px; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw__track { flex: none; width: 44px; height: 26px; padding: 3px; border: 1.5px solid var(--muted); border-radius: 99px; transition: background-color .25s, border-color .25s; }
.sw__track::after { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); transition: translate .3s cubic-bezier(.2, 1.5, .4, 1), background-color .25s; }
.sw input:checked + .sw__track { border-color: var(--accent); background: var(--accent); }
.sw input:checked + .sw__track::after { translate: 18px 0; background: var(--accent-ink); }
.sw input:focus-visible + .sw__track { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---------- roles: an administrator does not see the patient's own parts, and the other way round ---------- */
/* tabs and views are chosen by cabinet.js from the role; everything else marked here follows the view */
:root[data-role="admin"] [data-role="patient"]:not(.cab__tabs button, .cab__view), :root:not([data-role="admin"]) [data-role="admin"]:not(.cab__tabs button, .cab__view) { display: none !important; }
.cab__tabs button[hidden] { display: none; }
/* support works in the admin panel without the administrator's own actions */
:root[data-staff="support"] :is([data-act="ban"], [data-act="close"], [data-act="refund"], [data-act="comp"], [data-act="state"], [data-act="revoke"], [data-admin-only]) { display: none !important; }
.adm-role { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font: 400 10px/1.6 "JetBrains Mono", monospace; vertical-align: 1px; }
.adm-role[data-role-name="admin"], .adm-role[data-role-name="developer"] { border-color: var(--accent); color: var(--ink); }
#admRole { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--ink); font: inherit; }
:root[data-role="admin"] .medcard::before { background: var(--ink); }
:root[data-role="admin"][data-dose="on"] .medcard::before { background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, var(--accent-ink) 8px 16px); }

/* ---------- administrator's panel ---------- */
.cab__blocked { padding: 14px 18px; border: 1px solid var(--danger); border-radius: 14px; color: var(--danger); font-size: 14px; }
.cab__blocked[hidden] { display: none; }

.adm-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.adm-search { flex: 1 1 260px; max-width: 380px; }
.adm-search input { font-family: "Onest", sans-serif; letter-spacing: 0; }
.adm-select { flex: 0 1 200px; }
.adm-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-filter .chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.adm-found { margin-left: auto; padding-bottom: 12px; color: var(--muted); font-size: 10px; }
.adm-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.adm-chips .chip, .adm-card__head .chip { height: 32px; padding: 0 12px; font-size: 12px; }
.chip:disabled { opacity: .4; pointer-events: none; }

.table small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.table--wrap td:nth-child(2) { white-space: normal; min-width: 280px; }
.table--pick tbody tr[data-user] { cursor: pointer; transition: background-color .2s; }
.table--pick tbody tr[data-user]:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.adm-sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; transition: color .2s; }
.adm-sort:hover, .adm-sort[data-dir="up"], .adm-sort[data-dir="down"] { color: var(--ink); }
.adm-sort::after { content: ""; width: 0; height: 0; border-inline: 4px solid transparent; opacity: 0; }
.adm-sort[data-dir="up"]::after { border-bottom: 5px solid currentColor; opacity: 1; }
.adm-sort[data-dir="down"]::after { border-top: 5px solid currentColor; opacity: 1; }
.adm-open { padding: 0; border: 0; background: none; color: var(--ink); font-size: inherit; text-align: left; border-bottom: 1px dashed transparent; transition: border-color .2s; }
.adm-open:hover { border-bottom-color: var(--muted); }
.adm-open .mono { color: var(--muted); font-size: 11px; }
.adm-open:focus-visible, .adm-sort:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.status[data-state="banned"] i { background: var(--danger); }
.kv .status { font-size: 12px; }
.kv--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adm-plain { text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.adm-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.adm-card__head .muted { color: var(--muted); font-size: 10px; }
.adm-danger:hover { border-color: var(--danger); color: var(--danger); }
.adm-key { font-size: 12px; letter-spacing: .08em; text-transform: none; user-select: all; }

/* one bar per day, oldest on the left; --h is the day's share of the best day */
.adm-bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); align-items: end; gap: 3px; height: 120px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.adm-bars i { height: max(2px, calc(var(--h) * 100%)); border-radius: 3px 3px 1px 1px; background: var(--ink); opacity: .85; transition: opacity .2s; }
.adm-bars i:hover { opacity: 1; }
:root[data-dose="on"] .adm-bars i { background: var(--accent); box-shadow: 0 0 10px var(--glow); }

/* revenue by product: --w is the product's share of the best one */
.adm-share { display: grid; gap: 14px; }
.adm-share__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 12px; }
.adm-share__row span b { display: block; font-weight: 600; font-size: 15px; }
.adm-share__row small { color: var(--muted); font-size: 12px; }
.adm-share__row > b { font-variant-numeric: tabular-nums; }
.adm-share__row i { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--ink) calc(var(--w) * 100%), color-mix(in srgb, var(--ink) 10%, transparent) 0); }
:root[data-dose="on"] .adm-share__row i { background: linear-gradient(90deg, var(--accent) calc(var(--w) * 100%), color-mix(in srgb, var(--ink) 10%, transparent) 0); }

.adm-list { margin: 0; padding: 0; list-style: none; display: grid; }
.adm-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.adm-list li:first-child { padding-top: 0; }
.adm-list .muted { color: var(--muted); font-size: 13px; }
.adm-list b { font-variant-numeric: tabular-nums; }

.adm-comp { display: grid; gap: 8px; }
.adm-comp > .mono { color: var(--muted); font-size: 10px; }
.adm-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.field textarea { width: 100%; min-height: 84px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); font: 400 14px/1.45 "Onest", sans-serif; resize: vertical; transition: border-color .2s; }
.field textarea:focus-visible { outline: 0; border-color: var(--signal); }
.adm-box .field input[type="text"] { font-family: "Onest", sans-serif; letter-spacing: 0; }

/* ---------- one user: the dialog ---------- */
.adm-modal { width: min(1000px, calc(100% - 24px)); max-width: none; max-height: min(90vh, 940px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); color: var(--ink); box-shadow: 0 40px 120px rgba(0, 0, 0, .6); overflow: hidden; }
.adm-modal[open] { display: flex; animation: view-in .3s cubic-bezier(.2, .8, .2, 1) backwards; }
.adm-modal::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px); }
.adm-modal__in { display: grid; grid-auto-rows: max-content; align-content: start; gap: 18px; width: 100%; padding: clamp(16px, 2.6vw, 26px); overflow-y: auto; overscroll-behavior: contain; }
.adm-modal__head { display: flex; align-items: center; gap: 14px; }
.adm-avatar { display: grid; flex: none; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 800 20px/1 "Unbounded", sans-serif; }
:root[data-dose="on"] .adm-avatar { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 30px var(--glow); }
.adm-modal__title { display: grid; gap: 6px; min-width: 0; margin-right: auto; }
.adm-modal__title h2 { overflow: hidden; font: 600 clamp(20px, 2.4vw, 28px)/1.05 "Unbounded", sans-serif; letter-spacing: -.04em; text-overflow: ellipsis; }
.adm-modal__title .mono { color: var(--muted); font-size: 11px; text-transform: none; overflow-wrap: anywhere; }
.adm-x { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); transition: border-color .2s, color .2s; }
.adm-x:hover { border-color: var(--ink); color: var(--ink); }
.adm-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.adm-alert { padding: 12px 16px; border: 1px solid var(--danger); border-radius: 12px; color: var(--danger); font-size: 14px; }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-tabs .chip { display: inline-flex; align-items: center; gap: 8px; }
.adm-tabs .chip em { padding: 2px 7px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); font-size: 10px; font-style: normal; }
.adm-tabs .chip[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.adm-tabs .chip[aria-selected="true"] em { background: color-mix(in srgb, var(--bg) 22%, transparent); }
.adm-modal__pane { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); overflow-x: auto; }
.adm-modal__pane > .panel__sub, .adm-modal__pane > .news, .adm-modal__pane > .adm-inline { margin: 16px 20px; }
.adm-modal__pane > .table + .adm-inline { margin-top: 0; max-width: 420px; }
.adm-modal__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.adm-box { display: grid; align-content: start; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }

@media (max-width: 760px) {
  .kv--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-found { margin-left: 0; }
  .adm-modal { width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
}

/* ---------- login ---------- */
.login { min-height: calc(100svh - 69px); display: grid; place-items: center; padding: 28px var(--gut); }
.login__card { width: min(460px, 100%); display: grid; gap: 18px; padding: clamp(22px, 4vw, 34px); border: 2px solid var(--ink); border-radius: 8px; background: var(--bg); animation: view-in .6s cubic-bezier(.2, .8, .2, 1) backwards; }
.login__title { padding-bottom: 12px; border-bottom: 10px solid var(--ink); font: 800 clamp(30px, 6vw, 44px)/1 "Unbounded", sans-serif; letter-spacing: -.05em; }
.login__sub { display: flex; justify-content: space-between; gap: 12px; margin-top: -8px; padding-bottom: 8px; border-bottom: 3px solid var(--ink); color: var(--muted); font-size: 10px; }
.login__note { color: var(--muted); font-size: 13px; }
.login__note[data-kind="fail"] { color: var(--danger); }
.login__switch { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 4px; transition: color .2s; }
.login__switch:hover { color: var(--ink); }
.field[hidden], .panel[hidden], .login__switch[hidden] { display: none; }
/* until cabinet.js has decided what to show */
:root[data-boot] main { visibility: hidden; }

/* ---------- toast ---------- */
.toast { position: fixed; right: var(--gut); bottom: var(--gut); z-index: 90; max-width: min(420px, calc(100% - 2 * var(--gut))); padding: 14px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; opacity: 0; translate: 0 16px; pointer-events: none; transition: opacity .3s ease, translate .35s cubic-bezier(.2, 1.4, .4, 1); }
.toast.is-on { opacity: 1; translate: 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cab { grid-template-columns: 1fr; }
  .cab__side { position: static; }
  .cab__tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .cab__tabs button { flex: none; padding: 10px 14px; }
  .cab__out { display: none; }
  .cab-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cab__view.is-on > *, .login__card, .rx.is-extending .rx__plans, .adm-modal[open] { animation: none; }
  .rx, .rx__blister i, .toast, .medcard__top .pill-ico { transition: none; }
}

/* ---------- money: balance, payouts, shares, team ---------- */
.mn-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.mn-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.mn-h2 { font: 600 20px/1.1 "Unbounded", sans-serif; letter-spacing: -.04em; }
.mn-plus { color: var(--signal); }
.mn-minus { color: var(--danger); }
.mn-off { padding: 14px 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 14px; }
.mn-share { display: grid; gap: 10px; }
.mn-share__row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 38px; align-items: end; gap: 8px; }
.mn-share__row .field input, .mn-share__row .field select { height: 42px; }
.mn-share__sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--muted); font-size: 13px; }
.mn-share__sum b { color: var(--ink); font-weight: 600; }
.mn-share__sum[data-over] b { color: var(--danger); }
.mn-x { width: 38px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--muted); transition: border-color .2s, color .2s; }
.mn-x:hover { border-color: var(--danger); color: var(--danger); }
.mn-assign { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto; align-items: end; gap: 10px; }
.mn-adjust { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-adjust input { width: 120px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); font: 400 13px/1 "JetBrains Mono", monospace; }
.mn-adjust input[name="note"] { width: 190px; font-family: "Onest", sans-serif; }
.mn-role { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--ink); font: inherit; font-size: 13px; }
.status[data-state="pending"] i { background: #ffb020; }
.status[data-state="rejected"] i, .status[data-state="cancelled"] i { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
:root[data-dose="on"] .status[data-state="paid"] i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.status[data-state="paid"] i { background: var(--signal); }
@media (max-width: 720px) {
  .mn-assign { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- publishing builds and the loader (cabinet-deploy.js) ---------- */
.deploy { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.deploy__list { display: grid; gap: 8px; position: sticky; top: 16px; }
.deploy__item { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); text-align: left; transition: border-color .2s, background-color .2s; }
.deploy__item b { font-size: 14px; font-weight: 600; }
.deploy__item span { color: var(--muted); font-size: 11px; }
.deploy__item:hover { border-color: var(--ink); }
.deploy__item[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); }
.deploy__detail { display: grid; gap: 16px; min-width: 0; }
.deploy__bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.deploy__bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.deploy__check { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.deploy__check input { width: 20px; height: 20px; padding: 0; }
.deploy__check span { color: var(--ink); font-size: 13px; }
.panel .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.field input[type="file"] { height: auto; padding: 12px 14px; }
@media (max-width: 860px) {
  .deploy { grid-template-columns: 1fr; }
  .deploy__list { position: static; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
