:root {
  --bg: #0f0d0b;
  --card: #1a1714;
  --card-2: #221e1a;
  --border: #2e2823;
  --text: #f4ece1;
  --muted: #a99c8c;
  --accent: #f2a93b;
  --accent-ink: #1a1206;
  --ok: #8fd19e;
  --over: #ff8a6b;
  --radius: 18px;
  --head: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.08; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 20px 14px;
  background: rgba(15, 13, 11, .86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.wordmark { font-family: var(--head); font-weight: 700; font-size: 1.35rem; text-decoration: none; letter-spacing: -0.02em; }

/* ---------- takkar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem var(--body); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 8px 14px; font: 500 .9rem var(--body); cursor: pointer; }

/* ---------- landing ---------- */
.landing main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 72px 0 40px; display: grid; gap: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--muted); margin: 0 0 .6em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 40px; }
.hero-card {
  max-width: 380px; padding: 22px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--border);
}
.hc-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.hc-big { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; }
.hc-num { font-family: var(--head); font-size: 3.4rem; font-weight: 700; line-height: 1; }
.hc-sub { color: var(--muted); }
.hc-next { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }

.section { padding: 64px 0; border-top: 1px solid var(--border); }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li, .level { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.steps p, .level p { color: var(--muted); margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); font-weight: 600; margin-bottom: 14px; }
.levels { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 24px; }
.level-num { display: block; font-family: var(--head); font-size: 2.6rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.section-theory h2 { font-size: clamp(2rem, 6vw, 3.8rem); max-width: 12em; }
.level-main { border-color: var(--accent); position: relative; }
.level-badge { position: absolute; top: 18px; right: 18px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink); background: var(--accent); padding: 4px 10px; border-radius: 999px; }
.section-note p { color: var(--muted); max-width: 40em; font-size: 1.05rem; }
.cta { text-align: center; }
.footer {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: 28px 20px calc(env(safe-area-inset-bottom) + 28px);
  color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border);
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.steps .reveal:nth-child(2), .levels .reveal:nth-child(2) { transition-delay: .08s; }
.steps .reveal:nth-child(3), .levels .reveal:nth-child(3) { transition-delay: .16s; }
.steps .reveal:nth-child(4) { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- app ---------- */
.app-main { max-width: 560px; margin: 0 auto; padding: 24px 18px calc(env(safe-area-inset-bottom) + 48px); }
.app h1 { font-size: 2rem; }
.view { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.form { display: grid; gap: 18px; margin-top: 20px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 500; font-size: .92rem; padding: 0; margin-bottom: 8px; }
input[type=number], input[type=time], input:not([type]), select {
  width: 100%; min-height: 52px; padding: 0 14px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  font: 500 1.05rem var(--body);
  color-scheme: dark;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg label, .chips label { position: relative; }
.seg input, .chips input { position: absolute; opacity: 0; inset: 0; }
.seg span, .chips span, .chip {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font: 500 .95rem var(--body); color: var(--text); cursor: pointer;
}
.seg input:checked + span, .chips input:checked + span, .chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + span, .chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.slider-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.slider-row input { flex: 1; accent-color: var(--accent); height: 32px; }
.slider-row output { font-family: var(--head); font-weight: 700; font-size: 1.4rem; min-width: 4.2em; text-align: right; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.live-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.live-head .eyebrow { color: var(--text); font-weight: 600; }
.live-head .muted { margin: 0; font-size: .9rem; }

.gauge-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.gauge-top .muted { white-space: nowrap; }
.gauge-num { font-family: var(--head); font-size: 3.6rem; font-weight: 700; line-height: 1; }
.bar { position: relative; height: 10px; background: var(--card-2); border-radius: 999px; margin: 18px 0 12px; overflow: visible; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.bar-target { position: absolute; top: -5px; width: 2px; height: 20px; background: var(--text); transform: translateX(-1px); }
.gauge-state { margin: 0; font-weight: 500; color: var(--muted); }
.gauge-state.on { color: var(--ok); }
.gauge-state.over { color: var(--over); }

.next { background: var(--card-2); }
.next-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.next-head select { width: auto; min-height: 38px; font-size: .95rem; padding: 0 10px; }
.next-big { font-family: var(--head); font-size: 2.8rem; font-weight: 700; margin: 10px 0 4px; line-height: 1.05; }
.next p { margin: 0; }

.h-sm { font-size: 1.1rem; margin: 26px 0 12px; }
.drinks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.drink {
  display: grid; gap: 2px; text-align: left;
  padding: 14px 16px; min-height: 68px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  color: var(--text); font: inherit; cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.drink strong { font-weight: 600; }
.drink span { color: var(--muted); font-size: .85rem; }
.drink:active { transform: scale(.97); border-color: var(--accent); }
.drink-custom { border-style: dashed; }

.chart-card canvas { display: block; width: 100%; height: 180px; }
.legend { display: flex; gap: 18px; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.lg { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: 6px; }
.lg-line { border-top: 3px solid var(--accent); }
.lg-target { border-top: 1px dashed var(--muted); }

.sober p { margin: 0; }
.sober strong { font-family: var(--head); font-size: 1.3rem; }
.sober .warn { margin-top: 10px; color: var(--muted); font-size: .9rem; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.log .empty { display: block; }
.log-t { font-variant-numeric: tabular-nums; color: var(--muted); }
.log-d { color: var(--muted); font-size: .85rem; }
.log-x { background: none; border: 0; color: var(--muted); font: 500 .85rem var(--body); cursor: pointer; padding: 6px; }

dialog {
  width: min(92vw, 460px); padding: 22px; border-radius: 22px;
  background: var(--card); color: var(--text); border: 1px solid var(--border);
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog .form { margin-top: 0; }

/* ---------- viðbætur ---------- */
.small { font-size: .85rem; }
.topnav { display: flex; gap: 8px; }
.more { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 4px 16px; }
.more summary { cursor: pointer; padding: 12px 0; font-weight: 500; }
.more[open] { padding-bottom: 16px; }
.more .field { margin-top: 10px; }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#consent { display: grid; gap: 14px; }

.insight { background: var(--card-2); border: 1px solid var(--accent); border-radius: 14px; padding: 14px 16px; margin: 14px 0 0; cursor: pointer; }

.mood { border-color: var(--accent); animation: fadeUp .3s ease both; }
.mood p { margin: 0 0 12px; }
.mood-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood-btn { display: grid; gap: 2px; justify-items: center; padding: 10px 4px; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font: inherit; cursor: pointer; }
.mood-btn strong { font-family: var(--head); font-size: 1.3rem; }
.mood-btn span { font-size: .72rem; color: var(--muted); }
.mood-btn:active { background: var(--accent); color: var(--accent-ink); }

.extras, .home-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.home-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.extra { display: grid; gap: 2px; text-align: left; padding: 14px 16px; min-height: 64px; background: var(--card-2); border: 1px solid var(--border); border-radius: 16px; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; transition: transform .12s ease; }
.extra strong { font-weight: 600; }
.extra span { color: var(--muted); font-size: .85rem; }
.extra:active { transform: scale(.97); }

.notify { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.notify p { margin: 4px 0 0; }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool { display: grid; gap: 4px; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.tool strong { font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { display: grid; gap: 2px; }
.stats strong { font-family: var(--head); font-size: 1.25rem; }

.log li { grid-template-columns: auto 1fr auto auto; gap: 10px; }
.log button.log-t { min-width: 64px; min-height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: 500 .95rem var(--body); font-variant-numeric: tabular-nums; cursor: pointer; }
.log button.log-t:disabled { border-color: transparent; cursor: default; opacity: 1; }
.log li.editing { grid-template-columns: 1fr; }
.log li.editing > :not(.time-edit) { display: none; }
.time-edit { display: flex; align-items: center; gap: 8px; }
.time-edit select { width: auto; min-height: 42px; padding: 0 10px; }

.history { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.history li.card { margin: 0; }
.history .empty { padding: 20px 0; }
.h-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.h-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9rem; }
.h-stats em { font-style: normal; color: var(--text); font-weight: 600; }

.dlg-rt { padding: 14px; }
.rt { display: grid; place-content: center; text-align: center; min-height: 52vh; border-radius: 16px; background: var(--card-2); margin-bottom: 12px; user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer; transition: background .1s; }
.rt.wait { background: #3a1f1a; }
.rt.go { background: var(--accent); color: var(--accent-ink); }
.rt.go .rt-sub { color: var(--accent-ink); }
.rt-msg { font-family: var(--head); font-size: 2.6rem; font-weight: 700; margin: 0; }
.rt-sub { color: var(--muted); margin: 8px 16px 0; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: .92rem; z-index: 50; max-width: 90vw; text-align: center; animation: fadeUp .25s ease both; }

/* ---------- sýnishorn ---------- */
.demo-tag { margin: 12px 0 0; font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 10px; }
.login { margin-top: 18px; }
.login p { margin: 4px 0 12px; }
.login-row { display: flex; gap: 8px; }
.login-row input { flex: 1; min-width: 0; }
#login-in { display: flex; align-items: center; justify-content: space-between; }
.login-who { display: flex; align-items: center; gap: 12px; }
.login-who p { margin: 0; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border); font-weight: 600; flex: none; }
.notify-actions { display: flex; gap: 8px; flex: none; }
.group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.group-head p { margin: 4px 0 0; }
.members { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.members li { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
.m-main { min-width: 0; }
.m-top { display: flex; justify-content: space-between; gap: 8px; font-size: .95rem; }
.m-st { color: var(--muted); font-size: .85rem; }
.m-st.on { color: var(--ok); }
.m-st.over { color: var(--over); }
.bar-sm { height: 6px; margin: 8px 0 0; }
.bar-sm .bar-target { top: -4px; height: 14px; }
.m-act { grid-column: 2; display: flex; gap: 6px; }
.chip-sm { min-height: 32px; padding: 0 12px; font-size: .82rem; }

/* ---------- happy hour ---------- */
.topnav { flex-wrap: wrap; justify-content: flex-end; }
.topnav .icon-btn { padding: 7px 12px; font-size: .85rem; }
.hh-filter { margin: 14px 0 6px; }
.hh { list-style: none; padding: 0; margin: 10px 0 0; }
.hh-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.hh-main { display: grid; gap: 2px; min-width: 0; }
.hh-time, .hh-price { color: var(--muted); font-size: .88rem; }
.hh-side { display: grid; justify-items: end; align-content: start; gap: 8px; text-align: right; flex: none; }
.hh-st { font-size: .85rem; color: var(--muted); }
.hh-item.now .hh-st { color: var(--ok); }
.hh-item.done { opacity: .5; }
.hh-side .chip { text-decoration: none; }
.hh-teaser { display: flex; justify-content: space-between; align-items: center; width: 100%; color: var(--text); font: inherit; cursor: pointer; text-align: left; border-color: var(--accent); }

.reset { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.reset p { margin: 8px 0 0; text-align: center; }

.group-join { margin-top: 14px; }
.group-leave { margin-top: 10px; padding-left: 0; }
#login-code { margin-top: 10px; }

/* ---------- þynnkuspá ---------- */
.hang-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hang-top strong { font-family: var(--head); font-size: 1.5rem; }
.hang .bar { margin: 14px 0 12px; }
.hang p { margin: 0 0 6px; }
.hang .warn { margin-top: 10px; color: var(--muted); }
.hang-ask { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.hang-ask p { margin: 0 0 8px; }
