:root {
  --paper: #F8F7F3;
  --ink: #263B39;
  --text: #48534F;
  --accent: #426345;
  --rule: #d4d8ce;
  --content-width: 1104px;
  --gutter: 5.3vw;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
  scrollbar-gutter: stable;
  background: var(--paper);
  font: 16px/1.5 var(--sans);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: var(--paper);
  color: var(--text);
}

:where(h1, h2, h3) { color: var(--heading-color, var(--ink)); }

.muster-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding-top: calc(30px + env(safe-area-inset-top));
  background: var(--paper);
}

.muster-header::after {
  content: "";
  grid-area: 1 / 1 / 2 / -1;
  align-self: end;
  border-bottom: 1px solid var(--rule);
  pointer-events: none;
}

.brand {
  grid-area: 1 / 1;
  justify-self: start;
  color: var(--ink);
  font: 600 24px/1 var(--sans);
  letter-spacing: -.055em;
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.muster-header h1, .muster-content, .muster-footer {
  width: min(100%, var(--content-width));
  margin-inline: auto;
}
.muster-header h1 {
  grid-area: 2 / 1 / 3 / -1;
  margin-block: 32px 0;
  font: 400 clamp(44px, 5.5vw, 72px)/1.06 var(--serif);
  letter-spacing: -.052em;
}

.muster-nav {
  grid-area: 1 / 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 0 22px;
}
.muster-nav :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0;
  border: 0;
  box-shadow: inset 0 -3px transparent;
  background: transparent;
  color: var(--text);
  font: 550 14px/1.25 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.muster-nav :is(a, button):hover { color: var(--accent); text-decoration: underline; text-underline-offset: .25em; }
.muster-nav :is([aria-current="page"], [aria-pressed="true"]) {
  color: var(--ink);
  box-shadow: inset 0 -3px var(--accent);
}
.muster-nav .muster-back { color: var(--accent); }
.muster-back::after {
  content: "";
  height: 16px;
  margin-left: 14px;
  border-right: 1px solid var(--rule);
}
.muster-nav .icon, .muster-footer .icon { width: 15px; height: 15px; flex: none; }

.muster-content { flex: 1 0 auto; }
.muster-intro { max-width: 66ch; margin: 10px 0 26px; color: var(--text); }

.muster-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  margin-top: 36px;
  padding: 15px 0 calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  color: var(--text);
  font: 400 12px/1.45 var(--sans);
}
.footer-credit { display: grid; gap: 3px; }
.footer-credit #storage-status { display: inline-flex; align-items: center; gap: 5px; }
.footer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0 20px; }
.footer-actions :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.footer-actions :is(a, button):hover { color: var(--accent); text-decoration-thickness: 2px; }
#reset-notice { flex-basis: 100%; margin: 0; color: var(--accent); }
#reset-notice:empty { position: absolute; }

#reset-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: 90dvh;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fefdf9;
  color: var(--ink);
  box-shadow: 0 12px 48px #23393135;
}
#reset-dialog::backdrop { background: #1b302c69; }
#reset-title { margin: 0 0 10px; font: 400 29px/1.12 var(--serif); letter-spacing: -.03em; }
#reset-description { font-size: 15px; color: var(--text); }
.reset-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 9px; margin-top: 20px; }
.reset-actions button {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: 600 14px/1.4 var(--sans);
  cursor: pointer;
}
.reset-actions button:hover { border-color: var(--accent); }
.reset-actions button[value="reset"] { border-color: #834738; background: #834738; color: white; }
.reset-actions button[value="reset"]:hover { background: #6f3c2e; }
:is(.muster-header, .muster-footer, #reset-dialog) :is(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  :root { --gutter: clamp(16px, 5.3vw, 28px); }
  .muster-header { padding-top: calc(18px + env(safe-area-inset-top)); row-gap: 10px; }
  .muster-header::after { grid-row: 2; }
  .brand { font-size: 21px; }
  .muster-header h1 {
    grid-area: 1 / 2;
    width: auto;
    margin: 0 0 0 12px;
    justify-self: end;
    text-align: right;
    font: 500 18px/1.2 var(--sans);
    letter-spacing: -.025em;
  }
  .muster-nav {
    grid-area: 2 / 1 / 3 / -1;
    justify-content: start;
    gap: 0 clamp(10px, 3.5vw, 20px);
  }
  .muster-nav :is(a, button) { min-height: 44px; font-size: 13px; }
  .muster-nav .muster-back { margin-right: auto; }
  .muster-back::after { display: none; }
  .muster-intro { margin-block: 18px 20px; font-size: 15px; }
  .muster-footer { align-items: start; flex-direction: column; margin-top: 26px; }
  #reset-notice { flex-basis: auto; }
}
