/* Julafton
   Polarnatt och papperslapp. Det enda djärva elementet är lappen med lacksigillet;
   allt annat är stilla och lättläst för alla åldrar. */

/* Typsnitt (SIL Open Font License), lagrade lokalt så att appen fungerar utan nät */
@font-face { font-family: 'Young Serif'; font-weight: 400; font-display: swap; src: url('/fonts/young-serif-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-display: swap; src: url('/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-display: swap; src: url('/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }

:root {
  --night: #18233F;
  --night-raised: #22305A;
  --night-line: #34446F;
  --on-night: #E9ECF3;
  --on-night-muted: #A9B3C9;
  --snow: #F2F4F6;
  --paper: #FFFFFF;
  --ink: #1A1F2B;
  --ink-muted: #4A5263;
  --line: #D5DAE1;
  --lingon: #B0213A;
  --lingon-dark: #8A1A2E;
  --spruce: #2F5A48;
  --brass: #C8A25A;

  --serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Skala 1.25, bas 17 px */
  --s-1: 0.8rem;
  --s0: 1rem;
  --s1: 1.25rem;
  --s2: 1.5625rem;
  --s3: 1.953rem;
  --s4: 2.441rem;
  --s5: 3.052rem;

  --focus: 0 0 0 3px var(--paper), 0 0 0 6px var(--brass);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 106.25%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--s0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--night);
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; max-width: 62ch; }

a { color: inherit; }

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Sidor ---------- */

.page { min-height: 100vh; min-height: 100dvh; }
.page.night { background: var(--night); color: var(--on-night); }
.page.snow { background: var(--snow); color: var(--ink); }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.9rem + env(safe-area-inset-top)) 1.25rem 0.9rem;
  max-width: 52rem;
  margin: 0 auto;
}
.bar-title { font-family: var(--serif); font-size: var(--s1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar nav { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.navlink { white-space: nowrap; }

.navlink {
  border: 0;
  background: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: var(--s-1);
  font-weight: 700;
}
.night .navlink { color: var(--on-night-muted); }
.night .navlink:hover { color: var(--on-night); }
.snow .navlink { color: var(--ink-muted); }
.snow .navlink:hover { color: var(--ink); }

/* ---------- Knappar ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 2px solid transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--lingon); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--lingon-dark); }
.btn-secondary { background: transparent; border-color: var(--night); color: var(--night); }
.btn-secondary:hover:not(:disabled) { background: var(--night); color: #fff; }
.night .btn-secondary { border-color: var(--on-night-muted); color: var(--on-night); }
.night .btn-secondary:hover:not(:disabled) { background: var(--night-raised); color: var(--on-night); }
.btn-danger { background: transparent; border-color: var(--lingon); color: var(--lingon); }
.btn-danger:hover:not(:disabled) { background: var(--lingon); color: #fff; }

.linkbtn {
  border: 0; background: none; padding: 0.25rem 0;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; font-weight: 700;
}

/* ---------- Formulär ---------- */

.field { display: grid; gap: 0.35rem; }
.field + .field { margin-top: 1.1rem; }
.field label { font-weight: 700; }
.field .help { font-size: var(--s-1); color: var(--ink-muted); }
.night .field .help { color: var(--on-night-muted); }

input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"], input[inputmode="numeric"], textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
input:focus-visible, textarea:focus-visible { border-color: var(--night); box-shadow: var(--focus); }

.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; }
.checkbox input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--lingon); }

.error-text { color: var(--lingon); font-weight: 700; margin-top: 0.75rem; }
.night .error-text { color: #FF9AA9; }
.error-text:empty { display: none; }

/* ---------- Inloggning ---------- */

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1.25rem;
}
.login-inner { width: min(26rem, 100%); }
.login-seal { width: 4.5rem; height: 4.5rem; margin-bottom: 1.75rem; display: block; }
.login h1 { font-size: var(--s4); margin-bottom: 0.75rem; }
.login .lede { color: var(--on-night-muted); margin-bottom: 2rem; }
.login form { display: grid; gap: 1rem; }
.login .btn { width: 100%; }
.login form .field { margin-bottom: 1rem; }
.login .alt { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: var(--on-night-muted); }
.login .alt .linkbtn { color: var(--on-night); }
.code-input { font-size: var(--s3); letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.devnote {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--brass);
  border-radius: 6px;
  color: var(--on-night);
  font-size: var(--s-1);
}

