:root {
  --fog: #131B27; --paper: #1A2433; --ink: #E3E8EF; --soft: #8C99AB;
  --line: #2A3649; --coffee: #CF9662; --crema: #2A2621;
  --up: #62BD93; --down: #E57B62;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--fog); }
body {
  margin: 0; color: var(--ink); background: var(--fog);
  font-family: "Public Sans", system-ui, sans-serif; font-size: 15px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
a { color: var(--ink); }
code { font-size: 13px; background: var(--fog); padding: 1px 4px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--coffee); outline-offset: 2px; }

.page { max-width: 1080px; margin: 0 auto; padding: 28px 16px 40px; }
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hello { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 32px; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.sub { color: var(--soft); margin: 4px 0 0; }
.who { font-size: 13px; color: var(--soft); display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; }

h2 { font-family: "Bricolage Grotesque", sans-serif; font-weight: 500; font-size: 18px; margin: 0; }
h2 small { font-family: "Public Sans", sans-serif; font-size: 12px; color: var(--soft); font-weight: 400; }

.moved-box, .col { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.moved-box { margin-top: 20px; }
.moved { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.moved li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 10px; background: var(--crema); border-radius: 8px; }
.moved li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coffee); }
.moved li.up::before { background: var(--up); }
.moved li.dn::before { background: var(--down); }
.moved b { font-weight: 600; }
.moved small { color: var(--soft); font-size: 12px; }
.quiet { color: var(--soft); margin: 10px 0 2px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.col.wide { grid-column: 1 / -1; }
.col h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row { display: grid; grid-template-columns: 1fr 64px 58px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.col h2 + .row { margin-top: 10px; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head h2 { flex: 1; }
.card-head + .row, .card-head + .alert { margin-top: 10px; }
.src { font-size: 12px; color: var(--soft); display: block; }
.val { font-weight: 600; font-size: 16px; display: block; }
.meta { font-size: 12px; color: var(--soft); display: block; }
.d { text-align: right; font-size: 13px; font-weight: 600; }
.meta .d { font-weight: 400; font-size: 12px; }
.d.up { color: var(--up); } .d.dn { color: var(--down); } .d.flat { color: var(--soft); font-weight: 400; }
svg.sp { width: 64px; height: 22px; overflow: visible; }
svg.sp polyline { fill: none; stroke: var(--coffee); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

.status { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--soft); font-size: 13px; }
.alert { color: #F2B8A8; background: #3A2420; border-radius: 8px; padding: 8px 10px; margin: 0 0 12px; }
.status .alert { margin: 0; }

.btn { display: inline-block; background: var(--coffee); color: #1A140F; font-weight: 600; text-decoration: none; border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn[disabled] { opacity: .6; cursor: wait; }
button.link { background: none; border: 0; color: var(--ink); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }

.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

.login { display: grid; place-items: center; min-height: 100vh; }
.signin { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px; max-width: 380px; width: calc(100% - 32px); display: grid; gap: 14px; }
.signin .sub { margin: 0; }

.card-meta { font-size: 12px; color: var(--soft); margin: 4px 0 0; }
.version { color: var(--soft); font-size: 12px; margin-top: 24px; }

/* "Collected from" under every card: where the numbers came from */
.origins { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--soft); }
.origins-label { font-weight: 600; color: var(--ink); }
.origins ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.origins a, .origins b { color: var(--ink); font-weight: 600; }

/* GitHub module */
details.group { border-top: 1px solid var(--line); padding: 10px 0; }
details.group:first-of-type { margin-top: 10px; }
details > summary { cursor: pointer; list-style-position: outside; }
summary .owner { font-weight: 600; font-size: 16px; margin-right: 8px; }
summary .meta { display: inline; }
.repos { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.repos li { padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.repos a { font-weight: 600; text-decoration: none; }
.repos a:hover { text-decoration: underline; }
.desc { display: block; font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; color: var(--coffee); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 6px; }
details.archived { margin-top: 8px; font-size: 13px; color: var(--soft); }

/* Settings */
.settings { margin-top: 20px; }
.modules { list-style: none; margin: 10px 0 0; padding: 0; }
.module-row { padding: 12px 0; border-top: 1px solid var(--line); }
.module-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.fields { margin-top: 10px; display: grid; gap: 10px; max-width: 640px; }
.field { display: grid; gap: 4px; }
.field-label { font-size: 13px; font-weight: 600; }
.saved { font-weight: 400; color: var(--up); margin-left: 6px; }
.field input, .field textarea { background: var(--fog); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; width: 100%; }
.field textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; resize: vertical; }
.field-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; }
.ok { color: var(--up); }

/* Guild Wars 2 module */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.chars { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; font-size: 14px; }
.chars .meta { display: block; }
.warn { color: var(--coffee); }
.switch { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
.switch input { width: 18px; height: 18px; accent-color: var(--coffee); }

/* Guild Wars 2 progress */
.gw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 24px; }
.gw-sec { padding: 10px 0 6px; border-top: 1px solid var(--line); min-width: 0; }
.gw-sec h3 { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--coffee); margin: 0 0 6px; }
.gw-line { margin: 6px 0 2px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ticks { list-style: none; margin: 2px 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.ticks li { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--soft); }
.ticks li.done { color: var(--up); border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.goals { list-style: none; margin: 2px 0 6px; padding: 0; font-size: 13px; min-width: 0; }
.goals li { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; padding: 2px 0; }
.goals li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.goals li b { font-weight: 600; white-space: nowrap; }
.goals li.done b, .goals li.done span:first-child { color: var(--up); }
.goals li.beaten b { color: var(--coffee); }
.goals li.meta { display: block; padding: 0 0 4px; font-size: 12px; }
.gw-sec progress { width: 100%; height: 6px; accent-color: var(--coffee); margin: 4px 0; }
.gw-tp .stats { border-top: 0; padding-top: 0; }

/* Weather, time and friends */
.friends { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 24px; }
.friends li { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-left: 10px; border-left: 3px solid var(--line); }
.friends li.morning, .friends li.afternoon { border-left-color: var(--coffee); }
.friends li.evening { border-left-color: color-mix(in srgb, var(--coffee) 45%, var(--line)); }
.friends .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends .when .val { display: inline; }

/* YouTube */
.yt-latest { margin: 0 0 8px; }
.yt-latest li span:first-child { white-space: normal; }
.domain-list { margin-top: 8px; }
.goals li.warn span:first-child, .goals li.warn b { color: var(--coffee); }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .hello { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .htmx-indicator { transition: none; } }
.link-wait { margin-top: 10px; }
.limits h3, .tokens-head { margin: 4px 0 6px; font-size: 13px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
.limit { padding: 8px 0; border-top: 1px solid var(--line); }
.limit-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.limit-head .meta { display: inline; }
.limit-row { display: grid; grid-template-columns: 72px minmax(80px, 1fr) 44px minmax(0, 1.4fr); gap: 10px; align-items: center; padding: 3px 0; font-size: 13px; }
.limit-row meter { width: 100%; height: 10px; }
.limit-pct { font-weight: 600; text-align: right; }
.limit-row.high .limit-pct, .limit-row.high .limit-name { color: var(--coffee); }
.tokens-head { margin-top: 14px; }
@media (max-width: 640px) { .limit-row { grid-template-columns: 64px 1fr 40px; } .limit-row .meta { grid-column: 1 / -1; } }
