:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #241841;
  background: #151638;
  --violet: #5c4997;
  --gold: #c49b58;
  --line: #d9cbea;
  --tab-space: calc(72px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
body { margin: 0; }
.app {
  max-width: 500px;
  min-height: 100dvh;
  margin: auto;
  background: radial-gradient(ellipse at 7% 12%, #fdf8ff, transparent 45%), linear-gradient(150deg, #c8bced, #f5effb 39%, #e7dcfa);
  padding-bottom: calc(var(--tab-space) + 8px);
}
.hero {
  min-height: 154px;
  padding: 12px 16px 17px;
  text-align: left;
  color: #fff9ff;
  background:
    linear-gradient(90deg, #15183d 0%, #15183df7 32%, #15183d96 55%, #15183d19 83%),
    url("./garden-reference.jpg") right 47% / auto 175px no-repeat,
    #15183d;
  border-bottom: 1px solid #ebce91;
}
.brand {
  display: block;
  text-align: center;
  color: #ffe2a7;
  text-shadow: 0 1px 4px #121330;
  font: italic 19px Georgia, serif;
}
.brand small {
  display: block;
  font: 10px system-ui, sans-serif;
  letter-spacing: .09em;
}
h1 { margin: 9px 0 4px; font-size: 24px; line-height: 1.28; }
.hero p { margin: 0; font-size: 12px; max-width: 190px; line-height: 1.5; }
.hero-illustrated {
  padding: 0;
  background: #222465;
  border-bottom: 0;
}
.hero-illustrated .brand {
  padding: 8px 12px;
  background: #15183d;
}
.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  isolation: isolate;
}
.hero-banner > * { grid-area: 1 / 1; }
.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-caption {
  position: relative;
  width: 43%;
  padding: 8px 0 8px 16px;
  text-shadow: 0 1px 4px #101130;
}
.hero-caption::before {
  position: absolute;
  z-index: -1;
  inset: -4px -8% -4px 0;
  background: linear-gradient(90deg, #15183de8 72%, #15183d00);
  border-radius: 0 50% 50% 0;
  content: "";
}
.hero-caption h1 { margin: 0 0 5px; font-size: 19px; }
.hero-footer {
  padding: 0 16px 12px;
  background: linear-gradient(#222465, #151638);
}
.demo {
  display: inline-block;
  border: 1px solid #ddc289;
  background: #201942;
  color: #fff3d9;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  margin-top: 6px;
}
main { padding: 10px 11px 16px; }
section { margin: 0 0 11px; }
h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px 5px;
  font-size: 15px;
  line-height: 1.4;
}
h2::after { content: ""; height: 1px; flex: 1; margin-left: 3px; background: linear-gradient(90deg, var(--gold), #e0c891); }
p { line-height: 1.5; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #7850bf; outline-offset: 2px; }
h1:focus { outline: none; }
h1.keyboard-focus:focus { outline: 2px solid #e0caff; outline-offset: 2px; }
.panel, .row, .notice, .recommendation {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(120deg, #fffbff, #f1eafa);
  box-shadow: 0 1px 3px #321c541e, inset 0 0 0 1px #ffffffad;
}
.panel { padding: 10px; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel p, .panel li, label { font-size: 13px; }
.panel h3 { font-size: 14px; margin: 8px 0; }
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 9px;
  min-height: 48px;
  border-color: #d8ba86;
  background: linear-gradient(100deg, #fff0dd, #fff8f8 65%, #efe2ff);
  font-size: 13px;
}
.pill, .level {
  display: inline-block;
  flex: none;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.pill { background: linear-gradient(155deg, #8c73bc, #4b357d); color: white; }
.level { background: #fae5b6; color: #594016; border: 1px solid #dcbf85; }
.chevron { margin-left: auto; font: 23px Georgia, serif; color: #513980; }
.summary {
  display: flex;
  justify-content: space-evenly;
  align-items: stretch;
  padding: 8px 5px;
  background: radial-gradient(circle at 91% 29%, #fff7da 0 8px, #fff3 9px 17px, transparent 18px), linear-gradient(120deg, #ded1f6, #ece3fd 55%, #d5c4f5);
}
.summary > * { flex: 1; min-width: 0; }
.summary > * + * { border-left: 1px solid #c9b7e3; }
.stat { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 5px; }
.stat .icon { grid-row: span 2; }
.stat small { font-size: 10px; }
.stat strong { font-size: clamp(13px, 4.3vw, 20px); white-space: nowrap; }
.icon { color: #7455ab; font-size: 21px; line-height: 1; flex: none; }
.stack { display: grid; gap: 4px; }
.row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 8px; font-size: 13px; }
.row .names { flex: 1; }
.row small, .muted { display: block; color: #514465; font-size: 11px; }
.field { display: grid; grid-template-columns: 23px minmax(0, 1fr) auto 15px; }
.field .names b { display: block; }
.recommendations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.recommendation { display: block; padding: 7px; font-size: 12px; }
.recommendation .icon, .recommendation b { display: block; }
.recommendation small { display: block; margin-top: 4px; font-size: 11px; }
.week-controls, .segments, .actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-controls { justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.week-controls a { display: inline-flex; align-items: center; min-height: 44px; }
.week-date { padding: 4px 9px; border-radius: 20px; background: #fff5e3; white-space: nowrap; }
.segments { padding: 3px; margin-bottom: 8px; flex-wrap: nowrap; }
.segments a { flex: 1; text-align: center; }
.segment-active { color: white; background: linear-gradient(130deg, #8e76c5, #56428d); }
.day-row { display: grid; grid-template-columns: 6.5em 1fr 1fr 1.4fr 12px; gap: 4px; font-size: 12px; text-align: center; }
.day-date { padding-inline: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.day-row .muted { grid-column: span 3; text-align: center; }
.record-field {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) max-content max-content 12px;
  gap: 6px;
  min-height: 64px;
}
.record-field .level { margin-top: 3px; }
.trend { border-left: 1px solid var(--line); padding-left: 6px; }
.trend-chart { display: block; width: 84px; fill: none; stroke: #7750b9; stroke-width: 1.5; }
.trend-chart .trend-grid { stroke: #d5c4e6; stroke-width: 1; }
.trend-chart circle { fill: #fbf5ff; }
.trend-detail { max-width: 280px; }
.trend-detail svg { width: 100%; }
.trend-detail div { display: flex; justify-content: space-between; font-size: 12px; }
.records-note { padding: 6px 10px; border-radius: 12px; background: #f9f3ff; color: #514465; font-size: 12px; }
.settings-grid, .export-grid { display: grid; gap: 6px; grid-template-columns: 1fr 1.55fr; }
.export-grid { grid-template-columns: 1fr 1fr; }
.time-card { align-content: center; text-align: center; background: linear-gradient(155deg, #fffcff, #e3d5f8); }
.time-card strong { font-size: 27px; }
.settings-grid .row { font-size: 12px; }
.settings-level { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px auto 44px; gap: 4px; }
.level-detail { display: flex; align-items: center; gap: 5px; min-height: 44px; }
.settings-level button { width: 44px; padding: 0; font-size: 18px; }
.settings-level button[aria-disabled="true"] { opacity: .55; }
.level-dots { display: flex; gap: 3px; }
.level-dots i { width: 7px; height: 7px; border: 1px solid #8e73bc; border-radius: 50%; }
.level-dots i:first-child, .level-dots[data-level="1"] i:nth-child(2), .level-dots[data-level="2"] i { background: #8e73bc; }
.sample-photo {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px solid #e0d1ef;
  border-radius: 8px;
  background: radial-gradient(ellipse at 35% 27%, #fff8ed, transparent 68%), linear-gradient(145deg, #d9d5fa, #e7cdeb);
}
.sample-photo svg { display: block; width: 100%; max-width: 172px; }
.report-preview { display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 10px; }
.report-preview p { margin: 4px 0 7px; }
.report-preview .sample-photo { min-height: 0; }
.report-preview + .actions { margin-top: 8px; font-size: 12px; }
.report-compact { grid-template-columns: 72px 1fr; }
.completed-missions { list-style: none; margin: 0; padding: 0; }
.completed-missions li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.completed-missions small { white-space: nowrap; }
#extension, #next-start, #media-export { scroll-margin-bottom: var(--tab-space); }
.back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: #50367d; font-size: 13px; font-weight: 700; }
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 5px 11px;
  border: 1px solid #c4b2e4;
  border-radius: 20px;
  font: inherit;
  background: #fbf6ff;
  color: #3c285f;
}
.segments .segment-active, .primary { background: linear-gradient(130deg, #896dbb, #513883); color: white; }
button:disabled { opacity: .66; }
label { display: grid; gap: 4px; margin: 8px 0; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: 7px; border: 1px solid #baabd5; border-radius: 7px; background: #fffaff; font: inherit; color: inherit; }
input[type="radio"] { width: auto; min-height: auto; }
fieldset { border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
fieldset label { display: flex; min-height: 36px; align-items: center; }
details summary { cursor: pointer; padding: 6px 0; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 9px; font-size: 13px; }
dt { font-weight: 650; }
dd { margin: 0; }
#tabs {
  position: fixed;
  z-index: 1;
  inset: auto 0 0;
  max-width: 500px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  align-items: center;
  min-height: var(--tab-space);
  padding: 13px 18px calc(6px + env(safe-area-inset-bottom));
  isolation: isolate;
  background: linear-gradient(transparent 18px, #211c47 18px);
  color: #fff9ff;
}
.tab-decoration { position: absolute; z-index: -1; inset: 0; width: 100%; height: 72px; pointer-events: none; }
#tabs a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 49px; border-radius: 24px; font-size: 11px; }
#tabs a[aria-current] { background: linear-gradient(150deg, #8063a8, #493473); color: #fff2bd; box-shadow: inset 0 0 0 1px #e1ba73; }
#tabs a:focus-visible { outline-color: #f2d68f; }
.tab-icon { width: 23px; height: 23px; }
