/* =========================================================================
   PrestaFácil — Nature-Corporate Theme
   Palette: forest greens, river blues, clay/earth browns, warm sand
   Mobile-first, responsive.
   ========================================================================= */

:root {
  /* Nature palette */
  --forest-900: #1b3a2b;
  --forest-700: #2f5d43;
  --forest-500: #3f7d5a;
  --forest-300: #7bb392;
  --forest-100: #e4f0e9;

  --river-700: #1f4e6b;
  --river-500: #2e7da6;
  --river-300: #8cc4dd;
  --river-100: #e2f0f7;

  --clay-700: #6e4a30;
  --clay-500: #9c6b43;
  --clay-300: #c9a37b;
  --clay-100: #f1e7da;

  --sand-50: #f7f4ee;
  --sand-100: #efe9df;

  --ink: #20312a;
  --ink-soft: #5b6b63;
  --line: #dfe3da;
  --white: #ffffff;

  /* States */
  --ok: #3f7d5a;
  --ok-bg: #e4f0e9;
  --warn: #b8860b;
  --warn-bg: #faf0d7;
  --danger: #b1452f;
  --danger-bg: #f7e2dc;
  --info: #2e7da6;

  /* System */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(27, 58, 43, .06), 0 1px 3px rgba(27, 58, 43, .05);
  --shadow-md: 0 4px 14px rgba(27, 58, 43, .10);
  --shadow-lg: 0 12px 40px rgba(27, 58, 43, .16);
  --sidebar-w: 248px;
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;            /* global clamp: nothing scrolls/pans the page sideways */
  overscroll-behavior-x: none;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sand-50);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; /* don't let mobile auto-inflate text */
  font-size: 15px;
  line-height: 1.5;
  position: relative;
}
a { color: var(--river-500); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ---------- App layout ---------- */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--forest-900), var(--forest-700));
  color: #dcebe1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--forest-300), var(--river-300));
  display: grid; place-items: center;
  font-size: 20px; box-shadow: var(--shadow-sm);
}
.brand .name { font-weight: 800; font-size: 17px; color: #fff; letter-spacing: .2px; line-height: 1.1; }
.brand .tag { font-size: 11px; color: var(--forest-300); font-weight: 600; }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.4); padding: 14px 12px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,.82); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, color .15s; width: 100%;
  background: none; border: none; text-align: left;
}
.nav-item .ic { width: 20px; text-align: center; font-size: 16px; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 3px 0 0 var(--forest-300); }

.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.55); }
.sidebar-foot b { color: #fff; }

/* Main */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; max-width: 100%; overflow-x: hidden; }

.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; position: sticky; top: 0; z-index: 40;
  max-width: 100%;
}
/* Brand shown in the top bar */
.topbar .topbrand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar .topbrand .tb-logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--forest-500), var(--river-300));
  display: grid; place-items: center; font-size: 18px; box-shadow: var(--shadow-sm);
}
.topbar .topbrand .tb-name { font-size: 19px; font-weight: 800; color: var(--forest-900); letter-spacing: -.2px; line-height: 1; }
.topbar .topbrand .tb-page { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.topbar h1 { font-size: 19px; font-weight: 800; color: var(--forest-900); }
.topbar .crumb { color: var(--ink-soft); font-size: 13px; }
.topbar .spacer { flex: 1; }
.hamburger {
  display: none; background: none; border: 1px solid var(--line); border-radius: 10px;
  width: 44px; height: 44px; flex: none; font-size: 22px; line-height: 1; color: var(--forest-700);
  align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.hamburger:active { background: var(--sand-100); }
.topbar .pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--forest-100); color: var(--forest-700);
  padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.topbar .pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.content { padding: 22px; max-width: 1240px; width: 100%; min-width: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
  transition: all .15s; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--forest-300); }
