/* Обращения Telegram: тёмный интерфейс со стеклом и светом.
   Все классы, которыми управляет app.js, сохранены: status/ok/bad/working, chip good/warn/bad,
   session/selected, entry, note/current, quick, panel, tab/active, wide, signed-in, check, pick. */

:root {
  --bg: #0a0f17;
  --bg-2: #0e1420;
  --card: rgba(22, 30, 45, .74);
  --card-solid: #171f2e;
  --card-soft: #0f1624;
  --line: var(--btn-secondary);
  --line-soft: rgba(255, 255, 255, .16);
  --text: #eaf0fb;
  --muted: #97a6bd;
  --accent: #7fe0cf;
  --accent-2: #9d8dff;
  --accent-3: #8bd2ff;
  --accent-ink: #0b211c;
  --warn-bg: rgba(242, 207, 152, .12);
  --warn: #f2cf98;
  --bad: #ff9f98;
  --bad-bg: rgba(255, 159, 152, .12);
  --good: #79d8cb;
  --good-bg: rgba(121, 216, 203, .12);
  --field-bg: rgba(10, 15, 24, .55);
  --field-bg-focus: rgba(10, 15, 24, .8);
  --row-bg: rgba(10, 15, 24, .45);
  --row-bg-strong: rgba(10, 15, 24, .62);
  --nav-bg: rgba(14, 20, 32, .6);
  --nav-bg-solid: rgba(14, 20, 32, .82);
  --btn-secondary: rgba(255, 255, 255, .08);
  --btn-secondary-hover: rgba(255, 255, 255, .13);
  --switch-bg: rgba(255, 255, 255, .12);
  --track: rgba(255, 255, 255, .06);
  --chip-bg: rgba(255, 255, 255, .04);
  --pre-text: #b9c9df;
  --placeholder: #5f6e86;
  --dialog-bg: rgba(22, 30, 45, .9);
  --card-shadow: 0 18px 40px rgba(0, 0, 0, .28);
  --aurora: .2;
  --tap: 44px;
  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --glow: 0 0 0 1px rgba(127, 224, 207, .28), 0 10px 32px rgba(127, 224, 207, .18);
  color-scheme: dark;
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #2b3647 transparent;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-wrap: break-word; background: var(--bg); min-height: 100dvh; }
main {
  position: relative; z-index: 1;
  max-width: 900px; margin: auto;
  padding: 28px max(20px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
h1 { font-family: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif; font-size: 28px; letter-spacing: -.7px; margin: 6px 0 0; font-weight: 700; }
h2 { font-size: 19px; margin: 0 0 6px; letter-spacing: -.3px; font-weight: 650; }
h3 { font-size: 12px; margin: 26px 0 2px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600; }
p { line-height: 1.6; margin: 8px 0; }
.muted { color: var(--muted); font-size: 14px; }
.badge { color: var(--accent); font-size: 11px; letter-spacing: 2.4px; font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(127, 224, 207, .3); }

/* ---------- living background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i {
  position: absolute; width: 58vw; height: 58vw; border-radius: 50%;
  filter: blur(96px); opacity: var(--aurora); background: var(--accent);
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { left: -18%; top: -24%; }
.aurora i:nth-child(2) { background: var(--accent-2); left: 52%; top: 42%; animation-duration: 36s; animation-delay: -14s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(12vw, 10vh) scale(1.22); } }
body.no-effects .aurora { display: none; }

/* ---------- login ---------- */
body:not(.signed-in) main { min-height: 100dvh; display: grid; place-items: center; max-width: none; }
#login { width: min(100%, 440px); padding: 30px 28px; }
#login h1 { font-size: 30px; margin-top: 8px; }
#login button { width: 100%; margin-top: 18px; }

/* ---------- layout ---------- */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.topbar-text { min-width: 0; }
.card {
  position: relative; isolation: isolate;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 14px 0;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, var(--card-shadow);
  transition: border-color .3s var(--ease);
}
/* a soft light and a brighter rim that follow the cursor; effects.js sets --x and --y */
.card::before, .card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .35s var(--ease); z-index: -1;
}
.card::before { background: radial-gradient(300px circle at var(--x, 50%) var(--y, 50%), rgba(127, 224, 207, .12), transparent 62%); }
.card::after {
  padding: 1px;
  background: radial-gradient(240px circle at var(--x, 50%) var(--y, 50%), rgba(127, 224, 207, .9), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover::before, .card:hover::after { opacity: 1; }
body.no-effects .card::before, body.no-effects .card::after { display: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

/* panels slide up when a tab opens */
.panel { animation: rise .4s var(--ease) both; }
#draft, #inviteBlock, #auCodeBox, #uploadResults li, #answerBox { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- navigation ---------- */
.tabs {
  position: relative; display: flex; gap: 4px; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  overflow-x: auto; scrollbar-width: none; margin-bottom: 4px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 9px;
  background: transparent; color: var(--muted); border-radius: var(--radius-sm); padding: 10px 14px;
  margin: 0; font-weight: 600; white-space: nowrap; flex: 0 0 auto; border: 0;
  transition: color .25s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); }
.tab .icon { width: 18px; height: 18px; flex: 0 0 auto; }
/* the ink slides under the active tab; effects.js positions it, CSS only falls back to a static pill */
.tabs .ink {
  position: absolute; z-index: 0; left: 6px; top: 6px; width: 0; height: 0;
  border-radius: var(--radius-sm); background: rgba(127, 224, 207, .12);
  box-shadow: inset 0 0 0 1px rgba(127, 224, 207, .22);
  transition: left .4s var(--ease), top .4s var(--ease), width .4s var(--ease), height .4s var(--ease), opacity .2s;
  opacity: 0;
}
/* until effects.js has measured the active tab, the tab paints its own pill */
.tabs:not(:has(.ink[style])) .tab.active { background: rgba(127, 224, 207, .12); }

/* ---------- controls ---------- */
label { display: block; font-size: 13px; margin: 14px 0 0; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px; min-height: var(--tap);
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--field-bg); color: inherit; font: inherit;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .26); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(127, 224, 207, .16); background: var(--field-bg-focus); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input[type="file"] { padding: 9px; cursor: pointer; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 7px 12px; margin-right: 12px;
  background: var(--btn-secondary); color: var(--text); cursor: pointer;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2397a6bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

button {
  --mx: 0px; --my: 0px;
  position: relative; overflow: hidden; isolation: isolate;
  padding: 12px 18px; min-height: var(--tap); border: 0; border-radius: var(--radius-sm);
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-3) 55%, var(--accent-2) 100%);
  color: var(--accent-ink); font: inherit; font-weight: 650; cursor: pointer; margin-top: 12px;
  transform: translate(var(--mx), var(--my));
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .2s, color .2s, opacity .2s;
}
button:hover { box-shadow: var(--glow); }
button:active { transform: translate(var(--mx), var(--my)) scale(.965); transition-duration: .08s; }
button:disabled { opacity: .38; cursor: default; box-shadow: none; }
button.secondary { background: var(--btn-secondary); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
button.secondary:hover { background: var(--btn-secondary-hover); box-shadow: inset 0 0 0 1px var(--line-soft); }
button.ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
button.ghost:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-soft); }
button.danger { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255, 159, 152, .25); }
button.danger:hover { background: rgba(255, 159, 152, .2); box-shadow: inset 0 0 0 1px rgba(255, 159, 152, .45); }
button.small { padding: 9px 13px; min-height: 38px; font-size: 13px; margin-top: 0; }
.tab { overflow: visible; transform: none; }
.tab:hover, .tab:active { box-shadow: none; transform: none; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 1;
  background: rgba(255, 255, 255, .35); transform: scale(0); animation: ripple .55s ease-out forwards;
}
button.secondary .ripple, button.ghost .ripple, button.danger .ripple { background: rgba(255, 255, 255, .14); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* switches for confirmations; the small .pick boxes in the lists stay boxes */
.check { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; font-size: 14px; color: var(--text); padding: 6px 0; cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative;
  width: 38px; height: 22px; min-height: 22px; margin: 0; padding: 0; border-radius: 999px;
  background: var(--switch-bg); border: 1px solid var(--line-soft);
  transition: background .25s var(--ease), border-color .25s;
}
.check input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); transition: transform .25s var(--ease), background .25s;
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::before { transform: translateX(16px); background: var(--accent-ink); }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pick, .session-head .pick {
  appearance: auto; -webkit-appearance: auto; width: 18px; height: 18px; min-height: 18px;
  margin: 0; flex: 0 0 auto; accent-color: var(--accent); border-radius: 5px;
}

