:root {
  --bg: #faf7f2;
  --panel: #ffffff;
  --ink: #2f2a26;
  --muted: #7a716a;
  --line: #e8e1d7;
  --accent: #6f8b74;        /* salie */
  --accent-dark: #4f6a55;
  --accent-soft: #e7eee8;
  --rose: #c98b8b;
  --rose-soft: #f6e9e7;
  --gold: #b9975b;
  --red: #b4483f;
  --red-soft: #f8e4e1;
  --orange: #c07a26;
  --orange-soft: #fbefdc;
  --blue: #4c6f94;
  --blue-soft: #e5edf6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans);
}
a { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.9rem; margin: 0 0 .25rem; }
h2 { font-size: 1.3rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
small, .muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 230px; flex: none; background: #fff; border-right: 1px solid var(--line);
  padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-family: var(--serif); font-size: 1.35rem; padding: 0 .6rem .2rem; color: var(--ink); text-decoration: none; display: block; }
.brand span { color: var(--rose); }
.brand-sub { padding: 0 .6rem 1rem; font-size: .82rem; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: .6rem; padding: .48rem .6rem; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: .95rem;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.nav .ico { width: 1.3rem; text-align: center; opacity: .8; }
.nav .badge { margin-left: auto; }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: .7rem .4rem; }
.side-foot { margin-top: 1rem; padding: .6rem; font-size: .85rem; color: var(--muted); }
.side-foot form { display: inline; }
.main { flex: 1; min-width: 0; padding: 1.6rem 2rem 4rem; max-width: 1280px; }
.topbar { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .topbar {
    display: flex; align-items: center; gap: .8rem; position: sticky; top: 0; z-index: 40;
    background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1rem;
  }
  .topbar .brand { padding: 0; font-size: 1.15rem; }
  .main { padding: 1rem 1rem 4rem; }
  h1 { font-size: 1.5rem; }
}

