/* ============================================================
   Pluggplan – "skrivbordsplaneraren"
   Prickat papper, bläck och överstrykningspennor.
   ============================================================ */

:root {
  --paper: #f3eee2;
  --paper-2: #fbf8f1;
  --paper-3: #ece5d4;
  --ink: #1c1a2b;
  --ink-2: #4b4860;
  --ink-3: #8a869c;
  --line: #ddd5c3;
  --line-2: #cbc1ab;
  --dot: rgba(28, 26, 43, .13);
  --red: #d4402b;
  --red-soft: rgba(212, 64, 43, .1);
  --ok: #2f8a4c;
  --chip-ink: #1c1a2b;
  --ev-outline: #1c1a2b;
  --shadow: 0 1px 0 rgba(28, 26, 43, .05), 0 14px 30px -18px rgba(28, 26, 43, .35);
  --shadow-lg: 0 30px 80px -30px rgba(28, 26, 43, .55);
  --r: 16px;
  --r-sm: 10px;
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

/* ---------- Färgteman ----------
   data-theme på <html>: auto (följer systemet), papper, natt, skog, hav, persika */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="auto"] {
    --paper: #15141c; --paper-2: #1e1c27; --paper-3: #272431;
    --ink: #efe9da; --ink-2: #bdb7c9; --ink-3: #7f7a92;
    --line: #2f2c3b; --line-2: #3c3849; --dot: rgba(239, 233, 218, .07);
    --red: #ff7a63; --red-soft: rgba(255, 122, 99, .12); --ok: #6fd18e;
    --ev-outline: var(--ink);
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .8);
    --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}
:root[data-theme="natt"] {
  --paper: #15141c; --paper-2: #1e1c27; --paper-3: #272431;
  --ink: #efe9da; --ink-2: #bdb7c9; --ink-3: #7f7a92;
  --line: #2f2c3b; --line-2: #3c3849; --dot: rgba(239, 233, 218, .07);
  --red: #ff7a63; --red-soft: rgba(255, 122, 99, .12); --ok: #6fd18e;
  --ev-outline: var(--ink);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .9);
  color-scheme: dark;
}
:root[data-theme="skog"] {
  --paper: #e6eee2; --paper-2: #f5f9f2; --paper-3: #dae5d4;
  --ink: #14241b; --ink-2: #3f5446; --ink-3: #788b7d;
  --line: #cddbc8; --line-2: #b3c6ad; --dot: rgba(20, 36, 27, .12);
  --red: #c2410c; --red-soft: rgba(194, 65, 12, .1); --ok: #2f8a4c;
}
:root[data-theme="hav"] {
  --paper: #0e1726; --paper-2: #152238; --paper-3: #1d2d47;
  --ink: #e7eef9; --ink-2: #a9b8cf; --ink-3: #6f819e;
  --line: #22334f; --line-2: #2f4465; --dot: rgba(231, 238, 249, .07);
  --red: #ff8a6b; --red-soft: rgba(255, 138, 107, .13); --ok: #6fd1a0;
  --ev-outline: var(--ink);
  --shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 14px 30px -18px rgba(0, 0, 0, .85);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .9);
  color-scheme: dark;
}
:root[data-theme="persika"] {
  --paper: #f7e7e0; --paper-2: #fdf6f2; --paper-3: #f0dad0;
  --ink: #2b1620; --ink-2: #5e4450; --ink-3: #9a7f89;
  --line: #ead2c8; --line-2: #dbbcaf; --dot: rgba(43, 22, 32, .11);
  --red: #c81e5b; --red-soft: rgba(200, 30, 91, .1); --ok: #2f8a4c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(var(--dot) 1.1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--paper);
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px) 10px;
  max-width: 1440px; margin: 0 auto;
}
.brand { text-decoration: none; color: var(--ink); }
.brand-word {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 144;
}
.brand-word em {
  font-style: italic; font-weight: 500;
  background: linear-gradient(104deg, transparent 2%, #f7d64a 4%, #f7d64a 94%, transparent 97%) 0 72% / 100% 46% no-repeat;
  padding: 0 .06em;
  color: var(--chip-ink);
}
.top-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid transparent; border-radius: 999px;
  padding: 9px 16px; font-weight: 650; font-size: 14px;
  transition: transform .15s ease, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 0 6px 16px -8px rgba(28,26,43,.6); }
