@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Ocean Serenity: 01161E 124559 598392 AEC3B0 EFF6E0 */
  --bg: #eff6e0;
  --card: #fbfdf5;
  --line: #d9e4cd;
  --text: #01161e;
  --label: #598392;
  --accent: #124559;
  --accent-soft: #dbe8d4;
  --urgent: #d9503f;
  --urgent-soft: #fdeae3;
  --ok: #3f8a68;
  --ok-soft: #dcecd6;
  --danger: #c4432f;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #01161e; --card: #0b2530; --line: #124559; --text: #eff6e0; --label: #8fb0b9;
    --accent: #aec3b0; --accent-soft: #124559; --urgent: #ff7a68; --urgent-soft: #3a1f1f;
    --ok: #aec3b0; --ok-soft: #12353a;
  }
  button { color: #01161e; }
  .items input[type=checkbox]:checked::after { color: #01161e; }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 520px; margin: 0 auto; padding: 20px 16px 48px; }
a { color: var(--accent); text-decoration: none; }

h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 4px; }
h2 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--label); margin: 0 0 10px; }
.muted { color: var(--label); margin: 0 0 16px; }
.error { color: var(--danger); }

.card, .sheet {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
  box-shadow: 0 1px 2px rgba(1, 22, 30, .04), 0 8px 24px rgba(1, 22, 30, .08);
}
.sheet { padding: 14px 16px 10px; }

form { display: flex; flex-direction: column; gap: 10px; }
.row, form.row { display: flex; flex-direction: row; gap: 10px; align-items: center; }
input:not([type=checkbox]) {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  font: inherit; font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 12px;
  outline: none;
  transition: border-color .15s, background-color .15s;
}
input::placeholder { color: var(--label); }
input:focus { border-color: var(--accent); background: var(--card); }

button {
  padding: 11px 18px;
  font: inherit; font-weight: 700; font-size: .92rem;
  border: 0; border-radius: 12px;
  background: var(--accent); color: #fff;
  cursor: pointer;
  transition: transform .1s, opacity .15s;
}
button:active { transform: scale(.97); }
button.link { background: none; color: var(--label); padding: 8px 10px; }
button.link:hover { color: var(--accent); }
button.danger { color: var(--danger); }

ul { list-style: none; padding: 0; margin: 0 0 8px; }
.lists li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.lists li:last-child { border-bottom: 0; }
.lists li form { flex-direction: row; }
.lists a { font-weight: 700; color: var(--text); flex: 1; }
.badge {
  display: inline-block; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent);
  font-size: .75rem; font-weight: 700;
  border-radius: 999px; padding: 2px 9px; margin-left: 6px;
}

/* Ting på lista */
.items { margin-top: 10px; }
.items li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px; margin-bottom: 6px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  touch-action: pan-y;
  transition: transform .2s, background-color .15s, border-color .15s;
}
.items li.swiping { transition: none; user-select: none; }
.items li.armed-done { background: var(--ok-soft); border-color: var(--ok); }
.items li.armed-urgent { background: var(--urgent-soft); border-color: var(--urgent); }
.items li.urgent { border-color: var(--urgent); background: var(--urgent-soft); }
.items li.urgent span::before { content: attr(data-urgent) ' '; }
.items label { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.items span { font-weight: 600; overflow-wrap: anywhere; }
.items small { color: var(--label); margin-left: auto; padding-right: 6px; font-size: .75rem; white-space: nowrap; }
.items li.done span { text-decoration: line-through; color: var(--label); }
.items li.done { background: transparent; }
.items input[type=checkbox] {
  appearance: none; flex: none;
  width: 24px; height: 24px; margin: 0;
  border: 2px solid var(--label); border-radius: 50%;
  background: transparent; cursor: pointer;
  display: grid; place-content: center;
}
.items input[type=checkbox]:checked { background: var(--ok); border-color: var(--ok); }
.items input[type=checkbox]:checked::after { content: '✓'; color: #fff; font-size: 14px; line-height: 1; }

.code { font-weight: 700; font-size: 1.4rem; letter-spacing: 3px; user-select: all; }
.back { display: inline-block; font-weight: 600; color: var(--label); }

/* Hjelp */
.topbar { display: flex; align-items: center; justify-content: space-between; }
button.help {
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 1rem;
}
.helpDialog {
  border: 0; border-radius: var(--radius); padding: 22px;
  max-width: 400px; width: calc(100% - 32px);
  background: var(--card); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.helpDialog::backdrop { background: rgba(15, 17, 30, .5); }
.helpDialog h2 { font-size: 1.1rem; text-transform: none; letter-spacing: 0; color: var(--text); margin-bottom: 14px; }
.howto { margin: 0 0 16px; }
.howto li { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.demo {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-content: center; font-size: 1.3rem; font-weight: 700;
  background: var(--bg); color: var(--label);
}
.demo.ok { background: var(--ok-soft); color: var(--ok); }
.demo.hot { background: var(--urgent-soft); color: var(--urgent); }
.helpDialog form button { width: 100%; }

/* Admin */
main.wide { max-width: 640px; }
.left { text-align: left; margin: 0 0 10px; }
.invite { margin: 4px 0 14px; }
.invite input { font-size: .9rem; }
.listname { font-weight: 700; color: var(--text); flex: 1; }


/* Versjon */
footer.ver { text-align: center; color: var(--label); font-size: .75rem; padding: 16px 0 24px; }