/* ---------- status ---------- */
.status { min-height: 20px; font-size: 14px; margin: 12px 0 0; line-height: 1.5; display: flex; align-items: flex-start; gap: 8px; }
.status:empty { display: block; }
.status.working { color: var(--muted); }
.status.ok { color: var(--good); animation: fade .35s var(--ease) both; }
.status.ok:not(:empty)::before { content: ""; flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--good-bg); box-shadow: inset 0 0 0 1px rgba(121, 216, 203, .5); animation: pop .4s var(--ease) both; }
.status.bad { color: var(--bad); animation: shake .45s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.notice { background: var(--warn-bg); border: 1px solid rgba(242, 207, 152, .18); padding: 12px 14px; border-radius: var(--radius-sm); color: var(--warn); font-size: 14px; }

/* a thin running bar instead of the grey <progress>; app.js toggles its hidden attribute */
.bar { position: relative; height: 3px; margin: 0 0 10px; border-radius: 3px; overflow: hidden; background: var(--track); }
.bar i { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); animation: slide 1.1s linear infinite; }
@keyframes slide { to { left: 100%; } }

.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; line-height: 1.4;
  border: 1px solid var(--line-soft); color: var(--muted); white-space: nowrap; background: var(--chip-bg);
}
.chip.good { color: var(--good); border-color: rgba(121, 216, 203, .35); background: var(--good-bg); }
.chip.warn { color: var(--warn); border-color: rgba(242, 207, 152, .35); background: var(--warn-bg); }
.chip.bad { color: var(--bad); border-color: rgba(255, 159, 152, .35); background: var(--bad-bg); }

