@font-face { font-family: "Albert Sans"; src: url("albert_sans.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #F4F1EC; --card: #FBFAF7; --sunk: #EAE6DF; --ink: #1E2320; --stone: #5D635F; --faint: #7A807C;
  --line: #E3DED6; --border: #CFC8BD; --fjord: #2E5E63; --on-fjord: #FFFFFF; --lingon: #B5473A; --mist: #E3E9E7; --on-mist: #24494D;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141716; --card: #1C201E; --sunk: #202523; --ink: #ECE8E1; --stone: #A5ABA6; --faint: #8A908B;
    --line: #2A2F2C; --border: #3B413E; --fjord: #8FC0C3; --on-fjord: #0F2527; --lingon: #E0806E; --mist: #24302F; --on-mist: #BFDADB;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.4 "Albert Sans", system-ui, sans-serif; font-feature-settings: "tnum"; }
h1 { font-size: 32px; font-weight: 600; margin: 0 0 16px; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 600; margin: 0; color: var(--stone); }
a { color: var(--fjord); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button[disabled] { opacity: .45; cursor: default; }
input[type=text], input[type=date], input[type=time], input[type=number], select, textarea {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 0; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--fjord); outline-offset: -1px; }
textarea { min-height: 72px; resize: vertical; }
:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; }

.centered { min-height: 100vh; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.shell { display: flex; min-height: 100vh; }
.rail { width: 200px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 28px 16px; border-right: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 20px; padding: 0 12px 16px; display: flex; align-items: center; gap: 10px; }
.mark { width: 34px; height: 34px; border-radius: 9px; }
.logo { width: 112px; height: 112px; border-radius: 26px; }
.tab { padding: 10px 12px; border-radius: 12px; color: var(--stone); text-decoration: none; font-weight: 500; }
.tab:hover { background: var(--sunk); }
.tab.on { background: var(--mist); color: var(--on-mist); }
.page { flex: 1; min-width: 0; max-width: 1040px; padding: 28px 32px 64px; }
.grow { flex: 1; min-width: 0; }
.meta { font-size: 14px; color: var(--stone); }
.empty { color: var(--stone); padding: 32px 0; }
.problem { color: var(--lingon); }
.banner { display: flex; gap: 12px; align-items: center; background: var(--sunk); border-left: 3px solid var(--lingon); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

.primary { background: var(--fjord); color: var(--on-fjord); border-radius: 12px; padding: 10px 18px; font-weight: 600; white-space: nowrap; }
.quiet { color: var(--stone); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; white-space: nowrap; }
.quiet:hover { background: var(--sunk); }
.quiet.small { padding: 4px 10px; font-size: 14px; border-radius: 10px; }
.quiet.signout { border: 0; text-align: left; padding: 10px 12px; }
.link { color: var(--fjord); font-weight: 600; padding: 6px 4px; }
.link.danger { color: var(--lingon); }

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pill { background: var(--sunk); border-radius: 20px; padding: 8px 16px; font-weight: 500; }
.pill.on { background: var(--ink); color: var(--paper); }
.stores { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 12px; }
.store { color: var(--stone); padding: 4px; font-weight: 500; }
.store.on { color: var(--fjord); font-weight: 700; }

.addbox { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.addline { display: flex; gap: 8px; align-items: center; }
.addline.small { font-size: 14px; }
.hints { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--border); border-radius: 14px; padding: 6px 12px; font-size: 14px; }
.chip:hover { background: var(--sunk); }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.understood { color: var(--fjord); }
.undo { display: flex; gap: 8px; align-items: center; min-height: 34px; }
.undo .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.head { margin-top: 20px; padding: 4px 0; }
.head.today { color: var(--lingon); }
.head.faded, .row.faded .name { color: var(--faint); }
.headrow { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.row { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; }
.row:hover { background: var(--sunk); }
.row[draggable=true] { cursor: grab; }
.row.open { background: var(--mist); }
.row.done .name { color: var(--stone); text-decoration: line-through; }
.name { font-weight: 500; overflow-wrap: anywhere; }
.clicks { cursor: pointer; }
.late { color: var(--lingon); }
.tick { width: 24px; height: 24px; flex: none; border: 2px solid var(--faint); border-radius: 50%; padding: 0; }
.tick:hover { border-color: var(--fjord); background: var(--mist); }
.tick.ticked { background: var(--fjord); border-color: var(--fjord); }
.amount { color: var(--stone); font-size: 14px; padding: 4px 8px; border-radius: 8px; }
.row .amount:empty { display: none; }
.amount:hover { background: var(--card); }
.amountedit { width: 100px !important; padding: 4px 8px !important; }
.remove { color: var(--faint); font-size: 20px; line-height: 1; padding: 2px 8px; border-radius: 8px; }
.remove:hover { color: var(--lingon); }
.narrow { width: 80px !important; }
.addline.wrap { flex-wrap: wrap; }
.amountbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 60%; }
.primary.tiny { padding: 4px 12px; font-size: 14px; }

.split { display: flex; gap: 32px; align-items: flex-start; }
.listside { flex: 1; min-width: 0; }
.editor { width: 340px; flex: none; position: sticky; top: 28px; max-height: calc(100vh - 56px); overflow: auto; display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.editor .headrow { margin-top: 0; }
.editor label:not(.check) { font-size: 13px; color: var(--stone); margin-top: 6px; }

.title { margin-top: 0; align-items: flex-start; }
.inlineedit { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0 12px; }
.newtopic { margin-bottom: 8px; }
.order { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.order[draggable=true] { cursor: grab; }
.grip { color: var(--faint); user-select: none; font-size: 18px; }
.chipon { background: var(--mist); color: var(--on-mist); border-color: transparent; }
.settings h3 { margin-top: 28px; margin-bottom: 6px; }
.settings .order input[type=text] { flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.card h3 a { color: var(--stone); text-decoration: none; }
.card h3 a:hover { color: var(--fjord); }
.line { display: flex; gap: 10px; align-items: center; min-height: 30px; }
.line .name { flex: 1; min-width: 0; }
.line .when { width: 90px; }
.line .tick { width: 20px; height: 20px; }
.round { color: var(--lingon); }
.daylabel { font-weight: 600; margin-top: 10px; }
.pick { display: block; text-align: left; margin-top: 6px; }
.relation { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.relation select { width: auto; padding: 4px 6px; font-size: 13px; }
.treewrap { overflow-x: auto; padding-bottom: 8px; }
.tree { position: relative; }
.treelines { position: absolute; inset: 0; }
.treelines line, .treelines path { stroke: var(--faint); stroke-width: 1.5; fill: none; }
.treelines .ended { stroke-dasharray: 5 4; }
.treenode { position: absolute; width: 104px; height: 44px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; font-size: 14px; font-weight: 500; overflow: hidden; }
.treenode:hover, .treenode.on { background: var(--mist); color: var(--on-mist); }
.hourstrip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; }
.hourstrip .tile { min-width: 112px; }
.curve { width: 100%; height: auto; }
.curve .line { stroke: var(--fjord); stroke-width: 2.5; fill: none; }
.curve circle { fill: var(--fjord); }
.curve text { fill: var(--stone); font: 13px "Albert Sans", sans-serif; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0 12px; text-align: center; }
.day { min-height: 56px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 6px 2px; }
.day.other { opacity: .45; }
.day.today { color: var(--lingon); font-weight: 700; }
.day.on { background: var(--mist); color: var(--on-mist); }
.dot { color: var(--fjord); line-height: 1; font-size: 13px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin: 8px 0 16px; }
.barcell { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; text-align: center; position: relative; padding-bottom: 18px; }
.bar { background: var(--fjord); border-radius: 4px 4px 0 0; min-height: 1px; }
.barlabel { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--stone); white-space: nowrap; }
.dayband { position: relative; height: 34px; margin: 8px 0 4px; border-top: 2px solid var(--line); }
.bandnow { position: absolute; top: -6px; width: 2px; height: 10px; background: var(--lingon); }
.bandmark { position: absolute; top: -6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--fjord); }
.bandhour { position: absolute; top: 8px; font-size: 11px; color: var(--stone); transform: translateX(-50%); }
.event { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.when { width: 110px; flex: none; color: var(--stone); font-size: 14px; }

.hero { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; max-width: 520px; }
.big { font-size: 56px; font-weight: 600; line-height: 1.1; }
.battery { height: 10px; background: var(--sunk); border-radius: 5px; overflow: hidden; margin: 10px 0; }
.fill { height: 100%; background: var(--fjord); }
.fill.charging { background: #5B8A5A; }
.fill.low { background: var(--lingon); }
.heroline { font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.value { font-size: 20px; font-weight: 600; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail { width: auto; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); z-index: 2; background: var(--paper); }
  .brand { padding: 0 6px 0 0; font-size: 0; gap: 0; }
  .tab { white-space: nowrap; }
  .page { padding: 16px 16px 48px; }
  .split { flex-direction: column; }
  .editor { position: static; width: 100%; max-height: none; }
  .addline { flex-wrap: wrap; }
  .addline > input.grow { flex-basis: 100%; }
}