.btn-ink:hover { box-shadow: 0 10px 22px -10px rgba(28,26,43,.7); transform: translateY(-1px); }
.btn-ghost { background: var(--paper-2); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-danger-ghost { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn .plus { font-size: 18px; line-height: 1; margin-top: -2px; }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

.icon-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--paper-2); border: 1.5px solid var(--line-2);
  transition: border-color .15s, transform .15s;
  font-size: 20px; line-height: 1;
}
.icon-btn:hover { border-color: var(--ink-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 32px; height: 32px; font-size: 17px; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.on { background: #f7d64a; border-color: #1c1a2b; color: #1c1a2b; }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--paper-2); }

.show-sm { display: none; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .top-actions { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; }
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(290px, 360px) 1fr;
  gap: 20px;
  padding: 10px clamp(16px, 4vw, 40px) 24px;
  max-width: 1440px; margin: 0 auto;
  align-items: start;
}
.side { display: grid; gap: 20px; position: sticky; top: 16px; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

/* Staggered page-load */
.reveal { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.side .reveal:nth-child(2) { animation-delay: .08s; }
.cal.reveal { animation-delay: .14s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

.kicker {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 6px;
}
.h-display {
  font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 120; margin: 0;
}

/* ---------- Today ---------- */
.today-card { padding: 20px 20px 18px; overflow: hidden; position: relative; }
.today-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.today-date { display: flex; align-items: baseline; gap: 10px; }
.today-num {
  font-family: var(--f-display); font-weight: 800; font-size: 64px; line-height: .85;
  letter-spacing: -0.05em; font-variation-settings: "opsz" 144;
}
.today-wd { font-family: var(--f-display); font-style: italic; font-size: 22px; line-height: 1.1; }
.today-mo { font-size: 13px; color: var(--ink-3); }
.ring { --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center; }
.ring span { width: 46px; height: 46px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 12px; font-weight: 600; }

.sess-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sess {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px 10px 10px; border-radius: var(--r-sm);
  background: var(--paper); border: 1px solid var(--line);
  position: relative;
  transition: opacity .2s, transform .2s;
}
.sess::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.sess.done { opacity: .55; }
.sess.done .sess-title { text-decoration: line-through; text-decoration-thickness: 2px; }
.sess-time { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); text-align: right; line-height: 1.3; }
.sess-time b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
.sess-title { font-weight: 650; line-height: 1.25; }
.sess-title mark { background: linear-gradient(transparent 52%, var(--c) 52%, var(--c) 92%, transparent 92%); color: inherit; padding: 0 2px; }
.sess-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

.check {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--ink-2);
  display: grid; place-items: center; cursor: pointer; background: var(--paper-2);
  transition: background .15s, border-color .15s, transform .15s;
}
.check::after { content: ""; width: 11px; height: 6px; border: 2.5px solid var(--paper); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.check:checked { background: var(--ink); border-color: var(--ink); }
.check:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check:hover { transform: scale(1.06); }

.empty { text-align: center; padding: 18px 8px 6px; color: var(--ink-2); }
.empty .h-display { font-size: 22px; margin-bottom: 6px; color: var(--ink); }
.empty p { margin: 0 0 14px; }
.empty .row-btns { justify-content: center; }
.rest {
  padding: 14px; border-radius: var(--r-sm); border: 1.5px dashed var(--line-2);
  color: var(--ink-2); font-size: 14px;
}
.rest b { font-family: var(--f-display); font-style: italic; font-weight: 600; color: var(--ink); font-size: 17px; display: block; }

/* ---------- Upcoming ---------- */
.upcoming-card { padding: 18px 20px; }
.up-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.up {
  display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start;
  padding: 10px 6px; border-radius: var(--r-sm); cursor: pointer;
  border-bottom: 1px dashed var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%;
}
.up:last-child { border-bottom: 0; }
.up:hover { background: var(--paper); }
.up-count { text-align: center; line-height: 1; padding-top: 2px; }
.up-count b { display: block; font-family: var(--f-display); font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.up-count small { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.up-count.soon b { color: var(--red); }
.up-name { font-weight: 650; line-height: 1.25; }
.up-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tag {
  display: inline-block; font-family: var(--f-mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; background: var(--c); color: var(--chip-ink); margin-right: 6px; vertical-align: 1px;
}
.bar { position: relative; height: 6px; border-radius: 6px; background: var(--paper-3); margin-top: 8px; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; }
.bar .planned { background: repeating-linear-gradient(-45deg, var(--line-2) 0 3px, transparent 3px 6px); }
.bar .done { background: var(--ink); }
.warn { margin-top: 6px; font-size: 12px; color: var(--red); display: flex; gap: 6px; align-items: flex-start; }

/* ---------- Calendar ---------- */
.cal { padding: 18px 18px 14px; min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 4px 14px; }
.cal-title { display: flex; align-items: baseline; gap: 10px; }
.cal-title .h-display { font-size: clamp(28px, 3.4vw, 40px); text-transform: lowercase; }
.cal-title .h-display em { font-weight: 400; font-style: italic; color: var(--ink-3); }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; background: var(--paper-3); border-radius: 999px; padding: 3px; margin-right: 6px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-selected="true"] { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.day {
  min-height: 118px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; position: relative;
  background: var(--paper-2); transition: background .12s; min-width: 0;
  text-align: left; font: inherit; color: inherit;
}
.day:hover { background: var(--paper); }
.day.out { background: transparent; }
.day.out .dnum { color: var(--ink-3); opacity: .55; }
.day.past:not(.today) > * { opacity: .6; }
.day.free::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(135deg, transparent 0 9px, var(--dot) 9px 10px); }
.dtop { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 2px; }
.dnum { font-family: var(--f-display); font-weight: 650; font-size: 17px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; margin: -2px 0 0 -4px; }
.day.today .dnum { background: var(--red); color: #fff; }
.wk { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); letter-spacing: .04em; }
.dsum { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); }

.chip {
  display: block; font-size: 12px; line-height: 1.25; padding: 3px 6px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink);
}
.chip.ev {
  background: var(--c); color: var(--chip-ink); font-weight: 700;
  box-shadow: 1px 2px 0 rgba(28,26,43,.18); transform: rotate(-.6deg);
}
.chip.ev .t { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; margin-right: 4px; opacity: .75; }
.chip.ss { padding: 1px 4px; }
.chip.ss span { background: linear-gradient(transparent 55%, var(--c) 55%, var(--c) 95%, transparent 95%); }
.chip.ss.done { opacity: .5; text-decoration: line-through; }
.chip.more { color: var(--ink-3); font-size: 11px; }
.dots { display: none; gap: 3px; flex-wrap: wrap; padding: 0 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.dots i.ev { border-radius: 2px; width: 9px; height: 9px; outline: 1.5px solid var(--ev-outline); outline-offset: -1.5px; }

@media (max-width: 760px) {
  .cal { padding: 14px 10px 10px; }
  .day { min-height: 64px; padding: 4px; }
  .day .chip { display: none; }
  .day .dots { display: flex; }
  .dsum, .wk { display: none; }
  .dow { padding: 6px 4px; text-align: center; font-size: 10px; }
  .dnum { font-size: 15px; width: 26px; height: 26px; margin: 0; }
}

/* List / agenda view */
.agenda { display: grid; gap: 4px; }
.ag-day { display: grid; grid-template-columns: 74px 1fr; gap: 16px; padding: 12px 6px; border-bottom: 1px dashed var(--line); }
.ag-day:last-child { border-bottom: 0; }
.ag-date { line-height: 1.05; }
.ag-date b { display: block; font-family: var(--f-display); font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.ag-date span { font-size: 12px; color: var(--ink-3); text-transform: lowercase; }
.ag-day.is-today .ag-date b { color: var(--red); }
.ag-items { display: grid; gap: 8px; align-content: start; }
.ag-ev {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--c); color: var(--chip-ink);
  font-weight: 700; cursor: pointer; border: 0; text-align: left; width: 100%;
  box-shadow: 2px 3px 0 rgba(28,26,43,.18);
}
.ag-ev .t { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.ag-ev .tm { margin-left: auto; font-family: var(--f-mono); font-size: 12px; font-weight: 600; }
.ag-empty { color: var(--ink-3); padding: 24px 6px; text-align: center; }
@media (max-width: 520px) {
  .ag-day { grid-template-columns: 50px 1fr; gap: 10px; padding: 10px 0; }
  .ag-date b { font-size: 26px; }
}

/* ---------- Footer ---------- */
.foot {
  max-width: 1440px; margin: 0 auto; padding: 4px clamp(16px, 4vw, 40px) 32px;
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3);
}
.foot span { margin-right: auto; }

/* ---------- Dialogs ---------- */
dialog.sheet {
  border: 1px solid var(--line-2); border-radius: 20px; padding: 0;
  width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--paper-2); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog.sheet[open] { animation: pop .28s cubic-bezier(.2, .9, .3, 1.15); }
dialog.sheet::backdrop { background: rgba(20, 18, 30, .45); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.sheet > form, .sheet > div { padding: 20px 22px; display: grid; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { font-family: var(--f-display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; margin: 0; }
.sheet-foot { display: flex; gap: 8px; align-items: center; padding-top: 6px; flex-wrap: wrap; }
.spacer { flex: 1; }
.sub { font-family: var(--f-display); font-weight: 650; font-size: 18px; margin: 8px 0 -6px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 0; }
.hint b { color: var(--ink-2); }

@media (max-width: 640px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92vh; }
  dialog.sheet[open] { animation: slideup .3s cubic-bezier(.2, .9, .3, 1); }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
}

.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field > span i { font-weight: 400; color: var(--ink-3); }
.field input:not([type=checkbox]), .field textarea, .suffix {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line-2);
  background: var(--paper); outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .suffix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(247, 214, 74, .55); }
.suffix { display: flex; align-items: center; gap: 6px; }
.suffix input { border: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; width: 100%; min-width: 0; }
.suffix b { font-weight: 500; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.field.checkline { display: flex; align-items: center; gap: 10px; align-self: end; padding-bottom: 10px; }
.field.checkline input { width: 20px; height: 20px; accent-color: var(--ink); }
.field.checkline span { font-weight: 500; color: var(--ink); font-size: 14px; }
.field.invalid input { border-color: var(--red); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}

.types { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.types legend { font-size: 12.5px; font-weight: 650; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.types label { position: relative; }
.types input { position: absolute; opacity: 0; pointer-events: none; }
.types span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  font-weight: 650; font-size: 14px; cursor: pointer; transition: all .15s; background: var(--paper);
}
.types span:hover { border-color: var(--ink-2); }
.types input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: rotate(-1.5deg); }
.types input:focus-visible + span { box-shadow: 0 0 0 3px rgba(247, 214, 74, .7); }

.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.weekdays label { display: grid; gap: 4px; text-align: center; }
.weekdays span { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.weekdays input { width: 100%; text-align: center; padding: 9px 2px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--paper); outline: none; }
.weekdays input:focus { border-color: var(--ink); }
.weekdays .total { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); text-align: right; }
@media (max-width: 520px) { .weekdays { grid-template-columns: repeat(4, 1fr); } }

/* Temaväljare */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.themes label { position: relative; }
.themes input { position: absolute; opacity: 0; pointer-events: none; }
.swatch {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: var(--paper); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.swatch:hover { border-color: var(--ink-2); }
.themes input:checked + .swatch { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(247, 214, 74, .6); transform: rotate(-.6deg); }
.themes input:focus-visible + .swatch { box-shadow: 0 0 0 3px rgba(247, 214, 74, .8); }
.swatch b { display: block; font-weight: 650; font-size: 14px; line-height: 1.2; }
.swatch small { color: var(--ink-3); font-size: 12px; }
.mini {
  width: 46px; height: 36px; border-radius: 8px; position: relative; overflow: hidden;
  background: var(--bg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
}
.mini::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 11px; border-radius: 3px; background: var(--card); }
.mini::after {
  content: ""; position: absolute; left: 8px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg); box-shadow: 11px 0 0 var(--acc), 22px 0 0 #f7d64a;
}

.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Day dialog content */
.day-sec { display: grid; gap: 8px; }
.day-sec h3 { margin: 4px 0 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.ev-card {
  border-radius: 12px; padding: 14px 16px; background: var(--c); color: var(--chip-ink);
  box-shadow: 3px 4px 0 rgba(28,26,43,.2); display: grid; gap: 4px; transform: rotate(-.4deg);
}
.ev-card .t { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.ev-card h4 { margin: 0; font-family: var(--f-display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.ev-card p { margin: 0; font-size: 13.5px; opacity: .85; white-space: pre-wrap; }
.ev-card .row-btns { margin-top: 6px; }
.ev-card .btn { background: rgba(255,255,255,.55); border-color: rgba(28,26,43,.35); color: #1c1a2b; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 50; right: 16px; bottom: 16px; display: grid; gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 12px 14px 12px 16px;
  box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: flex-start;
  animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.2);
  font-size: 14px;
}
.toast.reminder { background: #f7d64a; color: #1c1a2b; }
.toast b { display: block; font-family: var(--f-display); font-size: 16px; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; font-size: 16px; padding: 0 2px; }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ============================================================
   v2: konton, delning, aktiviteter, röda dagar, mobil
   ============================================================ */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.readonly .owner-only { display: none !important; }

/* ---------- Inloggning ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.1fr minmax(320px, 440px); gap: clamp(24px, 6vw, 80px);
  align-items: center; max-width: 1180px; margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) clamp(16px, 5vw, 48px);
  padding-top: max(clamp(24px, 6vw, 72px), env(safe-area-inset-top));
}
.auth-hero .brand-word { font-size: 34px; }
.auth-title {
  font-family: var(--f-display); font-weight: 800; letter-spacing: -0.035em; line-height: .98;
  font-size: clamp(44px, 7vw, 86px); margin: 28px 0 26px; font-variation-settings: "opsz" 144;
}
.auth-title em { font-weight: 400; font-style: italic; display: block; color: var(--ink-2); }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 16.5px; color: var(--ink-2); }
.auth-points mark { --hl: #f7d64a; color: var(--chip-ink); background: linear-gradient(104deg, transparent 1%, var(--hl) 3%, var(--hl) 96%, transparent 99%) 0 70% / 100% 55% no-repeat; padding: 0 3px; font-weight: 650; }
.auth-points li:nth-child(2) mark { --hl: #93d996; }
.auth-points li:nth-child(3) mark { --hl: #f59ac0; }
.auth-points li:nth-child(4) mark { --hl: #8fc9f2; }
.auth-card { padding: 22px; display: grid; gap: 16px; }
.auth-form { display: grid; gap: 14px; }
.btn.big { padding: 13px 20px; font-size: 15px; justify-content: center; }
.form-error { margin: 0; color: var(--red); font-size: 13.5px; font-weight: 600; }
.form-error:empty { display: none; }
.invite-banner {
  border-radius: 12px; padding: 12px 14px; background: #f7d64a; color: #1c1a2b; font-size: 14px; line-height: 1.35;
  box-shadow: 2px 3px 0 rgba(28,26,43,.2); transform: rotate(-.5deg);
}
.invite-banner b { font-family: var(--f-display); font-size: 17px; }
.seg.wide { display: flex; margin: 0; }
.seg.wide button { flex: 1; padding: 9px 12px; font-size: 14px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; align-content: start; gap: 22px; }
  .auth-title { margin: 18px 0 16px; }
  .auth-points { font-size: 15px; }
}

/* ---------- Toppfält: planväljare och banner ---------- */
.topbar { gap: 12px; }
.brand { flex: none; }
.plan-switch { margin-right: auto; margin-left: 4px; position: relative; min-width: 0; }
.plan-switch select {
  appearance: none; -webkit-appearance: none; border: 1.5px solid var(--line-2); background-color: var(--paper-2);
  border-radius: 999px; padding: 8px 32px 8px 14px; font-weight: 650; font-size: 14px; max-width: 46vw;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
  text-overflow: ellipsis;
}
.view-banner { max-width: 1440px; margin: 0 auto 4px; padding: 0 clamp(16px, 4vw, 40px); }
.view-banner > div {
  display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 14px;
}
.view-banner b { font-family: var(--f-display); font-size: 16px; }
.view-banner .btn { margin-left: auto; background: var(--paper); color: var(--ink); }

/* ---------- Aktiviteter & röda dagar ---------- */
.chip.act { border: 1.5px solid var(--ink-3); background: transparent; color: var(--ink-2); font-weight: 600; padding: 1px 5px; }
.chip.act .t { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; margin-right: 4px; color: var(--ink-3); }
.chip.act.allday { background: var(--paper-3); border-style: dashed; }
.dots i.act { background: transparent; outline: 1.5px solid var(--ink-3); outline-offset: -1.5px; }
.day.holiday { background: var(--red-soft); }
.day.holiday .dnum { color: var(--red); }
.day.today.holiday .dnum { color: #fff; }
.hol { font-size: 10.5px; line-height: 1.15; color: var(--red); font-weight: 650; padding: 0 2px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hol.afton { color: var(--ink-3); font-weight: 500; font-style: italic; }
.day.selected { box-shadow: inset 0 0 0 2px var(--ink); }

.act-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--r-sm); border: 1.5px dashed var(--line-2); background: transparent; color: var(--ink);
}
button.act-row:hover { border-color: var(--ink-2); }
.act-row .t { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.act-row b { font-weight: 650; display: block; line-height: 1.2; }
.act-row .tm { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.act-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--paper-3); }
.act-ico svg { width: 17px; height: 17px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hol-row { display: flex; align-items: center; gap: 8px; color: var(--red); font-weight: 650; font-size: 14px; }
.hol-row::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--red); flex: none; }
.hol-row.afton { color: var(--ink-2); font-weight: 500; font-style: italic; }
.hol-row.afton::before { background: var(--ink-3); }
.also { margin-top: 14px; display: grid; gap: 6px; }
.also .kicker { margin: 0; }

/* ---------- Dela ---------- */
.share-sec { display: grid; gap: 10px; }
.share-sec + .share-sec { border-top: 1px dashed var(--line); padding-top: 14px; }
.share-sec:empty { display: none; }
.invite-row { display: flex; gap: 8px; }
.invite-row input, .invite-out input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--paper); outline: none;
}
.invite-row input:focus { border-color: var(--ink); }
.invite-out { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--paper); border: 1.5px dashed var(--ink-3); }
.invite-out input { font-family: var(--f-mono); font-size: 12.5px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; background: var(--c, #f7d64a); color: #1c1a2b; flex: none; }
.people .who { flex: 1; min-width: 0; line-height: 1.25; }
.people .who small { display: block; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .btn { flex: none; }
.muted { color: var(--ink-3); font-size: 13.5px; margin: 0; }

/* ---------- Konto ---------- */
.account-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.account-box .av { width: 42px; height: 42px; font-family: var(--f-display); font-weight: 800; font-size: 19px; }
.account-box .who { flex: 1; min-width: 140px; line-height: 1.25; }
.account-box .who small { color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Dagdetalj (mobil, under månadsvyn) ---------- */
.day-detail { margin-top: 14px; display: grid; gap: 10px; }
.day-detail .dd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.day-detail .dd-head h3 { margin: 0; font-family: var(--f-display); font-size: 22px; font-weight: 700; }

.grabber { display: none; }
.tabbar { display: none; }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); font-size: 15.5px; }
  input, select, textarea { font-size: 16px !important; } /* hindrar iOS från att zooma in */

  .topbar {
    position: sticky; top: 0; z-index: 20;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand-word { font-size: 24px; }
  .plan-switch select { max-width: 42vw; padding: 7px 28px 7px 12px; }
  .layout { padding: 12px 12px 16px; gap: 14px; }
  .foot { display: none; }
  .view-banner { padding: 10px 12px 0; }

  body[data-tab="today"] [data-screen="cal"],
  body[data-tab="cal"] [data-screen="today"] { display: none; }

  .today-card { padding: 18px 16px 16px; }
  .today-num { font-size: 58px; }
  .upcoming-card { padding: 16px; }
  .sess { padding: 12px 12px 12px 10px; }
  .check { width: 28px; height: 28px; border-radius: 8px; }
  .up { padding: 12px 4px; }

  .cal { padding: 14px 10px 12px; border-radius: 18px; }
  .cal-head { padding: 0 4px 12px; gap: 10px; }
  .cal-title .h-display { font-size: 28px; }
  .cal-nav { width: 100%; }
  .cal-nav .seg { margin-right: auto; }
  .cal-nav .icon-btn.sm { width: 38px; height: 38px; }
  .cal-nav .btn.sm { padding: 8px 14px; }
  .day { min-height: 58px; }
  .day .hol { display: none; }

  .tabbar {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--paper-2) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar button {
    border: 0; background: none; color: var(--ink-3); display: grid; justify-items: center; gap: 2px;
    padding: 6px 0 4px; min-height: 52px; font-size: 11px; font-weight: 650; border-radius: 12px;
    -webkit-tap-highlight-color: transparent; transition: transform .12s;
  }
  .tabbar button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar button[aria-current="page"] { color: var(--ink); }
  .tabbar button[aria-current="page"] svg { stroke-width: 2.3; }
  .tabbar button:active { transform: scale(.93); }
  .tabbar .fab {
    width: 58px; height: 58px; min-height: 0; padding: 0; border-radius: 20px; justify-self: center; align-self: center;
    background: var(--ink); color: var(--paper); box-shadow: 0 10px 24px -8px rgba(28,26,43,.6);
    margin-top: -26px; transform: rotate(-3deg); place-items: center;
  }
  .tabbar .fab:active { transform: rotate(-3deg) scale(.93); }
  .tabbar .fab svg { width: 28px; height: 28px; stroke-width: 2.4; }
  body.readonly .tabbar { grid-template-columns: repeat(4, 1fr); }

  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); right: 12px; left: 12px; width: auto; }

  dialog.sheet > form, dialog.sheet > div { padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
  .grabber { display: block; width: 42px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 2px auto -4px; }
  .sheet-head h2 { font-size: 24px; }
  .sheet-foot .btn { padding: 11px 16px; }
  .types span { padding: 9px 14px; }
}
.cat-section { display: grid; gap: 14px; }
.cat-section .field.checkline { padding-bottom: 0; align-self: start; }

/* ---------- Lösenord & konto ---------- */
.auth-sub { margin: 0 0 4px; font-family: var(--f-display); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.auth-link { justify-self: center; font-size: 13.5px; }
.form-ok { margin: 0; color: var(--ok); font-size: 14px; font-weight: 600; }
.form-ok:empty { display: none; }
.acct-more { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.acct-more summary { cursor: pointer; padding: 11px 14px; font-weight: 650; font-size: 14px; list-style: none; display: flex; justify-content: space-between; }
.acct-more summary::-webkit-details-marker { display: none; }
.acct-more summary::after { content: "+"; color: var(--ink-3); font-size: 18px; line-height: 1; }
.acct-more[open] summary::after { content: "–"; }
.acct-more.danger summary { color: var(--red); }
.acct-body { display: grid; gap: 12px; padding: 0 14px 14px; }

/* ---------- Admin ---------- */
dialog.sheet.wide { width: min(880px, calc(100vw - 24px)); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat {
  border-radius: 14px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line);
  display: grid; gap: 2px; position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, #f7d64a); }
.stat b { font-family: var(--f-display); font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.stat small { font-size: 11.5px; color: var(--ink-3); }
.admin-search input {
  width: 100%; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--paper); outline: none;
}
.admin-search input:focus { border-color: var(--ink); }
.ulist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.urow {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line);
}
.urow.blocked { opacity: .7; border-style: dashed; }
.urow .who { min-width: 0; line-height: 1.3; }
.urow .who b { font-weight: 650; }
.urow .who small { display: block; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); }
.urow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-family: var(--f-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.badge.admin { background: #f7d64a; color: #1c1a2b; }
.badge.blocked { background: var(--red); color: #fff; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
@media (max-width: 640px) {
  .urow { grid-template-columns: auto 1fr; }
  .urow .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .stat b { font-size: 26px; }
}

/* ---------- Intervju (onboarding) ---------- */
dialog.onboard {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  background: radial-gradient(var(--dot) 1.1px, transparent 1.4px) 0 0 / 22px 22px, var(--paper); color: var(--ink);
}
dialog.onboard::backdrop { background: var(--paper); }
dialog.onboard[open] { animation: none; }
body.ob-open { overflow: hidden; }
.ob-wrap {
  height: 100%; overflow-y: auto; display: grid; grid-template-rows: auto auto 1fr auto;
  max-width: 680px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px 0;
}
.ob-top { display: flex; align-items: center; justify-content: space-between; }
.ob-top .brand-word { font-size: 24px; }
.ob-progress { height: 6px; border-radius: 6px; background: var(--paper-3); margin: 16px 0 6px; overflow: hidden; }
.ob-progress i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 6px; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.ob-step { padding: 20px 0 28px; display: grid; gap: 16px; align-content: start; animation: obIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes obIn { from { opacity: 0; transform: translateX(14px); } }
@media (prefers-reduced-motion: reduce) { .ob-step { animation: none; } }
.ob-kicker { margin: 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ob-title {
  margin: 0; font-family: var(--f-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02;
  font-size: clamp(32px, 6vw, 48px); font-variation-settings: "opsz" 144;
}
.ob-lead { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; max-width: 52ch; }
.ob-sub { margin: 6px 0 -6px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.ob-hint { margin: 0; font-size: 13px; color: var(--ink-3); }
.ob-ok { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }

.ob-cards { display: grid; gap: 10px; }
.ob-cards.cols2 { grid-template-columns: 1fr 1fr; }
.ob-card {
  text-align: left; padding: 16px 18px; border-radius: 16px; border: 2px solid var(--line-2); background: var(--paper-2);
  display: grid; gap: 4px; transition: border-color .15s, transform .15s, box-shadow .15s; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.ob-card:hover { border-color: var(--ink-2); }
.ob-card b { font-size: 17px; font-weight: 700; }
.ob-card span { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.ob-card.on { border-color: var(--ink); box-shadow: 3px 4px 0 var(--ink); transform: translate(-2px, -2px); background: var(--paper-2); }
.ob-card.on b::after { content: " ✓"; }

.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ob-chip {
  border: 1.5px solid var(--line-2); background: var(--paper-2); border-radius: 999px; padding: 9px 14px;
  font-weight: 650; font-size: 14px; color: var(--ink); transition: all .12s; min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}
.ob-chip:hover { border-color: var(--ink-2); }
.ob-chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ob-chip:active { transform: scale(.95); }
.ob-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ob-inline input, .ob-actform > input {
  flex: 1; min-width: 160px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--paper-2); outline: none;
}
.ob-inline input:focus, .ob-actform > input:focus { border-color: var(--ink); }
.ob-time { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.ob-time input { padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--paper-2); }

.ob-days { display: grid; gap: 8px; }
.ob-day { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: center; }
.ob-dname { font-weight: 650; text-transform: capitalize; }
.ob-amounts { display: flex; gap: 6px; flex-wrap: wrap; }
.ob-amounts .ob-chip { padding: 7px 11px; min-height: 36px; font-size: 13px; }
.ob-sum { margin: 0; color: var(--ink-2); }

.ob-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ob-acts li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1.5px dashed var(--ink-3); background: var(--paper-2); }
.ob-acts small { display: block; color: var(--ink-3); font-family: var(--f-mono); font-size: 12px; }
.ob-acts em { color: var(--ink-3); font-size: 12px; }
.ob-actform { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); }

.ob-summary { list-style: none; margin: 0; padding: 0; display: grid; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.ob-summary li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px dashed var(--line); }
.ob-summary li:last-child { border-bottom: 0; }
.ob-summary span { color: var(--ink-3); }
.ob-summary b { text-align: right; }
.ob-howto { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 16px; line-height: 1.45; }

.ob-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px;
  padding: 14px 0 max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--paper) 30%);
}
.ob-foot .btn.big { padding: 14px 24px; font-size: 15.5px; }

@media (max-width: 520px) {
  .ob-cards.cols2 { grid-template-columns: 1fr; }
  .ob-day { grid-template-columns: 1fr; gap: 6px; }
  .ob-wrap { padding-left: 16px; padding-right: 16px; }
  .ob-foot .btn.big { flex: 1; justify-content: center; }
}
.ob-amounts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ob-amounts .ob-chip { padding: 7px 0; font-size: 12.5px; white-space: nowrap; }
