@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --bg: #edf0f3;
  --surface: #ffffff;
  --ink: #1d2b45;
  --ink-soft: #33415c;
  --muted: #5b6576;
  --line: #d5dbe3;
  --plus: #2e7d57;
  --plus-soft: #e3f1ea;
  --minus: #b5423a;
  --minus-soft: #f7e5e3;
  --int: #a8740f;
  --int-soft: #f6eedb;
  --focus: #3a6fd8;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-s: 6px;
  --radius-m: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141b28;
    --surface: #1d2636;
    --ink: #e8edf5;
    --ink-soft: #c6cfdc;
    --muted: #97a2b4;
    --line: #2f3a4d;
    --plus: #5cc08e;
    --plus-soft: #1c3329;
    --minus: #ec7d72;
    --minus-soft: #3a2224;
    --int: #e0b252;
    --int-soft: #352c19;
    --focus: #8fb2ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px 64px; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.muted { color: var(--muted); }

/* Topbar */
.topbar {
  width: 100%; max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px;
}
.logo {
  font-family: var(--display); font-weight: 800; font-size: 1.5rem;
  letter-spacing: -0.03em; text-decoration: none;
}
.topbar nav a { font-weight: 600; text-decoration: none; color: var(--ink-soft); }
.topbar nav a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 10px 22px; background: transparent; color: var(--ink);
  transition: background .15s, color .15s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-ghost { border-color: transparent; color: var(--muted); padding-inline: 12px; }
.btn-ghost:hover { color: var(--minus); }
.btn-small { padding: 6px 14px; font-size: .95rem; }
.link-btn {
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600;
}

/* Start */
.hero { max-width: 760px; padding: 48px 0 56px; }
.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(3.5rem, 13vw, 8.5rem);
  line-height: .9; letter-spacing: -0.05em; margin: 0 0 24px;
}
.hero-lead { font-size: 1.3rem; line-height: 1.45; max-width: 34em; margin: 0 0 32px; color: var(--ink-soft); }
.start-form {
  display: flex; gap: 8px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 6px;
  max-width: 620px;
}
.start-form:focus-within { border-color: var(--ink); }
.start-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.15rem;
  border: 0; background: transparent; color: var(--ink); padding: 10px 16px;
}
.start-form input:focus { outline: none; }
.hero-note { color: var(--muted); font-size: .98rem; margin: 14px 0 0 4px; }

.method {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  border-top: 1.5px solid var(--line); padding-top: 32px;
}
.method h2 {
  font-family: var(--display); font-weight: 600; font-size: 1.3rem;
  margin: 0 0 6px; display: flex; align-items: center; gap: 10px;
}
.method p { margin: 0; color: var(--ink-soft); max-width: 28em; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--k); flex: none; }
[data-kind="plus"] { --k: var(--plus); --k-soft: var(--plus-soft); }
[data-kind="minus"] { --k: var(--minus); --k-soft: var(--minus-soft); }
[data-kind="intressant"] { --k: var(--int); --k-soft: var(--int-soft); }
.example-link { margin-top: 40px; }

/* Editor */
.editor-head { padding: 24px 0 28px; }
.title-input {
  width: 100%; resize: none; overflow: hidden;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.035em;
  color: var(--ink); background: transparent; border: 0; padding: 4px 0; margin: 0;
  border-bottom: 2px solid transparent;
}
.title-input:hover:not([readonly]) { border-bottom-color: var(--line); }
.title-input:focus { outline: none; border-bottom-color: var(--ink); }
.editor-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-top: 16px;
}
.save-status { color: var(--muted); font-size: .95rem; }
.editor-actions { display: flex; gap: 8px; }
.readonly-banner {
  margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius-m);
  background: var(--surface); border: 1.5px solid var(--line);
}

.columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.col {
  background: var(--surface); border-radius: var(--radius-m);
  border-top: 5px solid var(--k); padding: 18px 18px 14px;
}
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.col-head h2 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; margin: 0; color: var(--k); }
.col-total { font-weight: 600; color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
.col-hint { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }

.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 8px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.item-text {
  grid-column: 1; width: 100%; resize: none; overflow: hidden;
  font: inherit; line-height: 1.4; color: var(--ink);
  background: transparent; border: 0; padding: 2px 4px; margin: 0 0 0 -4px;
  border-radius: var(--radius-s);
}
.item-text:focus { outline: none; background: var(--k-soft); }
.item-remove {
  grid-column: 2; grid-row: 1; align-self: start;
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 1.25rem; line-height: 1;
}
.item-remove:hover { background: var(--bg); color: var(--minus); }
.weight { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; }
.weight-label { font-size: .85rem; color: var(--muted); margin-right: 6px; }
.weight button {
  width: 26px; height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%;
}
.weight button span {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--k); background: transparent; transition: background .1s, transform .1s;
}
.weight button.on span { background: var(--k); }
.weight button:hover span { transform: scale(1.2); }
.weight-word { font-size: .85rem; color: var(--muted); margin-left: 6px; }

.add-form { display: flex; gap: 6px; margin-top: 12px; }
.add-form input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink);
  border: 1.5px dashed var(--line); border-radius: var(--radius-s);
  background: transparent; padding: 8px 10px;
}
.add-form input:focus { outline: none; border-style: solid; border-color: var(--k); }
.add-form button {
  font: inherit; font-weight: 600; border: 0; border-radius: var(--radius-s);
  background: var(--k-soft); color: var(--k); padding: 0 14px; cursor: pointer;
}
.readonly .add-form, .readonly .item-remove { display: none; }
.readonly .weight button { cursor: default; }
.readonly .weight button:hover span { transform: none; }

/* Summary */
.summary { margin-top: 40px; border-top: 1.5px solid var(--line); padding-top: 32px; }
.summary h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 0 0 20px; letter-spacing: -0.02em; }
.summary-grid { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 40px; align-items: start; }
.scale { width: 100%; height: auto; display: block; overflow: visible; }
.scale-stand { fill: var(--line); }
.scale-bar { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }
.scale-string { stroke: var(--muted); stroke-width: 1.5; }
.scale-pivot { fill: var(--ink); }
.pan-plus { fill: var(--plus); }
.pan-minus { fill: var(--minus); }
.pan-num { font-family: var(--display); font-weight: 800; font-size: 22px; fill: var(--ink); }
#scale-beam, #pan-left, #pan-right { transition: transform .7s cubic-bezier(.34, 1.4, .5, 1); transform-box: view-box; }
#scale-beam { transform-origin: 160px 70px; }
.scale-legend { display: flex; justify-content: space-between; padding: 4px 6px 0; font-weight: 600; }
.scale-legend span { color: var(--k); }

.reflection { max-width: 38em; }
.reflection p { margin: 0 0 14px; }
.reflection .lead { font-size: 1.25rem; font-family: var(--display); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.reflection h3 { font-family: var(--display); font-weight: 600; font-size: 1.1rem; margin: 24px 0 8px; }
.reflection ul { margin: 0; padding-left: 1.2em; }
.reflection li { margin-bottom: 4px; }

/* Mina beslut */
.page-title { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.6rem); letter-spacing: -0.04em; margin: 24px 0 8px; }
.decision-list { list-style: none; padding: 0; margin: 24px 0 0; max-width: 760px; }
.decision-list li { border-bottom: 1px solid var(--line); }
.decision-list a { display: flex; justify-content: space-between; gap: 16px; padding: 16px 4px; text-decoration: none; }
.decision-list a:hover .d-title { text-decoration: underline; }
.d-title { font-weight: 600; font-size: 1.15rem; }
.d-meta { color: var(--muted); font-size: .95rem; white-space: nowrap; }
.empty { margin-top: 24px; }