/* ---------- lists ---------- */
ul { list-style: none; padding: 0; margin: 14px 0 0; }
li.session {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--row-bg); transition: border-color .25s var(--ease), background .25s;
}
li.session:hover { border-color: var(--line-soft); background: var(--row-bg-strong); }
li.session.selected { border-color: rgba(127, 224, 207, .55); box-shadow: 0 0 0 3px rgba(127, 224, 207, .1); }
li.session .status { margin-top: 6px; }
li.session p.muted { margin: 4px 0; }
.session-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.session-head strong { margin-right: auto; font-size: 15px; }
.session-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
li.empty { color: var(--muted); font-size: 14px; padding: 16px; border: 1px dashed var(--line-soft); border-radius: 14px; }
li.entry { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.5; }

/* session rows: avatar, live dot, and the two selects beside the details */
.avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
  font-weight: 700; font-size: 14px; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); letter-spacing: .5px;
}
.dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #5f6e86; }
.dot.alive { background: var(--good); animation: breathe 2.2s ease-in-out infinite; }
.dot.dead { background: var(--bad); }
.dot.unreachable, .dot.limited { background: var(--warn); }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(121, 216, 203, .5); } 50% { box-shadow: 0 0 0 6px rgba(121, 216, 203, 0); } }
li.session:has(.session-controls) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; align-items: start; }
li.session:has(.session-controls) > .session-head, li.session:has(.session-controls) > .session-actions { grid-column: 1 / -1; }
.session-meta { grid-column: 1; min-width: 0; }
.session-controls { grid-column: 2; display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.session-controls label { margin: 0; min-width: 190px; flex: 1 1 190px; }
.session-controls select { margin-top: 6px; min-height: 40px; padding: 8px 34px 8px 12px; }
@media (max-width: 760px) {
  li.session:has(.session-controls) { grid-template-columns: 1fr; }
  .session-controls { grid-column: 1; }
}

pre {
  white-space: pre-wrap; font: inherit; max-height: 280px; overflow: auto;
  color: var(--pre-text); background: var(--row-bg-strong); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px;
}
footer { font-size: 12px; line-height: 1.8; text-align: center; color: var(--muted); margin-top: 24px; }

/* ---------- report procedure ---------- */
.steps { display: flex; gap: 0; margin: 12px 0 4px; padding: 0; counter-reset: step; }
.steps li { flex: 1 1 0; min-width: 0; position: relative; font-size: 12px; color: var(--muted); padding: 0 6px 0 0; display: flex; flex-direction: column; gap: 8px; }
.steps li::before {
  content: counter(step); counter-increment: step; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--track); border: 1px solid var(--line-soft); color: var(--muted);
  transition: background .3s var(--ease), color .3s, border-color .3s, box-shadow .3s;
}
.steps li::after { content: ""; position: absolute; left: 32px; right: 0; top: 13px; height: 1px; background: var(--line-soft); }
.steps li:last-child::after { display: none; }
.steps li.done::before { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.steps li.done::after { background: var(--good); }
.steps li.now { color: var(--text); }
.steps li.now::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px rgba(127, 224, 207, .18); }
.steps li.bad { color: var(--bad); }
.steps li.bad::before { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
@media (max-width: 480px) { .steps li span { display: none; } }

/* telegram answers */
.linkbutton {
  display: inline-flex; align-items: center; padding: 9px 13px; min-height: 38px;
  border-radius: var(--radius-sm); background: var(--btn-secondary); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 650; text-decoration: none;
  transition: background .2s, box-shadow .2s;
}
.linkbutton:hover { background: var(--btn-secondary-hover); box-shadow: inset 0 0 0 1px var(--line-soft); }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 6px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; display: inline-block; margin-right: 8px; transition: transform .25s var(--ease); }
details[open] > summary::before { transform: rotate(90deg); }
summary.accepted { color: var(--good); }
summary.refused { color: var(--warn); }
details pre { margin-top: 8px; font-size: 13px; }
li.entry details { margin-top: 6px; }

/* history: a coloured line per status, the account beside the target */
#history li.entry { border-left: 3px solid var(--line-soft); padding-left: 14px; border-bottom: 0; margin-bottom: 10px; border-radius: 0 10px 10px 0; background: var(--row-bg); padding-top: 10px; padding-bottom: 10px; }
#history li.entry.st-reported, #history li.entry.st-joined { border-left-color: var(--good); }
#history li.entry.st-error, #history li.entry.st-rejected { border-left-color: var(--bad); }
#history li.entry.st-limited, #history li.entry.st-unknown, #history li.entry.st-pending, #history li.entry.st-manual { border-left-color: var(--warn); }
#history li.entry .who { color: var(--muted); font-size: 12px; margin-right: 8px; }

/* placeholder help under the justification field */
ul.plain { margin: 10px 0 0; font-size: 13px; line-height: 1.7; color: var(--text); }
ul.plain li { padding: 2px 0; overflow-wrap: anywhere; }
code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px;
  background: var(--row-bg-strong); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px;
  color: var(--accent);
}

/* per-file outcome of a batch upload */
#uploadResults:empty { display: none; }
#uploadResults li.session { padding: 11px 13px; margin-bottom: 8px; }
#uploadResults li.session p { margin: 6px 0 0; }

