/* MillionFiles — net positive ventures "Daylight Studio" brand layer.
   Self-hosted fonts, brand tokens, on-brand components. */

/* ---------- fonts (self-hosted, latin) ---------- */
@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/public-sans-var.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --navy: #1D2A41;
  --deep-blue: #003767;
  --sky: #00A2D5;
  --sky-ink: #0A6E91;
  --cta: #0089B8;
  --cta-hover: #0A6E91;
  --cta-active: #115975;
  --cta-ink: #F2FAFE;
  --spark: #F04923;
  --daylight: #ECF8FE;

  --canvas: #F4F7FB;
  --surface: #FBFCFE;
  --border: #D8E0EA;
  --muted: #647488;
  --slate-100: #E9EEF4;
  --slate-300: #BAC6D4;
  --slate-400: #8C9BAD;
  --slate-700: #344150;

  --font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 10px;

  --lift: 0 2px 8px rgba(29,42,65,.08);
  --float: 0 8px 24px rgba(29,42,65,.12);
  --focus: 0 0 0 3px rgba(0,162,213,.40);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--navy);
  background: var(--canvas);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky-ink); text-decoration: none; }
a:hover { color: var(--cta); text-decoration: underline; }

h1, h2, h3 { color: var(--navy); font-weight: 700; letter-spacing: -0.015em; line-height: 1.12; margin: 0; }

/* mono micro-label */
.label, .field > span, .table th {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.num, .fi-size, .ri-size, .table td, .table th { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 26px; height: 26px; display: block; }
.logo-word { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--navy); }
.logo-word .logo-accent { color: var(--sky); }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.nav a:hover { color: var(--navy); text-decoration: none; }
.logout { margin: 0; }
.logout button {
  background: none; border: none; cursor: pointer; padding: 0; color: var(--muted);
  font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em;
}
.logout button:hover { color: var(--spark); }
.nav-burger { display: none; } /* shown only on narrow screens (see media query) */

/* ---------- layout ---------- */
.main { max-width: 960px; margin: 0 auto; padding: 56px 32px 80px; }
body.wide .main { max-width: 1180px; padding: 36px 32px 28px; }

h1 { font-size: 36px; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 18px; max-width: 46ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--sky-ink); margin: 0 0 18px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 18px; border-radius: var(--r-md); border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
}
.btn.primary {
  background: var(--cta); color: var(--cta-ink);
  box-shadow: 0 1px 2px rgba(0,75,110,.28), inset 0 -1px 0 0 rgba(0,30,55,.32), inset 0 1px 0 0 rgba(255,255,255,.15);
}
.btn.primary:hover { background: var(--cta-hover); transform: translateY(-1px); text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,120,170,.34), inset 0 -1px 0 0 rgba(0,30,55,.32); }
.btn.primary:active { background: var(--cta-active); transform: translateY(0); }
.btn.primary:focus-visible { outline: none; box-shadow: var(--focus), inset 0 -1px 0 0 rgba(0,30,55,.32); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--navy); }
.btn.ghost:hover { background: var(--daylight); border-color: var(--sky); transform: translateY(-1px); text-decoration: none; }
.btn.ghost:focus-visible { outline: none; box-shadow: var(--focus); }
.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--sky-ink); font: inherit; font-size: inherit;
}
.linklike:hover { color: var(--cta); text-decoration: underline; }
.linklike.danger { color: var(--muted); }
.linklike.danger:hover { color: var(--spark); }

/* ---------- auth ---------- */
.auth-card { max-width: 380px; margin: 12vh auto 0; text-align: center; }
.auth-mark { width: 56px; height: 56px; margin: 0 auto 22px; display: block; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.auth-form input {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  font: inherit; font-size: 16px; background: var(--surface); color: var(--navy);
}
.auth-form input::placeholder { color: var(--slate-400); }
.auth-form input:focus { outline: none; border-color: var(--sky); box-shadow: var(--focus); }
.error { color: var(--spark); font-size: 14px; }
.auth-tag {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--slate-400); margin-top: 34px;
}
.auth-alt { margin-top: 20px; font-size: 14px; color: var(--slate-500); }
.auth-alt a { font-weight: 600; }

/* ---------- split (send / drop) ---------- */
.split { display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: 52px; align-items: center; min-height: 62vh; }
.split-left h1 { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.0; }
.split-right { width: 100%; }

