/* Clan Amicitia. Stone-grey ledger with a verdigris accent; the clan crest as the one ornament. */
:root {
  --bg: #edf0ee; --surface: #fafbfa; --ink: #1b2220; --muted: #5a6662; --line: #d3d9d6;
  --accent: #2c6b63; --accent-ink: #ffffff; --accent-soft: #dcebe8; --gold: #8a6210; --gold-soft: #f3e8cc;
  --band: #2c4a46; --danger: #b5452f;
  --lv1: #eef6ef; --lv2: #d7ecd9; --lv3: #a9d6b0; --lv4: #6db67a;
  --font-display: "Alegreya SC", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Alegreya Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121716; --surface: #1a2120; --ink: #e4ebe8; --muted: #9aa7a2; --line: #2c3633;
    --accent: #6fb8ad; --accent-ink: #0f1514; --accent-soft: #1f3431; --gold: #d9b45a; --gold-soft: #3a3020;
    --band: #22302e; --lv1: #1d2a27; --lv2: #22402f; --lv3: #2d5c3d; --lv4: #3f7d50;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121716; --surface: #1a2120; --ink: #e4ebe8; --muted: #9aa7a2; --line: #2c3633;
  --accent: #6fb8ad; --accent-ink: #0f1514; --accent-soft: #1f3431; --gold: #d9b45a; --gold-soft: #3a3020;
  --band: #22302e; --lv1: #1d2a27; --lv2: #22402f; --lv3: #2d5c3d; --lv4: #3f7d50;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.45; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding: 10px 18px; font-weight: 700; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; }
button:disabled { opacity: .6; cursor: default; }
input[type="search"], input[type="text"], input[type="number"], input:not([type]), select {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px;
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
code { font-size: .9em; }

.demo-bar { background: var(--gold-soft); color: var(--ink); text-align: center; font-size: .9rem; padding: 6px 16px; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-inner { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: .02em; }
.brand img { width: 44px; height: 44px; display: block; }
.card-logo { display: block; width: 150px; height: 150px; margin: 0 auto 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.tabs a:hover { color: var(--ink); background: var(--bg); }
.tabs a.on { color: var(--accent-ink); background: var(--accent); }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.badge { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); background: var(--gold-soft); border-radius: 4px; padding: 1px 6px; }

main { padding-bottom: 60px; }
.pagehead { padding: 26px 0 6px; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.1; margin: 0 0 6px; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin: 0 0 10px; line-height: 1.15; }
h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--muted); font-weight: 700; }
h4 { margin: 0; font-size: .9rem; }
.lede { color: var(--muted); margin: 0; max-width: 70ch; }
.stats { display: flex; gap: 28px; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.stats b { font-family: var(--font-display); font-size: 1.5rem; margin-right: 6px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 0; }
.toolbar input[type="search"] { flex: 1 1 240px; max-width: 360px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.picker { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.jump { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.jump a { flex: none; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; font-size: .9rem; }
.jump a:hover { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 6px 14px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.bar { display: inline-block; width: 120px; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.done i { background: var(--gold); }
.chip { display: inline-block; font-size: .8rem; background: var(--accent-soft); color: var(--ink); border-radius: 99px; padding: 1px 8px; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.gold { background: var(--gold-soft); color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.empty { color: var(--muted); padding: 10px 0; }
.source { color: var(--muted); font-size: .86rem; margin-top: 30px; }

.group { margin: 26px 0 8px; scroll-margin-top: 80px; }
.ghead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; }
.ghead h2 { margin: 0; }
.gprog { margin-left: auto; display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .92rem; }
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.tablewrap.wide { max-height: 78vh; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--font-display); font-weight: 500; font-size: .86rem; letter-spacing: .03em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
td { padding: 7px 12px; vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

table.hunt tbody.ach + tbody.ach { border-top: 1px solid var(--line); }
.hunt .c-ach { width: 30%; border-right: 1px solid var(--line); }
.hunt .c-rew { width: 20%; border-right: 1px solid var(--line); font-size: .93rem; }
.hunt .c-need { white-space: nowrap; color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.hunt .c-tick { text-align: center; width: 70px; }
.hunt td.c-mob, .hunt td.c-need, .hunt td.c-tick { border-top: 1px dashed var(--line); }
.hunt tr:first-child td.c-mob, .hunt tr:first-child td.c-need, .hunt tr:first-child td.c-tick { border-top: 0; }
.aname { font-weight: 700; color: var(--ink); text-decoration: none; }
.aname:hover { color: var(--accent); text-decoration: underline; }
.desc { margin: 3px 0 8px; color: var(--muted); font-style: italic; font-size: .9rem; }
.aprog { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-mob a { color: var(--ink); text-decoration: none; font-weight: 500; }
.c-mob a:hover { color: var(--accent); text-decoration: underline; }
.also { display: block; color: var(--muted); font-size: .8rem; }
tr.killed td.c-mob, tr.killed td.c-need, tr.killed td.c-tick { background: var(--accent-soft); }
tr.killed .c-mob a { color: var(--muted); text-decoration: line-through; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 16px 0; }
.panel .tablewrap { border-radius: 8px; }
.panel.narrow { max-width: 560px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.person { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px 4px 8px; cursor: pointer; user-select: none; }
.person.on { background: var(--accent-soft); border-color: var(--accent); }
table.plan td { border-top: 1px solid var(--line); }
table.plan tr:first-child td { border-top: 0; }
.prov { margin: 6px 0 10px; }
.prov p { margin: 2px 0 0; color: var(--ink); }

.prefs { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 4px; }
.prefs label { display: flex; align-items: center; gap: 8px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 4px 28px; }
.skill { display: grid; grid-template-columns: 1fr 74px 36px 74px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.skill.focused { background: var(--accent-soft); border-radius: 6px; }
.focus-box { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); cursor: pointer; }
.skill.focused .focus-box { color: var(--accent); font-weight: 700; }
.leveling { color: var(--accent); }
.skill label { font-weight: 500; }
.skill input { width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
.skill .best { grid-column: 1 / -1; }
.matrix-wrap { overflow-x: auto; }
/* Armor grid: spread across the panel like the three-column skill lists above it. */
table.matrix { width: 100%; min-width: 560px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
table.matrix th, table.matrix td { padding: 8px 14px; border-bottom: 1px dashed var(--line); text-align: center; vertical-align: middle; }
table.matrix thead th { font-family: var(--font-body); color: var(--ink); vertical-align: top; border-bottom: 1px solid var(--line); }
table.matrix th.corner, table.matrix .wt { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--ink); line-height: 1.3; letter-spacing: 0; }
table.matrix th.corner { width: 140px; text-align: left; }
table.matrix .wt { margin-bottom: 4px; }
table.matrix tbody th { text-align: left; font-family: var(--font-body); font-size: 1rem; font-weight: 500; color: var(--ink); letter-spacing: 0; padding-right: 22px; }
table.matrix tr.avg th { font-size: .9rem; }
table.matrix .mx { display: flex; align-items: center; justify-content: center; gap: 6px; }
table.matrix .mx input[type="number"] { width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
table.matrix .mx .tier { width: 30px; text-align: left; }
table.matrix td.focused { background: var(--accent-soft); }
table.matrix td.focused .focus-box { color: var(--accent); font-weight: 700; }
table.matrix .mx .focus-box { margin-left: 6px; }
table.matrix td .leveling { margin-top: 3px; }
table.matrix tr.avg th, table.matrix tr.avg td { color: var(--muted); font-variant-numeric: tabular-nums; border-bottom: 0; }

table.grid { width: auto; min-width: 100%; }
table.grid th, table.grid td { padding: 5px 9px; border-bottom: 1px solid var(--line); }
table.grid thead th, table.grid tr:first-child th { position: sticky; top: 0; z-index: 2; }
table.grid .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: nowrap; font-weight: 500; }
table.grid th.sticky { z-index: 3; }
table.grid .mcol { text-align: center; font-family: var(--font-body); font-weight: 700; color: var(--ink); }
table.grid tr.band td { background: var(--band); color: #fff; font-weight: 700; font-family: var(--font-display); letter-spacing: .03em; }
table.grid tr.band td.sticky { background: var(--band); }
table.grid tr.foot td { color: var(--muted); }
table.grid td.held { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.focus, .swatch.focus { box-shadow: inset 0 0 0 2px var(--accent); }
td.focus .up, .swatch .up { color: var(--accent); font-size: .7em; margin-right: 3px; vertical-align: 1px; }
td.lv4.focus .up { color: var(--ink); }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.swatch { display: inline-block; padding: 2px 8px; border-radius: 3px; background: var(--lv2); color: var(--ink); font-variant-numeric: tabular-nums; }
table.grid td.leveling { max-width: 160px; }
td.lv.dflt { color: var(--muted); opacity: .7; }
.dng { color: var(--accent); font-size: .85em; font-weight: 500; white-space: nowrap; }
td.lv1 { background: var(--lv1); } td.lv2 { background: var(--lv2); } td.lv3 { background: var(--lv3); } td.lv4 { background: var(--lv4); font-weight: 700; }
td.yes { background: var(--accent-soft); color: var(--accent); font-weight: 700; text-align: center; }

.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 16px; align-items: start; }
.prov-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.prov-toggle .pname { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; line-height: 1.15; }
.prov-toggle .chev { font-size: .9rem; color: var(--muted); width: 1em; }
.prov-toggle:hover .pname { color: var(--accent); }
.prov-panel.closed { padding-bottom: 12px; }
table.grid tr.band.prov td { font-family: var(--font-body); font-weight: 500; }
table.grid tr.band.prov .prov-toggle { color: #fff; }
table.grid tr.band.prov .prov-toggle .pname { font-size: 1.1rem; letter-spacing: .03em; }
table.grid tr.band.prov .prov-toggle .chev { color: #cfe0dc; }
table.grid tr.band.prov .prov-toggle:hover .pname { color: #fff; text-decoration: underline; }
table.grid tr.band.prov td.small { color: #dbe8e4; }
.prov-grid .panel { margin: 8px 0; }
ul.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
ul.ticks label { display: flex; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; }

.roster tr.inactive td { color: var(--muted); }
.roster .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.roster .actions button { font-size: .85rem; padding: 4px 10px; }
.name-edit { width: 150px; padding: 4px 8px !important; font-weight: 700; }
form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
form.inline input { flex: 1 1 180px; }

.screen { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px; max-width: 520px; width: 100%; }
.card h1 { font-size: 1.8rem; }
.card p { color: var(--ink); }
.card .btns { margin-top: 18px; gap: 16px; }
.card h1 { text-align: center; }
.claim-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; max-height: 260px; overflow-y: auto; }
.claim-list button { border-radius: 99px; }
.card input[type="search"] { width: 100%; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(520px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.error { background: var(--danger); color: #fff; }

@media (max-width: 720px) {
  h1 { font-size: 1.6rem; }
  .me { margin-left: 0; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tabs a { flex: none; }
  table.hunt thead { display: none; }
  table.hunt, table.hunt tbody, table.hunt tr, table.hunt td { display: block; }
  table.hunt tr { display: grid; grid-template-columns: 1fr auto auto; align-items: center; }
  table.hunt td.c-ach, table.hunt td.c-rew { grid-column: 1 / -1; border-right: 0; width: auto; }
  table.hunt td.c-rew { padding-top: 0; }
  .gprog { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
