/* Pier App-Store – the look of Pier (same tokens: dark theme, marigold accent), laid out as a public website. */

:root {
  --bg: #1A1F29;
  --bg-sidebar: #151A22;
  --surface: #222835;
  --surface-raised: #2A3140;
  --hover: #232A37;
  --border: #333B4C;
  --border-strong: #48526A;
  --text: #E7EAF0;
  --text-muted: #8E97AA;
  --text-faint: #5E6779;
  --accent: #F5B83D;
  --accent-hover: #F8C55E;
  --accent-pressed: #E3A62C;
  --on-accent: #1A1F29;
  --blue: #6FA8F5;
  --violet: #C38FF0;
  --teal: #4FD1C5;
  --orange: #F59E4C;
  --success: #7FCB6E;
  --danger: #F2727F;

  --font-text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --r: 6px;
  --r-pop: 10px;
  --page: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font-text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 16px; line-height: 1.3; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, pre, .mono { font-family: var(--font-mono); }
.mono { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.danger { color: var(--danger); }
.ok { color: var(--success); }
.hint { color: var(--text-muted); font-size: 12.5px; }
.small { font-size: 12px; }
.grow { flex: 1 1 auto; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.break { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt { margin-top: 12px; }
.mt-s { margin-top: 6px; }
.mb { margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.icon { display: block; flex: none; }
.boot { padding: 40px; color: var(--text-muted); }

/* ------------------------------------------------------------------ shell: top bar, page, footer */

.shell { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1000px 640px at 15% 0, color-mix(in srgb, var(--accent) 5%, transparent), transparent 72%), var(--bg); }
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg-sidebar) 92%, transparent); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px); }
.topbar-inner { max-width: var(--page); margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 16px var(--font-display); text-decoration: none; white-space: nowrap; min-width: 0; }
.brand-mark { color: var(--accent); }
.brand-name { overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: var(--r); color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nav-count { font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: var(--on-accent); display: inline-grid; place-items: center; font-weight: 600; }
.top-search { flex: 1 1 260px; max-width: 360px; margin-left: auto; position: relative; }
.top-search input[type=search] { padding-left: 34px; height: 34px; background: var(--surface); }
.top-search .icon { position: absolute; left: 10px; top: 9px; color: var(--text-faint); pointer-events: none; }
.account { display: flex; align-items: center; gap: 6px; }
.topbar .menu-toggle { display: none; }
.page { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 28px 24px 64px; outline: none; }
.footer { border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12.5px; }
.footer-inner { max-width: var(--page); margin: 0 auto; padding: 18px 24px 26px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.footer a { color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.footer a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ controls */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:active:not(:disabled) { background: var(--accent-pressed); }
.btn-secondary { background: var(--surface-raised); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--border-strong); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--danger); color: var(--on-accent); font-weight: 600; }
.btn-ghost-danger { color: var(--danger); }
.btn-ghost-danger:hover:not(:disabled) { background: rgba(242, 114, 127, .1); }
.btn-small { height: 27px; padding: 0 10px; font-size: 12.5px; }
.btn-big { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r); border: 0; background: transparent; color: var(--text-muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], input[type=email], input:not([type]), select, textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); padding: 0 10px; height: 34px; min-width: 0; width: 100%; }
textarea { padding: 8px 10px; height: auto; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; flex: none; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span:first-child { color: var(--text-muted); font-size: 12.5px; }
.field .hint { margin-top: 1px; }
.field-foot { display: flex; justify-content: space-between; gap: 10px; }
.counter { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter.over { color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 3px 0; }
.check input { margin-top: 3px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-error { color: var(--danger); min-height: 18px; white-space: pre-line; }

.segments { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg { border: 0; background: transparent; color: var(--text-muted); padding: 0 12px; height: 30px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.seg + .seg { border-left: 1px solid var(--border); }
.seg:hover { color: var(--text); background: var(--hover); }
.seg.active { background: var(--surface-raised); color: var(--text); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--text-muted)) 14%, transparent); color: var(--c, var(--text-muted)); font-weight: 500; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill-ok { --c: var(--success); }
.pill-warn { --c: var(--orange); }
.pill-danger { --c: var(--danger); }
.pill-info { --c: var(--blue); }
.pill-accent { --c: var(--accent); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; white-space: nowrap; color: var(--text-muted); text-decoration: none; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.chip .count { color: var(--text-faint); font-size: 12px; }
.chip.active .count { color: color-mix(in srgb, var(--on-accent) 70%, transparent); }
.chip.static { cursor: default; height: 22px; padding: 0 8px; font-size: 12px; background: var(--surface-raised); border: 0; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------------ blocks */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pop); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .03); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { flex: 1; }
.card.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.view-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head .titles { flex: 1 1 320px; min-width: 0; }
.view-sub { color: var(--text-muted); padding-top: 8px; line-height: 1.5; max-width: 760px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; margin-bottom: 14px; font-size: 13px; }
.back:hover { color: var(--accent); }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; flex: 1; }
.section-head a { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.section-head a:hover { color: var(--accent); }

.callout { border: 1px solid var(--border); background: var(--surface-raised); border-radius: var(--r); padding: 11px 13px; line-height: 1.5; }
.risk { border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, transparent); border-radius: var(--r); padding: 11px 13px; }
.warnbox { border: 1px solid color-mix(in srgb, var(--orange) 40%, var(--border)); background: color-mix(in srgb, var(--orange) 7%, transparent); border-radius: var(--r); padding: 11px 13px; }
.okbox { border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border)); background: color-mix(in srgb, var(--success) 7%, transparent); border-radius: var(--r); padding: 11px 13px; }
.box-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.risk .box-title { color: var(--danger); }
.okbox .box-title { color: var(--success); }
.warnbox .box-title { color: var(--orange); }
.list { margin: 6px 0 0; padding-left: 18px; }
.list li { margin: 4px 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px 9px; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-count { color: var(--text-faint); font-weight: 400; font-size: 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(51, 59, 76, .55); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table tbody tr:hover { background: var(--hover); }
.table a { text-decoration: none; }
.table a:hover { color: var(--accent); }
.cell-app { display: flex; align-items: center; gap: 10px; min-width: 0; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; max-width: 520px; margin: 48px auto 0; padding: 0 16px; color: var(--text-muted); }
.empty-state.compact { margin: 18px auto 10px; gap: 6px; }
.empty-icon { color: var(--text-faint); }
.empty-title { color: var(--text); font-weight: 600; font-size: 16px; }
.empty-text { line-height: 1.5; }
.empty-action { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------------ app icons and cards */

.app-icon { width: 40px; height: 40px; border-radius: 9px; flex: none; object-fit: contain; background: var(--surface-raised); }
.app-icon.small { width: 26px; height: 26px; border-radius: 6px; }
.app-icon.large { width: 72px; height: 72px; border-radius: 16px; }
.app-letter { display: inline-grid; place-items: center; font: 600 17px var(--font-display); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.app-letter.small { font-size: 12px; }
.app-letter.large { font-size: 30px; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); gap: 14px; }
.app-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pop);
  text-decoration: none; min-width: 0; transition: border-color .15s ease-out, transform .15s ease-out; }
.app-card:hover { border-color: #3D4659; transform: translateY(-1px); }
.app-card:hover .app-card-name { color: var(--accent); }
.app-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-card-name { font: 600 15px var(--font-display); }
.app-card-meta { color: var(--text-faint); font-size: 12px; }
.app-card-summary { color: var(--text-muted); line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-faint); font-size: 12px; }
.app-card-foot .sep { flex: 1; }
.app-card-foot .stat { display: inline-flex; align-items: center; gap: 4px; }
.risk-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--orange); }

