:root {
  --brand: #b5527a;
  --brand-ink: #fff;
  --brand-soft: #b5527a1a;
  --bg: #f3f4f6;
  --card: #fff;
  --text: #15181b;
  --muted: #5f6870;
  --faint: #8b949b;
  --line: #e4e7ea;
  --line-2: #d3d8dc;
  --ok: #1f9d5b;
  --err: #d23b3b;
  --zen: #53d18a;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { color: var(--muted); padding: 16px 0; margin: 0; }
.hint { color: var(--faint); font-size: .86rem; margin: 10px 0 0; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Topbar */
.bar { background: #000; color: #f2f4f5; position: sticky; top: 0; z-index: 20; }
.bar__inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 700; letter-spacing: .14em; font-size: .9rem; flex: none; }
.logo small { font-weight: 500; letter-spacing: .04em; color: #8b949b; margin-left: 4px; }
.logo__mark { width: 28px; height: 28px; border-radius: 8px; background: #13171a; border: 1px solid #22282b; display: grid; place-items: center; }
.logo__mark svg { width: 20px; height: 20px; fill: none; stroke: var(--zen); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tabs { display: flex; gap: 4px; margin: 0 auto; background: #13171a; padding: 4px; border-radius: 999px; }
.tab { background: none; border: 0; color: #a3abb0; padding: 7px 16px; border-radius: 999px; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { background: #f2f4f5; color: #000; }
.share { flex: none; background: var(--zen); color: #04140b; border: 0; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .88rem; }
@media (max-width: 900px) {
  .bar__inner { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .tab { flex: 1; padding: 7px 10px; }
  .share { margin-left: auto; }
}
@media (max-width: 420px) { .tab { font-size: .8rem; padding: 7px 6px; } .share { font-size: .8rem; padding: 7px 12px; } }

main { max-width: 1240px; margin: 0 auto; padding: 32px 20px 64px; }
@media (max-width: 600px) { main { padding: 16px 16px 48px; } }

/* Kundens bokning */
.book { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; max-width: 1040px; margin: 0 auto; }
@media (max-width: 900px) { .book { grid-template-columns: 1fr; } }
.widget { background: var(--card); border-radius: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px -12px rgba(0,0,0,.12); overflow: hidden; }
.widget__head { display: flex; gap: 14px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.widget__head p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.widget__logo { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; flex: none; }
.widget__body { padding: 8px 28px 28px; }
.widget__body h2 { margin: 18px 0 14px; }
@media (max-width: 600px) { .widget__head { padding: 18px 20px; } .widget__body { padding: 4px 20px 24px; } }

.progress { list-style: none; margin: 0; padding: 14px 28px 0; display: flex; gap: 6px; }
.progress li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: .74rem; line-height: 1.3; color: var(--faint); font-weight: 500; }
.progress li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line); }
.progress li.is-done::before, .progress li.is-now::before { background: var(--brand); }
.progress li.is-now { color: var(--text); }
@media (max-width: 600px) { .progress { padding: 12px 20px 0; } }

.services { display: grid; gap: 10px; }
.service { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; transition: border-color .15s, background .15s, transform .1s; }
.service:hover { border-color: var(--brand); background: var(--brand-soft); }
.service:active { transform: scale(.995); }
.service small { display: block; color: var(--muted); font-size: .86rem; }
.service__meta { text-align: right; flex: none; }

.back { background: none; border: 0; padding: 0; color: var(--muted); font-size: .88rem; margin-top: 16px; }
.back:hover { color: var(--text); }
.chosen { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; background: var(--brand-soft); border-radius: 12px; padding: 12px 16px; margin-top: 12px; font-size: .92rem; }
.chosen span { color: var(--muted); }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.day b { font-size: 1.1rem; }
.day small { font-size: .7rem; color: var(--faint); }
.day:hover:not(:disabled) { border-color: var(--brand); }
.day.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.day.on small { color: inherit; opacity: .85; }
.day:disabled { opacity: .45; cursor: not-allowed; background: var(--bg); }
.times { margin-top: 18px; }
.slots__label { font-size: .8rem; color: var(--faint); margin: 12px 0 8px; font-weight: 500; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot { background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 0; font-weight: 600; font-size: .92rem; }
.slot:hover { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }

.details { display: grid; gap: 14px; }
.f label { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.f small { color: var(--faint); font-weight: 400; }
.f input, .f textarea, .f select, .svc input, .svc select, .hour input, .auto-edit textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; font-size: .95rem;
}
.f input:focus, .f textarea:focus, .svc input:focus, .svc select:focus, .hour input:focus, .auto-edit textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.f--err input { border-color: var(--err); }
.f__err { display: block; color: var(--err); font-size: .82rem; margin-top: 4px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--muted); cursor: pointer; }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.consent.f--err { color: var(--err); }
.cta { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 12px; padding: 14px 20px; font-weight: 600; font-size: 1rem; width: 100%; transition: filter .15s; }
.cta:hover { filter: brightness(1.08); }

.done { text-align: center; padding: 28px 0 8px; }
.done__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; margin: 0 auto 8px; }
.done__icon svg { width: 32px; height: 32px; fill: none; stroke: var(--brand-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done p { margin: 0 0 8px; }
.done__actions { display: grid; gap: 14px; max-width: 320px; margin: 20px auto 0; }

/* Sms-panel */
.sms { position: sticky; top: 84px; }
.sms__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 600; margin: 0 0 10px; }
.sms__phone { background: #fff; border: 8px solid #15181b; border-radius: 34px; overflow: hidden; min-height: 420px; display: flex; flex-direction: column; }
.sms__top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .9rem; background: #fafafa; }
.sms__avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: .8rem; }
.sms__list { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sms__empty { color: var(--faint); font-size: .88rem; text-align: center; margin: auto 12px; }
.bubble { background: #e9ebee; border-radius: 16px 16px 16px 4px; padding: 10px 13px; font-size: .88rem; max-width: 92%; animation: pop .35s ease both; }
.bubble--later { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }
.bubble__meta { display: block; font-size: .7rem; font-weight: 600; color: var(--faint); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }
.bubble:nth-child(2) { animation-delay: .1s; } .bubble:nth-child(3) { animation-delay: .2s; } .bubble:nth-child(4) { animation-delay: .3s; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 900px) { .sms { position: static; } .sms__phone { min-height: 0; } }

/* Admin */
.admin__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin__head p { margin: 2px 0 0; }
.btn-sec { background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.btn-sec:hover { border-color: var(--brand); color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--line); }
.stat span { display: block; font-size: .8rem; color: var(--muted); }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -0.02em; margin-top: 4px; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } }
.admin__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .admin__grid { grid-template-columns: 1fr; } }
.side { display: grid; gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.panel h2 { margin-bottom: 12px; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel__head h2 { margin: 0; }
.panel--row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.panel--row h2 { margin-bottom: 0; }
.pill { font-size: .78rem; background: var(--brand-soft); color: var(--brand); padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.daynav { display: flex; gap: 4px; }
.daynav button { background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 11px; font-size: .86rem; font-weight: 500; }
.daynav button:hover { border-color: var(--brand); }

.agenda { list-style: none; margin: 0; padding: 0; }
.ag, .slotfree { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.ag:first-child, .slotfree:first-child { border-top: 0; }
.ag__time { width: 52px; flex: none; font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }
.ag__time small { display: block; color: var(--faint); font-weight: 400; font-size: .78rem; }
.ag__body { flex: 1; min-width: 0; border-left: 3px solid var(--brand); padding-left: 12px; }
.ag__body > b, .ag__body > span, .ag__body > small { display: block; }
.ag__body > span { font-size: .9rem; color: var(--muted); }
.ag__body small { color: var(--faint); font-size: .82rem; overflow-wrap: anywhere; }
.ag--done .ag__body { border-left-color: var(--ok); }
.ag--cancelled .ag__body { border-left-color: var(--line-2); opacity: .6; }
.ag--cancelled .ag__body b { text-decoration: line-through; }
.ag__actions { display: flex; gap: 6px; flex: none; }
.ag__actions button { background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 10px; font-size: .8rem; font-weight: 500; }
.ag__actions button:hover { border-color: var(--brand); color: var(--brand); }
.slotfree { color: var(--faint); font-size: .86rem; align-items: center; }
.slotfree .ag__time { color: var(--faint); font-weight: 400; }
.slotfree > span:last-child { flex: 1; border: 1px dashed var(--line-2); border-radius: 8px; padding: 6px 12px; }
.badge { display: inline-block; background: var(--brand); color: var(--brand-ink); font-size: .68rem; padding: 1px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; font-weight: 600; text-decoration: none; }
.badge--grey { background: var(--line); color: var(--muted); }
.badge--ok { background: #e3f5ea; color: var(--ok); }
@media (max-width: 560px) { .ag { flex-wrap: wrap; } .ag__actions { width: 100%; padding-left: 68px; } }

.queue { list-style: none; margin: 0; padding: 0; }
.queue li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.queue li:first-child { border-top: 0; }
.queue__when { color: var(--faint); width: 118px; flex: none; font-variant-numeric: tabular-nums; }

.autos { list-style: none; margin: 0; padding: 0; }
.autos li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.autos li:first-child { border-top: 0; }
.autos small { display: block; color: var(--faint); font-size: .8rem; }

.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span[aria-hidden] { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: background .15s; }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Inställningar */
.settings { max-width: 860px; margin: 0 auto; display: grid; gap: 18px; }
.settings__intro p { margin: 6px 0 0; max-width: 46em; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line-2); border-radius: 99px; padding: 8px 16px; font-weight: 500; }
.preset span { width: 12px; height: 12px; border-radius: 50%; }
.preset:hover, .preset.on { border-color: var(--text); }
.preset.on { background: var(--text); color: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.color { display: flex; align-items: center; gap: 10px; }
.color input { width: 48px !important; height: 42px; padding: 3px !important; cursor: pointer; }
.color span { color: var(--muted); font-variant-numeric: tabular-nums; }

.svc-head, .svc { display: grid; grid-template-columns: 1.2fr 1.6fr 110px 100px 36px; gap: 8px; align-items: center; }
.svc-head { font-size: .78rem; color: var(--faint); margin-bottom: 6px; }
.svc-list { display: grid; gap: 8px; }
.svc input, .svc select { padding: 9px 10px; font-size: .9rem; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; height: 36px; font-size: 1.3rem; color: var(--faint); }
.icon-btn:hover { color: var(--err); border-color: var(--line-2); }
@media (max-width: 700px) {
  .svc-head { display: none; }
  .svc { grid-template-columns: 1fr 1fr 36px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
  .svc [data-svc="name"] { grid-column: 1 / 3; }
  .svc [data-svc="desc"] { grid-column: 1 / 4; grid-row: 2; }
  .svc .icon-btn { grid-column: 3; grid-row: 1; }
}

.hours { display: grid; gap: 8px; }
.hour { display: grid; grid-template-columns: 130px 120px auto 120px; gap: 10px; align-items: center; }
.hour__day { display: flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.hour__day input { width: 18px; height: 18px; accent-color: var(--brand); }
.hour input[type="time"] { padding: 8px 10px; }
.hour input:disabled { opacity: .4; }
@media (max-width: 500px) { .hour { grid-template-columns: 1fr 1fr auto 1fr; } .hour__day { grid-column: 1 / -1; } .hour > span { text-align: center; } .hour input[type="time"]:first-of-type { grid-column: 1 / 3; } }

.auto-edit { padding: 14px 0; border-top: 1px solid var(--line); }
.auto-edit:first-of-type { border-top: 0; }
.auto-edit__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.auto-edit__head small { color: var(--faint); margin-left: auto; font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.auto-edit__head small input { width: 64px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 8px; }
.auto-edit textarea { resize: vertical; font-size: .9rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #15181b; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 50; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