/* bulk actions */
.bulk { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--row-bg); }
.bulk .check { margin: 0; padding: 0; }
.bulk select { width: auto; flex: 1 1 190px; min-width: 160px; margin-top: 0; min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.bulk button { margin-top: 0; }
@media (max-width: 480px) { .bulk select, .bulk button { flex: 1 1 100%; } }

/* ---------- AU Report: the dialogue as a chat ---------- */
#auTranscript { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5;
  border: 1px solid var(--line); background: var(--row-bg-strong);
}
.bubble.bot { align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; border-bottom-right-radius: 5px; background: rgba(121, 216, 203, .1); border-color: rgba(121, 216, 203, .3); }
.bubble .who { display: flex; gap: 8px; align-items: baseline; font-size: 11px; color: var(--muted); margin-bottom: 4px; letter-spacing: .4px; text-transform: uppercase; }
.au-text { white-space: pre-wrap; margin: 0; }
.bubble .row { margin-top: 8px; gap: 6px; }
.bubble.typing { padding: 12px 16px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------- notes ---------- */
body.wide main { max-width: 1180px; }
.notes-layout { display: grid; gap: 16px; grid-template-columns: minmax(260px, 360px) 1fr; margin-top: 14px; }
#noteList { margin: 0; max-height: 620px; overflow-y: auto; padding-right: 2px; }
li.note {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 8px; background: var(--row-bg); cursor: pointer;
  transition: border-color .25s var(--ease), background .25s, transform .25s var(--ease);
}
li.note:hover { border-color: var(--line-soft); background: var(--row-bg-strong); transform: translateX(2px); }
li.note.current { border-color: rgba(127, 224, 207, .55); background: rgba(127, 224, 207, .06); }
li.note strong { display: block; overflow-wrap: anywhere; }
li.note .snippet {
  color: var(--muted); font-size: 13px; margin: 6px 0 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
li.note .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.note-editor textarea { min-height: 260px; }
@media (max-width: 860px) {
  .notes-layout { grid-template-columns: 1fr; }
  #noteList { max-height: 320px; }
}

/* quick notes beside the report form */
.report-layout { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .report-layout { grid-template-columns: minmax(0, 1fr) 330px; } }
#panel-report-notes h2 { margin-bottom: 4px; }
#quickList { max-height: 460px; overflow-y: auto; }
li.quick {
  border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px;
  margin-bottom: 8px; background: var(--row-bg); cursor: pointer;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
li.quick:hover { border-color: rgba(127, 224, 207, .5); transform: translateX(2px); }
li.quick strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
li.quick .snippet {
  color: var(--muted); font-size: 13px; margin: 5px 0 0; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

dialog#quickView {
  width: min(680px, calc(100vw - 28px)); max-height: 86vh; overflow: auto;
  border: 1px solid var(--line-soft); border-radius: 20px; padding: 26px;
  background: var(--dialog-bg); color: var(--text);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  animation: rise .3s var(--ease);
}
dialog#quickView::backdrop { background: rgba(5, 8, 14, .7); backdrop-filter: blur(4px); }
dialog#quickView h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
dialog#quickView textarea { min-height: 220px; margin-top: 14px; }

/* ---------- prompts ---------- */
#promptList .snippet {
  color: var(--muted); font-size: 13px; margin: 8px 0 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#promptBody { min-height: 200px; }
#promptTestResult { margin-top: 12px; max-height: 340px; }
#generateTools { align-items: flex-end; margin-top: 10px; }
#generateLabel { margin: 0; flex: 1 1 200px; min-width: 160px; }
#generateLabel select { margin-top: 6px; }
@media (max-width: 480px) { #generateTools > button { flex: 1 1 100%; } }

/* ---------- icons ---------- */
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---------- the cursor: a dot that tracks exactly and a ring that follows a beat behind ---------- */
#cursorDot, #cursorRing { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 10000; border-radius: 50%; opacity: 0; transition: opacity .25s; will-change: transform; }
#cursorDot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
#cursorRing {
  width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid rgba(127, 224, 207, .9);
  transition: width .22s var(--ease), height .22s var(--ease), margin .22s var(--ease), background .22s, border-radius .22s, opacity .25s, border-color .22s;
}
#cursorRing.hover { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: rgba(127, 224, 207, .12); border-color: rgba(127, 224, 207, .6); }
#cursorRing.text { width: 3px; height: 26px; margin: -13px 0 0 -1px; border-radius: 2px; background: var(--accent); border-color: transparent; }
#cursorRing.down { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
body.custom-cursor #cursorDot, body.custom-cursor #cursorRing { opacity: 1; }
body.custom-cursor, body.custom-cursor * { cursor: none !important; }
body.custom-cursor :is(input, textarea, select, option) { cursor: auto !important; }

/* ---------- phones ---------- */
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  main { padding: 16px max(14px, env(safe-area-inset-right)) calc(36px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  h1 { font-size: 22px; }
  h2 { font-size: 17px; }
  .card { padding: 16px; border-radius: 14px; }
  input, select, textarea { font-size: 16px; }
  .topbar { align-items: flex-start; }
  .row > button { flex: 1 1 auto; }
  .session-actions button { flex: 1 1 calc(50% - 4px); }
  .session-head strong { flex: 1 1 100%; margin-right: 0; }
}
.tab .narrow-only { display: none; }

@media (max-width: 700px) {
  .aurora i { filter: blur(70px); opacity: calc(var(--aurora) * .8); }
  /* Nine tabs do not fit a phone at a size a thumb can hit, so the bar scrolls sideways: every tab
     keeps its whole name and a full-size target, and the active one is brought into view (showTab). */
  .tabs {
    position: fixed; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
    margin: 0; padding: 6px; gap: 2px; border-radius: 20px;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    background: var(--nav-bg-solid); box-shadow: 0 -8px 30px rgba(0, 0, 0, .45), 0 0 0 1px var(--line);
  }
  .tab {
    flex: 1 0 auto; min-width: 62px; padding: 7px 8px 6px; min-height: 54px; font-size: 11px; font-weight: 700;
    flex-direction: column; gap: 4px; line-height: 1.1; white-space: nowrap;
    justify-content: center; letter-spacing: -.1px; border-radius: 14px; scroll-snap-align: center;
  }
  .tab .badge-count { position: absolute; top: 3px; right: 6px; margin: 0; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; }
  html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tab .icon { width: 20px; height: 20px; }
  .tabs .ink { border-radius: 14px; }
  body.signed-in main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 0 6px; margin-bottom: 6px; align-items: center; }
  .topbar .badge { display: none; }
  .topbar h1 { font-size: 19px; letter-spacing: -.3px; }
  #activeAccount { margin: 2px 0 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card { margin: 10px 0; }
  .row > button.small { flex: 1 1 auto; }
  .tab .wide-only { display: none; }
  .tab .narrow-only { display: inline; }
}

/* ---------- touch screens, whatever their width (a phone held sideways is wide) ---------- */
html { -webkit-tap-highlight-color: transparent; }
button, select, summary, .linkbutton, label.check, .tab { touch-action: manipulation; }  /* no double-tap zoom, no 300 ms wait */
@media (pointer: coarse) {
  /* iOS zooms the whole page into any field whose text is smaller than 16px */
  input, select, textarea { font-size: 16px; }
  button.small, .linkbutton { min-height: 44px; }
  .check { min-height: 44px; align-items: center; }
  summary { padding: 12px 0; }
  li.entry .pick { width: 22px; height: 22px; }
}
@media (hover: none) {
  /* a finger has no hover: without this the glow stays on the last button touched */
  button:hover { box-shadow: none; }
  .card:hover::before, .card:hover::after { opacity: 0; }
}
@media (max-width: 700px), (pointer: coarse) {
  /* a blur behind every card and two drifting lights cost a phone its smooth scrolling */
  .card { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .aurora i { animation: none; }
}
dialog#quickView { max-height: 86dvh; }

/* ---------- desktop: the tabs become a side rail ---------- */
@media (min-width: 1000px) {
  main { max-width: 1240px; }
  body.wide main { max-width: 1400px; }
  #workspace { display: grid; grid-template-columns: 228px minmax(0, 1fr); column-gap: 26px; align-items: start; }
  #workspace > * { grid-column: 2; min-width: 0; }
  #workspace > .tabs {
    grid-column: 1; grid-row: 1 / span 60; position: sticky; top: 20px; align-self: start;
    flex-direction: column; gap: 4px; padding: 10px; overflow: visible; margin: 0;
  }
  #workspace > .tabs .tab { width: 100%; padding: 12px 14px; justify-content: flex-start; }
  #workspace > .tabs .tab .icon { width: 20px; height: 20px; }
  #workspace > .report-layout { grid-column: 2; }
  #workspace > footer { grid-column: 1 / -1; }
  .topbar { margin-top: 6px; }
}

/* ---------- light theme: the same tokens, daylight values; app.js sets data-theme ---------- */
:root[data-theme="light"] {
  --bg: #edf1f7;
  --bg-2: #e4e9f1;
  --card: rgba(255, 255, 255, .74);
  --card-solid: #ffffff;
  --card-soft: #f3f6fb;
  --line: rgba(15, 25, 40, .1);
  --line-soft: rgba(15, 25, 40, .22);
  --text: #15202e;
  --muted: #58697f;
  --accent: #0e9a88;
  --accent-2: #6a57ff;
  --accent-3: #2b8ad6;
  --accent-ink: #ffffff;
  --warn-bg: rgba(186, 117, 23, .12);
  --warn: #7a4f08;
  --bad: #b0271f;
  --bad-bg: rgba(176, 39, 31, .1);
  --good: #0d6b55;
  --good-bg: rgba(13, 107, 85, .1);
  --glow: 0 0 0 1px rgba(14, 154, 136, .25), 0 10px 28px rgba(14, 154, 136, .18);
  --field-bg: rgba(255, 255, 255, .85);
  --field-bg-focus: #ffffff;
  --row-bg: rgba(255, 255, 255, .62);
  --row-bg-strong: rgba(255, 255, 255, .9);
  --nav-bg: rgba(255, 255, 255, .72);
  --nav-bg-solid: rgba(255, 255, 255, .94);
  --btn-secondary: rgba(15, 25, 40, .07);
  --btn-secondary-hover: rgba(15, 25, 40, .12);
  --switch-bg: rgba(15, 25, 40, .16);
  --track: rgba(15, 25, 40, .08);
  --chip-bg: rgba(15, 25, 40, .04);
  --pre-text: #2c3a4d;
  --placeholder: #8c9ab0;
  --dialog-bg: rgba(255, 255, 255, .94);
  --card-shadow: 0 14px 34px rgba(30, 45, 70, .12);
  --aurora: .32;
  color-scheme: light;
  scrollbar-color: #b9c3d2 transparent;
}
:root[data-theme="light"] .chip.good { border-color: rgba(13, 107, 85, .3); }
:root[data-theme="light"] .chip.warn { border-color: rgba(122, 79, 8, .3); }
:root[data-theme="light"] .chip.bad { border-color: rgba(176, 39, 31, .3); }
:root[data-theme="light"] .bubble.me { background: rgba(13, 107, 85, .08); border-color: rgba(13, 107, 85, .25); }
:root[data-theme="light"] #cursorRing { border-color: rgba(14, 154, 136, .9); }
:root[data-theme="light"] .tabs .ink { background: rgba(14, 154, 136, .12); box-shadow: inset 0 0 0 1px rgba(14, 154, 136, .22); }

/* ---------- motion off ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- mail ---------- */
li.mail-row {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 11px 14px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--row-bg); cursor: pointer; transition: border-color .25s var(--ease), background .25s;
}
li.mail-row:hover { border-color: var(--line-soft); background: var(--row-bg-strong); }
li.mail-row .dot { grid-row: 1 / span 2; }
li.mail-row .dot.new { background: var(--accent); }
li.mail-row .sender { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li.mail-row .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
li.mail-row .subject { grid-column: 2 / span 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
li.mail-row.unread .subject { color: var(--text); }
li.mail-row.unread .sender { color: var(--accent); }
#mailViewText { max-height: 520px; }
#mailViewAttachments a { color: var(--accent); text-decoration: none; }
#mailViewAttachments a:hover { text-decoration: underline; }
#mailView, #mailComposeBox { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- mail menu: rail of mailboxes and folders, the list, the reading pane ---------- */
.mail-layout { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 12px; align-items: start; }
.mail-rail h3 { margin-top: 8px; }
#mailBoxes, .mail-folders { margin: 6px 0 0; }
#mailBoxes li, .mail-folders li {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; color: var(--muted); font-size: 14px; margin-bottom: 2px;
  transition: background .2s, color .2s, border-color .2s;
}
#mailBoxes li:hover, .mail-folders li:hover { background: var(--row-bg); color: var(--text); }
#mailBoxes li.current, .mail-folders li.current { background: rgba(127, 224, 207, .12); color: var(--accent); border-color: rgba(127, 224, 207, .25); }
#mailBoxes li .name, .mail-folders li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mailBoxes li.trouble .name::after { content: " !"; color: var(--bad); }
.badge-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 1;
}
.tab .badge-count { margin-left: 2px; }
.mail-search input { flex: 1 1 160px; margin-top: 0; }
.mail-search button { margin-top: 0; }
.mail-list-pane .check { margin-top: 8px; }
li.mail-row .box { font-size: 11px; color: var(--accent); margin-left: 6px; }
#mailHint { margin: 4px 0 0; }
@media (min-width: 760px) {
  .mail-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .mail-read-pane { grid-column: 1 / -1; }
}
@media (min-width: 1180px) {
  .mail-layout { grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1.1fr); }
  .mail-read-pane { grid-column: auto; position: sticky; top: 16px; }
  #mailView, #mailComposeBox { margin-top: 0; padding-top: 0; border-top: 0; }
}
@media (max-width: 759px) {
  #mailBoxes, .mail-folders { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  #mailBoxes li, .mail-folders li { flex: 0 0 auto; border-color: var(--line); white-space: nowrap; margin: 0; }
  #mailBoxes li .name, .mail-folders li .name { max-width: 160px; }
}

/* new-mail toast */
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 70; max-width: min(380px, calc(100vw - 36px));
  padding: 12px 16px; border-radius: 14px; background: var(--dialog-bg); border: 1px solid var(--line-soft);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4); cursor: pointer; display: grid; gap: 4px;
  animation: rise .3s var(--ease); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.toast strong { color: var(--accent); font-size: 13px; }
