:root {
  --ink: #1c1612;
  --ink-soft: #7b7773;
  --paper: #edece8;
  --paper-2: #e1e0dc;
  --card: #f6f6f3;
  --wine: #722f37;
  --wine-deep: #4d1c24;
  --gold: #b0894d;
  --gold-soft: #d4bc8a;
  --line: rgba(28, 22, 18, 0.12);
  --ok: #2f6b4f;
  --warn: #9a4b1f;
  --danger: #8e2430;
  --shadow: 0 18px 40px rgba(28, 22, 18, 0.08);
  --radius: 18px;
  --font-display: Fraunces, Georgia, serif;
  --font-body: "Source Sans 3", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}
body {
  font-family: var(--font-body, "Source Sans 3", sans-serif);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}
img, svg, video { max-width: 100%; height: auto; }
.brand-logo, .nav-icon, .nav-avatar { max-width: none; }
a, button, .btn, summary, input, select, textarea, label {
  touch-action: manipulation;
}
a, button, .btn, summary {
  -webkit-tap-highlight-color: color-mix(in srgb, var(--wine) 16%, transparent);
}

h1, h2, h3, .brand-name, .display {
  font-family: var(--font-display, Fraunces, Georgia, serif);
  font-weight: 650;
  letter-spacing: -0.02em;
}

a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.75rem 1.6rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-left: max(1.6rem, calc(env(safe-area-inset-left) + 1rem));
  padding-right: max(1.6rem, calc(env(safe-area-inset-right) + 1rem));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, #fff);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
  overflow: visible;
}
.topbar a:hover { text-decoration: none; }

.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--wine); color: #fff;
  font-family: var(--font-display, Fraunces, serif); font-weight: 650;
}
.brand-name { font-size: 1.18rem; }
.brand-lockup {
  display: block;
  width: min(200px, 62vw);
  height: auto;
  margin: 0 auto;
}
.brand-lockup-sm { width: min(132px, 48vw); }
.brand-lockup-lg { width: min(240px, 70vw); }
.auth-logo { display: flex; justify-content: center; margin: 0 0 0.35rem; }
.auth-card { width: min(460px, 100%); margin: 0 auto; }
.auth-card-wide { width: min(640px, 100%); }
.hero-logo { width: min(148px, 46vw); height: auto; margin: 0 0 0.85rem; display: block; }
body.nav-auth .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 7.5rem);
  padding-top: 1.25rem;
}
body.nav-auth .auth-logo { margin: 0 0 0.4rem; }
body.nav-auth .brand-lockup { width: min(220px, 68vw); }
.footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  margin: 0;
  max-width: 100%;
}
.footer-brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  background: transparent;
}

.login-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #edece8;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.85s ease;
}
.login-splash.is-leaving {
  opacity: 0;
  pointer-events: none;
}
.login-splash-video {
  width: min(280px, 58vw);
  height: min(48vh, 340px);
  object-fit: contain;
}
.login-splash-fallback {
  display: none;
  width: min(240px, 52vw);
  height: auto;
}
.login-splash.is-fallback .login-splash-video { display: none; }
.login-splash.is-fallback .login-splash-fallback { display: block; }
.login-splash-hint {
  position: absolute;
  bottom: max(1.4rem, calc(env(safe-area-inset-bottom) + 0.8rem));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a8580;
}
body.is-splashing { overflow: hidden; }

.topnav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex: 1;
  min-width: 0;
}
.topnav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 1.25rem;
  flex: 1;
  min-width: 0;
}
.topnav-links .nav-link {
  padding: 0.28rem 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.93rem;
  letter-spacing: 0.01em;
  box-shadow: inset 0 -2px 0 transparent;
}
.topnav-links .nav-link:hover,
.topnav-links .nav-link.is-active {
  background: transparent;
  color: var(--wine);
  box-shadow: inset 0 -2px 0 var(--gold);
}
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { color: var(--wine); text-decoration: none; }

.topnav-end {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
}
.btn-nav {
  gap: 0.4rem;
  padding: 0.48rem 1.05rem;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: visible;
  flex-shrink: 0;
}
.topnav .btn-ghost:hover {
  background: color-mix(in srgb, var(--wine) 8%, transparent);
  color: var(--wine);
  border-color: color-mix(in srgb, var(--wine) 35%, var(--line));
}
.topnav .btn-primary:hover { color: #fff; }

.btn-new-event, .btn-register { max-width: none; }
.label-short { display: none; }

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.18rem 0.75rem 0.18rem 0.18rem;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  max-width: 11rem;
  flex-shrink: 0;
}
.nav-user-chip:hover {
  border-color: color-mix(in srgb, var(--wine) 50%, var(--line));
  color: var(--wine);
  background: color-mix(in srgb, var(--wine) 8%, var(--paper-2));
}
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wine); color: #fff;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
  flex-shrink: 0;
}
.nav-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logout:hover { color: var(--wine); }

