:root {
  --ivory: #f7f2ea;
  --ivory-deep: #eee5d8;
  --paper: #fffdf9;
  --espresso: #2b211a;
  --espresso-soft: #4b3c31;
  --ink: #342b25;
  --muted: #766c63;
  --gold: #805d33;
  --gold-soft: #d8c29f;
  --sage: #3f4742;
  --sage-deep: #303833;
  --sage-soft: #dce7d4;
  --powder: #d7eaf1;
  --blush: #efd6d3;
  --butter: #f1e7bd;
  --lavender: #dedaf0;
  --success: #2f684b;
  --danger: #99493f;
  --warning: #74551f;
  --border: rgba(67, 51, 40, .13);
  --border-strong: rgba(67, 51, 40, .22);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow-sm: 0 1px 2px rgba(45, 34, 25, .06), 0 8px 20px rgba(45, 34, 25, .04);
  --shadow-md: 0 18px 50px rgba(45, 34, 25, .09);
  --sidebar: 276px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
a, button, input, select { touch-action: manipulation; }
button { border: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { display: block; width: 1.15rem; height: 1.15rem; stroke-width: 1.8; }

:focus-visible {
  outline: 3px solid rgba(169, 133, 82, .42);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--espresso);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand-mark {
  display: inline-block;
  flex: 0 0 auto;
  width: 42px;
  height: 34px;
  background-color: var(--espresso);
  -webkit-mask: url(../../assets/logo-mark.png) center / contain no-repeat;
  mask: url(../../assets/logo-mark.png) center / contain no-repeat;
}
.brand-mark--light { background-color: var(--ivory); }
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.eyebrow--light { color: var(--gold-soft); }

.boot-screen {
  position: fixed;
  z-index: 999;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  background: var(--sage);
  color: rgba(247, 242, 234, .72);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: opacity .35s ease, visibility .35s ease;
}
.boot-screen.is-hidden { opacity: 0; visibility: hidden; }
.boot-screen .brand-mark { width: 64px; height: 50px; margin-bottom: 8px; }
.loader {
  width: 34px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
}
.loader::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-soft);
  animation: load 1.1s ease-in-out infinite alternate;
}
@keyframes load { to { transform: translateX(125%); } }

/* Authentication */
.auth-page {
  min-height: 100vh;
  display: grid;
  background: var(--paper);
}
.auth-visual {
  position: relative;
  isolation: isolate;
  display: none;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(28px, 4vw, 58px);
  background:
    radial-gradient(circle at 13% 22%, rgba(231, 179, 177, .36), transparent 28%),
    radial-gradient(circle at 70% 48%, rgba(174, 198, 220, .25), transparent 30%),
    linear-gradient(145deg, #4b4c47 0%, #38443d 50%, #303732 100%);
  color: var(--ivory);
}
.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .72;
}
.auth-visual::before {
  right: -26vw;
  bottom: -35vw;
  background: radial-gradient(circle at 35% 30%, #e7beba, #b6bad2 32%, rgba(124, 120, 144, .12) 65%, transparent 68%);
}
.auth-visual::after {
  right: -8vw;
  bottom: -30vw;
  background: radial-gradient(circle at 45% 35%, #f0d8c2, #c9b8d7 40%, rgba(88, 85, 108, 0) 70%);
  filter: blur(28px);
}
.auth-visual__noise {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.auth-brand { position: relative; z-index: 3; }
.auth-brand__link,
.auth-panel__mobile-brand,
.sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-decoration: none;
  text-transform: uppercase;
}
.auth-visual__copy {
  position: relative;
  z-index: 3;
  align-self: center;
  width: min(650px, 85%);
  margin: auto 0;
}
.auth-visual__copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 5.7vw, 6.6rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .87;
}
.auth-visual__copy h2 em { color: #ead9bd; font-weight: 400; }
.auth-visual__copy > p:last-child {
  max-width: 480px;
  margin: 28px 0 0;
  color: rgba(247, 242, 234, .7);
  font-size: clamp(.95rem, 1.2vw, 1.1rem);
  font-weight: 300;
}
.auth-visual__footer {
  position: relative;
  z-index: 3;
  margin: 0;
  color: rgba(247, 242, 234, .48);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.auth-orbit { position: absolute; z-index: 2; right: 9%; bottom: 11%; width: 285px; height: 270px; }
.auth-orbit::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -190px;
  width: 460px;
  height: 460px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
}
.auth-orbit__card {
  position: absolute;
  display: flex;
  align-items: flex-end;
  width: 128px;
  height: 164px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 30px;
  box-shadow: 0 26px 60px rgba(30, 25, 28, .2);
  color: #3e3834;
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1;
}
.auth-orbit__card--one { left: 74px; top: 0; z-index: 2; background: var(--powder); }
.auth-orbit__card--two { left: -8px; top: 54px; transform: rotate(-18deg); background: var(--sage-soft); }
.auth-orbit__card--three { right: -12px; top: 58px; transform: rotate(18deg); background: var(--butter); }
.auth-panel {
  display: grid;
  min-height: 100vh;
  padding: 28px 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(216, 194, 159, .2), transparent 28%),
    var(--paper);
}
.auth-panel__inner { width: min(100%, 430px); margin: auto; }
.auth-panel__mobile-brand { margin-bottom: 60px; color: var(--espresso); }
.auth-panel h1,
.auth-panel h2 {
  margin: 0;
  color: var(--espresso);
  font-family: var(--serif);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1;
}
.auth-panel__intro { margin: 14px 0 30px; color: var(--muted); font-size: .94rem; }
.auth-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field__label-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.field label { color: var(--espresso-soft); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.field label span { color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); font-size: .72rem; }
.field__control { position: relative; }
.field__control > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: #94877c;
  pointer-events: none;
}
.field input,
.field select,
.field textarea,
.search-field input,
.filter-select select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, .68);
  color: var(--espresso);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.field input, .field select, .field textarea { padding: 11px 14px; }