/* Dialog */
.dialog {
  border: 0; border-radius: var(--radius-m); padding: 0;
  width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--ink);
}
.dialog::backdrop { background: rgba(20, 27, 40, .45); }
.dialog-inner { padding: 28px; }
.dialog h2 { font-family: var(--display); font-weight: 800; font-size: 1.7rem; margin: 0 0 8px; letter-spacing: -0.03em; }
.share-row { margin-top: 18px; }
.share-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input {
  flex: 1; min-width: 0; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px;
}
.dialog-actions { margin-top: 24px; display: flex; justify-content: flex-end; }

/* Footer, toast */
.footer { text-align: center; color: var(--muted); font-size: .95rem; padding: 24px 20px 32px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 999px;
  font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.18); z-index: 10;
}

/* Prose pages */
.prose { max-width: 680px; padding-top: 16px; }
.prose h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.4rem); letter-spacing: -0.04em; line-height: 1; margin: 24px 0 24px; }
.prose h2 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; margin: 32px 0 8px; }

@media (max-width: 860px) {
  .columns, .method { grid-template-columns: 1fr; }
  .method { gap: 20px; }
  .summary-grid { grid-template-columns: 1fr; gap: 24px; }
  .scale-wrap { max-width: 360px; }
}
@media (max-width: 480px) {
  main { padding-inline: 16px; }
  .topbar { padding: 16px; }
  .start-form { flex-direction: column; border-radius: var(--radius-m); }
  .start-form .btn { width: 100%; }
  .editor-actions { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  #scale-beam, #pan-left, #pan-right { transition: none; }
}
@media print {
  .topbar nav, .editor-actions, .add-form, .item-remove, .footer, .save-status { display: none !important; }
  body { background: #fff; }
}

/* ---------- Ämnessidor, översikt och PMI-sidan ---------- */
.topbar nav { display: flex; gap: 20px; }
.topic { max-width: 1120px; padding-top: 8px; }
.crumbs { margin: 8px 0 0; font-weight: 600; color: var(--muted); }
.crumbs a { color: inherit; }
.topic-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 5rem); line-height: .98; letter-spacing: -0.045em;
  margin: 12px 0 24px; max-width: 14em;
}
.topic-intro { max-width: 40em; font-size: 1.2rem; line-height: 1.5; color: var(--ink-soft); }
.topic-intro p { margin: 0 0 14px; }
.topic h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.02em; margin: 40px 0 12px; }
.topic h3 { font-family: var(--display); font-weight: 600; font-size: 1.1rem; margin: 20px 0 4px; }
.topic p { max-width: 40em; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 8px; }
.cta-row .btn { text-decoration: none; display: inline-block; }

.topic-example { margin-top: 48px; border-top: 1.5px solid var(--line); padding-top: 8px; }
.topic-example .columns { margin-top: 20px; }
.col-head h3 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; margin: 0; color: var(--k); }
.sitem {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); line-height: 1.4;
}
.sweight { display: inline-flex; gap: 4px; flex: none; }
.sdot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--k); }
.sdot.on { background: var(--k); }

.topic-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 16px; }
.qlist { padding-left: 1.2em; margin: 0; max-width: 40em; }
.qlist li { margin-bottom: 8px; }
.notis { margin-top: 32px; padding: 14px 18px; background: var(--surface); border-radius: var(--radius-m); color: var(--ink-soft); }

.topic-cta {
  margin-top: 56px; padding: 28px; background: var(--surface); border-radius: var(--radius-m);
  border-left: 5px solid var(--ink);
}
.topic-cta h2 { margin-top: 0; }
.topic-cta .cta-row { margin-bottom: 0; }

.related { margin-top: 48px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; }
.related li { border-bottom: 1px solid var(--line); }
.related a { display: block; padding: 12px 0; font-weight: 600; text-decoration: none; }
.related a:hover { text-decoration: underline; }

.topic-list { columns: 2; column-gap: 40px; max-width: none; }
.topic-list li { break-inside: avoid; }

.method-inline { border-top: 0; padding-top: 8px; margin: 16px 0; }
.method-inline h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }

.popular { margin-top: 48px; }
.popular h2 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin: 0 0 12px; }
.popular ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.popular a {
  display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--surface);
  border: 1.5px solid var(--line); text-decoration: none; font-weight: 600;
}
.popular a:hover { border-color: var(--ink); }
.popular .all a { background: transparent; border-color: var(--ink); }
.popular .all a:hover { background: var(--ink); color: var(--bg); }
.popular { margin-top: 40px; }

.footer p { margin: 4px 0; }
.footer p a { margin: 0 8px; }

@media (max-width: 860px) {
  .topic-cols { grid-template-columns: 1fr; gap: 0; }
  .topic-list { columns: 1; }
}
@media (max-width: 480px) {
  .topbar nav { gap: 14px; font-size: .95rem; }
  .logo { font-size: 1.3rem; }
  .topic-cta { padding: 20px; }
}

/* ---------- Version 2: alternativ, jämförelse och bidrag ---------- */
.contrib-banner {
  margin: 16px 0 0; padding: 16px 18px; border-radius: var(--radius-m);
  background: var(--surface); border: 1.5px solid var(--line); max-width: 760px;
}
.contrib-banner p { margin: 0 0 12px; }
.contrib-banner label { display: block; font-weight: 600; margin-bottom: 6px; }
.contrib-banner input {
  font: inherit; color: var(--ink); background: var(--bg); width: min(280px, 100%);
  border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px;
}
.contrib-banner input:focus { outline: none; border-color: var(--ink); }
.contributing .title-input:hover { border-bottom-color: transparent; }

.options-bar { margin: 0 0 20px; }
.options-bar:empty { display: none; }
.add-option-solo { font-size: 1rem; }
.option-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.option-tab {
  font: inherit; font-weight: 600; cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--line);
}
.option-tab:hover { border-color: var(--ink); }
.option-tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab-score { font-size: .85rem; font-weight: 400; opacity: .75; font-variant-numeric: tabular-nums; }
.option-add { background: transparent; border-style: dashed; color: var(--ink-soft); }
.option-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.option-name {
  font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px solid var(--line);
  padding: 4px 0; min-width: 0; width: min(420px, 100%);
}
.option-name:focus { outline: none; border-bottom-color: var(--ink); }

.item.contrib .item-text { font-style: normal; }
.item-by { grid-column: 1 / -1; margin-top: 2px; }
.by-chip {
  display: inline-block; font-size: .8rem; font-weight: 600; line-height: 1.2;
  padding: 3px 9px; border-radius: 999px; background: var(--k-soft); color: var(--k);
}
.item.mine .by-chip { outline: 1.5px solid var(--k); outline-offset: -1.5px; }

.share-hint { margin: 0 0 8px; color: var(--muted); font-size: .95rem; }

.compare { margin-top: 40px; border-top: 1.5px solid var(--line); padding-top: 32px; }
.compare h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 0 0 20px; letter-spacing: -0.02em; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-m); padding: 6px 18px; }
.compare-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.compare-table th, .compare-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table thead th { font-size: .9rem; color: var(--muted); font-weight: 600; }
.compare-table .num { text-align: right; white-space: nowrap; }
.compare-table tbody th { font-weight: 600; }
.compare-table tr.active th .link-btn { text-decoration-thickness: 2.5px; }
.compare-table .link-btn { text-align: left; }
.bars-col { width: 34%; }
.cbars { display: grid; gap: 4px; }
.cbar { display: block; height: 8px; border-radius: 4px; min-width: 2px; transition: width .4s; }
.cbar-plus { background: var(--plus); }
.cbar-minus { background: var(--minus); }
.compare-text { margin-top: 24px; }

@media (max-width: 600px) {
  .bars-col { display: none; }
  .table-wrap { padding: 4px 10px; }
  .compare-table th, .compare-table td { padding: 10px 6px; }
}
@media (prefers-reduced-motion: reduce) { .cbar { transition: none; } }