/* ---------- Min lapp ---------- */

.home { max-width: 40rem; margin: 0 auto; padding: 1rem 1.25rem 4rem; }

.hero { display: grid; justify-items: center; text-align: center; }
.greet { font-family: var(--serif); font-size: var(--s3); margin-top: 1rem; }
.hint { color: var(--on-night-muted); margin-top: 0.5rem; max-width: 30ch; }

.tag-wrap {
  position: relative;
  width: min(19rem, 86vw);
  margin: 0 auto;
  filter: drop-shadow(0 18px 24px rgba(4, 8, 20, .45));
}
.tag-string {
  position: absolute;
  left: 50%;
  top: 0;
  width: 60px;
  height: 6.15rem;
  transform: translateX(-50%);
  overflow: visible;
  z-index: 2;
}
.tag {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  padding: 4.25rem 1.6rem 2rem;
  clip-path: polygon(22% 0, 78% 0, 100% 15%, 100% 100%, 0 100%, 0 15%);
}
.pendulum {
  position: relative;
  padding-top: 4.5rem;
  transform-origin: 50% 0;
  transform: rotate(-2.5deg);
}
.tag::before {
  /* Hålet i lappen, med förstärkningsring */
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 50%;
  width: 1.05rem;
  height: 1.05rem;
  margin-left: -0.525rem;
  border-radius: 50%;
  background: var(--night);
  box-shadow: 0 0 0 4px #E7E9EE;
}
.tag-field { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 0.6rem; }
.tag-field + .tag-field { margin-top: 1.4rem; }
.tag-label { font-family: var(--serif); font-size: var(--s0); color: var(--ink-muted); padding-bottom: 0.3rem; }
.tag-line {
  min-height: 2.6rem;
  border-bottom: 1.5px dotted #9AA2B1;
  padding-bottom: 0.2rem;
  font-family: var(--serif);
  font-size: var(--s3);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.tag-line.from { font-size: var(--s1); min-height: 2rem; color: var(--ink-muted); }

.seal {
  position: absolute;
  left: 64%;
  top: 46%;
  width: 6.5rem;
  height: 6.5rem;
  margin: -3.25rem 0 0 -3.25rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  z-index: 3;
}
.seal svg { width: 100%; height: 100%; display: block; }
.seal .half { position: absolute; inset: 0; }
.seal .half.left  { clip-path: polygon(0 0, 53% 0, 46% 22%, 56% 41%, 45% 60%, 54% 79%, 48% 100%, 0 100%); }
.seal .half.right { clip-path: polygon(53% 0, 100% 0, 100% 100%, 48% 100%, 54% 79%, 45% 60%, 56% 41%, 46% 22%); }
.seal:hover .half { transform: scale(1.03); }
.seal .half { transition: transform .2s ease; }

.seal.breaking .half.left  { animation: crack-left .7s cubic-bezier(.3,.1,.4,1) forwards; }
.seal.breaking .half.right { animation: crack-right .7s cubic-bezier(.3,.1,.4,1) forwards; }
@keyframes crack-left {
  0%   { transform: none; }
  18%  { transform: translate(-2px, 0) rotate(-2deg); }
  100% { transform: translate(-70px, 150px) rotate(-38deg); opacity: 0; }
}
@keyframes crack-right {
  0%   { transform: none; }
  18%  { transform: translate(2px, 0) rotate(2deg); }
  100% { transform: translate(64px, 170px) rotate(30deg); opacity: 0; }
}


.tag-wrap.swing .pendulum { animation: swing 2.4s cubic-bezier(.25,.6,.3,1) both; }
@keyframes swing {
  0%   { transform: rotate(9deg); }
  30%  { transform: rotate(-6deg); }
  55%  { transform: rotate(1.5deg); }
  78%  { transform: rotate(-3.5deg); }
  100% { transform: rotate(-2.5deg); }
}

.reveal-in { animation: ink-in .6s ease-out both; }
@keyframes ink-in { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }

.tag.waiting .tag-line:first-of-type { color: transparent; }

.about {
  margin-top: 2.25rem;
  width: min(30rem, 100%);
  text-align: left;
  border-left: 3px solid var(--brass);
  padding: 0.25rem 0 0.25rem 1.1rem;
}
.about .age { font-family: var(--serif); font-size: var(--s1); }
.about h2 { font-family: var(--sans); font-weight: 700; font-size: var(--s0); margin-top: 0.9rem; color: var(--on-night-muted); }
.about p { white-space: pre-line; margin-top: 0.25rem; }
.about .empty { color: var(--on-night-muted); font-style: italic; }

.hero-actions { margin-top: 2rem; display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

.rules {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--night-line);
}
.rules h2 { font-size: var(--s3); margin-bottom: 1.5rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; margin: 0 0 2rem; }
.facts dt { color: var(--on-night-muted); }
.facts dd { margin: 0; font-family: var(--serif); }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; max-width: 62ch; }
.rule-list li { position: relative; padding-left: 1.6rem; }
.rule-list li::before {
  content: '';
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--brass);
  transform: rotate(45deg);
}