/* ---------- dropzone (signature) ---------- */
.dropzone {
  border: 1.5px dashed var(--slate-300); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), var(--daylight));
  padding: 44px 32px; display: flex; flex-direction: column; align-items: center; gap: 18px;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
  min-height: 330px; justify-content: center;
}
.dropzone.dragover { border-color: var(--sky); border-style: solid; box-shadow: var(--focus); background: var(--daylight); }
.dz-arrow {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--surface); color: var(--sky); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
  box-shadow: var(--lift);
}
.dz-title { font-size: 19px; font-weight: 700; color: var(--navy); margin: 0; letter-spacing: -0.01em; }
.dz-idle { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dz-idle p { margin: 0; }

.file-list { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.file-list:empty { display: none; }
.file-list li {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; font-size: 14px;
}
.file-list .fi-icon { font-size: 17px; }
.file-list .fi-name { font-weight: 500; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-list .fi-size { color: var(--muted); font-size: 13px; }
.file-list .fi-remove { color: var(--slate-400); }

.dz-controls { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field input, .field select {
  font: inherit; font-size: 15px; color: var(--navy);
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
}
.field input::placeholder { color: var(--slate-400); }
.field input:focus, .field select:focus { outline: none; border-color: var(--sky); box-shadow: var(--focus); }
.actions { display: flex; gap: 12px; justify-content: flex-end; }

.progress { width: 100%; }
.bar { height: 8px; background: var(--slate-100); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: var(--sky); transition: width .2s var(--ease); }

.result { margin-top: 24px; text-align: center; }
.result .ok { color: var(--sky-ink); font-weight: 700; font-size: 17px; margin: 0 0 14px; }
.ok { color: var(--sky-ink); }
.link-row { display: flex; gap: 10px; max-width: 540px; margin: 0 auto; }
.link-row input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  font: inherit; font-size: 14px; color: var(--navy); background: var(--daylight);
}
.link-row input:focus { outline: none; border-color: var(--sky); box-shadow: var(--focus); }

/* ---------- dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.table-wrap { margin-top: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 13px 16px; background: var(--canvas); border-bottom: 1px solid var(--border); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--slate-700); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: var(--daylight); }
.table .name { font-weight: 600; color: var(--navy); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 16px; align-items: center; white-space: nowrap; }
.tag {
  font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
}
.tag.send { background: var(--daylight); color: var(--sky-ink); }
.tag.drop { background: #E3ECF5; color: var(--deep-blue); }

/* dialog */
dialog {
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--float);
  width: min(440px, 92vw); background: var(--surface); color: var(--navy);
}
dialog::backdrop { background: rgba(29,42,65,.42); }
.dialog-form { display: flex; flex-direction: column; gap: 16px; }
.dialog-form h2 { font-size: 1.3rem; }
.dialog-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--daylight);
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
/* In the centered auth card (no flex parent), the icon is a block box, so auto
   margins are what center it horizontally. */
.auth-card .dialog-icon { margin: 0 auto 16px; }
#created-dialog .link-row { margin: 0; max-width: none; }
#created-dialog .actions { justify-content: flex-end; }

/* ---------- viewer (list + preview) ---------- */
.viewer-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding-top: 4px; }
.vw-headings { min-width: 0; }
.viewer-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.expiry-note {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.expiry-note.expiry-urgent { color: var(--spark); }
.lock-badge { margin-right: 6px; font-size: 0.95em; vertical-align: baseline; }
.viewer-body {
  display: grid; grid-template-columns: 312px 1fr;
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
  height: clamp(420px, calc(100vh - 280px), 1000px);
}
.file-rail { border-right: 1px solid var(--border); background: var(--canvas); padding: 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.rail-item { display: flex; align-items: center; gap: 4px; border-radius: var(--r-md); width: 100%; transition: background .12s var(--ease); }
.rail-item:hover { background: var(--daylight); }
.rail-item.active { background: var(--surface); box-shadow: var(--lift); }
.ri-main {
  display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 11px 12px; border: none; background: none; border-radius: var(--r-md);
  cursor: pointer; font: inherit; color: var(--navy); flex: 1; min-width: 0;
}
.ri-dl {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-right: 6px; border-radius: var(--r-sm);
  color: var(--slate-400); font-size: 15px; text-decoration: none;
}
.ri-dl:hover { background: var(--daylight); color: var(--sky); text-decoration: none; }
.rail-item .ri-icon { font-size: 17px; }
.rail-item .ri-text { overflow: hidden; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.rail-item .ri-name { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item .ri-size { display: block; font-size: 12px; color: var(--muted); }

.preview-pane { display: flex; align-items: center; justify-content: center; background: var(--daylight); padding: 26px; height: 100%; min-height: 0; position: relative; overflow: auto; }
.preview-pane img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); box-shadow: var(--float); }
.preview-pane video { max-width: 100%; max-height: 100%; border-radius: var(--r-md); background: var(--navy); }
.preview-pane audio { width: min(560px, 90%); }
.preview-pane iframe { width: 100%; height: 100%; align-self: stretch; border: none; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--float); }
.preview-empty { text-align: center; color: var(--muted); }
.preview-empty .big-emoji { font-size: 50px; }
.preview-download { text-align: center; }
.preview-download .big-emoji { font-size: 54px; margin-bottom: 12px; }

/* ---------- misc ---------- */
.centered-msg { text-align: center; max-width: 460px; margin: 12vh auto 0; }
.centered-msg .auth-mark { width: 56px; height: 56px; }
.big-emoji { font-size: 56px; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 28px; min-height: auto; }
  .viewer-body { grid-template-columns: 1fr; height: auto; }
  .file-rail { border-right: none; border-bottom: 1px solid var(--border); }
  .rail-items { flex-direction: row; overflow-x: auto; }
  .rail-item { min-width: 190px; }
  .preview-pane { min-height: 58vh; }
  h1 { font-size: 30px; }
  .split-left h1 { font-size: 34px; }
  .topbar { padding: 14px 20px; }
  .main { padding: 40px 20px 64px; }
  body.wide .main { padding: 32px 20px 40px; }
}