.btn-primary { background: linear-gradient(135deg, var(--forest-700), var(--forest-500)); color: #fff; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }
.btn-blue { background: linear-gradient(135deg, var(--river-700), var(--river-500)); color: #fff; border-color: transparent; }
.btn-clay { background: linear-gradient(135deg, var(--clay-700), var(--clay-500)); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-danger { color: var(--danger); border-color: var(--danger-bg); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* ---------- Cards / KPIs ---------- */
.grid { display: grid; gap: 16px; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 800; color: var(--forest-900); }
.card-head .sub { font-size: 12px; color: var(--ink-soft); }

.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.kpi.green::before { background: var(--forest-500); }
.kpi.blue::before { background: var(--river-500); }
.kpi.clay::before { background: var(--clay-500); }
.kpi.amber::before { background: var(--warn); }
.kpi .kpi-label { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; display: flex; align-items: center; gap: 7px; }
.kpi .kpi-icon { font-size: 16px; }
.kpi .kpi-val { font-size: 27px; font-weight: 800; color: var(--forest-900); margin-top: 7px; letter-spacing: -.5px; }
.kpi .kpi-foot { font-size: 12px; color: var(--ink-soft); margin-top: 5px; }
.kpi .up { color: var(--ok); font-weight: 700; }
.kpi .down { color: var(--danger); font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; max-width: 100%; width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--sand-50); }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--sand-50); }
.t-name { font-weight: 700; color: var(--forest-900); }
.t-sub { font-size: 12px; color: var(--ink-soft); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
th.num { text-align: right; }

/* Avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px; flex: none; }
.cell-person { display: flex; align-items: center; gap: 11px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge .bdot { width: 7px; height: 7px; border-radius: 50%; }
.badge.ok { background: var(--ok-bg); color: var(--forest-700); }
.badge.ok .bdot { background: var(--ok); }
.badge.warn { background: var(--warn-bg); color: #8a6508; }
.badge.warn .bdot { background: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.danger .bdot { background: var(--danger); }
.badge.info { background: var(--river-100); color: var(--river-700); }
.badge.info .bdot { background: var(--info); }
.badge.muted { background: var(--sand-100); color: var(--ink-soft); }
.badge.muted .bdot { background: var(--ink-soft); }

/* ---------- Progress ---------- */
.progress { background: var(--sand-100); border-radius: 999px; height: 8px; overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--forest-500), var(--forest-300)); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--forest-900); }
.field label .req { color: var(--danger); }
.field .hint { font-size: 11.5px; color: var(--ink-soft); }
input, select, textarea {
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--white); width: 100%; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px var(--forest-100); }
textarea { resize: vertical; min-height: 72px; }
.upload {
  border: 2px dashed var(--clay-300); border-radius: 12px; padding: 18px; text-align: center;
  color: var(--clay-700); background: var(--clay-100); cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.upload:hover { border-color: var(--clay-500); background: #ece0cf; }
.upload .em { font-size: 26px; }
.upload .preview { max-height: 120px; border-radius: 8px; box-shadow: var(--shadow-sm); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(27,58,43,.45); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 24px; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; margin: auto; animation: pop .18s ease; }
.modal.wide { max-width: 820px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; color: var(--forest-900); font-weight: 800; }
.modal-head .x { background: none; border: none; font-size: 24px; color: var(--ink-soft); line-height: 1; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--sand-50); border-radius: 0 0 18px 18px; }

/* ---------- Misc ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .lead { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { flex: 1 1 180px; min-width: 0; position: relative; }
.search input { padding-left: 38px; }
.search .si { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }
.seg { display: inline-flex; background: var(--sand-100); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; padding: 7px 13px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.seg button.active { background: var(--white); color: var(--forest-700); box-shadow: var(--shadow-sm); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.empty .em { font-size: 44px; opacity: .5; }

.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.charts > * { min-width: 0; }   /* let grid children shrink so inner tables scroll, not overflow */
.grid > * { min-width: 0; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 38px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, var(--forest-500), var(--forest-300)); transition: height .4s ease; min-height: 4px; }
.bar.blue { background: linear-gradient(180deg, var(--river-500), var(--river-300)); }
.bar-label { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.bar-val { font-size: 10.5px; color: var(--ink-soft); }

/* Donut via conic-gradient */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.donut { width: 130px; height: 130px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 24px; background: var(--white); border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; text-align: center; }
.donut-center b { font-size: 22px; color: var(--forest-900); display: block; }
.donut-center small { font-size: 11px; color: var(--ink-soft); }
.legend { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-item .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend-item b { margin-left: auto; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 22px; }
.detail-grid .it label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); font-weight: 700; }
.detail-grid .it div { font-weight: 600; color: var(--ink); margin-top: 2px; }
.id-photos { display: flex; gap: 12px; flex-wrap: wrap; }
.id-photos .ph { flex: 1 1 130px; width: 150px; max-width: 100%; height: 100px; border-radius: 10px; background: var(--sand-100); display: grid; place-items: center; color: var(--ink-soft); font-size: 12px; border: 1px solid var(--line); text-align: center; overflow: hidden; }
.id-photos .ph img { width: 100%; height: 100%; object-fit: cover; }