/* ---------- Admin ---------- */

.admin { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.admin h1 { font-size: var(--s4); margin-bottom: 2rem; }
.admin section + section { margin-top: 3.5rem; }
.admin h2 { font-size: var(--s2); }

.draw-panel {
  background: var(--night);
  color: var(--on-night);
  border-radius: 14px;
  padding: 1.75rem;
  display: grid;
  gap: 1rem;
}
.draw-panel h2 { font-size: var(--s3); }
.draw-panel p { color: var(--on-night-muted); }
.draw-panel strong { color: var(--on-night); }
.draw-panel .btn-secondary { border-color: var(--on-night-muted); color: var(--on-night); }
.draw-panel .btn-secondary:hover:not(:disabled) { background: var(--night-raised); color: var(--on-night); }
.draw-panel .row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 0.25rem; }

.seal-dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.25rem 0; padding: 0; list-style: none; }
.seal-dots li {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--night-line);
}
.seal-dots li.opened { background: var(--lingon); border-color: var(--lingon); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 0.5rem; }
.section-head .count { font-family: var(--sans); font-size: var(--s0); color: var(--ink-muted); margin-left: 0.4rem; }
.section-help { color: var(--ink-muted); margin-bottom: 1.25rem; }

.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.people li { border-bottom: 1px solid var(--line); }
.person {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  align-items: center;
  padding: 0.9rem 0.5rem;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.person:hover { background: rgba(24, 35, 63, .04); }
.p-name { font-weight: 700; }
.p-meta { grid-column: 1; color: var(--ink-muted); font-size: var(--s-1); }
.p-status { grid-column: 2; grid-row: 1 / span 2; font-size: var(--s-1); color: var(--ink-muted); text-align: right; }
.p-status.done { color: var(--spruce); font-weight: 700; }
.p-status.todo { color: var(--lingon); font-weight: 700; }
.people-empty { padding: 2rem 0; color: var(--ink-muted); }

.settings-form { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; margin-top: 1rem; }
.settings-form .grid2 { display: grid; gap: 1.1rem 1rem; grid-template-columns: 1fr 1fr; }
.settings-form .grid2 .field + .field { margin-top: 0; }
.settings-form .full { grid-column: 1 / -1; }
.settings-form .actions { margin-top: 1.5rem; }

/* ---------- Dialoger ---------- */

dialog {
  width: min(34rem, calc(100vw - 2rem));
  overflow: hidden;
  max-height: calc(100dvh - 2rem);
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(10, 16, 34, .35);
}
dialog::backdrop { background: rgba(18, 26, 48, .6); }
dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } }
dialog[open], dialog > form { display: flex; flex-direction: column; min-height: 0; }
dialog > form { max-height: calc(100dvh - 2rem); }
.dialog-body { padding: 1.75rem 1.5rem 1.5rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.dialog-actions { flex-shrink: 0; border-top: 1px solid var(--line); }
.dialog-body h2 { font-size: var(--s2); margin-bottom: 1.25rem; }
.dialog-body > p { color: var(--ink-muted); }
.dialog-note { background: var(--snow); border-radius: 6px; padding: 0.75rem 0.9rem; font-size: var(--s-1); margin-bottom: 1.25rem; }
.dialog-actions {
  display: flex; flex-wrap: wrap-reverse; gap: 0.75rem; justify-content: flex-end;
  padding: 1rem 1.5rem 1.5rem;
}
.dialog-actions .spacer { flex: 1; }


/* ---------- Startsida ---------- */

.landing { display: grid; justify-items: center; padding: 3rem 1.25rem 4rem; }
.landing-inner { width: min(30rem, 100%); }
.landing h1 { font-size: var(--s5); margin-bottom: 0.75rem; }
.landing .lede { color: var(--on-night-muted); font-size: var(--s1); line-height: 1.45; }
.continue { margin-top: 1.75rem; }
.create { margin-top: 3rem; padding-top: 2.25rem; border-top: 1px solid var(--night-line); }
.create h2 { font-size: var(--s3); margin-bottom: 1.25rem; }
.create form { display: grid; gap: 1.1rem; }
.create .field + .field { margin-top: 0; }
.create .btn { width: 100%; margin-top: 0.4rem; }
.footnote { margin-top: 2rem; color: var(--on-night-muted); font-size: var(--s-1); }

.pin-input { font-size: var(--s2); letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; max-width: 11rem; }

/* ---------- Inloggning: välj namn ---------- */

.names { border: 0; margin: 0 0 1.5rem; padding: 0; }
.names legend { font-family: var(--serif); font-size: var(--s2); margin-bottom: 1rem; padding: 0; }
.name-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.name-option { position: relative; }
.name-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.name-option span {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 2px solid var(--night-line);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.name-option:hover span { border-color: var(--on-night-muted); }
.name-option input:checked + span { background: var(--paper); color: var(--night); border-color: var(--paper); }
.name-option input:focus-visible + span { box-shadow: var(--focus); }
.notice { border-left: 3px solid var(--brass); padding: 0.25rem 0 0.25rem 1rem; margin-bottom: 1rem; color: var(--on-night); }
.login .field + .btn { margin-top: 0.25rem; }

/* ---------- Flikar ---------- */

.tabs {
  display: flex;
  gap: 0.25rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1rem;
  border-bottom: 1px solid var(--night-line);
  overflow-x: auto;
}
.snow .tabs { border-bottom-color: var(--line); }
.tabs a {
  padding: 0.75rem 0.85rem 0.7rem;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.night .tabs a { color: var(--on-night-muted); }
.snow .tabs a { color: var(--ink-muted); }
.tabs a[aria-current="page"] { border-bottom-color: var(--brass); }
.night .tabs a[aria-current="page"], .night .tabs a:hover { color: var(--on-night); }
.snow .tabs a[aria-current="page"], .snow .tabs a:hover { color: var(--ink); }

/* ---------- Önskelista ---------- */

.section-lede { color: var(--on-night-muted); margin: 0.5rem 0 1.25rem; }
.snow .section-lede { color: var(--ink-muted); }
.wishes { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--night-line); }
.wishes h2 { font-size: var(--s3); }
.wishes form { display: grid; gap: 1rem; justify-items: start; }
.about h2 + p { margin-bottom: 0.25rem; }

/* ---------- Julafton ---------- */

.page-title { font-size: var(--s4); margin-top: 1.5rem; }
.julafton section { margin-top: 3rem; }
.julafton h2 { font-size: var(--s3); margin-bottom: 1rem; }
.schedule { list-style: none; margin: 0; padding: 0; }
.schedule li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--night-line);
}
.schedule li:last-child { border-bottom: 1px solid var(--night-line); }
.schedule .time { font-family: var(--serif); font-size: var(--s1); color: var(--brass); font-variant-numeric: tabular-nums; }
.what { font-weight: 700; }
.note { color: var(--on-night-muted); font-size: var(--s-1); margin-top: 0.15rem; }
.empty-state { color: var(--on-night-muted); font-style: italic; }

