:root {
  color-scheme: light;
  --nav: #142e34;
  --nav-muted: #bed0ce;
  --ink: #182d35;
  --muted: #54676c;
  --line: #d8e3e3;
  --bg: #f3f7f6;
  --paper: #fff;
  --accent: #075d52;
  --accent-deep: #06483f;
  --accent-light: #e6f2ee;
  --blue: #294e7d;
  --warning: #82540a;
  --danger: #9c2b2b;
  --radius: .85rem;
  background: var(--bg);
  color: var(--ink);
  font: 100%/1.65 "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body, h1, h2, h3, h4, p, fieldset { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, .button { touch-action: manipulation; }
:focus-visible { outline: 3px solid #387ce2; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 5; left: 1rem; top: -5rem; background: var(--paper); padding: .5rem; }
.skip:focus { top: 1rem; }
.startup { padding: 2rem; }
.layout { display: grid; grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 1.6rem; padding: 1.4rem 1rem; background: var(--nav); color: white; }
.brand { display: flex; align-items: center; gap: .65rem; color: inherit; font-weight: 800; text-decoration: none; line-height: 1.35; }
.brand-mark { display: grid; place-items: center; color: var(--nav); background: #b5e6d7; border-radius: .5rem; width: 2rem; height: 2rem; flex-shrink: 0; }
.nav { display: grid; gap: .22rem; }
.nav a { font-size: .96rem; color: var(--nav-muted); text-decoration: none; padding: .52rem .72rem; border-radius: .45rem; }
.nav a:hover, .nav a[aria-current="page"] { color: white; background: #285058; }
.identity { color: var(--nav-muted); margin-top: auto; overflow-wrap: anywhere; }
.identity .button { margin-top: .45rem; }
main { margin-inline: auto; width: min(100%, 74rem); padding: clamp(1rem, 4vw, 2.55rem); min-width: 0; }
.page { display: grid; gap: 1rem; }
.heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1rem; }
h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 1.22rem; line-height: 1.35; }
h3 { font-size: 1.03rem; }
.subtle { color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .9rem; color: var(--muted); }
.panel, .sheet { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: clamp(.85rem, 3vw, 1.3rem); }
.sheet { overflow: hidden; }
.headrow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem .85rem; margin-bottom: .75rem; }
.companies, .split, .folders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.directory { display: grid; gap: .85rem; }
.company-card { display: grid; gap: .2rem; min-height: 7rem; align-content: center; padding: 1rem; color: #163a61; background: #edf3fa; border: 1px solid #d8e3ee; border-radius: .68rem; text-decoration: none; }
.company-card.almer { color: var(--accent-deep); background: var(--accent-light); border-color: #cfe3dc; }
.company-card:hover strong { text-decoration: underline; }
.company-card strong { font-size: 1.22rem; }
.cluster { display: grid; gap: .8rem; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .9rem; }
.full { grid-column: 1 / -1; }
.inline-form, .filters { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; }
.inline-form .grow { flex: 1 1 15rem; }
.filters > label { flex: 1 1 8rem; }
label, .label { display: grid; gap: .22rem; font-size: .92rem; font-weight: 650; min-width: 0; }
input, textarea, select { border: 1px solid #a9bbbe; border-radius: .42rem; background: white; color: var(--ink); min-width: 0; width: 100%; padding: .46rem .55rem; font-weight: 400; }
textarea { min-height: 5rem; resize: vertical; }
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); margin: .12rem .2rem .12rem 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; border: 1px solid transparent; border-radius: .45rem; min-height: 2.45rem; padding: .42rem .75rem; background: var(--accent); color: white; text-decoration: none; font-weight: 700; white-space: normal; text-align: center; }
.button:hover { background: var(--accent-deep); }
.button.secondary { color: var(--accent-deep); background: var(--accent-light); border-color: #c4ded4; }
.button.secondary:hover { background: #d6eae4; }
.button.outline { color: inherit; background: transparent; border-color: currentColor; }
.button.outline:hover { background: #819a9220; }
.button.small { padding: .28rem .55rem; min-height: 2rem; font-size: .88rem; }
.methods { display: flex; flex-wrap: wrap; gap: .42rem; align-items: center; }
.switch { border: 1px solid var(--line); border-radius: .45rem; padding: .32rem .65rem; color: var(--muted); background: white; }
.switch[aria-pressed="true"] { border-color: #9cc9bb; background: var(--accent-light); color: var(--accent-deep); font-weight: 700; }
.folder { display: flex; justify-content: space-between; gap: .65rem; align-items: baseline; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .55rem; color: var(--ink); text-decoration: none; }
.folder:hover { background: var(--accent-light); }
.badge { display: inline-block; padding: .05rem .45rem; color: #315452; background: #e7efee; border-radius: .3rem; font-size: .83rem; white-space: nowrap; }
.badge.warn { color: var(--warning); background: #fff1d4; }
.badge.done { color: #0b6048; background: #dff3e9; }
.badge.payment-plan { color: #194677; background: #e5effa; }
.badge.payment-received { color: #0a6047; background: #dff3e9; }
.badge.payment-reported { color: #604477; background: #f0e8f7; }
.schedule-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; }
.schedule-title .badge { font-weight: 700; }
.empty { color: var(--muted); padding: .7rem 0; }
.notice { padding: .65rem .85rem; background: var(--accent-light); border-radius: .45rem; }
.error { color: var(--danger); font-weight: 650; }
.error:empty, .feedback:empty { display: none; }
.list { margin: 0; padding: 0; list-style: none; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: .5rem .85rem; padding: .68rem 0; overflow-wrap: anywhere; }
.list > li + li { border-top: 1px solid var(--line); }
.money-list > li { padding-left: .9rem; position: relative; }
.money-list > li::before { content: '•'; color: var(--accent); position: absolute; left: 0; top: .77rem; }
.list-title { color: var(--ink); font-weight: 700; }
.row-description { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; font-size: .88rem; color: var(--muted); }
.daylist { display: grid; gap: .75rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .52rem .62rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .9rem; color: var(--muted); background: #f5f9f8; }
.account-directory { min-width: 42rem; }
.account-directory tbody th { min-width: 9rem; background: var(--paper); color: var(--ink); }
.account-directory td { overflow-wrap: anywhere; }
.account-directory td:nth-child(2) { min-width: 9rem; width: 24%; }
.account-directory td:not(:nth-child(2)) { min-width: 6rem; }
.account-directory .subtle, .account-line, .account-note { font-size: .89rem; }
.account-line span { color: var(--muted); font-weight: 700; }
.account-note { margin-top: .2rem; white-space: pre-wrap; }
.secret-value { display: block; margin-bottom: .3rem; white-space: pre-wrap; }
.account-actions { display: grid; justify-items: start; gap: .35rem; }
.calendar { min-width: 39rem; table-layout: fixed; }
.calendar td { height: 5rem; border: 1px solid var(--line); }
.calendar .week td { height: 12rem; }
.calendar td.out { background: #f6f8f8; color: var(--muted); }
.calendar td.current { background: #edf8f3; }
.calendar-num { color: inherit; font-weight: 700; text-decoration: none; }
.calendar-event { display: block; color: var(--accent-deep); background: var(--accent-light); border-left: 2px solid #479982; padding: .12rem .28rem; margin-top: .26rem; border-radius: .15rem; font-size: .84rem; text-decoration: none; overflow-wrap: anywhere; }
.calendar-event:hover { text-decoration: underline; }
.calendar-event.cancelled { color: var(--muted); background: #e9eeee; border-color: #8fa1a1; }
.values { display: grid; grid-template-columns: minmax(7rem, .42fr) minmax(0, 1fr); margin: 0; }
.values dt, .values dd { margin: 0; padding: .4rem .55rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.values dt { color: var(--muted); font-size: .91rem; }
.values dd { white-space: pre-wrap; }
summary { cursor: pointer; font-weight: 700; }
.repeat { border: 1px solid var(--line); border-radius: .6rem; padding: .8rem; }
.repeat legend { padding-inline: .25rem; font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem .75rem; }
.checks label { display: inline-flex; align-items: center; gap: .19rem; }
.day-heading { color: var(--accent-deep); padding-top: .5rem; border-bottom: 1px solid var(--line); }
.auth { display: grid; align-content: center; min-height: 100vh; max-width: 32rem; }
.auth .brand { color: var(--ink); }
.auth .panel { padding: clamp(1rem, 5vw, 2rem); }
dialog { padding: 0; width: min(46rem, calc(100% - 1.5rem)); max-height: calc(100% - 1.5rem); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
dialog::backdrop { background: #122a30a6; }
.dialog-inner { padding: 1rem; }
.dialog-inner .headrow { border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: .25rem 0 0; font: inherit; }
@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { gap: .55rem; padding: .75rem 1rem; }
  .nav { display: flex; flex-wrap: wrap; gap: .12rem; }
  .nav a { padding: .34rem .52rem; }
  .identity { display: flex; gap: .6rem; align-items: center; }
  .identity .button { margin: 0; }
}
@media (max-width: 520px) {
  .companies, .split, .folders, .grid-form { grid-template-columns: 1fr; }
  .list > li { flex-wrap: wrap; }
}
