/* Dosta — app frame: brand, menu groups, Dark mode switch, footer and the info pages. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Brand */
/* Brand: the wordmark, with the tagline underneath. To resize it, change only the width. */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-decoration: none; }
.brand-wordmark { display: block; width: 9.5rem; height: auto; aspect-ratio: 362 / 102; }
.brand-tag { font-size: var(--text-s); font-weight: 400; line-height: 1.2; }
/* The leaf mark and the wordmark take their colours from the --logo-* tokens */
.logo-l1 { fill: var(--logo-1); }
.logo-l2 { fill: var(--logo-2); }
.logo-l3 { fill: var(--logo-3); }
.logo-l4 { fill: var(--logo-4); }
.logo-gaps { stroke: var(--logo-gap); }
.logo-ink { fill: var(--logo-ink); }
/* The leaf ring under the Light / Dark switch: decoration only. To resize it, change both sizes. */
.nav-ring { display: block; width: 5rem; height: 5rem; margin: 28px auto 8px; }

/* Menu groups: a thin line sets Help and info apart */
.nav-group-label {
  margin: 16px 0 6px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: var(--text-s); font-weight: 700;
}

/* Light / Dark switch: the current one is highlighted */
.theme-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 0 0; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.theme-option {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 8px;
  border: 0; border-radius: 6px; background: transparent;
  color: inherit; font: inherit; font-size: var(--text-s); cursor: pointer;
}
.theme-option[aria-pressed="false"]:hover { background: var(--fern-tint); }
.theme-option[aria-pressed="true"] { background: var(--fern); color: var(--on-fern); font-weight: 700; }
.theme-option:focus-visible { outline: 3px solid var(--fern); outline-offset: 2px; }
.theme-option .icon {
  flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.theme-choices { margin: 0; padding: 0; border: 0; }

/* Footer */
.app-footer {
  margin-top: 48px; padding: 20px 0 28px; border-top: 1px solid var(--line);
  font-size: var(--text-s); text-align: center;
}
.footer-line { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 4px; max-width: none; width: 100%; margin: 0; }
.footer-item + .footer-item::before { content: "\00b7"; margin: 0 10px; }
.ext-mark { margin-left: 4px; }

/* User guide */
.guide-tools { margin: 0 0 12px; }
.guide-section { border-bottom: 1px solid var(--line); }
.guide-section > summary { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; list-style: none; }
.guide-section > summary::-webkit-details-marker { display: none; }
.guide-section > summary::before {
  content: ""; flex: none; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
.guide-section[open] > summary::before { transform: rotate(45deg); }
.guide-heading { margin: 0; font-size: var(--text-l); }
.guide-body { padding: 0 0 20px; }
.guide-example { margin: 14px 0; padding: 14px 16px; border-radius: var(--radius); background: var(--fern-tint); }
.guide-example p { margin: 0; }
.guide-example .guide-label { margin-bottom: 4px; font-weight: 700; }
.guide-tip { padding-left: 14px; border-left: 3px solid var(--fern); }
.guide-qa dt, .guide-terms dt { margin-top: 14px; font-weight: 700; }
.guide-qa dd, .guide-terms dd { margin: 4px 0 0; }

/* Free money help and Donate: one shared column so every button lines up */
.help-list, .donate-list {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px;
  list-style: none; margin: 20px 0 28px; padding: 0;
}
.help-item, .donate-item {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.help-item > a, .donate-item > a { justify-self: stretch; justify-content: center; text-align: center; }
.help-name, .donate-name { margin: 0 0 2px; font-size: 1.0625rem; }
.help-item p, .donate-item p { margin: 0; }
.help-note { margin-top: 24px; }
.about-links { padding-left: 20px; }

@media (max-width: 600px) {
  .help-list, .donate-list { grid-template-columns: minmax(0, 1fr); }
  .help-item > a, .donate-item > a { justify-self: start; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-section > summary::before { transition: none; }
}
@media print {
  .app-footer, .theme-switch, .nav-group-label, .nav-list-secondary { display: none; }
}

/* Settings → Currency: one column, button on its own line */
.currency-form .field-note { margin: 6px 0 0; }
.currency-example { margin: 4px 0 0; }
.currency-form .button-row { margin-top: 12px; }

/* M6: text size, a sidebar that grows with it, and a one-row menu on narrow screens */
html[data-text-size="large"] { font-size: 125%; }
html[data-text-size="xlarge"] { font-size: 137.5%; }
.theme-choices + .theme-choices { margin-top: 16px; }

@media (min-width: 901px) {
  .shell { grid-template-columns: 12.5rem minmax(0, 1fr); }
  .nav { overflow-y: auto; }
}
@media (max-width: 900px) {
  .nav { display: flex; align-items: stretch; overflow-x: auto; }
  .nav .nav-list { flex: none; overflow: visible; }
  .nav .nav-list-secondary { border-left: 1px solid var(--line); }
  /* .nav in front: chrome.css loads after layout.css, so a plain .brand rule above would win */
  .nav .nav-group-label, .nav .theme-switch, .nav .brand, .nav .nav-ring { display: none; }
}