.dishes { list-style: none; margin: 0; padding: 0; }
.dishes li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--night-line);
}
.dishes li:last-child { border-bottom: 1px solid var(--night-line); }
.dish-action { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; text-align: right; }
.dishes .who { color: var(--on-night-muted); font-size: var(--s-1); }
.dishes li.mine .who { color: var(--brass); font-weight: 700; }
.dishes .linkbtn { color: var(--on-night); font-size: var(--s-1); }
.btn-small { min-height: 2.5rem; padding: 0.4rem 0.9rem; font-size: var(--s-1); }

.inline-form { display: flex; align-items: flex-end; gap: 0.75rem; margin-top: 1.75rem; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 14rem; }

/* ---------- Admin: listor ---------- */

.admin-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.admin-list li { border-bottom: 1px solid var(--line); }
.row-btn {
  width: 100%;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0.5rem;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.row-btn:hover { background: rgba(24, 35, 63, .04); }
.row-btn .time { font-family: var(--serif); min-width: 3.5rem; color: var(--ink-muted); }
.row-btn .what { flex: 1; }
.row-btn .who { color: var(--ink-muted); font-size: var(--s-1); }
.row-btn .who.todo { color: var(--lingon); font-weight: 700; }

.dialog-tools { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.dialog-tools h3 { font-family: var(--sans); font-weight: 700; font-size: var(--s0); }
.dialog-tools .help { display: block; margin: 0.25rem 0 0.75rem; color: var(--ink-muted); font-size: var(--s-1); }
.tool-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#sd-url { margin: 1rem 0; font-size: var(--s-1); }
.share-actions { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
#sd-text { color: var(--ink-muted); }

.danger { border-top: 1px solid var(--line); padding-top: 2rem; }
.danger p { color: var(--ink-muted); margin: 0.5rem 0 1rem; }


/* ---------- Nedräkning, väder och sällskap ---------- */

[hidden] { display: none !important; }

.countdown-line { color: var(--brass); font-weight: 700; margin-top: 1rem; }
.countdown-line + .greet { margin-top: 0.25rem; }

.jul-hero { text-align: center; padding: 2rem 0 0.5rem; }
.big-count {
  font-family: var(--serif);
  font-size: clamp(5rem, 22vw, 8rem);
  line-height: 0.95;
  margin: 0 auto;
  font-variant-numeric: lining-nums;
}
.count-unit { color: var(--brass); font-weight: 700; font-size: var(--s1); margin: 0.25rem auto 0; }
.today-line { font-family: var(--serif); font-size: var(--s4); margin: 0 auto; }
.date-line { font-family: var(--serif); font-size: var(--s1); margin: 1.5rem auto 0; }
.place-line { color: var(--on-night-muted); margin: 0.35rem auto 0; }
.maplink { color: var(--on-night); font-weight: 700; text-underline-offset: 3px; margin-left: 0.35rem; white-space: nowrap; }

.weather {
  margin-top: 2.5rem;
  border: 1px solid var(--night-line);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
}
.weather-place { color: var(--on-night-muted); font-size: var(--s-1); font-weight: 700; }
.weather-temp { font-family: var(--serif); margin-top: 0.4rem; }
.weather-temp .tmax { font-size: var(--s4); }
.weather-temp .tmin { font-size: var(--s2); color: var(--on-night-muted); margin-left: 0.5rem; }
.weather-desc { font-weight: 700; margin-top: 0.2rem; }
.weather-details { color: var(--on-night-muted); margin-top: 0.2rem; }
.weather-note { margin-top: 0.9rem; border-left: 3px solid var(--brass); padding-left: 0.8rem; font-size: var(--s-1); }
.weather-credit { margin-top: 0.9rem; font-size: var(--s-1); color: var(--on-night-muted); }
.weather-credit a { color: inherit; }
.weather-wait { color: var(--on-night-muted); }

.parties { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.party {
  border: 1px solid var(--night-line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.party.mine { border-color: var(--brass); }
.party-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.party h3 { font-size: var(--s1); }
.badge { font-family: var(--sans); font-size: var(--s-1); font-weight: 700; color: var(--brass); margin-left: 0.35rem; white-space: nowrap; }
.party-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0.9rem 0 0; }
.party-facts dt { color: var(--on-night-muted); font-size: var(--s-1); padding-top: 0.15rem; }
.party-facts dd { margin: 0; white-space: pre-line; }
.party > .note { margin-top: 0.6rem; font-style: italic; }

select {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
select:focus-visible { border-color: var(--night); }

.weather-field .label { font-weight: 700; }
.w-chosen { margin: 0.25rem 0 0.5rem; }
.w-search { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.w-search input { flex: 1; }
.w-results { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.w-results li { border-bottom: 1px solid var(--line); }
.w-results .help { padding: 0.5rem; display: block; color: var(--ink-muted); }

/* ---------- Övrigt ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  width: max-content;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 2rem);
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.loading { display: grid; place-items: center; min-height: 100vh; color: var(--on-night-muted); }


@media (max-width: 34rem) {
  .bar-title { font-size: var(--s0); }
  .settings-form .grid2 { grid-template-columns: 1fr; }
  .admin h1 { font-size: var(--s3); }
  .greet { font-size: var(--s2); }
  .draw-panel { padding: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.checkbox .help { font-weight: 400; color: var(--ink-muted); font-size: var(--s-1); }
