/* Screen Master – web viewer. Dark UI (a remote-desktop client sits next to the remote screen, dark keeps focus on it). */
:root {
  --bg: #0a0d13; --bg-2: #0e121a; --surface: #131822; --surface-2: #19202d; --elev: #1f2736;
  --border: #242c3b; --border-2: #303a4d; --text: #e8ecf4; --muted: #8b95aa; --dim: #5c6679;
  --accent: #4d8dff; --accent-2: #7b5cff; --accent-soft: rgba(77, 141, 255, .14);
  --ok: #34d399; --warn: #fbbf24; --danger: #f2555a; --danger-soft: rgba(242, 85, 90, .12);
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom); --sal: env(safe-area-inset-left); --sar: env(safe-area-inset-right);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overscroll-behavior: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { overflow: hidden; }
.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace; font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

/* icons */
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; } .ic.xl { width: 44px; height: 44px; stroke-width: 1.5; }
.logo { width: 28px; height: 28px; flex: 0 0 auto; } .logo-lg { width: 60px; height: 60px; filter: drop-shadow(0 8px 24px rgba(91, 110, 255, .35)); }

/* screens */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* buttons */
button { font: inherit; color: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 15px; transition: background .15s, transform .08s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, #4d8dff, #6a6cff); box-shadow: 0 6px 18px rgba(77, 120, 255, .28); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: var(--border-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger-soft); color: #ff8a8e; border-color: rgba(242, 85, 90, .35); }
.btn.danger:hover { background: rgba(242, 85, 90, .2); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { background: var(--elev); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
input.otp { letter-spacing: .5em; font-variant-numeric: tabular-nums; text-align: center; font-size: 20px; }
input.otp::placeholder { color: var(--dim); }
.form-error { color: #ff8a8e; min-height: 1.3em; margin: 0; font-size: 13.5px; }

/* spinner */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-top-color: #fff; display: none; }
.btn.loading .spinner.sm { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ login */
.view-login { align-items: center; justify-content: center; padding: calc(24px + var(--sat)) 16px calc(24px + var(--sab)); overflow-y: auto;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(77, 141, 255, .16), transparent 60%), radial-gradient(800px 500px at 100% 110%, rgba(123, 92, 255, .12), transparent 60%), var(--bg); }
.auth-card { width: min(100%, 390px); display: flex; flex-direction: column; gap: 14px; padding: 28px 24px 20px; background: rgba(19, 24, 34, .85);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.brand-lg { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 8px; }
.brand-lg h1 { font-size: 24px; font-weight: 700; margin-top: 4px; }
.brand-lg p { margin: 0; font-size: 14px; }
.auth-foot { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12.5px; margin: 18px 0 0; text-align: center; }

/* ------------------------------------------------------------ devices */
.topbar { display: flex; align-items: center; gap: 4px; padding: calc(8px + var(--sat)) calc(10px + var(--sar)) 8px calc(16px + var(--sal));
  background: rgba(10, 13, 19, .8); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.page { flex: 1; overflow-y: auto; padding: 20px calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal)); }
.page > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h2 { font-size: 22px; font-weight: 700; }
/* cockpit: search + tiles with the last preview of each station */
#view-devices .page > * { max-width: 1480px; }
.dev-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1 1 280px; position: relative; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 13px; color: var(--dim); pointer-events: none; }
.search input { height: 42px; padding: 0 76px 0 40px; font-size: 15px; }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.search-kbd { position: absolute; right: 10px; padding: 3px 6px; border: 1px solid var(--border-2); border-radius: 6px; color: var(--dim); font: 11px/1 ui-monospace, Consolas, monospace; pointer-events: none; }
.search input:focus ~ .search-kbd, .search input:not(:placeholder-shown) ~ .search-kbd { display: none; }
.seg.filter { flex: 0 0 auto; }
.seg.filter button { flex: 0 0 auto; padding: 0 13px; height: 34px; }
.devices { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.device { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, background .15s, box-shadow .15s; }
.device.online:hover { border-color: var(--border-2); box-shadow: 0 6px 22px rgba(0, 0, 0, .35); }
.tile-shot { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; border-bottom: 1px solid var(--border); background: #05070b; overflow: hidden; }
.device.offline .tile-shot { cursor: default; }
.shot-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .25s ease, filter .2s; }
.device.online .tile-shot:hover .shot-img { transform: scale(1.03); }
.device.offline .shot-img { filter: grayscale(.85) brightness(.5); }
.shot-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--dim); background: radial-gradient(120% 90% at 50% 0%, var(--surface-2), #07090e 70%); }
.device.online .shot-empty { color: var(--accent); }
.shot-state { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px;
  background: rgba(8, 10, 15, .8); color: var(--muted); font-size: 11.5px; font-weight: 650; backdrop-filter: blur(6px); }
.shot-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.device.online .shot-state { color: var(--ok); }
.device.online .shot-state .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.shot-go { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(8, 12, 20, .5);
  color: #fff; font-weight: 650; font-size: 15px; opacity: 0; transition: opacity .15s; }
.device.online .tile-shot:hover .shot-go, .tile-shot:focus-visible .shot-go { opacity: 1; }
.tile-shot:focus-visible { outline-offset: -3px; }
.dev-text { min-width: 0; padding: 10px 8px 2px 14px; }
.tile-head { display: flex; align-items: center; gap: 4px; }
.dev-name { flex: 1; min-width: 0; font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-more { width: 32px; height: 32px; margin: -4px 0; flex: 0 0 auto; }
.dev-note { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-status { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.device.online .dev-status { color: var(--ok); }
.tile-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 12px 12px; margin-top: auto; }
.dev-view { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 9px;
  border: 1px solid var(--border-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.dev-view:hover { background: var(--surface-2); color: var(--text); }
.dev-view:active { background: var(--elev); }
.device.offline .dev-view { display: none; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .ic { color: var(--dim); margin-bottom: 8px; }
.skeleton { aspect-ratio: 230 / 215; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }

/* ⋮ menu of a tile */
.popmenu { position: fixed; z-index: 60; min-width: 210px; display: flex; flex-direction: column; gap: 2px; padding: 5px; background: var(--elev); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); }
.pm-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 14px; font-weight: 550; }
.pm-item .ic { color: var(--muted); }
.pm-item:hover, .pm-item:focus-visible { background: var(--surface-2); outline: none; }
.pm-item.danger { color: #ff8a8e; }
.pm-item.danger .ic { color: var(--danger); }
.pm-item.danger:hover, .pm-item.danger:focus-visible { background: var(--danger-soft); }
.pm-sep { height: 1px; margin: 4px 6px; background: var(--border-2); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ session */
.view-session { background: #000; touch-action: none; }
.view-session.bar-hidden .sbar { display: none; }
.sbar { display: flex; align-items: center; gap: 2px; padding: calc(4px + var(--sat)) calc(6px + var(--sar)) 4px calc(4px + var(--sal)); background: var(--bg); border-bottom: 1px solid var(--border); z-index: 3; }
.sbar .icon-btn { width: 40px; height: 40px; }
.s-title { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; padding-left: 2px; }
.s-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.view-pill { flex: 0 0 auto; padding: 1px 7px; border-radius: 999px; background: rgba(251, 191, 36, .14); color: var(--warn); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.icon-btn.view-only { color: var(--warn); background: rgba(251, 191, 36, .12); }
.s-name { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-stats { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.conn-dot.good { background: var(--ok); } .conn-dot.fair { background: var(--warn); } .conn-dot.bad { background: var(--danger); }
.conn-dot.wait { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

#stage { flex: 1; position: relative; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#cursor { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 0 0; will-change: transform; display: none;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .95)) drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); image-rendering: auto; z-index: 1; }
#cursor.show { display: block; }
.zoom-badge { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: rgba(15, 18, 26, .82);
  border: 1px solid var(--border-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 2; }
.zoom-badge.show { opacity: 1; }
.fab { position: absolute; top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); z-index: 6; width: 44px; height: 44px; touch-action: manipulation; border-radius: 50%; border: 1px solid var(--border-2);
  background: rgba(15, 18, 26, .7); color: var(--text); display: grid; place-items: center; backdrop-filter: blur(8px); opacity: .75; }
.fab:hover { opacity: 1; }

/* session on a computer: the whole window is the remote screen. The bar hides above the top edge and slides out
   from a small handle stuck to that edge (25 % visible while working, full on hover). */
.bar-handle { display: none; }
body.desk .view-session .sbar { position: absolute; top: 0; left: 50%; z-index: 7; width: max-content; max-width: calc(100% - 16px); gap: 0;
  padding: 2px 6px 2px 4px; border: 1px solid var(--border-2); border-top: 0; border-radius: 0 0 12px 12px; background: rgba(12, 15, 22, .94);
  backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); transform: translate(-50%, calc(-100% - 30px)); visibility: hidden;
  transition: transform .18s ease, visibility 0s linear .18s; }
body.desk .view-session.bar-open .sbar { transform: translate(-50%, 0); visibility: visible; transition: transform .18s ease, visibility 0s; }
body.desk .sbar .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
body.desk .sbar .icon-btn .ic { width: 18px; height: 18px; }
body.desk .sbar .grow { flex: 0 0 12px; }
body.desk .s-title { max-width: 280px; }
body.desk .s-name { font-size: 13.5px; }
body.desk .s-stats { font-size: 11.5px; }
body.desk #btn-hide-bar, body.desk #btn-show-bar { display: none !important; }
body.desk .bar-handle { display: grid; place-items: center; position: absolute; top: 0; left: 50%; z-index: 6; width: 40px; height: 11px; padding: 0;
  transform: translateX(-50%); border: 0; border-radius: 0 0 7px 7px; background: rgba(34, 41, 56, .95); color: var(--text); opacity: .25;
  transition: opacity .15s, width .15s, height .15s; }
body.desk .bar-handle .ic { width: 12px; height: 12px; stroke-width: 2.6; }
body.desk .bar-handle:hover, body.desk .bar-handle:focus-visible { opacity: 1; width: 56px; height: 16px; background: var(--accent); }
body.desk .view-session.bar-open .bar-handle { opacity: 0; pointer-events: none; }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5, 7, 11, .78); backdrop-filter: blur(4px); z-index: 4; touch-action: auto; }
.overlay-card { width: min(100%, 440px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 22px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); max-height: 100%; overflow-y: auto; }
.ov-icon:empty { display: none; }
.ov-icon .ic { width: 40px; height: 40px; }
.ov-icon.error { color: var(--danger); } .ov-icon.warn { color: var(--warn); } .ov-icon.info { color: var(--accent); }
.ov-title { font-weight: 700; font-size: 17px; }
.ov-title:empty, .ov-msg:empty { display: none; }
.ov-msg { color: var(--muted); font-size: 14.5px; }
#ov-extra { width: 100%; }
#ov-extra:empty { display: none; }
#ov-extra textarea { margin-top: 6px; font-size: 12.5px; }
.ov-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; width: 100%; }
.ov-actions .btn { flex: 1 1 140px; }

.keybar { background: var(--bg); border-top: 1px solid var(--border); padding: 6px calc(6px + var(--sar)) calc(6px + var(--sab)) calc(6px + var(--sal)); z-index: 3; touch-action: pan-x; }
.kb-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.kb-row::-webkit-scrollbar { display: none; }
.kb-row button { flex: 0 0 auto; min-width: 44px; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; font-weight: 550; }
.kb-row button:active { background: var(--elev); }
.kb-row button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.kb-sep { flex: 0 0 1px; height: 24px; background: var(--border-2); margin: 0 2px; }
#kbd-input { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; pointer-events: none; }

/* ------------------------------------------------------------ dialogs */
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: 0; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(3, 5, 9, .62); backdrop-filter: blur(3px); }
.modal { width: min(440px, calc(100vw - 32px)); border-radius: 18px; padding: 22px; }
.modal[open], .modal form { display: flex; flex-direction: column; gap: 14px; }
.modal h3 { font-size: 18px; }
.modal p { margin: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.modal-actions .btn { min-width: 110px; }
.modal-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.modal-icon.warn { background: rgba(251, 191, 36, .12); color: var(--warn); }
.modal-icon .ic { width: 28px; height: 28px; }
.fp-box { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fp-box .k { font-size: 12.5px; color: var(--muted); }
.fp-box code { background: none; border: 0; padding: 0; font-size: 13.5px; letter-spacing: .02em; }
.fp-box code.old { color: #ff8a8e; text-decoration: line-through; }

.sheet { width: min(480px, 100vw); max-width: 100vw; max-height: min(88vh, 88dvh); border-radius: 20px; overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
@media (max-width: 560px) {
  .sheet { margin: auto auto 0; width: 100vw; border-radius: 20px 20px 0 0; border-bottom: 0; }
  .sheet[open] { animation: sheet-up .22s ease-out; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 20px; }
.sheet-head h3 { font-size: 17px; }
.sheet-body { overflow-y: auto; padding: 4px 20px calc(20px + var(--sab)); display: flex; flex-direction: column; gap: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 9px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.stat-grid .k { font-size: 11.5px; color: var(--muted); }
.stat-grid .v { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-grid > .wide { grid-column: 1 / -1; }
.stat-grid .v.warn { color: var(--warn, #f5b041); }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hint { margin: 0; font-size: 12.5px; color: var(--dim); }
.seg { display: flex; padding: 3px; gap: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; padding: 0 4px; transition: background .15s, color .15s; }
.seg button.on { background: var(--elev); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  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='%238b95aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; font-weight: 550; text-align: left; }
.tile .ic { color: var(--accent); }
.tile:active { background: var(--elev); }
.muted-tile { opacity: .55; }
.help { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13.5px; }
.help summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.help summary::-webkit-details-marker { display: none; }
.help ul { margin: 10px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.help b { color: var(--text); font-weight: 600; }
.fp { margin: 0; font-size: 12.5px; color: var(--dim); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--sab)); transform: translate(-50%, 16px); max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px;
  background: #222b3b; border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 14px; font-weight: 550; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(242, 85, 90, .5); color: #ffb0b3; }

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sbar .icon-btn { width: 36px; }
  #btn-fs { display: none; }
  .dev-view span { display: none; }
  .dev-view { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h3:focus-visible { outline: none; }
.minimap { position: absolute; right: calc(10px + var(--sar)); bottom: 10px; z-index: 2; border: 1px solid rgba(255, 255, 255, .55); background: rgba(10, 13, 19, .55);
  border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); pointer-events: none; opacity: 0; transition: opacity .25s; overflow: hidden; }
.minimap.show { opacity: 1; }
#mm-view { position: absolute; border: 1.5px solid var(--accent); background: rgba(77, 141, 255, .22); border-radius: 2px; }

/* ------------------------------------------------------------ account & security (konto.js) */
.banners { display: grid; gap: 8px; margin-bottom: 10px; }
.banners:empty { display: none; }
.banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 11px 12px 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--surface); font-size: 14px; }
.banner .btn { height: 36px; padding: 0 14px; }
.banner.warn { border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .07); }
.banner.info { border-color: rgba(77, 141, 255, .35); background: var(--accent-soft); }
.banner.danger { border-color: rgba(242, 85, 90, .45); background: var(--danger-soft); color: #ffb3b5; font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .08); }
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .08); margin-left: 8px; }
.tabs { max-width: 760px; margin: 0 auto 16px; }
.k-body { display: grid; gap: 14px; }
.k-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.k-sec h3 { font-size: 15px; color: var(--muted); font-weight: 650; }
.k-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.k-sec h3 + .k-row, .k-sec h3 + div > .k-row:first-child { border-top: 0; }
.k-row .btn { height: 36px; padding: 0 14px; }
.k-main { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.k-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ev-list { display: grid; gap: 0; }
.ev { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.ev:first-child { border-top: 0; }
.ev.important .k-main > span:first-child { color: var(--warn); }
.ev-time { flex: 0 0 104px; font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; padding-top: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.big-code { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .04em; text-align: center; padding: 14px 10px;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); overflow-wrap: anywhere; user-select: all; }
.share-list { display: grid; gap: 6px; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--bg-2); border-radius: var(--radius-sm); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select, input[type=date] { height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text); padding: 0 10px; font: inherit; }
.rk-card { display: grid; gap: 8px; padding: 16px; border: 2px dashed var(--border-2); border-radius: var(--radius-sm); background: var(--bg-2); }
.rk-title { font-weight: 700; font-size: 16px; }
.rk-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: baseline; font-size: 13.5px; }
.rk-row span:first-child { color: var(--muted); }
.rk-seed { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } .rk-row { grid-template-columns: 1fr; gap: 2px; } .ev-time { flex-basis: 78px; } }
@media print {
  body * { visibility: hidden !important; }
  #rk-print, #rk-print * { visibility: visible !important; color: #000 !important; }
  #rk-print { position: fixed; left: 0; top: 0; width: 100%; background: #fff !important; border-color: #000 !important; }
}