.tab-row { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab-row button { border: none; background: none; padding: 11px 15px; font-weight: 700; font-size: 14px; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-row button.active { color: var(--forest-700); border-bottom-color: var(--forest-500); }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--forest-900); color: #fff; padding: 13px 18px; border-radius: 11px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; animation: slideup .25s ease; }
@keyframes slideup { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.scrim { display: none; }

/* Help / instructions */
.help-doc { max-width: 820px; }
.help-doc h2 { color: var(--forest-900); font-size: 20px; margin: 26px 0 10px; }
.help-doc h3 { color: var(--forest-700); font-size: 16px; margin: 18px 0 8px; }
.help-doc p { margin-bottom: 10px; color: var(--ink); }
.help-doc ul, .help-doc ol { margin: 0 0 12px 22px; }
.help-doc li { margin-bottom: 6px; }
.help-step { display: flex; gap: 13px; margin-bottom: 14px; }
.help-step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--forest-500); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.callout { background: var(--river-100); border-left: 4px solid var(--river-500); padding: 13px 16px; border-radius: 0 10px 10px 0; margin: 12px 0; }
.callout.tip { background: var(--forest-100); border-color: var(--forest-500); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn); }

/* ---------- Tutorial video embed (in-app modal) ---------- */
.tutorial-body { padding: 0; background: #0f2017; }
.tutorial-frame {
  position: relative; width: 100%; max-width: 420px; margin: 0 auto;
  aspect-ratio: 9 / 16; max-height: 80vh;
}
.tutorial-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #142a1f; }

/* First-time dashboard card */
.tutorial-card { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--forest-100), var(--river-100)); border: none; }
.tutorial-card .tut-emoji { font-size: 34px; flex: none; }
.tutorial-card .tut-text { flex: 1; min-width: 0; }
.tutorial-card .tut-text h3 { color: var(--forest-900); font-size: 16px; }
.tutorial-card .tut-text p { color: var(--ink); font-size: 13px; }
.tutorial-card .tut-cta { display: flex; gap: 8px; flex: none; }
@media (max-width: 560px) {
  .tutorial-card { flex-direction: column; align-items: flex-start; text-align: left; }
  .tutorial-card .tut-cta { width: 100%; }
  .tutorial-card .tut-cta .btn { flex: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 248px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .charts { grid-template-columns: 1fr; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .topbar h1 { font-size: 17px; }
  .topbar .topbrand .tb-name { font-size: 17px; }
  .kpi .kpi-val { font-size: 24px; }
  .page-head .lead { font-size: 13px; }
}

/* ---------- MOBILE: data tables reflow into stacked cards ----------
   Below 640px every .table-wrap <table> becomes a vertical list of cards.
   Same markup/renderer as desktop — each <td> just carries a data-label.
   Desktop (>640px) is untouched. */
@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; -webkit-overflow-scrolling: auto; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }

  /* hide the header row (labels move into each cell via data-label) */
  .table-wrap thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

  /* each row = a card */
  .table-wrap tr {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 13px 15px; margin-bottom: 12px;
  }
  .table-wrap tbody tr:last-child { margin-bottom: 0; }
  .table-wrap tbody tr:hover { background: var(--white); }

  /* each cell = a label:value line */
  .table-wrap td {
    border: none; padding: 7px 0; min-height: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: right;
  }
  .table-wrap td::before {
    content: attr(data-label); flex: none; text-align: left;
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: var(--ink-soft);
  }
  .table-wrap td.num { white-space: normal; }
  .table-wrap td .t-sub { display: inline; }

  /* leading person/title cell = card header (avatar + name), full width, no label */
  .table-wrap td.cell-person-td {
    justify-content: flex-start; text-align: left; padding: 0 0 11px;
    margin-bottom: 4px; border-bottom: 1px solid var(--line);
  }
  .table-wrap td.cell-person-td::before { content: none; }
  .table-wrap td.cell-person-td .cell-person { width: 100%; }

  /* progress cell: bar takes the right side */
  .table-wrap td.progress-td .progress { flex: 1; min-width: 120px; }
  .table-wrap td.progress-td .t-sub { flex: none; }

  /* action cell: full-width button row at the bottom of the card */
  .table-wrap td.actions-td { justify-content: stretch; gap: 8px; padding-top: 11px; margin-top: 2px; border-top: 1px solid var(--line); }
  .table-wrap td.actions-td::before { content: none; }
  .table-wrap td.actions-td .btn { flex: 1; justify-content: center; }

  /* compact transaction rows (savings / payment history) stay one-line */
  .table-wrap.txlog td { padding: 5px 0; }
  .table-wrap.txlog tr { padding: 11px 13px; }
}

@media (max-width: 520px) {
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; max-width: none; min-height: 100%; }
  .topbar .pill { display: none; }              /* free up width on small phones */
  .topbar { gap: 10px; padding: 0 12px; }
  /* Tutorial fills the fullscreen modal on phones; dvh avoids URL-bar overflow */
  .tutorial-frame { max-width: 100%; aspect-ratio: auto; height: 100%; max-height: none; min-height: 72dvh; }
  .tutorial-frame iframe { position: static; height: 100%; min-height: 72dvh; }
  .tutorial-body { min-height: 72dvh; }
}