/* ---------- site footer + legal ---------- */
.sitefoot {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 32px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
body.wide .sitefoot { max-width: 1180px; }
.foot-links { display: flex; gap: 18px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--cta); }

.legal { max-width: 720px; }
.legal h1 { font-size: 32px; margin-bottom: 8px; }
.legal h2 { font-size: 18px; margin: 28px 0 6px; }
.legal p { color: var(--slate-700); line-height: 1.6; }
.legal a { color: var(--cta); }

@media (max-width: 820px) {
  .sitefoot { padding: 20px 20px 32px; }
}

/* ---------- owner-only controls ---------- */
.btn.small { padding: 7px 12px; font-size: 13px; }

/* Inline-editable headings: text + a pencil that reveals on hover. */
.editable { position: relative; }
.editable .ie-text { cursor: text; }
.editable.is-empty .ie-text { color: var(--slate-400); font-weight: 500; cursor: text; }
.lead.editable.is-empty .ie-text { font-style: italic; }
.ie-pencil {
  margin-left: 10px; padding: 0; width: 1.5em; height: 1.5em;
  font-size: 0.46em; line-height: 1; vertical-align: middle;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); cursor: pointer;
  opacity: 0; transform: translateY(-1px);
  transition: opacity .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.lead .ie-pencil { font-size: 12px; }
.editable:hover .ie-pencil,
.editable:focus-within .ie-pencil { opacity: 1; }
.ie-pencil:hover { color: var(--sky); border-color: var(--sky); }
.ie-pencil:focus-visible { opacity: 1; outline: none; box-shadow: var(--focus); }
.ie-input {
  font: inherit; color: var(--navy); width: 100%; max-width: 100%;
  padding: 2px 9px; margin: -3px 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.ie-input:focus { outline: none; box-shadow: var(--focus); border-color: var(--sky); }

/* File-rail header: count + collapse + download-all */
.rail-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.rail-collapse {
  flex: none; width: 22px; height: 22px; padding: 0; line-height: 1; font-size: 16px;
  border: none; background: transparent; color: var(--slate-400); cursor: pointer; border-radius: var(--r-sm);
}
.rail-collapse:hover { background: var(--daylight); color: var(--sky); }
.rail-count {
  flex: 1; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.rail-dl {
  flex: none; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--sky-ink); text-decoration: none; white-space: nowrap;
}
.rail-dl:hover { color: var(--sky); text-decoration: underline; }
.rail-items { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }

/* Owner "add files" at the end of the list */
.rail-add {
  flex: none; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--sky-ink); background: transparent;
  border: 1px dashed var(--slate-300); border-radius: var(--r-md); cursor: pointer;
  transition: border-color .14s var(--ease), background .14s var(--ease), color .14s var(--ease);
}
.rail-add:hover { border-color: var(--sky); background: var(--daylight); color: var(--sky); }
.rail-add:disabled { opacity: .6; cursor: default; }