/* ---------- Panels & cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; }
.panel-head h2, .panel-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
a.stat:hover { border-color: var(--accent); }

.hero {
  background: linear-gradient(135deg, #f3ece2 0%, #eef2ec 100%);
  border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem 1.8rem; margin-bottom: 1.2rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
}
.hero h1 { font-size: 2.3rem; margin: 0; }
.hero h1 .amp { color: var(--rose); font-style: italic; padding: 0 .2rem; }
.hero .date { color: var(--muted); margin-top: .3rem; }
.countdown { text-align: center; }
.countdown b { font-family: var(--serif); font-size: 3rem; line-height: 1; display: block; color: var(--accent-dark); }
.countdown span { color: var(--muted); font-size: .9rem; }

progress { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; vertical-align: middle; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
progress.over::-webkit-progress-value { background: var(--red); }
progress.over::-moz-progress-bar { background: var(--red); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.b-green { background: var(--accent-soft); color: var(--accent-dark); border-color: #cfdcd1; }
.b-red { background: var(--red-soft); color: var(--red); border-color: #efc9c4; }
.b-orange { background: var(--orange-soft); color: var(--orange); border-color: #f0d8b3; }
.b-blue { background: var(--blue-soft); color: var(--blue); border-color: #cddbea; }
.b-rose { background: var(--rose-soft); color: #9c5c5c; border-color: #ecd2cf; }

/* ---------- Forms ---------- */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time],
input[type=number], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: .45rem .6rem; min-height: 2.2rem;
}
textarea { min-height: 4.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field { margin-bottom: .8rem; }
.row { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: flex; align-items: center; gap: .45rem; color: var(--ink); font-size: .95rem; margin: 0; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; font-family: var(--serif); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-weight: 600; font-size: .9rem;
  padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 2.2rem;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { background: #fff; color: var(--accent-dark); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn.danger { background: #fff; color: var(--red); border-color: #efc9c4; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: .2rem .55rem; font-size: .82rem; min-height: 1.8rem; }
.btn.link { background: none; border: 0; color: var(--accent-dark); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline; }
.inline-form { display: inline; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: .5rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fcfaf7; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.list tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
table.list select { min-height: 1.9rem; padding: .15rem .4rem; font-size: .88rem; width: auto; }
.group-head td { background: var(--bg) !important; font-family: var(--serif); font-weight: 600; font-size: 1rem; padding-top: .8rem; }
.group-head .muted { font-family: var(--sans); font-weight: 400; font-size: .85rem; }
.name { font-weight: 600; text-decoration: none; color: var(--ink); }
.name:hover { color: var(--accent-dark); text-decoration: underline; }
.couple td { background: #fdf8f4; }
.diet { color: var(--orange); font-size: .85rem; }

/* ---------- Filters & tabs ---------- */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .92rem; }
.tabs a.active { color: var(--accent-dark); border-color: var(--accent); }
.tabs a .badge { margin-left: .3rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters input[type=search] { width: 220px; }
.filters select { width: auto; }

.bulkbar {
  position: sticky; bottom: 1rem; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  background: var(--ink); color: #fff; padding: .6rem .9rem; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.2);
  margin-top: 1rem;
}
.bulkbar select { width: auto; min-height: 2rem; }
.bulkbar .btn.ghost { color: var(--ink); }

/* ---------- Flash ---------- */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: var(--accent-soft); border-color: #cfdcd1; color: var(--accent-dark); }
.flash.error { background: var(--red-soft); border-color: #efc9c4; color: var(--red); }

/* ---------- Details-based editors ---------- */
details.edit > summary { list-style: none; cursor: pointer; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] { background: #fcfaf7; border-radius: 8px; }
details.edit .editor { padding: .8rem; border-top: 1px dashed var(--line); margin-top: .4rem; }
details.add > summary { cursor: pointer; display: inline-flex; }
details.add[open] > summary { margin-bottom: .8rem; }

/* ---------- Checklist ---------- */
.tasks { list-style: none; padding: 0; margin: 0; }
.task { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task input[type=checkbox] { width: 1.2rem; height: 1.2rem; margin-top: .15rem; flex: none; cursor: pointer; }
.task .t-body { flex: 1; min-width: 0; }
.task .t-title { font-weight: 500; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-meta { font-size: .82rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; }
.task details.edit { flex: none; }
.late { color: var(--red); font-weight: 600; }

/* ---------- Actiepunten ---------- */
.action { border-left: 4px solid var(--line); padding: .7rem 1rem; background: #fff; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: .7rem; box-shadow: var(--shadow); }
.action.rood { border-color: var(--red); }
.action.oranje { border-color: var(--orange); }
.action.blauw { border-color: var(--blue); }
.action summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.action summary b { font-weight: 600; }
.action ul { margin: .5rem 0 0; padding-left: 1.2rem; columns: 2 260px; font-size: .9rem; }
.action li { break-inside: avoid; }

/* ---------- Draaiboek ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4.6rem; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-item { display: flex; gap: 1.3rem; padding: .5rem 0; position: relative; }
.tl-time { width: 3.8rem; flex: none; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: .55rem; }
.tl-time small { display: block; font-weight: 400; }
.tl-item::before { content: ""; position: absolute; left: 4.33rem; top: 1.05rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
.tl-card { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; min-width: 0; }
.tl-card .meta { font-size: .85rem; color: var(--muted); display: flex; gap: .8rem; flex-wrap: wrap; }

/* ---------- Opstelling ---------- */
.seating { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.pool { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.pool .dropzone { min-height: 80px; }
.chip {
  display: flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 99px;
  padding: .18rem .6rem; font-size: .85rem; cursor: grab; margin: .2rem 0; user-select: none;
}
.chip:active { cursor: grabbing; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.chip.has-diet .dot { background: var(--orange); }
.chip small { margin-left: auto; }
.chip.dragging { opacity: .4; }
.canvas { position: relative; min-height: 640px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 20px 20px; overflow: auto; }
.tbl { position: absolute; width: 210px; background: #fff; border: 2px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow); }
.tbl.rond { border-radius: 50% / 22%; }
.tbl.full { border-color: var(--gold); }
.tbl.over { border-color: var(--red); }
.tbl-head { padding: .45rem .7rem; cursor: move; display: flex; justify-content: space-between; align-items: center; gap: .4rem; border-bottom: 1px solid var(--line); background: var(--accent-soft); border-radius: 12px 12px 0 0; touch-action: none; }
.tbl.rond .tbl-head { border-radius: 50% 50% 0 0 / 60% 60% 0 0; justify-content: center; flex-direction: column; gap: 0; text-align: center; }
.tbl-head b { font-family: var(--serif); }
.tbl-body { padding: .3rem .5rem .6rem; min-height: 60px; }
.dropzone.over { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -4px; }
.tbl details { font-size: .85rem; padding: 0 .6rem .5rem; }
@media (max-width: 900px) { .seating { grid-template-columns: 1fr; } .pool { position: static; max-height: none; } }

/* ---------- Cadeaus ---------- */
.gift { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.gift .price { font-family: var(--serif); font-size: 1.2rem; white-space: nowrap; }
.claims { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .88rem; }
.claims li { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; padding: .15rem 0; }

/* ---------- Login & RSVP ---------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: linear-gradient(160deg, #f3ece2 0%, #faf7f2 50%, #eef2ec 100%); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 2rem; width: 100%; max-width: 400px; }
.card h1 { text-align: center; }
.card .sub { text-align: center; color: var(--muted); margin-bottom: 1.5rem; }
.rsvp-page { max-width: 680px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.rsvp-hero { text-align: center; padding: 2rem 1rem 1.5rem; }
.rsvp-hero .names { font-family: var(--serif); font-size: 2.6rem; line-height: 1.1; }
.rsvp-hero .names .amp { color: var(--rose); font-style: italic; }
.rsvp-hero .when { color: var(--muted); margin-top: .5rem; font-size: 1.05rem; }
.ornament { color: var(--gold); letter-spacing: .5em; margin: .6rem 0; }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem; background: #fff; }
.person h3 { margin-bottom: .2rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; background: #fff; }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.admin-banner { background: var(--orange-soft); border: 1px solid #f0d8b3; color: #7a4c13; padding: .6rem 1rem; border-radius: 8px; margin-bottom: 1rem; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.linkbox { display: flex; gap: .4rem; }
.linkbox input { font-family: ui-monospace, monospace; font-size: .82rem; }

/* ---------- Print ---------- */
@media print {
  .side, .topbar, .no-print, .bulkbar { display: none !important; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .panel { box-shadow: none; break-inside: avoid; }
}

.task { flex-wrap: wrap; }
.task details.edit[open] { flex-basis: 100%; }
.chip.picked { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.gift-option { align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.gift-option input { margin-top: .2rem; }
.saved { outline: 2px solid var(--accent); outline-offset: 1px; transition: outline-color .3s; }
button.badge { cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; }
.panel h3 + p, .panel-head + p { margin-top: 0; }
.b-gold { background: #f6efe1; color: #8a6d35; border-color: #e8dabd; }
.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem 1.2rem; }
.role-notes { margin-top: .3rem; }
.role-notes input { min-height: 1.9rem; padding: .2rem .5rem; font-size: .85rem; }
.role-add, .role-notes { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.role-add select, .role-add input { flex: 1 1 150px; width: auto; }
.role-notes input { flex: 1 1 140px; width: auto; }

/* ---------- Inloggen met passkey ---------- */
.btn.wide { width: 100%; justify-content: center; min-height: 2.8rem; font-size: 1rem; }
.btn:disabled { opacity: .6; cursor: default; }
.center { text-align: center; }
.small-text { font-size: .85rem; }
.card h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.card form.center { margin-top: 1rem; }
.pw-login { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.pw-login summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; margin-bottom: .8rem; }
.keys { list-style: none; padding: 0; margin: 0 0 1rem; }
.keys li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.key-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .2rem; }
.key-row input { flex: 1 1 160px; width: auto; }

/* ---------- Telefoon ---------- */
.panel-head { flex-wrap: wrap; }
@media (pointer: coarse) {
  /* Vingers zijn groter dan muispijlen. */
  .btn.small { min-height: 2.2rem; padding: .3rem .7rem; }
  .nav a { padding: .65rem .6rem; }
  input[type=checkbox] { width: 1.25rem; height: 1.25rem; }
}
@media (max-width: 700px) {
  /* Brede tabellen worden kaartjes: de eerste cel over de volle breedte,
     de rest erachter met hun kolomnaam ervoor. */
  .table-wrap:has(> table.stack) { overflow-x: visible; }
  table.stack, table.stack tbody, table.stack tfoot { display: block; }
  table.stack thead, table.stack .th-row { display: none; }
  table.stack tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .9rem; padding: .6rem .2rem; border-bottom: 1px solid var(--line); }
  table.stack td { display: block; border: 0; padding: 0; }
  table.stack td:first-child, table.stack td.notes-cell { flex: 1 1 100%; }
  table.stack td.notes-cell { margin-top: -.5rem; font-size: .88rem; }
  table.stack td.empty-cell { display: none; }
  table.stack td.num { text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: .78rem; font-weight: 400; font-family: var(--sans); }
  table.stack td.right { margin-left: auto; }
  table.stack details.edit[open] { flex: 1 1 100%; }
  table.stack td:has(details.edit[open]) { flex: 1 1 100%; }
  table.stack .group-head { background: var(--bg); border-radius: 8px; padding: .5rem .6rem; margin-top: .6rem; }
  table.stack .group-head td { background: none !important; padding: 0; }
  table.stack tr:hover td { background: none; }
  table.stack tfoot tr { border-top: 2px solid var(--line); }
  table.stack tfoot td { border: 0; }
  table.stack td.nowrap { white-space: normal; }
  .page-head .btn { white-space: normal; }
  .hero h1 { font-size: 1.9rem; }
  .filters input[type=search] { width: 100%; }
}
/* Bewerkformulieren in een tabelcel: niet de uitlijning en smalle selects van de cel erven. */
details.edit .editor { text-align: left; }
table.list .editor select { width: 100%; min-height: 2.2rem; font-size: inherit; padding: .45rem .6rem; }

/* ---------- Mail ---------- */
.mail { display: grid; grid-template-columns: 190px 1fr; gap: 1rem; align-items: start; }
.mail-folders { display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 1rem; }
.mail-folders .btn { justify-content: center; margin-bottom: .6rem; }
.mail-folders a:not(.btn) { display: flex; justify-content: space-between; align-items: center; padding: .4rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; }
.mail-folders a:not(.btn):hover { background: #fff; }
.mail-folders a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.mail-main { min-width: 0; }
.mail-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; min-height: 2.2rem; }
.mail-bar [data-mail-actions] { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mail-bar select { width: auto; min-height: 1.8rem; padding: .1rem .4rem; font-size: .85rem; }
.mail-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.mail-list li { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .8rem; border-bottom: 1px solid var(--line); }
.mail-list li:last-child { border-bottom: 0; }
.mail-list li input { margin-top: .3rem; flex: none; }
.mail-list li a { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 0 .8rem; color: var(--ink); text-decoration: none; }
.mail-list li a:hover .m-subj { text-decoration: underline; }
.mail-list .m-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .m-date { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.mail-list .m-subj { grid-column: 1 / -1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.mail-list li.unread .m-from, .mail-list li.unread .m-subj { font-weight: 700; color: var(--ink); }
.mail-list li.unread { background: #fcfaf7; }
.mail-list .flag { color: var(--gold); }
.mail-msg h2 { margin-top: 0; overflow-wrap: anywhere; }
.mail-head { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; margin: 0 0 1rem; font-size: .9rem; }
.mail-head dt { color: var(--muted); }
.mail-head dd { margin: 0; overflow-wrap: anywhere; }
.mail-attach { list-style: none; padding: .6rem .8rem; margin: 0 0 1rem; background: var(--bg); border-radius: 8px; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.mail-frame { width: 100%; height: 70vh; border: 0; border-top: 1px solid var(--line); background: #fff; display: block; }
.mail-sig pre { font: inherit; font-size: .9rem; color: var(--muted); margin: .2rem 0 1rem; white-space: pre-wrap; }
.mail-compose textarea { font-family: inherit; }
.mail-compose details summary { cursor: pointer; margin-bottom: .4rem; }
.pager { margin-top: .8rem; justify-content: center; }
form.no-margin { margin: 0; }
@media (max-width: 900px) {
  .mail { grid-template-columns: 1fr; }
  .mail-folders { position: static; flex-direction: row; flex-wrap: wrap; gap: .3rem; }
  .mail-folders .btn { margin: 0 .3rem 0 0; }
  .mail-folders a:not(.btn) { background: #fff; border: 1px solid var(--line); padding: .25rem .6rem; font-size: .88rem; }
}
