/* The organizer. Builds on site.css. */
.app { padding-block: clamp(2rem, 5vw, 3.5rem) var(--band); }
.app-intro h1 { font-size: var(--step-3); }
.app-intro p { max-width: 64ch; margin-top: 0.75rem; color: var(--muted); }

.tabs { display: flex; gap: 0.25rem 1.75rem; flex-wrap: wrap; margin-top: 2rem; border-bottom: 1px solid var(--rule); }
.tabs a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 0.7rem 0; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--deep-olive); }
.tabs a[aria-current] { color: var(--deep-olive); border-bottom-color: var(--olive); }

.status { min-height: 1.6rem; margin-top: 0.9rem; font-size: var(--step--1); color: var(--olive); font-weight: 500; }

.view { margin-top: 0.75rem; }
.view-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; }
.view-head h2 { font-size: var(--step-2); }
.aside { font: italic 500 1.3rem/1.35 var(--display); color: var(--olive); max-width: 46ch; margin-top: 1.5rem; }

.button.quiet { background: transparent; color: var(--deep-olive); border-color: var(--olive); padding: 0.6rem 1rem; }
.button.quiet:hover { background: var(--olive); color: var(--ivory); }
.button.danger { border-color: #8C3B2E; color: #8C3B2E; }
.button.danger:hover { background: #8C3B2E; border-color: #8C3B2E; color: #fff; }
button.link { background: none; border: 0; padding: 0.25rem 0; font: inherit; font-size: var(--step--1); color: var(--olive); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
button.link:hover { color: var(--deep-olive); }
button[data-armed] { color: #8C3B2E; font-weight: 700; }
.button.danger[data-armed] { background: #8C3B2E; color: #fff; }
.row-actions { display: inline-flex; gap: 1rem; white-space: nowrap; }

.empty { margin-top: 2rem; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px dashed var(--sage); border-radius: 6px; background: var(--paper); }
.empty h3 { font: 500 var(--step-2)/1.1 var(--display); }
.empty p { margin-top: 0.6rem; max-width: 60ch; color: var(--muted); }

/* Facts: small label over a value */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1rem 1.5rem; }
.facts dt { font-size: var(--step--1); color: var(--muted); }
.facts dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.facts.totals { margin-top: 1.75rem; padding: 1.25rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }

/* Wallet */
.card-block { margin-top: 2rem; background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--olive); border-radius: 6px; padding: clamp(1.1rem, 3vw, 1.75rem); display: grid; gap: 1.25rem; justify-items: start; }
.card-block > * { width: 100%; }
.card-block > .button { width: auto; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1.5rem; }
.card-head h3 { font: 500 var(--step-2)/1.1 var(--display); }
.notes { font-size: var(--step--1); color: var(--muted); }

.benefits { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.benefit { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1rem; padding-block: 0.85rem; border-bottom: 1px solid var(--rule); }
.benefit-name { font-weight: 500; }
.benefit-amount { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.benefit-when, .benefit-notes { grid-column: 1 / -1; font-size: var(--step--1); color: var(--muted); padding-left: 2rem; }
.benefit .row-actions { grid-column: 1 / -1; padding-left: 2rem; }
.benefit.is-used .benefit-name { text-decoration: line-through; text-decoration-color: var(--gold); color: var(--muted); }

.check { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: 0.2rem 0 0; accent-color: var(--olive); flex: none; }

/* Subscriptions */
.subs { list-style: none; padding: 0; margin-top: 1.5rem; }
.sub { padding: 1.1rem 0 1.1rem 1rem; border-bottom: 1px solid var(--rule); border-left: 4px solid var(--rule); margin-top: 0.75rem; background: var(--paper); padding-right: 1rem; border-radius: 0 6px 6px 0; }
.sub.verdict-keep { border-left-color: var(--olive); }
.sub.verdict-optimize { border-left-color: var(--gold); }
.sub.verdict-cut { border-left-color: var(--charcoal); }
.sub.verdict-cut .sub-name { text-decoration: line-through; color: var(--muted); }
.sub-main { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.sub-name { font: 500 var(--step-1)/1.2 var(--display); font-size: 1.6rem; }
.sub-cost { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub-cost .muted { font-weight: 400; font-size: var(--step--1); }
.sub-meta { font-size: var(--step--1); color: var(--muted); margin-top: 0.25rem; overflow-wrap: anywhere; }
.sub-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1.5rem; margin-top: 0.75rem; }
.sub-foot label { font-size: var(--step--1); display: inline-flex; align-items: center; gap: 0.6rem; }

/* Calendar */
.controls { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: center; margin-top: 1.5rem; }
.controls label { display: inline-flex; align-items: center; gap: 0.6rem; }
.controls .check input { margin-top: 0; }
.controls + .small { margin-top: 0.75rem; }
.month { margin-top: 2.25rem; }
.month h3 { font: 500 var(--step-2)/1.1 var(--display); padding-bottom: 0.6rem; border-bottom: 2px solid var(--olive); }
.events { list-style: none; padding: 0; }
.event { display: grid; grid-template-columns: 6.5rem 4.75rem 1fr; gap: 0.25rem 1rem; padding-block: 0.9rem; border-bottom: 1px solid var(--rule); align-items: start; }
.event time { font-weight: 700; font-variant-numeric: tabular-nums; }
.event time .muted { display: block; font-weight: 400; font-size: var(--step--1); }
.tag { justify-self: start; font-size: 0.8125rem; font-weight: 500; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--sage); color: var(--deep-olive); background: #E3E6DA; }
.kind-use-by .tag { background: var(--olive); border-color: var(--olive); color: var(--ivory); }
.kind-cancel .tag { background: var(--charcoal); border-color: var(--charcoal); color: var(--ivory); }
.kind-review .tag, .kind-fee .tag { background: #EDE3CF; border-color: var(--gold); }
.kind-rhythm .tag { background: transparent; }
.event-title { font-weight: 500; }
.event-detail { font-size: var(--step--1); color: var(--muted); margin-top: 0.15rem; }
@media (max-width: 34rem) {
  .event { grid-template-columns: 1fr auto; }
  .event > div { grid-column: 1 / -1; }
}

/* Form controls */
select, input, textarea { font: inherit; color: inherit; }
select, input:not([type='checkbox']), textarea {
  background: #fff; border: 1px solid #A9AD9C; border-radius: 6px; padding: 0.55rem 0.7rem; max-width: 100%;
}
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

dialog { border: 0; border-radius: 8px; padding: 0; width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); background: var(--ivory); color: var(--charcoal); box-shadow: 0 2rem 4rem -1rem rgba(18, 24, 14, 0.6); }
dialog::backdrop { background: rgba(48, 59, 41, 0.6); }
dialog form { display: grid; gap: 1.1rem; padding: clamp(1.25rem, 4vw, 2rem); }
dialog h2 { font-size: var(--step-2); }
dialog label { display: grid; gap: 0.35rem; font-weight: 500; font-size: 0.95rem; }
dialog label input, dialog label select, dialog label textarea { font-weight: 400; font-size: 1rem; width: 100%; }
.hint { font-weight: 400; font-size: var(--step--1); color: var(--muted); }
.form-error { color: #8C3B2E; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }

/* Data box */
.data-box { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.data-box h2 { font-size: var(--step-2); }
.data-box p { max-width: 68ch; margin-top: 0.75rem; color: var(--muted); }
.data-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
