:root {
  --paper: #ffffff;
  --ink: #2b2a2e;
  --ink-soft: #6e6a64;
  --barn: #7e1a1a;
  --cream: #efe3c2;
  --line: #ddd9d2;
  --field: #ffffff;
  --shadow: 0 1px 2px rgba(43, 42, 46, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

img { max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

.top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 20px;
  background: #7e1a1a;
}

.band-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  color: #ffffff;
  opacity: 1;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.brand span {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  opacity: 1;
  -webkit-text-fill-color: #ffffff;
}

.brand img {
  width: auto;
  height: 48px;
  display: block;
}

.searchlook {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  background: #ffffff;
  border: 0;
  border-radius: 12px;
}

.glass {
  width: 18px;
  height: 18px;
  flex: none;
  color: #6e6a64;
}

.searchlook input {
  flex: 1;
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.searchlook input::placeholder { color: var(--ink-soft); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.top .menu-btn span { background: #ffffff; }
.top .auth {
  color: #ffffff;
  border-color: #ffffff;
  background: transparent;
}
.menu-panel .auth {
  color: var(--ink);
  border-color: var(--line);
  background: var(--field);
}

.tabwrap {
  margin: 0;
  background: #fff;
}

.chip {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.nav { position: relative; justify-self: end; }
.menu-btn {
  width: 44px;
  height: 44px;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  padding: 0 4px 0 8px;
  list-style: none;
  cursor: pointer;
}
.menu-btn::-webkit-details-marker { display: none; }
.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}
.menu-panel {
  position: absolute;
  z-index: 4;
  top: 48px;
  right: 0;
  width: min(280px, 78vw);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
}
.menu-panel a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-radius: 12px;
}
.soon {
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 16px;
}
.soon span { font-size: 14px; font-weight: 400; }

.auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  justify-self: start;
  min-height: 44px;
  margin: 8px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.menu-panel .auth { margin: 8px 4px 4px; }

.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.bar h1 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-actions { display: flex; align-items: center; }

.back, .textbtn {
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  background: transparent;
  border: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px 0 0;
  cursor: pointer;
}

.back { margin-right: 8px; }

.textbtn { text-decoration: underline; text-underline-offset: 3px; padding: 0; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
}

.login-mark {
  width: min(160px, 48vw);
  height: auto;
  display: block;
  margin: 16px auto 0;
}

.word {
  margin: 8px 0 24px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
}

.note {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin: 0 0 16px;
}

.tip-title { font-weight: 600; margin: 0 0 8px; font-size: 16px; }

.note p { margin: 0 0 8px; }
.note p:last-child { margin-bottom: 0; }

.hint, .unavailable, .empty {
  color: var(--ink-soft);
  margin: 8px 0;
  font-size: 14px;
}

.unavailable, .empty { text-align: center; }

.spend { font-weight: 600; margin: 0 0 16px; }

.htabs {
  display: flex;
  gap: 0;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.htab {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
}
.htab.on {
  background: transparent;
  color: var(--barn);
  border-bottom-color: var(--barn);
}
.choice {
  border: 0;
  margin: 8px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.choice legend { font-weight: 600; margin-bottom: 4px; }
.choice label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 400; }
.choice input { width: auto; min-height: 0; }

.section {
  margin: 24px 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 600;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tile {
  position: relative;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--barn);
  display: inline-block;
  flex: none;
}

.tile .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--field);
}

.tile img, .tile .ph, .hero {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #eceae6;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
}

.hero { aspect-ratio: 4 / 3; }
.plate-full { aspect-ratio: auto; height: auto; background: transparent; border: 0; }

.tile span {
  display: block;
  margin-top: 8px;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--barn);
  background: var(--barn);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.btn.secondary {
  background: var(--field);
  color: var(--ink);
  border-color: var(--line);
}

label.btn { margin-bottom: 8px; }

.btn.small { width: auto; min-height: 44px; padding: 8px 12px; font-size: 14px; }

.stack { display: grid; gap: 8px; margin-top: 16px; }
.stack label { font-weight: 600; }

.field { margin: 0 0 12px; }

.label-row, .field > label, .stack > label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-weight: 600;
  margin-bottom: 4px;
}

.check { color: var(--barn); font-size: 14px; font-weight: 600; white-space: nowrap; }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

textarea { min-height: 96px; resize: vertical; }

.file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.dock {
  display: grid;
  gap: 8px;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  background: transparent;
  border-top: 0;
  margin-top: 24px;
}

.dock:has(+ .quick) { padding-bottom: 0; }

.quick { margin-top: 8px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.quick .section { margin-top: 0; }
.quick-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 16px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  text-align: center;
}
.quick-tile svg {
  width: 28px;
  height: 28px;
  color: var(--barn);
}
.quick-tile span {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.previews, .plates { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }

.previews figure { margin: 0; width: 96px; }

.previews img, .plates img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
  background: #eceae6;
}

.previews button {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: 12px;
  font-weight: 600;
}

.specs { margin: 16px 0 8px; }

.spec {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.spec span:first-child { color: var(--ink-soft); }
.spec span:last-child { font-weight: 600; overflow-wrap: anywhere; }

.person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.person-email { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.person .hint { margin: 0; }

.folders {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin: 24px 0 0;
}
.folder {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 12px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
.folder.on { background: var(--field); }
.folder-panel {
  border: 1px solid var(--line);
  background: var(--field);
  padding: 12px 16px 16px;
  border-radius: 0 0 12px 12px;
}
.qr { border-bottom: 1px solid var(--line); }
.qr > summary, .source > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}
.source > summary { min-height: 44px; font-size: 14px; color: var(--ink-soft); }
.qr-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0 16px;
}

.meter label { grid-column: 1 / -1; margin: 0; }
.meter input { min-width: 0; }
.meter .btn { width: auto; min-width: 7rem; }

.due-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.due-row p, .log-row p { margin: 0; }
.service-name { font-weight: 600; margin: 0 0 4px; font-size: 20px; }
.hit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.hit span:last-child { color: var(--ink-soft); font-size: 14px; font-weight: 400; white-space: nowrap; }
.hit span:first-child { overflow-wrap: anywhere; }

.choices { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 8px; }
.choices .textbtn { min-height: 44px; }
.log-row { padding: 12px 0; border-bottom: 1px solid var(--line); }

:focus-visible {
  outline: 2px solid var(--barn);
  outline-offset: 2px;
}

@media (min-width: 800px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .wrap { padding-top: 24px; }
  .dock { grid-template-columns: 1fr 1fr; }
  .dock .btn:only-child { grid-column: 1 / -1; }
}