.nav-badge {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.nav-badge[hidden] { display: none; }

.nav-notify {
  position: relative;
  flex-shrink: 0;
}
.nav-notify > summary { list-style: none; }
.notify-toggle::-webkit-details-marker,
.notify-toggle::marker { display: none; content: none; }
.notify-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.notify-toggle:hover,
.nav-notify[open] .notify-toggle,
.nav-notify.has-unread .notify-toggle {
  color: var(--wine);
  border-color: color-mix(in srgb, var(--wine) 45%, var(--line));
  background: color-mix(in srgb, var(--wine) 10%, var(--card));
}
.notify-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}
.notify-badge[hidden] { display: none; }
.notify-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  width: min(22rem, calc(100vw - 1.5rem));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
}
.nav-notify[open] .notify-panel { display: block; }
.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.notify-panel-head strong { font-family: var(--font-display); }
.notify-list {
  max-height: 18rem;
  overflow: auto;
}
.notify-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.notify-item:hover { background: color-mix(in srgb, var(--wine) 8%, transparent); text-decoration: none; }
.notify-item.is-unread { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.notify-item-title { font-weight: 650; font-size: 0.9rem; }
.notify-item-body { color: var(--ink-soft); font-size: 0.85rem; line-height: 1.35; }
.notify-empty { margin: 0; padding: 1.1rem 0.9rem; }
.notify-footer {
  display: block;
  padding: 0.7rem 0.9rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
  color: var(--wine);
}
.notify-footer:hover { background: color-mix(in srgb, var(--wine) 8%, transparent); text-decoration: none; }

.nav-menu { display: none; }
.nav-menu-toggle {
  display: grid;
  list-style: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.nav-menu-toggle::-webkit-details-marker,
.nav-menu-toggle::marker { display: none; content: none; }
.nav-menu-toggle:hover,
.nav-menu[open] .nav-menu-toggle {
  color: var(--wine);
  border-color: color-mix(in srgb, var(--wine) 45%, var(--line));
  background: color-mix(in srgb, var(--wine) 10%, var(--card));
}
.nav-menu-panel { display: none; }

.phone-field { display: flex; align-items: center; gap: 0.35rem; }
.phone-prefix { color: var(--ink-soft); font-weight: 600; }
.btn-wa { background: #128C7E; color: #fff; }
.btn-wa:hover { background: #0e7368; color: #fff; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; min-height: 2.15rem; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 1rem; }
.ph-chips .btn { font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem; text-transform: none; }
.wa-preview { white-space: pre-wrap; background: var(--paper-2); padding: 1rem; border-radius: 12px; font-size: 0.95rem; }
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; max-width: 480px; width: calc(100% - 2rem); background: var(--card); color: var(--ink); }
dialog.modal::backdrop { background: rgba(28,22,18,0.45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); font-family: Fraunces, serif; }
.modal-body { padding: 1.1rem; }
.table-chip { cursor: grab; user-select: none; touch-action: none; }
.palette { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 1rem 0; }
.swatch { width: 72px; height: 72px; border-radius: 14px; display: grid; place-items: end; padding: 0.3rem; color: #fff; font-size: 0.65rem; text-shadow: 0 1px 2px #0008; }

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.site-footer {
  text-align: center;
  color: var(--ink-soft);
  padding: 2rem 1rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  font-size: 0.9rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0 1rem;
}
.display { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; margin: 0 0 1rem; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 42ch; }
.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.hero-card h3 { margin-top: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
  background: var(--paper-2);
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.muted { color: var(--ink-soft); }
.tiny { font-size: 0.82rem; color: var(--ink-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 0.55rem 1.05rem;
  border: 1px solid transparent; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit;
  min-height: 2.6rem;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--wine); color: #fff; }
.btn-primary:hover { background: var(--wine-deep); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-gold { background: var(--gold); color: #1c1612; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.2rem; }

label { display: block; font-weight: 600; margin: 0.7rem 0 0.3rem; }
input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 1rem;
  max-width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

.flash { padding: 0.8rem 1rem; border-radius: 12px; margin-bottom: 1rem; transition: opacity 0.4s; }
.flash-ok { background: #e5f3ea; color: var(--ok); }
.flash-error { background: #f8e6e8; color: var(--danger); }
.flash-warn { background: #f7ecdf; color: var(--warn); }
.flash-status {
  display: flex; align-items: flex-start; gap: 0.55rem; flex-wrap: wrap;
  margin: 0.6rem 0 1rem;
}
.flash-status-draft { background: #eee7da; color: var(--ink-soft); }
.flash-status-planned { background: #e8eef5; color: #3d5a80; }
.flash-status-published { background: #d9efe3; color: var(--ok); }
.flash-status-done { background: #efe8f2; color: #5c4a66; }

.badge-status-draft { background: #eee7da; color: var(--ink-soft); }
.badge-status-planned { background: #e8eef5; color: #3d5a80; }
.badge-status-published { background: #d9efe3; color: var(--ok); }
.badge-status-done { background: #efe8f2; color: #5c4a66; }

.subnav-wrap { position: relative; margin: 0.8rem 0 1.2rem; }
.subnav {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin: 0;
}
.subnav a {
  padding: 0.4rem 0.8rem; border-radius: 999px;
  background: transparent; color: var(--ink-soft); text-decoration: none;
  border: 1px solid transparent;
}
.subnav a.active, .subnav a:hover {
  background: var(--card); border-color: var(--line); color: var(--ink);
}

.stat { font-size: 1.7rem; font-family: Fraunces, serif; margin: 0.2rem 0; }
.progress {
  height: 10px; background: var(--paper-2); border-radius: 999px; overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--wine); }
.progress.warn > span { background: var(--warn); }
.progress.over > span { background: var(--danger); width: 100% !important; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }

.badge {
  display: inline-block; border-radius: 999px; padding: 0.15rem 0.55rem;
  font-size: 0.78rem; font-weight: 600;
}
.badge-pending { background: #eee7da; }
.badge-yes { background: #d9efe3; color: var(--ok); }
.badge-no { background: #f3d9dc; color: var(--danger); }
.badge-maybe { background: #f3e6cc; color: var(--warn); }
.badge-tier { background: #efe3c8; color: #6b4d1a; }
.badge-budget-quote { background: #e8eef5; color: #3d5a80; }
.badge-budget-expense { background: #f3e6cc; color: #6b4d1a; }
.badge-budget-advance { background: #d9efe3; color: var(--ok); }

.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }

.treasury-summary { padding: 1rem 1.2rem; }
.treasury-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem 1rem;
  margin: 0;
}
.treasury-kpis > div { min-width: 0; }
.treasury-kpis dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.treasury-kpis dd { margin: 0.2rem 0 0; font-size: 1.15rem; font-weight: 600; }

.table-inline select,
.table-inline .inline-text,
.table-inline .inline-num,
.table-inline .inline-date {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}
.table-inline select:focus,
.table-inline .inline-text:focus,
.table-inline .inline-num:focus,
.table-inline .inline-date:focus {
  border-color: var(--gold-soft);
  background: #fff;
  outline: none;
}
.table-inline .inline-num { max-width: 110px; }
.table-inline .inline-qty { max-width: 72px; }
.table-treasury { min-width: 1100px; }
.treasury-table {
  width: 100%;
  table-layout: fixed;
}
.treasury-table-poste {
  table-layout: fixed;
  width: 100%;
  min-width: 1180px;
}
.treasury-table-poste .col-poste-name { width: 14%; min-width: 120px; }
.treasury-table-poste th,
.treasury-table-poste td {
  padding: 0.35rem 0.45rem;
  vertical-align: middle;
}
.treasury-table-poste thead th {
  padding: 0.75rem 0.75rem 0.7rem 0.45rem;
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 5;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--wine) 12%, #fff) 0%,
      color-mix(in srgb, var(--paper) 40%, #fff) 100%
    );
  color: var(--wine-deep);
  font-family: var(--font-display, Fraunces, Georgia, serif);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 2px solid color-mix(in srgb, var(--gold) 60%, var(--wine) 25%);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--ink) 5%, transparent);
}
.treasury-table-poste thead th.num-col {
  text-align: right;
  white-space: nowrap;
}
.treasury-table-poste thead th.text-col {
  text-align: left;
}
.treasury-table-poste thead th.act-col {
  width: 2.5rem;
  padding-left: 0.25rem;
  padding-right: 0.35rem;
}
.treasury-table-poste thead th.treasury-col-poste {
  padding-left: 0.55rem;
}
.treasury-table-poste tbody td:nth-child(2),
.treasury-table-poste tbody td:nth-child(3),
.treasury-table-poste tbody td:nth-child(4),
.treasury-table-poste tbody td:nth-child(5),
.treasury-table-poste tbody td:nth-child(6),
.treasury-table-poste tbody td:nth-child(7),
.treasury-table-poste tbody td:nth-child(8) {
  text-align: right;
}
.treasury-table-poste tbody td:nth-child(2) .inline-num,
.treasury-table-poste tbody td:nth-child(3) .inline-num,
.treasury-table-poste tbody td:nth-child(4) .inline-num,
.treasury-table-poste tbody td:nth-child(5) .inline-num,
.treasury-table-poste tbody td:nth-child(6) .inline-num,
.treasury-table-poste tbody td:nth-child(7) .inline-num,
.treasury-table-poste tbody td:nth-child(8) .inline-num {
  padding-left: 0;
  padding-right: 0;
}
.treasury-table-poste .treasury-col-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  z-index: 2;
}
.treasury-table-poste td.treasury-resize-hit {
  cursor: col-resize;
}
.treasury-table-poste .treasury-col-resize::after {
  content: '';
  position: absolute;
  top: 18%;
  bottom: 18%;
  right: 3px;
  width: 2px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}
.treasury-table-poste .treasury-col-resize:hover::after,
body.treasury-col-resizing .treasury-table-poste .treasury-col-resize::after {
  background: var(--wine);
}
@media (pointer: coarse), (max-width: 860px) {
  .treasury-table-poste thead th {
    padding-right: 1.15rem;
  }
  .treasury-table-poste .treasury-col-resize {
    width: 32px;
    min-height: 44px;
  }
  .treasury-table-poste .treasury-col-resize::after {
    width: 3px;
    right: 14px;
    background: color-mix(in srgb, var(--ink) 34%, transparent);
  }
}
.table-scroll.is-col-resizing {
  overflow: hidden;
  touch-action: none;
}
body.treasury-col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: none;
}
.treasury-table-poste .treasury-poste-cell {
  vertical-align: top;
  min-width: 0;
}
.treasury-table-poste .treasury-poste-name {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.1rem;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  field-sizing: content;
}
.treasury-table-poste .row-add .treasury-poste-name:not(.treasury-add-poste-input) {
  min-height: 2.1rem;
}
.treasury-table-poste .col-qty { width: 5%; }
.treasury-table-poste .col-unit { width: 8%; }
.treasury-table-poste .col-budget { width: 8%; }
.treasury-table-poste .col-invoiced { width: 9%; }
.treasury-table-poste .col-budget-gap { width: 8%; }
.treasury-table-poste .col-paid-sum { width: 8%; }
.treasury-table-poste .col-reste { width: 8%; }
.treasury-table-poste .col-vendor { width: 12%; }
.treasury-table-poste .col-payer { width: 12%; }
.treasury-table-poste .col-act { width: 4%; }
.treasury-inline-form {
  display: block;
  margin: 0;
  padding: 0;
  height: 0;
  overflow: hidden;
}
.treasury-table-poste tbody td:nth-child(9) .inline-text,
.treasury-table-poste tbody td:nth-child(10) .inline-text {
  padding-left: 0;
  padding-right: 0;
  min-width: 0;
  width: 100%;
}
.treasury-table .inline-num,
.treasury-table .inline-qty,
.treasury-table .inline-date,
.treasury-table select,
.treasury-table .inline-text {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.treasury-table input[type=number]::-webkit-inner-spin-button,
.treasury-table input[type=number]::-webkit-outer-spin-button,
.treasury-table-poste input::-webkit-inner-spin-button,
.treasury-table-poste input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  display: none;
}
.treasury-table input[type=number],
.treasury-table-poste input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.treasury-table-poste input.inline-num,
.treasury-table-poste input.inline-qty,
.treasury-table-poste input.inline-money {
  appearance: none;
  -webkit-appearance: none;
  text-align: right;
}
.treasury-group-header td.num {
  text-align: right;
  padding: 0.35rem 0.45rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.treasury-group-header td.treasury-group-pad {
  padding: 0.35rem 0.45rem;
}
.treasury-group-header .group-sub-budget,
.treasury-group-header .group-sub-invoiced,
.treasury-group-header .group-sub-gap,
.treasury-group-header .group-sub-paid,
.treasury-group-header .group-sub-reste {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table-inline .inline-date { max-width: 140px; }
.table-inline .paid-cell { text-align: center; width: 3rem; }
.table-inline .paid-cell.is-disabled { opacity: 0.35; }
.table-inline .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-inline .row-add:not(.treasury-add-row) { background: color-mix(in srgb, var(--paper) 60%, #fff); }
.treasury-table-poste tbody,
.treasury-table-poste tr.treasury-add-row,
.treasury-table-poste tr.treasury-group-header {
  overflow: visible;
}
.treasury-table-poste .treasury-add-row td {
  position: relative;
  overflow: visible;
  padding: 0;
  height: 0;
  line-height: 0;
  border-bottom: none;
  background: transparent;
}
.treasury-add-line {
  position: relative;
  height: 0;
  overflow: visible;
}
.treasury-add-line::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 1px dashed color-mix(in srgb, var(--ink-soft) 22%, transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.treasury-add-row:hover .treasury-add-line::before,
.treasury-add-row.is-editing .treasury-add-line::before {
  opacity: 1;
}
.treasury-add-fab {
  position: absolute;
  left: 0.45rem;
  top: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 1.5px dashed color-mix(in srgb, var(--wine) 35%, transparent);
  border-radius: 999px;
  background: #fff;
  color: var(--wine);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transform: translateY(-50%) scale(0.96);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 6%, transparent);
  transition: opacity 0.2s ease, transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.treasury-add-row:hover .treasury-add-fab-poste,
.treasury-add-fab-poste:focus-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1.05);
  border-color: color-mix(in srgb, var(--wine) 55%, transparent);
  background: color-mix(in srgb, var(--wine) 8%, #fff);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--wine) 12%, transparent);
}
.treasury-add-fab-group {
  color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
}
.treasury-add-row .treasury-add-fab-group {
  left: 2.5rem;
}
.treasury-add-row:hover .treasury-add-fab-group,
.treasury-add-row .treasury-add-fab-group:focus-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1.05);
  border-color: color-mix(in srgb, var(--gold) 70%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, #fff);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--gold) 16%, transparent);
}
.treasury-group-header td.treasury-poste-cell {
  overflow: visible;
  position: relative;
}
.treasury-group-head-bar {
  position: relative;
  overflow: visible;
}
.treasury-group-header .treasury-add-fab-group {
  top: auto;
  bottom: 0;
  transform: translateY(50%) scale(0.96);
}
.treasury-group-header:hover .treasury-add-fab-group,
.treasury-group-header .treasury-add-fab-group:focus-visible {
  opacity: 1;
  transform: translateY(50%) scale(1.05);
  border-color: color-mix(in srgb, var(--gold) 70%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, #fff);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--gold) 16%, transparent);
}
.treasury-group-header.is-editing-group .treasury-add-editor-group {
  display: block;
  position: static;
  width: min(22rem, 100%);
  margin-top: 0.7rem;
}
.treasury-add-row.is-editing-group td {
  height: auto;
  line-height: normal;
  padding: 0 0.45rem 0.5rem;
}
.treasury-add-row.is-editing-group .treasury-add-line {
  height: auto;
}
.treasury-add-row.is-editing-group .treasury-add-editor-group {
  display: block;
  position: static;
  width: min(22rem, 100%);
  margin-top: 0.95rem;
}
.treasury-add-editor-group .treasury-add-group-input {
  display: block;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 8%, transparent);
}
.treasury-add-editor {
  display: none;
}
.treasury-add-row.is-editing td {
  height: auto;
  line-height: normal;
  padding: 0 0.45rem 0.5rem;
}
.treasury-add-row.is-editing .treasury-add-line {
  height: auto;
}
.treasury-add-row.is-editing .treasury-add-editor {
  display: block;
  position: static;
  width: min(22rem, 100%);
  margin-top: 0.95rem;
}
.treasury-add-row .treasury-add-poste-input {
  display: block;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--wine) 35%, transparent);
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 8%, transparent);
}
.table-inline .btn-icon {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.table-inline .btn-icon:hover { color: var(--danger); }

.treasury-poste-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.treasury-poste-head h3 { margin: 0; }
.treasury-groups-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.treasury-groups-bar label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.treasury-groups-bar .inline-text {
  width: auto;
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 280px;
  margin: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.treasury-groups-bar .btn {
  width: auto;
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
}
.treasury-groups-hint { margin: 0 0 0.75rem; }
.treasury-grand-total {
  background: color-mix(in srgb, var(--paper) 45%, #fff);
}
.treasury-grand-total td {
  font-weight: 700;
  padding: 0.35rem 0.45rem;
  border-top: 2px solid color-mix(in srgb, var(--ink-soft) 28%, transparent);
  vertical-align: middle;
}
.treasury-grand-total td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.treasury-grand-total-label {
  font-weight: 700;
}
.treasury-group-header { background: color-mix(in srgb, var(--paper) 65%, #fff); }
.treasury-group-header-inner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.treasury-group-header-inner .treasury-group-name {
  flex: 1;
  min-width: 0;
}
.treasury-group-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.treasury-group-toggle:hover { color: var(--wine); }
.treasury-group-section.is-collapsed .treasury-group-toggle {
  transform: rotate(-90deg);
}
.treasury-group-section.is-collapsed tr.treasury-group-collapsible {
  display: none;
}
.treasury-group-header td {
  font-weight: 600;
  padding: 0.35rem 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--ink-soft) 18%, transparent);
  vertical-align: middle;
}
.treasury-group-header.is-editing-group td {
  vertical-align: top;
}
.treasury-group-header .treasury-poste-cell {
  font-weight: 600;
}
.treasury-group-label {
  font-weight: 600;
}
.treasury-group-autres td { color: var(--ink-soft); font-style: italic; }
.treasury-group-autres .treasury-group-label { font-style: italic; }
.treasury-group-name { font-weight: 600; }
.treasury-group-select {
  width: 100%;
  min-width: 0;
  margin-bottom: 0.15rem;
  font-size: 0.78rem;
  padding: 0.25rem 1.4rem 0.25rem 0.35rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 0.55rem;
  cursor: pointer;
}
.treasury-group-select::-ms-expand {
  display: none;
}
.treasury-table-poste td:last-child {
  vertical-align: top;
  white-space: nowrap;
}
.treasury-table-poste td:last-child .treasury-delete-form {
  display: inline-block;
  vertical-align: middle;
}
.treasury-table-poste .treasury-poste-row[draggable="true"] {
  cursor: grab;
}
.treasury-table-poste .treasury-group-header[draggable="true"] {
  cursor: grab;
}
.treasury-table-poste .treasury-row-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.treasury-table-poste .treasury-drop-target td {
  background: color-mix(in srgb, var(--gold) 22%, var(--card));
}
.treasury-table-poste .treasury-drop-target .treasury-group-header td {
  background: color-mix(in srgb, var(--gold) 32%, var(--paper));
  box-shadow: inset 3px 0 0 var(--wine);
}
.treasury-table-poste .treasury-drop-before td {
  box-shadow: inset 0 3px 0 var(--wine);
}
.treasury-table-poste .treasury-drop-after td {
  box-shadow: inset 0 -3px 0 var(--wine);
}
.treasury-table-poste .treasury-group-header.treasury-drop-before td,
.treasury-table-poste .treasury-group-header.treasury-drop-after td {
  box-shadow: inset 0 3px 0 var(--wine);
}
.treasury-table-poste .treasury-group-header.treasury-drop-after td {
  box-shadow: inset 0 -3px 0 var(--wine);
}

@media (max-width: 900px) {
  .treasury-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .treasury-kpis { grid-template-columns: repeat(2, 1fr); }
}

.seating {
  position: relative; min-height: 380px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(90deg, rgba(114,47,55,0.05) 1px, transparent 1px),
    linear-gradient(rgba(114,47,55,0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
}
.table-chip {
  position: absolute; width: 140px; min-height: 88px;
  background: #fff; border: 1px solid var(--gold-soft);
  border-radius: 16px; padding: 0.6rem;
  box-shadow: var(--shadow);
}
.guest-space { max-width: 640px; margin: 0 auto; }
.ticket {
  border: 1px dashed var(--gold);
  border-radius: 20px;
  padding: 1.4rem;
  background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
}
.qr { width: 180px; height: 180px; background: #fff; border-radius: 12px; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }
.choice-card {
  display: block; border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem;
  background: #fff; cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s, background .15s;
}
.choice-card:hover { border-color: rgba(114,47,55,0.35); }
.choice-card.selected,
.choice-card:has(input:checked) {
  border-color: var(--wine);
  box-shadow: 0 0 0 2px rgba(114,47,55,0.18);
  background: #fff8f6;
}
.choice-card strong { display: block; margin-bottom: 0.25rem; }
.choice-card input[type="radio"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.reveal[hidden] { display: none !important; }
.reveal.is-open { display: block; animation: reveal .18s ease-out; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.perm-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem 1rem; margin-top: 0.4rem;
}
.perm-grid label { display: flex; gap: 0.45rem; align-items: center; font-weight: 500; margin: 0; }
.perm-grid input[type="checkbox"],
input[type="checkbox"] { width: auto; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.is-hidden { display: none !important; }
.inline-form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin: 0; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-inline: -0.15rem;
}
.card .table-scroll:has(.treasury-table-poste) {
  overflow-y: auto;
  max-height: min(72vh, 54rem);
}
.timeline-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.timeline-head h1 { margin-bottom: 0.25rem; }
.timeline-head .muted { margin: 0; max-width: 52ch; }
.timeline-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  position: relative;
}
.toolbar-popover-wrap {
  position: relative;
}
.toolbar-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 45;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem 1rem;
}
.toolbar-popover-lg {
  width: min(420px, calc(100vw - 2rem));
}
.toolbar-popover-xl {
  width: min(640px, calc(100vw - 2rem));
  max-height: min(70vh, 520px);
  overflow: auto;
}
.toolbar-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-family: var(--font-display, Fraunces, serif);
}
.toolbar-popover-head strong { font-weight: 650; }
.btn-icon.is-active,
.toolbar-popover-wrap:has(.toolbar-popover:not([hidden])) > .btn-icon {
  border-color: color-mix(in srgb, var(--wine) 45%, var(--line));
  color: var(--wine);
  background: color-mix(in srgb, var(--wine) 10%, var(--card));
}
.col-manager-scroll { max-height: 280px; margin-bottom: 0.25rem; }
.col-manager-table { font-size: 0.84rem; }
.col-manager-table input { min-width: 6.5rem; padding: 0.35rem 0.45rem; font-size: 0.84rem; }
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
}
.btn-icon:hover,
.icon-menu[open] > .btn-icon {
  border-color: color-mix(in srgb, var(--wine) 40%, var(--line));
  color: var(--wine);
  background: color-mix(in srgb, var(--wine) 6%, var(--card));
}
.icon-menu { position: relative; }
.icon-menu > summary { list-style: none; }
.icon-menu > summary::-webkit-details-marker { display: none; }
.icon-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 10.5rem;
  padding: 0.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.icon-menu-panel a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.icon-menu-panel a:hover {
  background: color-mix(in srgb, var(--wine) 8%, transparent);
  color: var(--wine);
  text-decoration: none;
}
.import-panel { margin-top: 0.5rem; margin-bottom: 0.75rem; }
.import-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.import-steps li {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-weight: 600;
}
.import-steps li.is-active {
  background: color-mix(in srgb, var(--wine) 12%, var(--paper-2));
  color: var(--wine);
}
.import-steps li.is-done {
  color: var(--ok);
}
.import-file-label span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.import-file-label input[type="file"] {
  width: 100%;
  padding: 0.55rem;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #fff;
}
.import-progress-wrap { margin: 0.75rem 0; }
.import-progress {
  height: 8px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.import-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--wine);
  transition: width 0.2s ease;
}
.import-map-table { font-size: 0.88rem; }
.import-map-table select {
  min-width: 11rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
}
.timeline-table { min-width: 980px; }
.timeline-table input,
.timeline-table select,
.timeline-table textarea {
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  min-width: 7rem;
}
.timeline-table textarea { min-height: 44px; }
.timeline-table .cell-title input { min-width: 12rem; }
.timeline-table .cell-wide textarea,
.timeline-table .cell-wide input { min-width: 10rem; }
.timeline-table tr.is-done-row { opacity: 0.58; }
.timeline-done {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
}
.horizon-late { color: var(--danger); font-weight: 650; }
.horizon-today { color: var(--warn); font-weight: 650; }
.horizon-done { color: var(--ok); }
.col-manager > summary {
  cursor: pointer;
  font-weight: 650;
  font-family: var(--font-display, Fraunces, Georgia, serif);
}
.col-manager-table { min-width: 640px; }
.timeline-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem 0.9rem;
}
.timeline-add-field.span-2 { grid-column: span 2; }

body:has(.gantt-board) .wrap {
  width: min(1540px, calc(100% - 1.15rem));
}
.gantt-card { padding: 1rem 1rem 1.1rem; }
.gantt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0 0 0.75rem;
}
.gantt-toolbar-label {
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.gantt-group-by {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.gantt-group-by label.gantt-toolbar-label {
  display: inline;
  margin: 0;
}
.gantt-select-wrap {
  position: relative;
  display: inline-flex;
}
.gantt-select-wrap::after {
  content: '';
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-20%);
  border: 4px solid transparent;
  border-top-color: var(--ink-soft);
  pointer-events: none;
}
.gantt-group-by-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  min-width: 8.2rem;
  margin: 0;
  padding: 0.4rem 1.9rem 0.4rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.gantt-group-by-select:hover {
  border-color: color-mix(in srgb, var(--wine) 35%, var(--line));
  color: var(--wine);
}
.gantt-group-by-select:focus,
.gantt-group-by-select:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--wine) 45%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wine) 14%, transparent);
}
.gantt-toolbar .gantt-legend {
  margin: 0;
  flex: 1;
  min-width: 12rem;
}
.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 0 0 0.75rem;
}
.gantt-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.gantt-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: var(--wine);
}
.gantt-swatch-diamond {
  width: 10px;
  height: 10px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--gold);
}
.gantt-swatch-jour { background: var(--wine); box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--wine); }
.gantt-swatch-we { background: var(--paper-2); border: 1px solid var(--line); }

.gantt-board {
  display: grid;
  grid-template-columns: minmax(280px, 40%) 1fr;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  min-height: 280px;
}
.gantt-table-pane,
.gantt-chart-pane {
  max-height: min(70vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.gantt-table-pane { border-right: 2px solid var(--line); }
.gantt-chart-pane { background: var(--card); }

.gantt-table { min-width: 520px; border-collapse: separate; border-spacing: 0; }
.gantt-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 64px;
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
  vertical-align: middle;
}
.gantt-table tbody td {
  height: 52px;
  max-height: 52px;
  padding: 0.2rem 0.35rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.gantt-table tbody tr.gantt-phase-row td {
  height: 34px;
  max-height: 34px;
  padding: 0;
  background: var(--phase, var(--wine));
  color: #fff;
  border-bottom: 0;
}
.gantt-table .col-status,
.gantt-table .cell-status { width: 8.2rem; white-space: nowrap; }
.gantt-table .col-add { width: 2.2rem; text-align: left; padding-left: 0.2rem; padding-right: 0; }
.gantt-table .col-actions { width: 7.5rem; text-align: right; white-space: nowrap; }
.gantt-table .cell-date { width: 6.2rem; }
.gantt-table .cell-title { min-width: 9.5rem; }
.gantt-task-row { cursor: pointer; }
.gantt-task-row:hover td { background: color-mix(in srgb, var(--wine) 7%, #fff); }
.gantt-cell-text {
  display: block;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.gantt-table .cell-title .gantt-cell-text { font-weight: 600; }
.gantt-table .cell-date .gantt-cell-text { font-variant-numeric: tabular-nums; }
dialog.modal.modal-wide { max-width: 680px; }
dialog.modal.modal-wide .modal-body {
  max-height: min(72vh, 640px);
  overflow-y: auto;
}
.gantt-phase-head {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  min-height: 34px;
  padding-left: 0.15rem;
}
.gantt-phase-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  height: 34px;
  padding: 0 0.7rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  font-family: var(--font-display, Fraunces, Georgia, serif);
  cursor: pointer;
  text-align: left;
}
.gantt-phase-head .gantt-phase-toggle {
  flex: 1;
  min-width: 0;
  width: auto;
  padding-left: 0.25rem;
}
.gantt-chevron { font-size: 0.75rem; opacity: 0.9; }
.gantt-phase-toggle[aria-expanded="false"] .gantt-chevron { transform: rotate(-90deg); display: inline-block; }
.gantt-plus {
  flex: 0 0 auto;
  appearance: none;
  width: 28px;
  height: 28px;
  margin: 0 0.2rem;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  opacity: 0.9;
}
.gantt-plus:hover,
.gantt-plus:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}
.gantt-table thead .gantt-plus {
  color: var(--wine);
  font-size: 1.35rem;
}
.gantt-table thead .gantt-plus:hover,
.gantt-table thead .gantt-plus:focus-visible {
  background: color-mix(in srgb, var(--wine) 12%, #fff);
}

.gantt-chart { position: relative; min-height: 100%; }
.gantt-cal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 64px;
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
}
.gantt-months,
.gantt-days,
.gantt-track {
  display: flex;
}
.gantt-month {
  height: 28px;
  line-height: 28px;
  padding: 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: capitalize;
  border-right: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  color: var(--ink);
}
.gantt-day {
  flex: 0 0 var(--day-w);
  width: var(--day-w);
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  color: var(--ink-soft);
  border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  position: relative;
}
.gantt-day.is-weekend,
.gantt-cell.is-weekend { background: color-mix(in srgb, var(--paper-2) 80%, #fff); }
.gantt-day.is-jour-j,
.gantt-cell.is-jour-j {
  background: color-mix(in srgb, var(--wine) 16%, #fff);
  color: var(--wine);
  font-weight: 700;
}
.gantt-day.is-today { box-shadow: inset 0 -2px 0 var(--gold); }
.gantt-flag {
  position: absolute;
  top: 1px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.gantt-phase-track {
  height: 34px;
  background: color-mix(in srgb, var(--phase, var(--wine)) 22%, #fff);
  border-bottom: 1px solid color-mix(in srgb, var(--phase, var(--wine)) 35%, var(--line));
}
.gantt-track {
  position: relative;
  height: 52px;
  border-bottom: 1px solid var(--line);
}
.gantt-cell {
  flex: 0 0 var(--day-w);
  width: var(--day-w);
  height: 52px;
  border-right: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.gantt-bar,
.gantt-diamond {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.gantt-bar {
  top: 14px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 4px rgba(28, 22, 18, 0.18);
}
.gantt-bar-label {
  padding: 0 0.45rem;
  font-size: 0.65rem;
  font-weight: 650;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-diamond {
  top: 19px;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 1px 3px rgba(28, 22, 18, 0.2);
}
.gantt-board .is-phase-collapsed { display: none !important; }
.gantt-table tr.is-done-row,
.gantt-track.is-done-row { opacity: 0.55; }
.gantt-table tr.is-progress-row td { background: color-mix(in srgb, #3d5a80 8%, #fff); }
.gantt-track.is-progress-row .gantt-bar,
.gantt-track.is-progress-row .gantt-diamond {
  box-shadow: 0 1px 6px rgba(61, 90, 128, 0.38);
}

.badge-tl-not_started { background: #eee7da; color: var(--ink-soft); }
.badge-tl-in_progress { background: color-mix(in srgb, #3d5a80 20%, #fff); color: #2c4563; }
.badge-tl-done { background: #d9efe3; color: var(--ok); }
.badge-tl-paused { background: #f3e6cc; color: var(--warn); }
.badge-tl-abandoned { background: #f3d9dc; color: var(--danger); }

.phase-color-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.phase-color-pick {
  position: relative;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(28, 22, 18, 0.18);
}
.phase-color-pick input {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  appearance: none;
  opacity: 0;
  cursor: pointer;
}
.phase-color-pick:has(input:checked),
.phase-color-pick:has(input:focus-visible) {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--swatch);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .gantt-board { grid-template-columns: 1fr; }
  .gantt-table-pane {
    border-right: 0;
    border-bottom: 2px solid var(--line);
    max-height: 42vh;
  }
  .gantt-chart-pane { max-height: 42vh; }
}

@media (max-width: 860px) {
  .hero, .grid-3, .grid-2, .form-row, .choice-grid, .perm-grid { grid-template-columns: 1fr; }
  .timeline-add-field.span-2 { grid-column: span 1; }
}

@media (min-width: 900px) {
  .nav-menu { display: none !important; }
  .label-short { display: none !important; }
  .label-full { display: inline !important; }
}

@media (max-width: 899px) {
  .topbar {
    padding: 0.55rem 0.85rem;
    padding-top: max(0.55rem, env(safe-area-inset-top));
    padding-left: max(0.85rem, calc(env(safe-area-inset-left) + 0.7rem));
    padding-right: max(0.85rem, calc(env(safe-area-inset-right) + 0.7rem));
    gap: 0.55rem;
  }
  .topnav { gap: 0.45rem; }
  .topbar.is-auth .topnav-links { display: none !important; }
  .nav-logout { display: none !important; }
  .label-full { display: none !important; }
  .label-short { display: inline !important; }
  .nav-menu {
    display: block;
    position: relative;
    flex-shrink: 0;
  }
  .nav-menu-toggle { display: grid; }
  .nav-menu[open] .nav-menu-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    left: max(0.7rem, env(safe-area-inset-left));
    right: max(0.7rem, env(safe-area-inset-right));
    top: calc(env(safe-area-inset-top, 0px) + 4.15rem);
    min-width: 0;
    max-height: min(72dvh, calc(100dvh - 5.4rem));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.15rem;
    padding: 0.55rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .nav-menu-panel .nav-link {
    display: flex;
    padding: 0.82rem 0.9rem;
    border-radius: 12px;
    white-space: normal;
    min-height: 2.7rem;
  }
  .nav-menu-panel .nav-link:hover,
  .nav-menu-panel .nav-link.is-active {
    background: color-mix(in srgb, var(--wine) 10%, transparent);
    color: var(--wine);
  }
  .nav-menu-panel .nav-logout-item {
    margin-top: 0.2rem;
    border-top: 1px solid var(--line);
    border-radius: 12px;
    padding-top: 0.75rem;
  }
  .nav-user-name { display: none; }
  .nav-user-chip { padding: 0.15rem; max-width: none; }
  .brand-name {
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  details.nav-menu > summary { list-style: none; }
  .notify-panel {
    position: fixed;
    right: max(0.7rem, env(safe-area-inset-right));
    left: max(0.7rem, env(safe-area-inset-left));
    width: auto;
    top: calc(env(safe-area-inset-top, 0px) + 4.15rem);
    max-height: min(70dvh, calc(100dvh - 5.4rem));
  }
}

@media (max-width: 420px) {
  .btn-new-event,
  .btn-register { padding: 0.45rem 0.75rem; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inbox-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.inbox-head h1 { margin: 0.15rem 0 0; }
.inbox-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.inbox-compose-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 42px;
  height: 42px;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line));
  background: color-mix(in srgb, var(--gold) 16%, var(--card));
  color: var(--wine);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  list-style: none;
  -webkit-appearance: none;
  appearance: none;
}
.inbox-compose-trigger .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
}
.inbox-compose-trigger:hover,
.inbox-compose-trigger.is-open {
  color: #fff;
  background: var(--wine);
  border-color: var(--wine);
}
.inbox-compose-trigger[hidden] { display: none !important; }
.inbox-compose-label { line-height: 1; }
.inbox-compose { margin-top: 0.85rem; }
.inbox-compose:has([data-compose-panel][hidden]) { grid-template-columns: 1fr; }
.inbox-compose:not(:has([data-compose-panel]:not([hidden]))) {
  margin-top: 0;
  gap: 0;
}
.inbox-compose-panel h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
}
.inbox-compose-panel h2 .nav-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--wine);
}
.btn-icon-first { gap: 0.4rem; position: relative; }
.btn-icon-first .nav-icon {
  width: 1.05rem;
  height: 1.05rem;
}
.btn-icon-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, #fff);
}
.btn-icon-danger:hover,
.btn-icon-danger:focus-visible {
  color: #fff;
  background: var(--danger);
  border-color: var(--wine-deep);
}
.inbox-hide .nav-icon,
.thread-hide .nav-icon,
.btn-icon-danger .nav-icon {
  width: 1.15rem;
  height: 1.15rem;
}
.inbox-list { padding: 0.35rem 0.4rem; }
.inbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}
.inbox-item:hover { background: color-mix(in srgb, var(--wine) 7%, transparent); text-decoration: none; }
.inbox-item.is-unread { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.inbox-item-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.inbox-item-main:hover { text-decoration: none; }
.inbox-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.18rem; }
.inbox-item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}
.inbox-item-top strong { font-size: 1.02rem; }
.inbox-item-meta { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.inbox-preview { color: var(--ink-soft); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-unread {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.badge-msg-unread { background: color-mix(in srgb, var(--wine) 16%, #fff); color: var(--wine); }
.badge-kind-direct { background: #efe3c8; color: #6b4d1a; }
.badge-kind-group { background: #e8eef5; color: #3d5a80; }
.badge-kind-vendor { background: #eee7da; color: var(--ink-soft); }
.inbox-hide {
  flex-shrink: 0;
  margin: 0;
  align-self: center;
}

.member-pick {
  display: grid;
  gap: 0.35rem;
  max-height: 12rem;
  overflow: auto;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.member-pick label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-weight: 500;
}
.member-pick input { width: auto; }

.thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.thread-head > div { min-width: 0; flex: 1; }
.thread-head h1 { margin: 0.2rem 0 0.35rem; overflow-wrap: anywhere; }
.thread-people { margin: 0; }
.thread-hide { margin: 0.15rem 0 0; flex-shrink: 0; }
.thread-card { padding: 0; overflow: hidden; }
.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.2rem;
  max-height: min(58vh, 560px);
  overflow: auto;
  background: color-mix(in srgb, var(--paper) 65%, #fff);
}
.msg { max-width: min(78%, 40rem); }
.msg.is-mine { margin-left: auto; }
.msg-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.28rem;
}
.msg-meta .nav-avatar { width: 22px; height: 22px; font-size: 0.58rem; }
.msg-bubble {
  padding: 0.7rem 0.9rem;
  border-radius: 16px 16px 16px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  line-height: 1.45;
}
.msg.is-mine .msg-bubble {
  background: color-mix(in srgb, var(--wine) 12%, #fff);
  border-color: color-mix(in srgb, var(--wine) 22%, var(--line));
  border-radius: 16px 16px 6px 16px;
}
.msg-receipt {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.28rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.msg.is-mine .msg-receipt { width: 100%; justify-content: flex-end; }
.msg.is-pending { opacity: 0.72; }
.msg-receipt.is-sent { color: var(--ink-soft); }
.msg-receipt.is-delivered { color: #5c5854; }
.msg-receipt.is-read { color: var(--wine); }
.msg-ticks { display: block; flex-shrink: 0; }
.msg-legend { margin: 0.35rem 0 0; letter-spacing: 0.02em; }
.msg-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  align-items: end;
  padding: 0.9rem 1.1rem 1.1rem;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.msg-compose textarea { min-height: 72px; margin: 0; }

@media (max-width: 860px) {
  .msg-compose { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .msg-compose {
    position: sticky;
    bottom: 0;
    z-index: 8;
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  }
  .msg-compose .btn { width: 100%; }
  .inbox-compose-trigger {
    width: 42px;
    padding: 0;
  }
  .inbox-compose-label { display: none; }
  .inbox-item { gap: 0.45rem; padding: 0.7rem 0.55rem; }
  .inbox-compose-panel .btn-icon-first { min-width: 2.6rem; }
}

@media (max-width: 520px) {
  .inbox-compose-panel .btn-icon-first {
    width: 42px;
    padding: 0;
    flex: 0 0 42px;
  }
  .inbox-compose-panel .btn-icon-first > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

.gift-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
}
.scan-reader { max-width: 420px; width: 100%; margin: 0 auto; }
.scan-reader video,
.scan-reader canvas,
.scan-reader img { width: 100% !important; height: auto !important; }
.scan-manual input { min-width: 0; }
.seating-add input[name="label"] { max-width: 160px; }
.seating-add input[name="capacity"] { max-width: 90px; }

/* —— Confort mobile —— */
@media (max-width: 860px) {
  .wrap {
    width: min(1120px, calc(100% - 1.25rem));
    margin: 1rem auto 2.25rem;
  }
  h1 { font-size: 1.55rem; line-height: 1.18; overflow-wrap: anywhere; }
  h2 { font-size: 1.22rem; overflow-wrap: anywhere; }
  .display { font-size: clamp(1.85rem, 9vw, 2.7rem); }
  .lede { font-size: 1.05rem; max-width: none; }
  .card { padding: 1rem 1.05rem; }
  .hero { padding: 1.1rem 0 0.4rem; gap: 1.2rem; }
  .actions { align-items: stretch; }
  .inline-form { width: 100%; }
  .inline-form input { flex: 1 1 10rem; min-width: 0; }
  body.nav-auth .wrap {
    min-height: calc(100dvh - 6.5rem);
    padding-top: 0.75rem;
    justify-content: flex-start;
  }
  .subnav-wrap {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 3.35rem);
    z-index: 28;
    margin: 0.35rem -0.35rem 1rem;
    padding: 0.35rem 0 0.45rem;
    background: color-mix(in srgb, var(--paper) 88%, #fff);
    backdrop-filter: blur(10px);
  }
  .subnav-wrap::after {
    content: '';
    position: absolute;
    top: 0.35rem;
    right: 0;
    bottom: 0.45rem;
    width: 1.6rem;
    background: linear-gradient(90deg, transparent, var(--paper));
    pointer-events: none;
  }
  .subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding: 0 0.35rem 0.1rem;
  }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.48rem 0.85rem;
    font-size: 0.88rem;
    background: var(--card);
    border-color: var(--line);
  }
  .seating { min-height: min(62vh, 460px); }
  dialog.modal {
    width: calc(100% - 1.2rem);
    max-height: calc(100dvh - 1.6rem);
    margin: auto;
  }
  .toolbar-popover,
  .icon-menu-panel {
    right: auto;
    left: 0;
    max-width: calc(100vw - 1.5rem);
  }
  .scan-reader { width: 100%; max-width: 100%; }
  .scan-manual { flex-wrap: wrap; }
  .scan-manual input { flex: 1 1 100%; min-width: 0; }
  .gift-row {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .gift-row form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }
  .gift-row .btn { width: 100%; }
  .ticket { padding: 1.1rem; text-align: center; }
  .ticket .qr { margin: 0.6rem auto 0; }
  .inbox-item-top { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .msg-thread { max-height: min(58dvh, 520px); }
  .gantt-toolbar { gap: 0.55rem 0.85rem; }
  .timeline-toolbar-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 720px) {
  .table-stack {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }
  .table-scroll:has(.table-stack) { overflow: visible; }
  .table-stack thead { display: none; }
  .table-stack tbody { display: block; }
  .table-stack tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin: 0 0 0.75rem;
    box-shadow: 0 8px 20px rgba(28, 22, 18, 0.05);
  }
  .table-stack tr:last-child { margin-bottom: 0; }
  .table-stack td {
    display: grid;
    grid-template-columns: 6.2rem minmax(0, 1fr);
    align-items: start;
    gap: 0.35rem 0.75rem;
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
  }
  .table-stack td:first-child { padding-top: 0; }
  .table-stack td:last-child { border-bottom: 0; padding-bottom: 0; }
  .table-stack td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
    padding-top: 0.35rem;
  }
  .table-stack td:not([data-label]),
  .table-stack td[data-label=""] {
    grid-template-columns: 1fr;
  }
  .table-stack td:not([data-label])::before,
  .table-stack td[data-label=""]::before { display: none; }
  .table-stack .phone-field { width: 100%; flex-wrap: wrap; }
  .table-stack .phone-field input { flex: 1 1 8rem; min-width: 0; }
  .table-stack .actions { margin: 0; width: 100%; }
  .table-stack select,
  .table-stack input { font-size: 1rem; }
  .table-stack .btn { width: auto; }
  .table-stack .btn-wa { width: 100%; }
}

@media (max-width: 640px) {
  .topbar:not(.is-auth) .topnav-links { display: none; }
  .auth-card .actions,
  .guest-space .actions,
  form.actions,
  .scan-manual {
    flex-direction: column;
    align-items: stretch;
  }
  .auth-card .actions .btn,
  .guest-space .actions .btn,
  form.actions .btn,
  form.actions input,
  .scan-manual .btn,
  .scan-manual input {
    width: 100%;
    max-width: none !important;
  }
  .seating-add input { max-width: none; }
  .pills { justify-content: flex-start; }
  .hero-logo { width: min(120px, 42vw); }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
  .wrap { width: calc(100% - 1rem); }
  .card { padding: 0.9rem 0.9rem; }
  .qr { width: 148px; height: 148px; }
}
