/* hexance-home — Swedish countryside: wood, green, calm notebook. Mobile-first. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --line: #e2dfd6;
  --text: #2a2d2a;
  --muted: #6b7069;
  --green: #3f7d4e;
  --green-soft: #e4efe6;
  --wood: #b9875b;
  --wood-soft: #f3e9df;
  --warn: #c9772b;
  --warn-soft: #f8ebdd;
  --warn-text: #7a4716;
  --danger: #b4413a;
  --danger-soft: #f6e3e1;
  --tech: #3b6ea5;
  --tech-soft: #e3ecf6;
  --radius: 10px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --focus: 0 0 0 3px rgba(63, 125, 78, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1e1b;
    --surface: #252823;
    --surface-2: #2d312c;
    --line: #3b403a;
    --text: #e9e7df;
    --muted: #a5aa9f;
    --green: #74b485;
    --green-soft: #2a3b2d;
    --wood: #d0a373;
    --wood-soft: #3a3128;
    --warn: #e3984f;
    --warn-soft: #3d2e1e;
    --warn-text: #f0c89a;
    --danger: #de6f66;
    --danger-soft: #3f2624;
    --tech: #86afe0;
    --tech-soft: #24303f;
    --focus: 0 0 0 3px rgba(116, 180, 133, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: 0.01em; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.rule-wood { border: 0; border-top: 2px solid var(--wood); margin: 0.75rem 0 1.25rem; width: 100%; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.tnum { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.center { text-align: center; }
.hidden { display: none !important; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-family: var(--serif); font-size: 1.25rem; margin-right: auto; }
.brand svg { width: 26px; height: 26px; color: var(--green); }
.nav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; list-style: none; width: 100%; }
.nav a { display: inline-block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--green); background: var(--green-soft); font-weight: 600; }
.nav .spacer { flex: 1; }
.nav form { display: inline; }
.nav button.linklike { background: none; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 8px; font: inherit; font-size: 0.95rem; cursor: pointer; }
.nav button.linklike:hover { color: var(--text); background: var(--surface-2); }
.userchip { font-size: 0.85rem; color: var(--muted); padding: 6px 4px; }
@media (min-width: 760px) {
  .nav { width: auto; }
}

/* Banners and flash */
.banner-remote { background: var(--warn-soft); color: var(--warn-text); border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.banner-remote .inner { max-width: 1100px; margin: 0 auto; padding: 6px 16px; display: flex; gap: 8px; align-items: center; }
.flash { max-width: 1100px; margin: 12px auto 0; padding: 0 16px; }
.flash > div { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--green-soft); color: var(--text); }
.flash > div.error { background: var(--danger-soft); border-color: var(--danger); }

/* Layout */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; padding: 14px 16px; text-align: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .more { margin-left: auto; font-size: 0.9rem; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.stack > * + * { margin-top: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.big { font-size: 1.8rem; font-family: var(--serif); line-height: 1.1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.85rem; }
.kv dd { margin: 0; }

/* Chips & pills */
.chip { display: inline-block; font-size: 0.75rem; padding: 1px 8px; border-radius: 999px; background: var(--wood-soft); color: var(--wood); border: 1px solid transparent; font-weight: 600; letter-spacing: 0.02em; vertical-align: middle; }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.tech { background: var(--tech-soft); color: var(--tech); }
.chip.muted { background: var(--surface-2); color: var(--muted); }
.pill { display: inline-block; font-size: 0.8rem; padding: 2px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.soon { background: var(--warn-soft); color: var(--warn-text); }
.pill.overdue { background: var(--danger-soft); color: var(--danger); }
.prio-1 { color: var(--danger); }
.prio-3 { color: var(--muted); }

/* Buttons */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--green); background: var(--green); color: #fff; font: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; min-height: 38px; }
.btn:hover { filter: brightness(0.95); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line); font-weight: 500; }
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); filter: none; }
.btn.tech { background: var(--tech); border-color: var(--tech); }
.btn.sm { padding: 4px 10px; font-size: 0.85rem; min-height: 30px; }
.btn.icon { padding: 4px 8px; min-width: 30px; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; }

/* Forms */
.form { display: grid; gap: 14px; }
.form label, .field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=url], input[type=email], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; line-height: 1.4;
}
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--green); box-shadow: var(--focus); }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: 1fr 1fr 1fr; } }
.help { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.error-text { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form > div { flex: 1 1 140px; }
.inline-form > .btn { flex: 0 0 auto; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 8px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border-top: 0; font-weight: 600; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.table-wrap { overflow-x: auto; }

/* Login */
.login-wrap { max-width: 420px; margin: 8vh auto 0; }
.login-wrap .brand { justify-content: center; display: flex; margin: 0 0 16px; font-size: 1.6rem; }

/* Board */
.board { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .board { grid-template-columns: repeat(5, 1fr); } }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 90px; }
.col.col-pagar { border-top: 3px solid var(--green); }
.col.col-parkerad { border-top: 3px solid var(--line); opacity: 0.92; }
.col-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 4px 4px; }
.col-head h2 { font-size: 1.05rem; margin: 0; }
.col-head .count { margin-left: auto; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.pcard .title { font-weight: 600; text-decoration: none; color: var(--text); display: block; }
.pcard .title:hover { color: var(--green); }
.pcard .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.pcard .moves { display: flex; gap: 4px; margin-top: 8px; }
.pcard .moves .spacer { flex: 1; }
.empty { color: var(--muted); font-size: 0.85rem; padding: 6px 4px; font-style: italic; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--green); }

/* Tasks */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.tasks li:first-child { border-top: 0; }
.tasks .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: transparent; padding: 0; }
.tasks .tick:hover { border-color: var(--green); }
.tasks li.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.tasks li.done .ttitle { color: var(--muted); text-decoration: line-through; }
.tasks .ttitle { flex: 1; }
.tasks .del { margin-left: auto; }

/* Notes */
.note { border-top: 1px solid var(--line); padding: 10px 0; }
.note:first-of-type { border-top: 0; }
.note .who { font-size: 0.8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.note .who form { margin-left: auto; }

/* Camera */
.camera { background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.camera img { width: 100%; height: auto; min-height: 120px; object-fit: contain; }
.camera-note { font-size: 0.85rem; color: var(--muted); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Mail */
.mail a { color: var(--tech); }
.mail .btn.primary { background: var(--tech); border-color: var(--tech); color: #fff; }
.maillist { list-style: none; margin: 0; padding: 0; }
.maillist li { border-top: 1px solid var(--line); }
.maillist li:first-child { border-top: 0; }
.maillist a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 4px; text-decoration: none; color: var(--text); }
.maillist a:hover { background: var(--surface-2); }
.maillist .from { color: var(--muted); font-size: 0.9rem; grid-column: 1; }
.maillist .subj { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maillist .date { grid-column: 2; grid-row: 1 / span 2; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; align-self: center; white-space: nowrap; }
.maillist li.unread .subj, .maillist li.unread .from { font-weight: 700; color: var(--text); }
.maillist li.unread .subj::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tech); margin-right: 8px; vertical-align: middle; }
.mailbody { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; overflow-wrap: anywhere; }
.mailbody blockquote { border-left: 3px solid var(--line); margin: 0.5em 0; padding-left: 10px; color: var(--muted); }
.mailbody table { max-width: 100%; }
.blocked-img { display: inline-block; font-size: 0.75rem; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); padding: 1px 6px; border-radius: 4px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }

/* Misc */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details summary { cursor: pointer; color: var(--green); font-weight: 600; }
details { margin-top: 8px; }