.field__control input { padding-left: 44px; padding-right: 46px; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.filter-select select:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(169, 133, 82, .11);
}
.field input::placeholder, .search-field input::placeholder { color: #a2988e; }
.text-button,
.back-button,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  color: var(--gold);
  font-size: .76rem;
  font-weight: 600;
}
.back-button { min-height: 44px; margin-bottom: 26px; color: var(--muted); }
.back-button:hover, .text-button:hover, .text-link:hover { color: var(--espresso); }
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .035em;
  transition: transform .2s var(--ease), box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .58; transform: none; }
.button--full { width: 100%; }
.button--primary { background: var(--espresso); color: var(--ivory); box-shadow: 0 9px 24px rgba(43, 33, 26, .16); }
.button--primary:hover { background: var(--espresso-soft); box-shadow: 0 12px 28px rgba(43, 33, 26, .2); }
.button--secondary { border-color: var(--border-strong); background: var(--paper); color: var(--espresso); }
.button--secondary:hover { border-color: var(--gold); }
.button--light { background: var(--ivory); color: var(--espresso); }
.button--light:hover { background: #fff; }
.button--ghost-dark { border-color: var(--border-strong); background: transparent; color: var(--espresso); }
.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--espresso);
  transition: background .2s ease, color .2s ease;
}
.icon-button:hover { background: var(--ivory-deep); }
.icon-button--inside { position: absolute; z-index: 2; top: 2px; right: 2px; }
.icon-button--dark { color: var(--ivory); }
.icon-button--dark:hover { background: rgba(255, 255, 255, .1); }
.form-message { min-height: 20px; margin: -4px 0 0; color: var(--danger); font-size: .8rem; }
.form-message.is-success { color: var(--success); }
.auth-help { margin: 25px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.auth-help a { color: var(--espresso); font-weight: 600; }
.setup-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(138, 104, 41, .22);
  border-radius: 14px;
  background: rgba(241, 231, 189, .38);
  color: var(--warning);
}
.setup-notice strong, .setup-notice span { display: block; }
.setup-notice strong { color: #635021; font-size: .82rem; }
.setup-notice span { margin-top: 3px; font-size: .74rem; }

/* App shell */
.app-shell { min-height: 100vh; background: #f5f0e8; }
.sidebar {
  position: fixed;
  z-index: 90;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 30px 22px 22px;
  background:
    radial-gradient(circle at 15% 8%, rgba(214, 192, 157, .11), transparent 25%),
    var(--sage-deep);
  color: var(--ivory);
}
.sidebar__brand { padding: 0 8px; }
.sidebar__nav { display: grid; gap: 6px; margin-top: 70px; }
.nav-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  border-radius: 13px;
  background: transparent;
  color: rgba(247, 242, 234, .6);
  font-size: .84rem;
  text-align: left;
  transition: background .2s ease, color .2s ease, transform .2s var(--ease);
}
.nav-item:hover { background: rgba(255, 255, 255, .055); color: var(--ivory); transform: translateX(2px); }
.nav-item.is-active { background: rgba(247, 242, 234, .11); color: var(--ivory); }
.nav-item svg { width: 18px; height: 18px; }
.nav-item__count { min-width: 23px; margin-left: auto; padding: 2px 7px; border-radius: 99px; background: var(--butter); color: #49432c; font-size: .67rem; text-align: center; }
.sidebar__bottom { display: grid; gap: 14px; margin-top: auto; }
.support-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
  color: inherit;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}
.support-card:hover { border-color: rgba(216, 194, 159, .35); background: rgba(255, 255, 255, .08); }
.support-card__icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--butter); color: #51482e; }
.support-card > svg { width: 15px; opacity: .45; }
.support-card strong, .support-card small { display: block; }
.support-card strong { font-size: .72rem; }
.support-card small { margin-top: 2px; color: rgba(247, 242, 234, .46); font-size: .64rem; }
.account-card { display: flex; gap: 10px; align-items: center; padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: #d8c29f;
  color: #40382c;
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 600;
}
.avatar--button { border-color: var(--border); }
.account-card__copy { min-width: 0; flex: 1; }
.account-card__copy strong, .account-card__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card__copy strong { font-size: .72rem; }
.account-card__copy small { margin-top: 2px; color: rgba(247, 242, 234, .43); font-size: .62rem; }
.mobile-header { display: none; }
.sidebar-scrim { display: none; }
.dashboard { min-height: 100vh; margin-left: var(--sidebar); padding: 32px clamp(24px, 4vw, 62px) 70px; }
.dashboard-header {
  display: flex;
  min-height: 66px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.dashboard-header h1 {
  margin: 0;
  color: var(--espresso);
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .95;
}
.dashboard-header__actions { display: flex; align-items: center; gap: 10px; }
.event-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-left: 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 253, 249, .65);
}
.event-select select { max-width: 190px; padding: 9px 35px 9px 0; border: 0; appearance: none; background: transparent; outline: 0; font-size: .75rem; font-weight: 600; }
.event-select > svg:first-of-type { width: 16px; color: var(--gold); }
.event-select > svg:last-of-type { position: absolute; right: 12px; width: 14px; pointer-events: none; }
.live-pill {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(47, 104, 75, .16);
  border-radius: 999px;
  background: rgba(220, 231, 212, .55);
  color: var(--success);
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.live-pill > span { width: 7px; height: 7px; border-radius: 50%; background: #4c9a6f; box-shadow: 0 0 0 4px rgba(76, 154, 111, .12); }
.live-pill.is-offline { border-color: rgba(138, 104, 41, .18); background: rgba(241, 231, 189, .44); color: var(--warning); }
.live-pill.is-offline > span { background: #b38d43; box-shadow: 0 0 0 4px rgba(179, 141, 67, .12); }
.dashboard-view { animation: view-in .34s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } }
.surface-card { border: 1px solid var(--border); border-radius: 24px; background: rgba(255, 253, 249, .83); box-shadow: var(--shadow-sm); }

.event-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 300px;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr);
  align-items: center;
  gap: 30px;
  overflow: hidden;
  padding: clamp(28px, 4.2vw, 54px);
  border: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(216, 194, 159, .13), transparent 28%),
    linear-gradient(130deg, #414945 0%, #343c37 100%);
  color: var(--ivory);
  box-shadow: 0 24px 60px rgba(48, 56, 51, .16);
}
.event-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -12%;
  bottom: -75%;
  width: 56%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(255, 255, 255, .02), 0 0 0 120px rgba(255, 255, 255, .015);
}
.event-hero__copy { position: relative; z-index: 3; }
.event-hero__label { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-soft); font-size: .72rem; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.event-hero__label svg { width: 15px; }
.event-hero h2 {
  max-width: 720px;
  margin: 16px 0 4px;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .92;
}
.event-hero__copy > p { margin: 8px 0 0; color: rgba(247, 242, 234, .62); font-size: .92rem; }
.event-hero__actions { display: flex; align-items: center; gap: 18px; margin-top: 28px; }
.last-update { display: inline-flex; align-items: center; gap: 7px; color: rgba(247, 242, 234, .5); font-size: .68rem; }
.last-update svg { width: 14px; }
.response-stack { position: relative; z-index: 2; width: 280px; height: 220px; justify-self: center; }
.response-stack__card {
  position: absolute;
  display: flex;
  width: 152px;
  height: 190px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 34px;
  box-shadow: 0 25px 50px rgba(18, 19, 18, .2);
  color: #403a34;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: .95;
  transition: transform .35s var(--ease);
}
.response-stack__card svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: rgba(255, 255, 255, .42); }
.response-stack__card--back { left: 0; top: 23px; transform: rotate(-15deg); background: var(--sage-soft); }
.response-stack__card--middle { right: 0; top: 22px; transform: rotate(15deg); background: var(--butter); }
.response-stack__card--front { left: 64px; top: 0; z-index: 2; background: var(--powder); }
.response-stack__card--front strong { margin-top: auto; font-family: var(--sans); font-size: 3.1rem; font-weight: 400; letter-spacing: -.08em; line-height: .9; }
.event-hero:hover .response-stack__card--back { transform: rotate(-18deg) translateX(-5px); }
.event-hero:hover .response-stack__card--middle { transform: rotate(18deg) translateX(5px); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.metric-card { position: relative; min-height: 184px; overflow: hidden; padding: 20px; border: 1px solid rgba(69, 54, 42, .09); border-radius: 22px; box-shadow: var(--shadow-sm); }
.metric-card::after { content: ""; position: absolute; right: -36px; bottom: -48px; width: 100px; height: 100px; border: 1px solid rgba(65, 58, 48, .1); border-radius: 50%; box-shadow: 0 0 0 18px rgba(255, 255, 255, .08); }
.metric-card--cream { background: #f2e9dc; }
.metric-card--green { background: var(--sage-soft); }
.metric-card--rose { background: var(--blush); }
.metric-card--blue { background: var(--powder); }
.metric-card__icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .48); }
.metric-card__icon svg { width: 17px; height: 17px; }
.metric-card__trend { position: absolute; top: 22px; right: 20px; color: rgba(52, 43, 37, .58); font-size: .65rem; letter-spacing: .07em; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 24px; font-family: var(--serif); font-size: 3.2rem; font-weight: 500; letter-spacing: -.06em; line-height: .75; }
.metric-card p { position: relative; z-index: 1; margin: 12px 0 0; color: rgba(52, 43, 37, .62); font-size: .76rem; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, .75fr); gap: 18px; margin-top: 18px; }
.chart-card, .deadline-card, .recent-card, .responses-card, .settings-card, .privacy-card, .help-card { padding: clamp(20px, 2.6vw, 30px); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-heading h2, .deadline-card h2, .settings-card h2, .privacy-card h2, .help-card h2 {
  margin: 0;
  color: var(--espresso);
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1;
}
.soft-badge, .status-badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 99px; background: var(--ivory); color: var(--muted); font-size: .66rem; white-space: nowrap; }
.status-badge--yes { background: var(--sage-soft); color: var(--success); }
.mini-chart { display: grid; height: 138px; grid-template-columns: repeat(7, 1fr); align-items: end; gap: clamp(8px, 2vw, 22px); margin-top: 24px; padding-top: 10px; border-bottom: 1px solid var(--border); }
.chart-column { display: grid; height: 100%; grid-template-rows: 1fr auto; align-items: end; gap: 8px; }
.chart-bar-wrap { display: flex; height: 100%; align-items: flex-end; justify-content: center; }
.chart-bar { width: min(30px, 65%); min-height: 4px; border-radius: 9px 9px 3px 3px; background: var(--sage); transform-origin: bottom; animation: grow .55s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); } }
.chart-label { color: var(--muted); font-size: .62rem; text-align: center; text-transform: uppercase; }
.deadline-card { position: relative; overflow: hidden; background: linear-gradient(145deg, #f2e7c1, #eee0ac); }
.deadline-card::after { content: ""; position: absolute; right: -70px; bottom: -80px; width: 190px; height: 190px; border: 1px solid rgba(83, 72, 40, .09); border-radius: 50%; box-shadow: 0 0 0 26px rgba(255, 255, 255, .12), 0 0 0 52px rgba(255, 255, 255, .08); }
.deadline-card__icon { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 28px; border-radius: 50%; background: rgba(255, 255, 255, .42); }
.deadline-card > p:not(.eyebrow) { position: relative; z-index: 1; margin: 12px 0 28px; color: rgba(52, 43, 37, .62); font-size: .76rem; }
.deadline-progress { position: relative; z-index: 1; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(52, 43, 37, .11); }
.deadline-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sage); transition: width .5s var(--ease); }
.recent-card { margin-top: 18px; }
.card-heading--row { align-items: center; }
.text-link { min-height: 44px; color: var(--espresso); }
.response-list { display: grid; margin-top: 18px; }
.response-list__item { display: grid; grid-template-columns: minmax(0, 1.5fr) auto minmax(80px, .65fr) auto; gap: 16px; align-items: center; min-height: 64px; padding: 11px 0; border-top: 1px solid var(--border); }
.guest-cell { display: flex; min-width: 0; align-items: center; gap: 11px; }
.guest-cell__avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--ivory-deep); color: var(--espresso); font-family: var(--serif); font-size: .83rem; font-weight: 600; }
.guest-cell__copy { min-width: 0; }
.guest-cell__copy strong, .guest-cell__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-cell__copy strong { color: var(--espresso); font-size: .8rem; font-weight: 600; }
.guest-cell__copy small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.status-badge { gap: 6px; font-weight: 600; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge--no { background: var(--blush); color: var(--danger); }
.status-badge--maybe { background: var(--butter); color: var(--warning); }
.needs-text { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.date-text { color: var(--muted); font-size: .67rem; text-align: right; }
.empty-state { padding: 52px 24px; text-align: center; }
.empty-state > span { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 15px; border-radius: 50%; background: var(--ivory-deep); color: var(--gold); }
.empty-state h3 { margin: 0; font-family: var(--serif); font-size: 1.4rem; font-weight: 500; }
.empty-state p { margin: 6px auto 0; color: var(--muted); font-size: .78rem; }

/* Response table */
.responses-toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.search-field { position: relative; min-width: 240px; flex: 1 1 320px; }
.search-field > svg { position: absolute; top: 50%; left: 14px; width: 17px; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding: 11px 14px 11px 42px; }
.filter-select { position: relative; flex: 0 0 auto; }
.filter-select select { min-width: 140px; padding: 10px 36px 10px 14px; appearance: none; }
.filter-select svg { position: absolute; top: 50%; right: 12px; width: 14px; transform: translateY(-50%); pointer-events: none; }
.check-filter { display: inline-flex; min-height: 48px; cursor: pointer; }
.check-filter input { position: absolute; opacity: 0; pointer-events: none; }
.check-filter span { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(255, 255, 255, .68); color: var(--muted); font-size: .76rem; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.check-filter input:checked + span { border-color: rgba(169, 133, 82, .35); background: var(--butter); color: var(--espresso); }
.check-filter input:focus-visible + span { outline: 3px solid rgba(169, 133, 82, .42); outline-offset: 3px; }
.check-filter svg { width: 16px; }
.table-summary { display: flex; justify-content: space-between; gap: 20px; margin-top: 25px; color: var(--muted); font-size: .7rem; }
.table-wrap { margin-top: 8px; overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { padding: 13px 12px; border-bottom: 1px solid var(--border-strong); color: var(--muted); font-size: .64rem; font-weight: 600; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 14px 12px; border-bottom: 1px solid var(--border); color: var(--espresso-soft); font-size: .76rem; vertical-align: middle; }
tbody tr { transition: background .2s ease; }
tbody tr:hover { background: rgba(238, 229, 216, .35); }
tbody tr:last-child td { border-bottom: 0; }
td .icon-button { width: 38px; height: 38px; }
.empty-state--table { border-top: 1px solid var(--border); }

/* Settings and admin */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; }
.settings-card { grid-row: span 2; }
.details-list { margin: 25px 0 0; }
.details-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; padding: 17px 0; border-top: 1px solid var(--border); }
.details-list dt { color: var(--muted); font-size: .7rem; }
.details-list dd { min-width: 0; margin: 0; color: var(--espresso); font-size: .8rem; font-weight: 600; overflow-wrap: anywhere; }
.details-list a { color: var(--gold); }
.connection-label { display: inline-flex; align-items: center; gap: 7px; color: var(--success); }
.connection-label span { width: 7px; height: 7px; border-radius: 50%; background: #4c9a6f; box-shadow: 0 0 0 4px rgba(76, 154, 111, .12); }
.privacy-card { background: linear-gradient(145deg, #dce7d4, #e5eadf); }
.privacy-card__icon { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 24px; border-radius: 50%; background: rgba(255, 255, 255, .52); color: var(--success); }
.privacy-card > p:not(.eyebrow), .help-card > p:not(.eyebrow) { color: var(--muted); font-size: .78rem; }
.privacy-card ul { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.privacy-card li { display: flex; gap: 8px; align-items: center; color: var(--espresso-soft); font-size: .72rem; }
.privacy-card li svg { width: 15px; color: var(--success); }
.help-card .button { margin-top: 15px; }
.admin-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 18px; }
.admin-toolbar p { margin: 0; color: var(--muted); font-size: .82rem; }
.customer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 20px; }
.customer-card { position: relative; min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: #fffdfa; }
.customer-card__head { display: flex; gap: 11px; align-items: center; }
.customer-card__head .avatar { border: 0; }
.customer-card h3 { margin: 0; overflow: hidden; color: var(--espresso); font-family: var(--serif); font-size: 1.24rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.customer-card__head p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.customer-card dl { display: grid; gap: 9px; margin: 18px 0 0; }
.customer-card dl div { display: flex; justify-content: space-between; gap: 10px; }
.customer-card dt { color: var(--muted); font-size: .65rem; }
.customer-card dd { margin: 0; overflow: hidden; color: var(--espresso-soft); font-size: .68rem; font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.customer-card__key { display: flex; gap: 6px; align-items: center; margin-top: 14px; padding: 8px 10px; border-radius: 10px; background: var(--ivory); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .58rem; }
.customer-card__key span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dialogs and toasts */
.dialog {
  width: min(92vw, 640px);
  max-height: min(88vh, 850px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 100px rgba(32, 26, 22, .28);
}
.dialog--form { width: min(94vw, 780px); }
.dialog--small { width: min(92vw, 460px); }
.dialog::backdrop { background: rgba(42, 37, 33, .52); backdrop-filter: blur(6px); }
.dialog[open] { animation: dialog-in .25s var(--ease) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dialog__header { position: sticky; z-index: 4; top: 0; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 23px 25px 18px; border-bottom: 1px solid var(--border); background: rgba(255, 253, 249, .94); backdrop-filter: blur(12px); }
.dialog__header h2 { margin: 0; color: var(--espresso); font-family: var(--serif); font-size: 1.8rem; font-weight: 500; line-height: 1; }
.dialog__body { padding: 24px 25px 28px; }
.dialog__body > p:first-child { margin-top: 0; color: var(--muted); font-size: .82rem; }
.detail-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.detail-section { padding: 18px 0; border-top: 1px solid var(--border); }
.detail-section h3 { margin: 0 0 12px; color: var(--muted); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; }
.detail-guests { display: grid; gap: 8px; }
.detail-guest { display: flex; justify-content: space-between; gap: 15px; padding: 10px 12px; border-radius: 11px; background: var(--ivory); font-size: .76rem; }
.detail-guest span:last-child { color: var(--muted); text-align: right; }
.detail-copy { margin: 0; color: var(--espresso-soft); font-size: .82rem; white-space: pre-wrap; }
.detail-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-meta div { padding: 12px; border-radius: 11px; background: var(--ivory); }
.detail-meta small, .detail-meta strong { display: block; overflow-wrap: anywhere; }
.detail-meta small { color: var(--muted); font-size: .63rem; }
.detail-meta strong { margin-top: 3px; font-size: .72rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field--wide { grid-column: 1 / -1; }
.customer-form .field input, .customer-form .field select { min-height: 46px; }
#guestForm { display: grid; gap: 16px; }
#guestForm > p { margin: 0; color: var(--muted); }
#guestForm > label { display: grid; gap: 8px; font-size: .85rem; }
#guestForm input, #guestForm select, #guestForm textarea { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--line, #d8cec3); border-radius: 12px; background: #fff; font-size: 16px; }
#guestForm textarea { min-height: 88px; resize: vertical; }
#guestForm input:focus, #guestForm select:focus, #guestForm textarea:focus { outline: 2px solid var(--gold, #997747); outline-offset: 2px; }
#responseDetail .detail-guest { flex-wrap: wrap; align-items: center; overflow-wrap: anywhere; }
#responseDetail .detail-guest .button { padding: 8px 12px; font-size: .75rem; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.credential-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 18px; padding: 14px; border: 1px solid rgba(47, 104, 75, .18); border-radius: 14px; background: rgba(220, 231, 212, .55); color: var(--success); }
.credential-result > svg { width: 22px; height: 22px; }
.credential-result strong { display: block; font-size: .8rem; }
.credential-result p { margin: 2px 0 0; color: var(--espresso-soft); font-size: .68rem; white-space: pre-line; }
.toast-region { position: fixed; z-index: 500; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-md); color: var(--espresso); font-size: .76rem; animation: toast-in .3s var(--ease) both; }
.toast svg { color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (min-width: 940px) {
  .auth-page { grid-template-columns: minmax(0, 1.55fr) minmax(390px, .75fr); }
  .auth-visual { display: flex; flex-direction: column; }
  .auth-panel__mobile-brand { display: none; }
}
@media (max-width: 1180px) {
  :root { --sidebar: 244px; }
  .sidebar { padding-inline: 16px; }
  .support-card { grid-template-columns: auto 1fr; }
  .support-card > svg { display: none; }
  .event-hero { grid-template-columns: minmax(0, 1fr) 260px; }
  .response-stack { transform: scale(.88); transform-origin: center; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar {
    width: min(86vw, 300px);
    transform: translateX(-102%);
    box-shadow: 30px 0 70px rgba(31, 34, 32, .25);
    transition: transform .3s var(--ease);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 80; inset: 0; display: block; background: rgba(30, 30, 28, .42); }
  .mobile-header { position: sticky; z-index: 70; top: 0; display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 10px 17px; border-bottom: 1px solid var(--border); background: rgba(247, 242, 234, .88); backdrop-filter: blur(14px); }
  .mobile-header__brand { display: flex; align-items: center; gap: 7px; color: var(--espresso); font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
  .mobile-header__brand .brand-mark { width: 28px; height: 24px; }
  .mobile-header .avatar { width: 38px; height: 38px; }
  .dashboard { margin-left: 0; padding: 24px 18px 60px; }
  .dashboard-header { align-items: center; }
  .event-hero { grid-template-columns: 1fr; }
  .response-stack { position: absolute; right: -35px; bottom: -72px; opacity: .68; transform: scale(.72); }
  .event-hero__copy { padding-right: 15%; }
  .overview-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card { grid-row: auto; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  table thead { display: none; }
  table tbody { display: grid; gap: 10px; margin-top: 12px; }
  table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255, 255, 255, .5);
  }
  table tbody td { display: block; min-width: 0; padding: 0; border: 0; }
  table tbody td:first-child { grid-column: 1 / -1; padding-right: 42px; }
  table tbody td:nth-child(3)::before,
  table tbody td:nth-child(4)::before,
  table tbody td:nth-child(5)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
  table tbody td:nth-child(3)::before { content: "Antal"; }
  table tbody td:nth-child(4)::before { content: "Specialkost"; }
  table tbody td:nth-child(5)::before { content: "Mottaget"; }
  table tbody td:last-child { position: absolute; top: 12px; right: 10px; }
  table tbody .needs-text { display: block; max-width: 100%; }
}
@media (max-width: 560px) {
  .auth-panel { padding: 22px 18px; }
  .auth-panel__mobile-brand { margin-bottom: 50px; }
  .dashboard { padding-inline: 13px; }
  .dashboard-header { align-items: flex-end; }
  .dashboard-header__actions { align-self: center; }
  .event-select { display: none !important; }
  .live-pill { padding-inline: 11px; }
  .event-hero { min-height: 345px; padding: 27px 23px; border-radius: 22px; }
  .event-hero__copy { padding-right: 0; align-self: start; }
  .event-hero h2 { font-size: 2.8rem; }
  .event-hero__actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .response-stack { right: -18px; bottom: -92px; opacity: .58; transform: scale(.62); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 166px; padding: 16px; }
  .metric-card__trend { top: 19px; right: 15px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metric-card strong { margin-top: 24px; font-size: 2.7rem; }
  .card-heading--row { align-items: flex-start; }
  .response-list__item { grid-template-columns: minmax(0, 1fr) auto; }
  .response-list__item .needs-text, .response-list__item .date-text { display: none; }
  .responses-card, .recent-card, .chart-card, .deadline-card, .settings-card, .privacy-card, .help-card { padding: 18px; border-radius: 19px; }
  .responses-toolbar { align-items: stretch; }
  .search-field { flex-basis: 100%; }
  .filter-select { flex: 1; }
  .filter-select select { min-width: 0; }
  .responses-toolbar .button { width: 100%; }
  .details-list > div { grid-template-columns: 100px minmax(0, 1fr); gap: 10px; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .customer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .credential-result { grid-template-columns: auto 1fr; }
  .credential-result .button { grid-column: 1 / -1; }
  .dialog__header { padding: 19px 18px 15px; }
  .dialog__body { padding: 20px 18px 24px; }
  .dialog__actions { flex-direction: column-reverse; }
  .dialog__actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Bordsplacering & admin-läge (v2) */
.nav-item__new { margin-left: auto; padding: 2px 7px; border-radius: 99px; background: var(--gold-soft); color: #3d2e17; font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-view--seating { animation: none; }
.viewas-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 10px 12px 10px 14px; border-radius: 16px; background: var(--sage); color: var(--ivory); font-size: .78rem; box-shadow: var(--shadow-sm); animation: view-in .3s var(--ease) both; }
.viewas-banner__icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.viewas-banner__icon svg { width: 16px; height: 16px; }
.viewas-banner__text { flex: 1; min-width: 0; }
.viewas-banner__back { min-height: 38px; padding: 8px 14px; font-size: .7rem; }
.customer-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.customer-card__stats div { padding: 8px 6px; border-radius: 10px; background: var(--ivory); text-align: center; }
.customer-card__stats strong { display: block; color: var(--espresso); font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1; }
.customer-card__stats span { display: block; margin-top: 2px; color: var(--muted); font-size: .58rem; letter-spacing: .05em; text-transform: uppercase; }
.customer-card__login { margin-top: 10px; color: var(--muted); font-size: .64rem; }
.customer-card__login b { color: var(--espresso-soft); font-weight: 500; }
.customer-card__actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; margin-top: 12px; }
.customer-card__actions .button { min-height: 38px; padding: 6px 12px; font-size: .68rem; }
.customer-card__actions .icon-button { width: 38px; height: 38px; border: 1px solid var(--border-strong); background: var(--paper); }
.customer-card__key { cursor: pointer; }
.customer-card__key:hover { color: var(--espresso); }
@media (max-width: 640px) { .viewas-banner { flex-wrap: wrap; } .viewas-banner__back { width: 100%; justify-content: center; } }

/* Edit an answer (2026-09-17) */
.edit-form { display: grid; gap: 14px; }
.edit-guests { display: grid; gap: 10px; margin-bottom: 10px; }
.edit-guest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border-radius: 11px; background: var(--ivory); }
.edit-guest__wide { grid-column: 1 / -1; }
.edit-guest__remove { grid-column: 1 / -1; justify-self: start; padding: 8px 12px; font-size: .75rem; }
.edit-form label { display: grid; gap: 6px; font-size: .78rem; }
.edit-form input, .edit-form select, .edit-form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line, #ddd5ca); border-radius: 10px; background: #fff; font: inherit; color: inherit; }
.edit-form textarea { min-height: 84px; resize: vertical; }
#responseDetail .detail-edit { margin: 18px 10px 0 0; }
@media (max-width: 640px) { .edit-guest { grid-template-columns: 1fr; } #responseDetail .detail-edit { width: 100%; margin-right: 0; } }

/* Språkväljare (i18n 2026-09-21) – fylls av js/i18n.js.
   Ljus variant under inloggningskortet, mörk variant längst ner i sidomenyn. */
.lang-switch {
  --ls-ink: var(--espresso);
  --ls-hover: rgba(67, 51, 40, .07);
  --ls-active: var(--ivory-deep);
  --ls-active-border: var(--border-strong);
  --ls-ring: rgba(169, 133, 82, .42);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.lang-switch__btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: transparent;
  color: var(--ls-ink);
  font-family: var(--sans);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1;
  opacity: .66;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease-out, opacity .16s ease-out, background-color .16s ease-out;
}
.lang-switch__btn:active { transform: scale(.97); }
.lang-switch__btn:focus-visible { outline: 3px solid var(--ls-ring); outline-offset: 2px; opacity: 1; }
.lang-switch__btn[aria-pressed="true"] { border-color: var(--ls-active-border); background-color: var(--ls-active); opacity: 1; cursor: default; }
@media (hover: hover) {
  .lang-switch__btn:hover { background-color: var(--ls-hover); opacity: 1; }
  .lang-switch__btn[aria-pressed="true"]:hover { background-color: var(--ls-active); }
}
.lang-flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(43, 33, 26, .18), inset 0 0 0 .5px rgba(255, 255, 255, .25);
}
.lang-flag--sv { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23006AA7' d='M0 0h32v32H0z'/%3E%3Cpath fill='%23FECC00' d='M9 0h6v32H9z'/%3E%3Cpath fill='%23FECC00' d='M0 13h32v6H0z'/%3E%3C/svg%3E"); }
.lang-flag--en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23012169' d='M0 0h32v32H0z'/%3E%3Cpath stroke='%23fff' stroke-width='6' d='M0 0l32 32M32 0L0 32'/%3E%3Cpath stroke='%23C8102E' stroke-width='2.4' d='M0 0l32 32M32 0L0 32'/%3E%3Cpath fill='%23fff' d='M12 0h8v32h-8z'/%3E%3Cpath fill='%23fff' d='M0 12h32v8H0z'/%3E%3Cpath fill='%23C8102E' d='M13.6 0h4.8v32h-4.8z'/%3E%3Cpath fill='%23C8102E' d='M0 13.6h32v4.8H0z'/%3E%3C/svg%3E"); }
.lang-flag--es { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23AA151B' d='M0 0h32v32H0z'/%3E%3Cpath fill='%23F1BF00' d='M0 8h32v16H0z'/%3E%3C/svg%3E"); }
.lang-flag--fr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23fff' d='M0 0h32v32H0z'/%3E%3Cpath fill='%230055A4' d='M0 0h10.7v32H0z'/%3E%3Cpath fill='%23EF4135' d='M21.3 0H32v32H21.3z'/%3E%3C/svg%3E"); }
.lang-flag--de { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M0 0h32v10.7H0z'/%3E%3Cpath fill='%23DD0000' d='M0 10.7h32v10.6H0z'/%3E%3Cpath fill='%23FFCE00' d='M0 21.3h32V32H0z'/%3E%3C/svg%3E"); }

/* Inloggningsvyn: diskret rad under kortet, på --paper. */
.auth-panel .lang-switch { display: flex; justify-content: center; margin-top: 28px; }

/* Sidomenyn: fem lika breda knappar på --sage-deep (ryms även i 244 px-menyn). */
.sidebar .lang-switch {
  --ls-ink: var(--ivory);
  --ls-hover: rgba(255, 255, 255, .07);
  --ls-active: rgba(247, 242, 234, .11);
  --ls-active-border: rgba(255, 255, 255, .1);
  --ls-ring: rgba(216, 194, 159, .6);
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
}
.sidebar .lang-switch__btn { flex: 1 1 0; min-width: 0; gap: 4px; padding: 0; font-size: .62rem; letter-spacing: .05em; }
.sidebar .lang-flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }

@media (max-width: 900px), (pointer: coarse) {
  .lang-switch__btn { min-height: 40px; }
}
@media (max-width: 400px) {
  .auth-panel .lang-switch { gap: 2px; }
  .auth-panel .lang-switch__btn { padding: 0 7px; }
}
@media (max-width: 900px) {
  /* Mobiltabellens kolumnrubriker kommer från data-label (sätts av app.js) så att de kan översättas. */
  table tbody td[data-label]::before { content: attr(data-label); }
}
@media (max-height: 640px) {
  /* Låga skärmar: låt sidomenyn rulla så att Logga ut alltid går att nå. */
  .sidebar { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
}
@media (prefers-reduced-motion: reduce) {
  .lang-switch__btn { transition: none; }
  .lang-switch__btn:active { transform: none; }
}
