/* Mina sidor – same blue palette as staging.vastergardet.se */
:root {
  --navy: #0f1d38; --blue: #25498e; --mid: #358dd6; --ice: #f0f5fb; --slate: #576c8e; --text: #3e4f6c; --line: #dfe7f2; --white: #fff;
  --ok: #1d6a3a; --ok-bg: #e1f2e6; --warn: #8a5300; --warn-bg: #fdf0d8; --err: #9b2c2c; --err-bg: #f8e3e1; --acc-bg: #e3edfb;
  --head: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; --body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ice); color: var(--navy); font-family: var(--body); font-size: 16px; line-height: 1.6; }
a { color: var(--blue); }
h1, h2 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; margin-top: 1.6em; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--blue); font-family: var(--head); font-weight: 800; }
.brand img { height: 46px; width: auto; }
.brand span { border-left: 1px solid var(--line); padding-left: 10px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-family: var(--head); font-weight: 700; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--navy); padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a.on { color: var(--blue); border-bottom-color: var(--blue); }
.nav form { margin: 0; }
.site-link { font-weight: 700; }
.who { font-size: .85rem; color: var(--slate); padding-block: 8px 0; }
.main { padding-block: 20px 72px; }
.lead { color: var(--text); margin: 0; }
.card { background: var(--white); border-radius: 16px; padding: 22px; margin: 0 0 16px; }
.card.narrow { max-width: 560px; }
.card.demo { background: #fffdf5; border: 1px dashed #e0c98a; }
.small { font-size: .88rem; color: var(--slate); }
.muted { color: var(--slate); font-size: .9rem; }
.form { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.form label, .grid-form label { font-weight: 600; font-size: .92rem; margin-top: 6px; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid #c9d8ef; border-radius: 10px; background: var(--white); color: var(--navy); min-height: 44px; }
input:focus, select:focus, textarea:focus, a:focus-visible, button:focus-visible { outline: 3px solid var(--mid); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { min-height: 0; margin-top: 4px; width: 18px; height: 18px; }
.btn { display: inline-block; font-family: var(--head); font-weight: 700; background: var(--blue); color: var(--white); border: 0; border-radius: 999px; padding: 12px 22px; text-decoration: none; cursor: pointer; font-size: 1rem; min-height: 44px; }
.btn:hover { background: var(--navy); color: var(--white); }
.btn.small { padding: 8px 14px; font-size: .9rem; min-height: 38px; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; background: transparent; color: var(--blue); border: 1px solid #c9d8ef; border-radius: 999px; padding: 8px 14px; text-decoration: none; cursor: pointer; font-size: .95rem; min-height: 38px; }
.danger { color: var(--err) !important; border-color: #ecc5c1 !important; }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }
.flash { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.info { background: var(--acc-bg); color: var(--navy); }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.4rem; letter-spacing: .12em; }
.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.acc { background: var(--acc-bg); color: var(--blue); }
.chip.muted { background: #eef1f5; color: var(--slate); }
.plain { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.quota { background: var(--white); border-radius: 999px; padding: 8px 16px; margin: 0; font-size: .92rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-head h2 { margin: 0; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.wd { text-align: center; font-size: .78rem; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: .05em; }
.day { min-height: 68px; border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; justify-content: space-between; font-size: .78rem; text-decoration: none; }
.day b { font-family: var(--head); font-size: 1rem; }
.day.free { background: var(--acc-bg); color: var(--blue); border: 1px solid #c4d6f2; }
.day.free:hover { background: var(--blue); color: var(--white); }
.day.mine { background: var(--blue); color: var(--white); }
.day.booked { background: #e7eaf0; color: var(--slate); }
.day.closed { background: var(--warn-bg); color: var(--warn); }
.day.past, .day.later, .day.soon { background: transparent; color: #a3b0c4; border: 1px solid var(--line); }
.day.blank { background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .85rem; color: var(--slate); margin: 14px 0 0; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; }
.dot.free { background: var(--acc-bg); border: 1px solid #c4d6f2; } .dot.mine { background: var(--blue); } .dot.booked { background: #e7eaf0; } .dot.closed { background: var(--warn-bg); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 12px 0; }
.facts dt { font-weight: 700; color: var(--slate); font-size: .9rem; }
.facts dd { margin: 0; }
.pay { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; background: var(--ice); border-radius: 14px; padding: 18px; margin: 14px 0; }
.pay h2 { margin-top: 0; }
.qr { width: 190px; max-width: 100%; background: var(--white); border-radius: 10px; padding: 6px; }
.qr svg { width: 100%; height: auto; display: block; }
.codebox { display: flex; flex-direction: column; gap: 4px; background: var(--ok-bg); color: var(--ok); border-radius: 14px; padding: 16px 18px; margin: 14px 0; }
.codebox .code { font-size: 2rem; color: var(--navy); }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--white); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 16px; align-items: center; }
.row form { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.inline input { width: 160px; min-height: 38px; padding: 6px 10px; }
.inline select { min-height: 38px; padding: 6px 10px; }
@media (max-width: 720px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .actions { justify-content: flex-start; }
  .day { min-height: 54px; padding: 4px 5px; }
  .day span { display: none; }
  .brand img { height: 38px; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--white); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.stat b { font-family: var(--head); font-size: 1.7rem; }
.stat span { font-size: .85rem; color: var(--slate); }
.stat.warn { background: var(--warn-bg); }
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 8px 16px; align-items: center; }
.grid-form .span { grid-column: 1 / -1; margin-top: 8px; }
@media (max-width: 600px) { .grid-form { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.demo-band { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: #fff4d6; color: #6b4d00; text-align: center; font-size: .82rem; padding: 6px 16px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #ecd9a2; }
/* Statistics charts */
h3 { font-family: var(--head); font-size: 1rem; margin: 18px 0 8px; }
h3:first-child { margin-top: 0; }
.chart { margin: 0 0 6px; }
.chart-sum { margin: -4px 0 10px; font-size: .88rem; color: var(--slate); }
/* Column chart: a 34px gutter for the scale, columns share the rest of the width */
.plot { position: relative; height: 150px; margin-top: 14px; }
.grid-line { position: absolute; left: 34px; right: 0; border-top: 1px solid var(--line); }
.grid-line.base { border-top-color: #b9c6da; }
.grid-label { position: absolute; left: 0; width: 28px; text-align: right; transform: translateY(50%); font-size: .7rem; color: var(--slate); font-variant-numeric: tabular-nums; line-height: 1; }
.cols, .xlabels { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: 2px; }
.cols { position: absolute; left: 34px; right: 0; top: 0; bottom: 0; }
.col { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 100%; outline: none; cursor: default; }
.col .bar { width: 100%; max-width: 24px; background: var(--blue); border-radius: 4px 4px 0 0; }
.col:hover .bar, .col:focus .bar { background: var(--mid); }
.col:focus-visible { box-shadow: inset 0 0 0 2px var(--mid); border-radius: 4px; }
.tip { position: absolute; left: 50%; transform: translate(-50%, -6px); background: var(--navy); color: #fff; font-size: .75rem; font-weight: 600; white-space: nowrap; padding: 3px 7px; border-radius: 6px; pointer-events: none; visibility: hidden; z-index: 2; }
.col.left .tip { left: 0; transform: translate(0, -6px); }
.col.right .tip { left: auto; right: 0; transform: translate(0, -6px); }
.col:hover .tip, .col:focus .tip { visibility: visible; }
.xlabels { margin-left: 34px; margin-top: 4px; }
.xlabels span { text-align: center; font-size: .68rem; color: var(--slate); font-weight: 600; white-space: nowrap; overflow: visible; }
/* Horizontal bars: label, bar, value */
.hbars { max-width: 560px; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; }
.hb-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.hb-track { display: block; height: 18px; }
.hb-bar { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; }
.hb-val { font-size: .85rem; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; min-width: 2ch; }
.figures { margin: 6px 0 4px; font-size: .9rem; }
.figures summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.figures table { margin-top: 8px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
a.stat { text-decoration: none; color: inherit; }
.dupes { margin: 8px 0 0; padding-left: 18px; font-size: .9rem; color: var(--text); }
.dupes form { display: inline; }
.merge { margin-top: 8px; }
.merge label { font-size: .88rem; font-weight: 600; }
.roles .check { font-size: .88rem; }
/* Preferences bar, larger text, tools, messages */
.prefs { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-block: 8px 0; font-size: .85rem; color: var(--slate); }
.prefs .who { padding: 0; }
.pref-links a { font-weight: 700; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--white); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
body.text-large { font-size: 19px; }
body.text-large .small, body.text-large .muted { font-size: .95rem; }
body.text-large .day { min-height: 80px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.history { margin-top: 14px; }
.history summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.msg h2 { margin: 0 0 6px; font-size: 1.05rem; }
.msg p { margin: 0 0 6px; }
.msg-body { white-space: pre-line; }
.tablewrap { overflow-x: auto; }
.xlabels.dense span:first-child { text-align: left; }
.xlabels.dense span:last-child { text-align: right; }
.paybox { background: var(--ice); border-radius: 14px; padding: 18px; margin: 14px 0; }
.paybox h2 { margin-top: 0; }
.mailtpl { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; margin: 0 0 14px; }
.mailtpl legend { font-family: var(--head); font-weight: 800; padding: 0 6px; }
.mailtpl textarea { width: 100%; font: inherit; font-size: .92rem; line-height: 1.5; }
.placeholders { margin: 8px 0 14px; font-size: .9rem; }
.placeholders summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.optin { margin: 18px 0; }
.optin h2 { margin-top: 0; font-size: 1.1rem; }