/* Collapsible rail: hide it, let the preview take the full stage, float a re-open pill */
.viewer-body { position: relative; }
.viewer-body.rail-collapsed { grid-template-columns: 1fr; }
.viewer-body.rail-collapsed .file-rail { display: none; }
.rail-expand {
  position: absolute; top: 14px; left: 14px; z-index: 2; display: none;
  align-items: center; gap: 6px; padding: 7px 13px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--sky-ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-full); cursor: pointer; box-shadow: var(--lift);
  transition: border-color .14s var(--ease), color .14s var(--ease);
}
.rail-expand::before { content: '▸'; font-size: 12px; }
.rail-expand:hover { border-color: var(--sky); color: var(--sky); }
.viewer-body.rail-collapsed .rail-expand { display: inline-flex; }

/* Per-file delete button in the rail (owner only) */
.ri-del {
  flex: 0 0 auto; cursor: pointer; font: inherit; font-size: 13px; line-height: 1;
  width: 28px; height: 28px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.ri-del:hover { background: #fdecec; color: var(--spark); }
.ri-del:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- storage page ---------- */
.store-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 4px 0 22px;
}
.store-kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.store-kpi-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.store-bar {
  display: flex; height: 18px; background: var(--slate-100);
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.store-seg { height: 100%; transition: width .3s var(--ease); }
.store-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; }
.store-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: middle;
}
.store-counts { margin-top: 18px; }
@media (max-width: 640px) { .store-kpis { grid-template-columns: 1fr; } }

/* ---------- checkbox field ---------- */
.check {
  display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--slate-700);
  cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--cta); flex: 0 0 auto; }

/* ---------- toasts ---------- */
.mf-toasts {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; max-width: min(92vw, 380px);
}
.mf-toast {
  padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--float);
  font-size: 14px; line-height: 1.4; border: 1px solid transparent;
  opacity: 0; transform: translateY(-8px); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.mf-toast.show { opacity: 1; transform: translateY(0); }
.mf-toast.is-error { background: #FEECEC; border-color: #F5C2C2; color: #8E1B1B; }
.mf-toast.is-info { background: var(--daylight); border-color: var(--border); color: var(--navy); }
@media (max-width: 640px) {
  .mf-toasts { left: 16px; right: 16px; max-width: none; }
}

/* ---------- mobile: burger nav + stacked table ---------- */
@media (max-width: 640px) {
  .topbar { position: relative; }

  /* Owner nav collapses into a burger that drops a full-width panel. */
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 11px; margin: -8px -8px -8px 0;
    cursor: pointer; border-radius: var(--r-sm);
  }
  .nav-burger span {
    display: block; height: 2px; width: 100%; background: var(--navy); border-radius: 2px;
    transition: transform .2s var(--ease), opacity .15s var(--ease);
  }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--lift);
    padding: 6px 0;
  }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav a, .logout button { width: 100%; box-sizing: border-box; padding: 14px 22px; font-size: 13px; text-align: left; }
  .nav a:hover { background: var(--daylight); }
  .logout { width: 100%; }
  /* burger morphs into an X when open */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Transfers: table → cards so every cell (incl. actions) is reachable. */
  .dash-head { flex-wrap: wrap; }
  .dash-head .btn { width: 100%; }
  .table-wrap { border: none; border-radius: 0; background: transparent; overflow: visible; }
  .table, .table tbody, .table tr, .table td { display: block; width: auto; }
  .table thead { display: none; }
  .table tr {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 14px 16px; margin-bottom: 12px;
  }
  .table tbody tr:hover { background: var(--surface); }
  .table td { border: none; padding: 5px 0; display: flex; gap: 16px; align-items: baseline; justify-content: space-between; }
  .table td::before {
    content: attr(data-label); flex: none;
    font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--muted);
  }
  .table td.cell-tag { padding-bottom: 8px; }
  .table td.cell-tag::before, .table td.row-actions::before { display: none; }
  .table td.name { max-width: none; white-space: normal; text-align: right; font-size: 15px; }
  .row-actions {
    flex-wrap: wrap; justify-content: flex-start; gap: 10px;
    margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border);
  }
  .row-actions .linklike, .row-actions a {
    min-height: 40px; padding: 8px 13px; display: inline-flex; align-items: center;
    border: 1px solid var(--border); border-radius: var(--r-md);
  }
  .row-actions .linklike:hover, .row-actions a:hover { background: var(--daylight); text-decoration: none; }

  /* Form action buttons: full-width, comfortable taps. */
  .actions { flex-wrap: wrap; }
  .actions .btn { flex: 1 1 130px; justify-content: center; }
  .split-left h1 { font-size: 30px; }
}