/* ------------------------------------------------------------------ start page */

.hero { padding: 26px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.hero h1 { font-size: 34px; letter-spacing: -.01em; }
.hero p { color: var(--text-muted); font-size: 15.5px; max-width: 680px; line-height: 1.55; }
.hero-search { position: relative; max-width: 620px; margin-top: 8px; }
.hero-search input[type=search] { height: 46px; font-size: 15.5px; padding-left: 42px; background: var(--surface); border-radius: 8px; }
.hero-search .icon { position: absolute; left: 14px; top: 15px; color: var(--text-faint); pointer-events: none; }
.filters { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 4px; }
.result-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }
.result-head h2 { flex: 1; font-size: 18px; }

/* ------------------------------------------------------------------ app page */

.app-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: start; margin-bottom: 22px; }
.app-head h1 { font-size: 30px; }
.app-head .summary { color: var(--text-muted); font-size: 15.5px; margin-top: 6px; line-height: 1.5; }
.app-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-muted); font-size: 13px; margin-top: 10px; align-items: center; }
.app-meta span { display: inline-flex; align-items: center; gap: 6px; }
.app-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 220px; }
.app-actions .hint { text-align: center; }
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.prose { line-height: 1.65; color: var(--text); }
.prose p + p { margin-top: 10px; }
.prose a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.prose a:hover { text-decoration: underline; }
.install-steps { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
.install-steps li + li { margin-top: 3px; }
.links { display: flex; flex-direction: column; gap: 8px; }
.links a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.links a:hover { color: var(--accent); }
.versions { display: flex; flex-direction: column; }
.version { padding: 13px 0; border-top: 1px solid rgba(51, 59, 76, .55); display: flex; flex-direction: column; gap: 6px; }
.version:first-child { border-top: 0; padding-top: 2px; }
.version.withdrawn { opacity: .65; }
.version-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-head .v { font: 600 14px var(--font-mono); }
.changelog-text { white-space: pre-line; color: var(--text-muted); line-height: 1.55; }
.sha { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sha code { font-size: 11.5px; color: var(--text-faint); overflow-wrap: anywhere; }
.version-risks { color: var(--orange); font-size: 12.5px; }
.report-link { background: none; border: 0; padding: 0; color: var(--text-faint); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.report-link:hover { color: var(--danger); }
.banner { border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; }

/* ------------------------------------------------------------------ upload */

.drop { border: 1.5px dashed var(--border-strong); border-radius: var(--r-pop); padding: 30px 20px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column;
  align-items: center; gap: 10px; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.drop .icon { color: var(--accent); }
.drop strong { color: var(--text); font-size: 15px; }
.drop.busy { pointer-events: none; opacity: .85; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--border); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--border); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; transition: width .2s linear; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.upload-status { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.token-value { display: flex; gap: 6px; align-items: center; }
.token-value code { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; overflow-wrap: anywhere; font-size: 12.5px; }
pre.snippet { background: #12161D; border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: pre; margin: 6px 0 0; color: #C5CBD6; }

/* ------------------------------------------------------------------ sign-in pages */

.auth-page { display: grid; place-items: start center; padding-top: 4vh; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pop); padding: 28px 26px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04); }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .lead { color: var(--text-muted); margin-bottom: 18px; line-height: 1.5; }
.auth-card .btn-primary { width: 100%; height: 38px; margin-top: 4px; }
.auth-card .switch { margin-top: 16px; color: var(--text-muted); text-align: center; }
.auth-card .switch a { color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------------ modal, toast, menu */

.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 13, 18, .6); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; z-index: 50; }
.modal { width: 100%; max-width: 500px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pop); display: flex; flex-direction: column; max-height: 86vh;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04); }
.modal-wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 6px 20px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 10px 20px 18px; overflow-y: auto; line-height: 1.5; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); justify-content: flex-end; flex-wrap: wrap; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 90; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { --kind: var(--blue); position: relative; overflow: hidden; display: flex; gap: 10px; align-items: flex-start; pointer-events: auto; background: var(--surface-raised);
  border: 1px solid var(--border); border-radius: var(--r-pop); padding: 12px 10px 12px 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); white-space: pre-line; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kind); }