.toast span { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .toast { left: 12px; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); } }

/* ---------- DSA Report: the server's Chrome on the page ---------- */
/* The picture lives in a frame of its own: zoomed in, it grows past the frame and the frame scrolls.
   Fingers are handled in dsa.js (one moves or clicks, two zoom), so the browser's own gestures are off. */
.dsa-view {
  margin-top: 10px; overflow: auto; max-height: min(78dvh, 900px); border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--row-bg-strong); overscroll-behavior: contain;
  scrollbar-width: thin; touch-action: none;
}
.dsa-view:focus-within { box-shadow: var(--glow); }
.dsa-screen {
  display: block; width: 100%; max-width: none; height: auto; cursor: crosshair; background: #fff; outline: none;
  /* a remote screen: no native image drag, no text selection, no callout on a long press */
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
.dsa-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.dsa-tools button { margin-top: 0; }
.dsa-group { display: flex; gap: 4px; }
.dsa-group button { min-width: 44px; padding-left: 10px; padding-right: 10px; font-variant-numeric: tabular-nums; }
#dsaZoomFit { min-width: 62px; }
#dsaDragMode[aria-pressed="true"] { background: rgba(127, 224, 207, .16); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(127, 224, 207, .45); }
.dsa-full-note { display: none; }
/* a mouse drags on the remote screen by itself: the finger switch is for touch only */
@media (hover: hover) and (pointer: fine) { #dsaDragMode { display: none; } }

/* «На весь экран»: the block covers the phone, the picture takes all the room the controls leave.
   The card around it must not be a containing block for it, hence .dsa-host (set from dsa.js). */
body.dsa-full { overflow: hidden; }
.card.dsa-host { backdrop-filter: none; -webkit-backdrop-filter: none; isolation: auto; animation: none; transform: none; }
.dsa-screen-block.dsa-expanded {
  position: fixed; inset: 0; z-index: 90; margin: 0; background: var(--bg);
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 8px;
}
.dsa-expanded .dsa-controls { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dsa-expanded .dsa-controls > * { margin-top: 0; flex: 0 0 auto; }
/* the way back is always in sight: the top row never scrolls away and never wraps */
.dsa-expanded .dsa-controls > .row.spread { flex-wrap: nowrap; }
.dsa-expanded .dsa-controls > .row.spread > .row { flex-wrap: nowrap; min-width: 0; }
.dsa-expanded .dsa-controls > .row.spread button { flex: 0 0 auto; white-space: nowrap; }
.dsa-expanded .dsa-hint, .dsa-expanded #dsaScreenTitle { display: none; }
.dsa-expanded .dsa-view { flex: 1 1 auto; min-height: 0; max-height: none; margin-top: 0; }
.dsa-expanded .dsa-full-note {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0; font-size: 13px; line-height: 1.4; color: var(--warn);
}
.dsa-expanded .dsa-full-note:empty { display: none; }
/* upright, the two rows of controls become strips that scroll sideways instead of eating the height */
.dsa-screen-block.dsa-expanded .dsa-tools, .dsa-screen-block.dsa-expanded .dsa-keys { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.dsa-expanded .dsa-tools::-webkit-scrollbar, .dsa-expanded .dsa-keys::-webkit-scrollbar { display: none; }
.dsa-screen-block.dsa-expanded .dsa-tools > *, .dsa-screen-block.dsa-expanded .dsa-keys > button { flex: 0 0 auto; white-space: nowrap; }
.dsa-screen-block.dsa-expanded .dsa-keys > input { flex: 0 0 190px; width: 190px; }
/* a phone held sideways is wide and low: the controls stand in a column beside the picture */
@media (orientation: landscape) and (max-height: 520px) {
  .dsa-screen-block.dsa-expanded { flex-direction: row; }
  .dsa-expanded .dsa-controls { flex: 0 0 min(232px, 34vw); overflow-y: auto; scrollbar-width: none; }
  .dsa-screen-block.dsa-expanded .dsa-tools, .dsa-screen-block.dsa-expanded .dsa-keys { flex-wrap: wrap; overflow-x: visible; }
  .dsa-screen-block.dsa-expanded .dsa-keys > input { flex: 1 1 100%; width: 100%; }
  .dsa-screen-block.dsa-expanded .dsa-tools > *, .dsa-screen-block.dsa-expanded .dsa-keys > button { flex: 1 1 auto; }
}
.dsa-hint { margin-top: 8px; }
.dsa-hint p { margin: 4px 0 0; }
#auScreenSlot .dsa-screen-block { margin-top: 12px; }
.au-proxy-edit { display: grid; gap: 8px; margin-top: 10px; }
.au-proxy-edit input { margin-top: 0; }

/* ---------- AU settings: four numbered steps ---------- */
.au-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
button.au-chip {
  margin: 0; min-height: 34px; padding: 6px 12px; font-size: 13px; font-weight: 600;
  border-radius: 999px; transform: none; box-shadow: none; background: var(--chip-bg); color: var(--muted);
}
button.au-chip.good { background: var(--good-bg); color: var(--good); }
button.au-chip.warn { background: var(--warn-bg); color: var(--warn); }
button.au-chip.bad { background: var(--bad-bg); color: var(--bad); }
button.au-chip:hover { box-shadow: none; filter: brightness(1.12); }
.au-step {
  margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--row-bg); scroll-margin-top: 16px; transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.au-step.flash { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127, 224, 207, .16); }
.au-step-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.au-step-head h3 { margin: 0; font-size: 15px; color: var(--text); text-transform: none; letter-spacing: -.1px; font-weight: 650; }
.au-step > .status { margin-top: 10px; }
.au-step ul#auSessionList { margin-top: 12px; }
.au-step li.session { margin-bottom: 8px; }
.au-add { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.au-add-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.au-switch { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.au-switch button[aria-pressed="true"] { background: rgba(127, 224, 207, .16); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(127, 224, 207, .45); }
.au-proxy-current { font-size: 14px; margin: 10px 0 4px; }
.au-show { margin-top: 4px; font-size: 13px; color: var(--muted); }
.au-note { font-size: 13px; margin: 6px 0 0; }
.au-under-field { margin-top: 8px; }
.au-hint { margin-top: 8px; }
.au-result { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left-width: 3px; background: var(--row-bg-strong); }
.au-result.ok { border-left-color: var(--good); }
.au-result.bad { border-left-color: var(--bad); }
.au-result > p:first-child { margin-top: 0; }
ul.au-checklist { margin: 8px 0 0; display: grid; gap: 6px; }
.au-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 14px; line-height: 1.45; }
.au-check strong { font-weight: 600; margin-right: 6px; }
.au-check .muted { display: block; font-size: 13px; overflow-wrap: anywhere; }
.au-check-icon { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.au-check.ok .au-check-icon { color: var(--good); background: var(--good-bg); }
.au-check.bad .au-check-icon { color: var(--bad); background: var(--bad-bg); }
.au-check.skip .au-check-icon { color: var(--muted); background: var(--chip-bg); }
.au-check.skip strong { color: var(--muted); }
.au-summary { margin: 10px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
ul.au-advice { margin: 8px 0 0; padding-left: 18px; list-style: disc; font-size: 14px; color: var(--warn); }
ul.au-advice li { margin: 4px 0; line-height: 1.5; }
.au-result .row button { margin-top: 10px; }
:root[data-theme="light"] .au-switch button[aria-pressed="true"] { background: rgba(14, 154, 136, .12); box-shadow: inset 0 0 0 1px rgba(14, 154, 136, .4); }
:root[data-theme="light"] .au-step.flash { box-shadow: 0 0 0 3px rgba(14, 154, 136, .16); }
@media (max-width: 700px) {
  .au-step { padding: 14px 12px; }
  .au-chips { gap: 6px; }
  button.au-chip { flex: 1 1 calc(50% - 6px); }
  .au-switch { display: flex; }
  .au-switch button { flex: 1 1 0; }
}
@media (pointer: coarse) { button.au-chip { min-height: 44px; } }
.dsa-keys { margin-top: 10px; }
.dsa-keys input { flex: 1 1 200px; margin-top: 0; }
.dsa-keys button { margin-top: 0; }
.dsa-summary { display: grid; gap: 6px 14px; grid-template-columns: max-content 1fr; margin: 12px 0; font-size: 14px; }
.dsa-summary div { display: contents; }
.dsa-summary strong { font-weight: 500; overflow-wrap: anywhere; }
#dsaFeed { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.bubble.site { align-self: center; max-width: 92%; background: var(--chip-bg); border-style: dashed; color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .dsa-summary { grid-template-columns: 1fr; } .dsa-summary span { margin-top: 6px; } }
.dsa-report-id { margin: 12px 0; }
.dsa-report-id strong { font-size: 20px; letter-spacing: 1px; user-select: all; color: var(--text); }
.dsa-report-id p { margin: 8px 0 0; }
/* the report went through: a card that draws its own tick once, when it appears */
.dsa-done { display: flex; align-items: center; gap: 18px; margin: 14px 0; padding: 18px 20px; border-radius: 16px; background: var(--good-bg); box-shadow: inset 0 0 0 1px rgba(121, 216, 203, .45); animation: done-in .5s var(--ease) both; }
.dsa-done[hidden] { display: none; }
.dsa-done-mark { flex: 0 0 auto; width: 56px; height: 56px; fill: none; stroke: var(--good); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; animation: done-pulse 1.4s var(--ease) .9s 1 both; border-radius: 50%; }
.dsa-done-mark circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: done-draw .6s var(--ease) .15s forwards; }
.dsa-done-mark path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: done-draw .35s var(--ease) .65s forwards; }
.dsa-done-body { min-width: 0; }
.dsa-done-body strong { display: block; font-size: 19px; color: var(--text); }
.dsa-done-body p { margin: 4px 0 10px; overflow-wrap: anywhere; }
@keyframes done-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes done-draw { to { stroke-dashoffset: 0; } }
@keyframes done-pulse { 0% { box-shadow: 0 0 0 0 rgba(121, 216, 203, .55); } 100% { box-shadow: 0 0 0 18px rgba(121, 216, 203, 0); } }
body.no-effects .dsa-done, body.no-effects .dsa-done-mark { animation: none; }
body.no-effects .dsa-done-mark circle, body.no-effects .dsa-done-mark path { animation: none; stroke-dashoffset: 0; }
#history li.entry.found { box-shadow: inset 0 0 0 1px var(--good); }
#history li.entry.st-dsa_sent { border-left-color: var(--good); }
#history li.entry.st-dsa_partial { border-left-color: var(--warn); }
#history li.entry.st-dsa_failed { border-left-color: var(--bad); }

.report-id-task { margin: 12px 0; }
.report-id-task p { margin: 0 0 8px; }
#history li.entry > button { margin-top: 8px; }

/* ---------- tab order ---------- */
.tab-order-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tab-order-row span { flex: 1; font-size: 14px; }
.tab-order-row button { margin-top: 0; min-width: 40px; padding: 4px 10px; }
.tab.dragging { opacity: .45; }
#pageTitle.welcome { animation: rise .6s var(--ease) both; }
li.proxy-row .session-head .chip:empty { display: none; }
.badge-count.bad { background: var(--bad); color: #1a0b0a; }
li.entry .pick { margin-right: 8px; vertical-align: middle; }
li.entry .meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); white-space: pre-wrap; }

/* the accepted proxy forms under every proxy field: long samples wrap instead of widening the phone page */
.proxy-forms { line-height: 1.8; overflow-wrap: anywhere; }
