:root {
  --accent: #7ab800;
  --accent-dark: #5c8a00;
  --ink: #1b1b1f;
  --muted: #6e6e78;
  --line: #e7e5e1;
  --bg: #f7f6f3;
  --card: #ffffff;
  --danger: #c0392b;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 600; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1rem; }
p { line-height: 1.5; }
code { background: #f0eee9; padding: 2px 6px; border-radius: 6px; font-size: .9em; word-break: break-all; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.center { text-align: center; }
.error { color: var(--danger); min-height: 1.2em; margin: .25rem 0; font-size: .9rem; }
.row { display: flex; align-items: center; }
.gap { gap: .5rem; }
.spacer { flex: 1; }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: .6rem 1rem; border-radius: 10px; font: inherit; font-weight: 500; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #cfccc6; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #efede8; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn.wide { width: 100%; }
.btn.danger-text { color: var(--danger); }

label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; font-weight: 500; margin-bottom: .9rem; }
input, select, textarea {
  font: inherit; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; font-size: .92rem; line-height: 1.45; }

/* Boot / centered views */
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.center-view { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 2rem; }
.card.narrow { width: 100%; max-width: 440px; }
.wordmark { display: flex; flex-direction: column; align-items: center; margin-bottom: .25rem; }
.wordmark span { font-size: 2rem; letter-spacing: .5em; font-weight: 300; margin-right: -.5em; }
.wordmark small { color: var(--accent); letter-spacing: .5em; font-weight: 600; font-size: .75rem; margin-right: -.5em; }
.copy-row { display: flex; gap: .5rem; align-items: center; margin: .75rem 0; }
.copy-row code { flex: 1; padding: .5rem .6rem; }

/* App layout */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { letter-spacing: .3em; font-weight: 300; }
.brand span { color: var(--accent); font-weight: 600; font-size: .8rem; }
.brand em { font-style: normal; letter-spacing: normal; color: var(--muted); margin-left: 1rem; font-size: .9rem; }
.layout { display: grid; grid-template-columns: 300px 1fr; flex: 1; min-height: 0; }
.sidebar { border-right: 1px solid var(--line); background: var(--card); padding: 1rem; display: flex; flex-direction: column; gap: .75rem; height: calc(100vh - 57px); position: sticky; top: 57px; }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; }
.sidebar-head h3 { margin: 0; }
.client-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.client-list li button {
  width: 100%; text-align: left; border: 0; background: transparent; padding: .6rem .7rem; border-radius: 10px;
  cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: .1rem;
}
.client-list li button:hover { background: #f3f1ed; }
.client-list li button.active { background: #efe8dc; }
.client-list .name { font-weight: 500; }
.client-list .email { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 1.75rem 2rem 6rem; min-width: 0; }

.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty h2 { color: var(--ink); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .meta { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.crumbs { font-size: .85rem; margin-bottom: .5rem; }
.crumbs a { color: var(--muted); text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Event cards */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.event-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; }
.event-card:hover { border-color: #cfccc6; box-shadow: 0 4px 16px rgba(0,0,0,.05); }
.event-card .cover { aspect-ratio: 4 / 3; background: #eeece8 center / cover no-repeat; display: grid; place-items: center; color: #b5b2ab; font-size: 2rem; }
.event-card .info { padding: .8rem .9rem; }
.event-card .title { font-weight: 600; }
.event-card .sub { color: var(--muted); font-size: .85rem; margin-top: .2rem; }

/* Event page */
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.section h3 { margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: #f3f1ed; border-radius: 999px; padding: .3rem .4rem .3rem .75rem; font-size: .85rem; }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 .25rem; }
.chip button:hover { color: var(--danger); }
.chips select { width: auto; padding: .3rem .5rem; font-size: .85rem; }

.dropzone {
  border: 2px dashed #d6d2ca; border-radius: var(--radius); padding: 2rem 1rem; text-align: center;
  background: #fbfaf8; cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #f6f0e6; }
.dropzone strong { display: block; font-size: 1.05rem; margin-bottom: .25rem; }

.toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 1.25rem 0 .75rem; }
.tabs { display: inline-flex; background: #ecebe7; border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: .4rem .85rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .9rem; }
.tabs button.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.photo { position: relative; border-radius: 10px; overflow: hidden; background: #eeece8; aspect-ratio: 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .fname { position: absolute; left: 0; right: 0; bottom: 0; padding: .9rem .5rem .35rem; font-size: .72rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .badges { position: absolute; top: .4rem; left: .4rem; display: flex; gap: .25rem; }
.badge { white-space: nowrap; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: .15rem .45rem; border-radius: 999px; }
.badge.fav { background: #d94a6a; }
.badge.cover { background: var(--accent-dark); }
.photo .tools { position: absolute; top: .4rem; right: .4rem; display: none; gap: .25rem; }
.photo:hover .tools { display: flex; }
.photo .tools button, .photo .tools a {
  border: 0; background: rgba(255,255,255,.92); border-radius: 8px; padding: .25rem .45rem; font-size: .75rem; cursor: pointer; color: var(--ink); text-decoration: none; font-family: inherit; white-space: nowrap;
}
.photo .tools button.del { color: var(--danger); }

/* Upload panel */
.uploads {
  position: fixed; right: 1rem; bottom: 1rem; width: 360px; max-height: 60vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 20;
}
.uploads .head { padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.uploads .head .row { justify-content: space-between; }
.uploads .bar { height: 6px; background: #ecebe7; border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.uploads .bar div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.uploads ul { list-style: none; margin: 0; padding: .25rem 0; overflow-y: auto; }
.uploads li { padding: .35rem 1rem; font-size: .82rem; display: flex; justify-content: space-between; gap: .75rem; }
.uploads li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads li .s { color: var(--muted); white-space: nowrap; }
.uploads li.error .s, .uploads li.skipped .s { color: var(--danger); white-space: normal; text-align: right; }
.uploads li.done .s { color: #2e8b57; }

/* Dialogs */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,20,20,.45); }
.dialog-body { padding: 1.5rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: .7rem 1.1rem; border-radius: 10px; font-size: .9rem; z-index: 50; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 1.25rem 1rem 6rem; }
  .uploads { left: 1rem; width: auto; }
}

/* Edit requests & activity */
.section .row h3 { margin: 0; }
.section .row { margin-bottom: .6rem; }
.count { background: #d94a6a; color: #fff; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; margin-left: .4rem; vertical-align: middle; }
.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.req { display: flex; align-items: center; gap: .8rem; padding: .5rem; border: 1px solid var(--line); border-radius: 10px; }
.req img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #eeece8; flex: none; }
.req-body { flex: 1; min-width: 0; }
.req-text { font-weight: 500; margin-bottom: .15rem; white-space: pre-wrap; }
.req.done { opacity: .55; }
.req.done .req-text { text-decoration: line-through; }
.badge.req-badge { background: #2f6fb3; }
table.activity { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.activity th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: .3rem .5rem; border-bottom: 1px solid var(--line); }
table.activity td { padding: .5rem; border-bottom: 1px solid var(--line); }
table.activity tr:last-child td { border-bottom: 0; }

/* Galleries vs projects */
.group-title { font-size: 1.05rem; margin: 1.5rem 0 .75rem; }
.group-title:first-of-type { margin-top: 0; }
.type-tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; margin-right: .3rem; vertical-align: 1px; }
.type-tag.gallery { background: #eef6dc; color: #4d7300; }
.type-tag.project { background: #e7f1fb; color: #1f5f9e; }
.photo .file-icon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 2.4rem; background: #eeece8; }
.photo .file-icon small { font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.photo .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.55); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; padding-left: 3px; }

/* Versions & project requests */
.inbox-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 1px solid var(--line); background: #fbfaf8; border-radius: 10px; padding: .6rem .75rem; font: inherit; font-weight: 500; cursor: pointer; }
.inbox-btn:hover, .inbox-btn.active { border-color: var(--accent); background: #f1f7e3; }
.badge.ver { background: #3d5c00; }
.badge.ok { background: #2e8b57; }
.photo .tools { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - .8rem); }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
label.check input { width: auto; }
.versions-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.versions-list li { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; }
.versions-list img, .versions-list .vi { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #eeece8; display: grid; place-items: center; flex: none; }
.versions-list .grow { flex: 1; min-width: 0; }
.pr-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.pr-card .top { display: flex; align-items: flex-start; gap: .75rem; }
.pr-card h3 { margin: 0; }
.pr-card .desc { white-space: pre-wrap; margin: .6rem 0; }
.pr-card textarea { margin-top: .4rem; }
.status { font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.status.received { background: #faeeda; color: #854f0b; }
.status.in_progress { background: #e6f1fb; color: #185fa5; }
.status.delivered { background: #eaf3de; color: #3b6d11; }
.status.declined { background: #f1efe8; color: #5f5e5a; }
.linked { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.photo .tools { top: auto; bottom: 1.9rem; left: .4rem; right: .4rem; max-width: none; justify-content: center; }

/* Bookings */
.bk-time { font-size: 1.05rem; font-weight: 600; }
.status.pending { background: #faeeda; color: #854f0b; }
.status.confirmed { background: #eaf3de; color: #3b6d11; }
.status.cancelled { background: #f1efe8; color: #5f5e5a; }
details.settings { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.1rem; margin-bottom: 1.25rem; }
details.settings summary { cursor: pointer; font-weight: 600; }
.hours-table { width: 100%; border-collapse: collapse; margin: .75rem 0; font-size: .9rem; }
.hours-table td { padding: .3rem .4rem; }
.hours-table select { width: auto; padding: .3rem .5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.hint { background: #f6f4ef; border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; margin: .4rem 0 .9rem; }
.inbox-btn + .inbox-btn { margin-top: -.25rem; }


.row.gap-xs { gap: .35rem; }

/* ---------- Companies ---------- */
.client-list li button.company .name { font-weight: 600; }
.client-list li button.member { padding-left: 1.6rem; position: relative; }
.client-list li button.member::before { content: ''; position: absolute; left: .8rem; top: .35rem; bottom: .35rem; border-left: 2px solid var(--line); }
.client-list .job { font-weight: 400; color: var(--muted); font-size: .85rem; }
.client-list .list-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .9rem .6rem .3rem; }
.person-list { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.person-row { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.person-info { min-width: 0; flex: 1 1 260px; }
.person-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.move-select { margin-top: .75rem; width: auto; max-width: 100%; font-size: .9rem; }
.chip.company-chip { background: #e9f3d6; color: #3b5c00; padding-right: .75rem; }
a.link { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.company-access { display: flex; flex-direction: column; gap: .45rem; }
.chip.member-chip { border: 0; cursor: pointer; font: inherit; font-size: .85rem; padding: .3rem .75rem; background: #e9f3d6; color: #3b5c00; }
.chip.member-chip.off { background: #f1efe8; color: var(--muted); text-decoration: line-through; }
.chip.member-chip:disabled { opacity: .6; cursor: default; }
.event-card .hidden-from { color: var(--danger); margin-top: .15rem; }
.people-wrap { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.people-checks { display: flex; flex-direction: column; gap: .15rem; }
.people-checks label.check { margin: 0; }

/* ---------- Folders inside a gallery ---------- */
.folder-bar { margin: 1rem 0 .6rem; display: flex; flex-direction: column; gap: .45rem; }
.folder-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.folder-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; }
.folder-chip span { color: var(--muted); margin-left: .2rem; }
.folder-chip.active { background: #1b1b1f; border-color: #1b1b1f; color: #fff; }
.folder-chip.active span { color: #cfcfd4; }
.folder-chip.add { border-style: dashed; color: var(--muted); }
.folder-actions .link { margin: 0 .1rem; }
.drop-target { display: block; font-size: .85rem; color: #3b5c00; background: #e9f3d6; border-radius: 6px; padding: .25rem .6rem; margin-bottom: .4rem; }
.select-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: #1b1b1f; color: #fff; border-radius: 10px; padding: .55rem .8rem; margin: .4rem 0 .8rem; }
.select-bar select { width: auto; font-size: .9rem; padding: .3rem .5rem; }
.select-bar .btn { background: #fff; }
.photo.selectable { cursor: pointer; }
.photo.selectable .tools { display: none !important; }
.photo .pick-mark { position: absolute; top: .4rem; right: .4rem; z-index: 3; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); color: transparent; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; }
.photo.picked { outline: 3px solid #93D501; outline-offset: -3px; }
.photo.picked .pick-mark { background: #93D501; border-color: #93D501; color: #1b1b1c; }

/* ---------- Read receipts ---------- */
.seen-tick { font-weight: 700; letter-spacing: -.12em; }
.seen-tick.no { color: #9a9aa0; }
.seen-tick.yes { color: #4f8a10; }
.badge.seen { background: rgba(255,255,255,.92); }
.seen-line { margin-top: .15rem; }
.new-tag { display: inline-block; background: #93D501; color: #1b1b1c; font-size: .7rem; font-weight: 700; border-radius: 5px; padding: .05rem .4rem; vertical-align: middle; }

/* ---------- Guest links ---------- */
.share-list { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.share-row { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: .65rem .8rem; }
.share-row.off { opacity: .6; }
.share-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1 1 320px; }
.share-title { display: flex; align-items: center; gap: .5rem; }
.share-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Phone layout & installed app ---------- */
.mobile-nav { display: none; }
@media (hover: none) {
  /* No mouse on phones/tablets: always show the file buttons. */
  .photo .tools { display: flex; }
}
@media (max-width: 800px) {
  .topbar { padding: .55rem .75rem; padding-top: max(.55rem, env(safe-area-inset-top)); }
  .brand { font-size: .95rem; letter-spacing: .22em; white-space: nowrap; }
  .brand em, #me { display: none; }
  .top-actions { gap: .1rem; }
  /* Icon-only buttons in the top bar */
  #alerts-btn, #install-btn { font-size: 0; padding: .35rem .55rem; }
  #alerts-btn::before { content: '🔔'; font-size: 1.15rem; }
  #install-btn::before { content: '📲'; font-size: 1.15rem; }

  /* One screen at a time: the menu, or the page you opened */
  .layout { align-content: start; }
  .layout[data-pane="list"] .main,
  .layout[data-pane="list"] .mobile-nav { display: none; }
  .layout[data-pane="main"] .sidebar { display: none; }
  .layout[data-pane="main"] .mobile-nav { display: block; padding: .5rem .5rem 0; }
  .sidebar { max-height: none; height: auto; border-bottom: 0; padding: 1rem .9rem 2rem; }
  .client-list { overflow: visible; flex: none; }
  .client-list li button { padding: .85rem .6rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .inbox-btn { padding: .95rem .9rem; font-size: 1rem; }
  .main { padding: .5rem 1rem 6rem; }
  .main .crumbs { display: none; }
  .page-head { margin-bottom: 1rem; }
  .page-head h1, .page-head h2 { font-size: 1.25rem; }

  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo .tools button, .photo .tools a { padding: .35rem .5rem; font-size: .78rem; }
  .section, details.settings { overflow-x: auto; }
  .dropzone { padding: 1.25rem 1rem; }
  .req { flex-wrap: wrap; }
  .pr-card .top { flex-wrap: wrap; }
  .tabs { max-width: 100%; overflow-x: auto; }

  .btn { min-height: 40px; }
  .btn.small { min-height: 36px; }
  input, select, textarea { font-size: 16px; } /* stops phones zooming in on tap */

  dialog { width: 96vw; max-height: 92vh; }
  .dialog-body { padding: 1.1rem; }
  .uploads { bottom: max(1rem, env(safe-area-inset-bottom)); }
  .toast { bottom: max(1.5rem, env(safe-area-inset-bottom)); }
}