.toast-error { --kind: var(--danger); }
.toast-ok { --kind: var(--success); }
.toast-msg { flex: 1; min-width: 0; line-height: 1.45; overflow-wrap: anywhere; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in 160ms ease-out; } }

.menu { position: fixed; z-index: 70; min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pop); padding: 5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 9px; height: 32px; padding: 0 10px; border: 0; background: transparent; border-radius: var(--r); cursor: pointer;
  text-align: left; color: var(--text); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
.menu .menu-label { padding: 6px 10px 4px; color: var(--text-faint); font-size: 12px; }

/* ------------------------------------------------------------------ narrow windows and phones */

@media (max-width: 980px) {
  .app-layout { grid-template-columns: minmax(0, 1fr); }
  .app-head { grid-template-columns: auto minmax(0, 1fr); }
  .app-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; min-width: 0; }
  .app-actions .hint { text-align: left; }
}

@media (max-width: 820px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .topbar .menu-toggle { display: inline-flex; margin-left: auto; }
  .nav, .account { display: none; width: 100%; }
  .topbar.open .nav, .topbar.open .account { display: flex; flex-wrap: wrap; }
  .top-search { order: 5; max-width: none; flex-basis: 100%; margin-left: 0; }
  .page { padding: 20px 16px 56px; }
  .hero h1 { font-size: 26px; }
  .app-head h1 { font-size: 24px; }
  .app-icon.large { width: 56px; height: 56px; border-radius: 12px; }
  .card { padding: 16px; }
  .modal-backdrop { padding: 16px 10px; }
  .modal { max-height: calc(100vh - 32px); }
  .table .hide-sm { display: none; }
  .footer-inner { padding: 16px; }
}
