/* ArbiTracker site: the app's colours (sky blue on slate, green accent). */
:root {
  --bg: #F1F5F9;
  --card: #FFFFFF;
  --soft: rgba(15, 23, 42, 0.05);
  --text: #0F172A;
  --muted: #475569;
  --line: #E2E8F0;
  --primary: #0284C7;
  --primary-soft: rgba(2, 132, 199, 0.10);
  --green: #078A5C;
  --green-soft: rgba(7, 138, 92, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --card: #111A2E;
    --soft: rgba(226, 232, 240, 0.06);
    --text: #E2E8F0;
    --muted: #94A3B8;
    --line: #1E293B;
    --primary: #38BDF8;
    --primary-soft: rgba(56, 189, 248, 0.12);
    --green: #34D399;
    --green-soft: rgba(52, 211, 153, 0.12);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--primary); }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 16px 24px;
}

section { margin: 0 0 64px; }

h2.section-title {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 6px;
}

.section-lead { color: var(--muted); margin: 0 0 22px; }

/* ---------- Wordmark: light and dark versions, like the app ---------- */
.wordmark { display: block; width: min(300px, 75%); height: auto; }
.wordmark.dark { display: none; }
@media (prefers-color-scheme: dark) {
  .wordmark.light { display: none; }
  .wordmark.dark { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 24px 0 8px;
}

.hero .icon {
  width: 104px;
  height: 104px;
  border-radius: 26px;
  box-shadow: 0 10px 34px rgba(2, 132, 199, 0.28);
}

.hero .wordmark { margin: 22px auto 0; }

.hero h1 {
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.1;
  margin: 22px 0 10px;
  letter-spacing: -0.02em;
}

.hero h1 .accent { color: var(--green); }

.rotator {
  font-size: 19px;
  color: var(--muted);
  margin: 0 0 26px;
  min-height: 1.6em;
}

.rotator .example {
  color: var(--primary);
  font-weight: 600;
  display: inline-block;
  transition: opacity 0.25s, transform 0.25s;
}

.rotator .example.out { opacity: 0; transform: translateY(6px); }

.buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  font-size: 16px;
}

.button.play { background: var(--green); color: #fff; }
.button.guide { background: var(--primary-soft); color: var(--primary); }
.button.guide:hover { background: var(--primary); color: #fff; }

/* ---------- Two tools in one ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}

.pillar .label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.pillar.collect .label { background: var(--green-soft); color: var(--green); }
.pillar.understand .label { background: var(--primary-soft); color: var(--primary); }

.pillar h3 { font-size: 22px; margin: 12px 0 10px; line-height: 1.25; }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding-left: 26px; position: relative; margin: 6px 0; }
.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--green);
}
.pillar.understand .checks li::before { color: var(--primary); }

/* ---------- Expandable "More" ---------- */
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }

details.more summary {
  cursor: pointer;
  list-style: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
}

details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " ▾"; }
details.more[open] summary::after { content: " ▴"; }

details.more p, details.more ul { color: var(--muted); font-size: 15px; margin: 10px 0 0; }
details.more ul { padding-left: 20px; }
details.more li { margin: 4px 0; }

/* ---------- Setup demo, drawn like the app (values from its themes.xml) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }

.chip {
  font: inherit;
  font-size: 15px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

.app-demo {
  /* The app's own colours, light */
  --a-bg: #F6F8FB;
  --a-container: #EEF2F7;
  --a-low: #FFFFFF;
  --a-on: #0F172A;
  --a-muted: #526075;
  --a-outline: #DCE2EA;
  --a-primary: #0284C7;
  --a-on-primary: #FFFFFF;
  --a-soft: rgba(15, 23, 42, 0.06);
  --a-pill: #E0F2FE;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

@media (prefers-color-scheme: dark) {
  .app-demo {
    --a-bg: #0F1420;
    --a-container: #1A2232;
    --a-low: #161D2B;
    --a-on: #E2E8F0;
    --a-muted: #9AA8BC;
    --a-outline: #2A3447;
    --a-primary: #38BDF8;
    --a-on-primary: #082F49;
    --a-soft: rgba(226, 232, 240, 0.06);
    --a-pill: rgba(56, 189, 248, 0.16);
  }
}

@media (max-width: 720px) {
  .app-demo { grid-template-columns: minmax(0, 1fr); }
}

.step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px 4px;
}

.step-label span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}

/* A phone-like screen */
.app {
  position: relative;
  overflow: hidden;
  background: var(--a-bg);
  color: var(--a-on);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 18px 16px 20px;
  min-height: 420px;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.10);
}

.app button { font-family: inherit; }

.app-title, .app-node { font-size: 22px; font-weight: 700; margin: 2px 4px 14px; }

/* Setup: one card per measurement (like item_measurement_field_editor) */
.def-card {
  background: var(--a-low);
  border: 1px solid var(--a-outline);
  border-radius: 18px;
  padding: 10px 12px;
  margin: 0 0 10px;
  animation: pop 0.3s ease both;
}

.def-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }

.def-label { width: 64px; flex: 0 0 auto; color: var(--a-muted); font-size: 14px; }

.def-input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  color: var(--a-on);
  background: var(--a-soft);
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  outline: none;
}

.def-input:focus { box-shadow: inset 0 0 0 2px var(--a-primary); }

.type-pill {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--a-primary);
  background: var(--a-pill);
  border: 0;
  border-radius: 999px;
  padding: 6px 28px 6px 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.def-options { color: var(--a-muted); font-size: 14px; }

.def-delete {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--a-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

.app-text-button {
  background: none;
  border: 0;
  color: var(--a-primary);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 4px;
  cursor: pointer;
}

/* Record: the entry card (view_measurements + ObservationFormView) */
.entry-card { background: var(--a-container); border-radius: 20px; padding: 16px; }

.entry-head { display: flex; align-items: center; margin: 0 0 16px; }
.entry-title { flex: 1 1 auto; font-size: 16px; font-weight: 500; }

.time-pill {
  font-size: 14px;
  font-weight: 500;
  padding: 5px 8px 5px 12px;
  border-radius: 16px;
  background: var(--a-low);
  border: 1px solid var(--a-outline);
}

.chev { color: var(--a-muted); font-size: 12px; margin-left: 2px; }

.form-field { margin: 0 0 8px; animation: pop 0.3s ease both; }

.form-name {
  display: flex;
  justify-content: space-between;
  color: var(--a-muted);
  font-size: 14px;
  padding: 0 12px 6px 16px;
}

.form-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 4px 12px 4px 16px;
  border-radius: 14px;
  background: var(--a-soft);
  cursor: pointer;
}

.form-row input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  color: var(--a-on);
  background: none;
  border: 0;
  outline: none;
  padding: 10px 4px 10px 0;
}

.form-row .value { flex: 1 1 auto; }
.form-row .unit { color: var(--a-muted); font-size: 14px; padding: 0 4px; }
.form-row .chev { font-size: 14px; }

/* Material 3 switch */
.switch {
  width: 52px;
  height: 32px;
  border-radius: 16px;
  border: 2px solid var(--a-muted);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--a-muted);
  transition: all 0.2s;
}

.switch.on { background: var(--a-primary); border-color: var(--a-primary); }
.switch.on::after { left: 22px; top: 2px; width: 24px; height: 24px; background: var(--a-on-primary); }

/* Number chips for small whole ranges */
.form-row.cells { padding: 4px; gap: 0; }

.cell {
  flex: 1 1 0;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 0;
  background: none;
  color: var(--a-on);
  cursor: pointer;
  padding: 0;
}

.cell.on { background: var(--a-primary); color: var(--a-on-primary); }

/* Category dropdown (PopupMenu) */
.menu {
  position: absolute;
  right: 8px;
  top: 100%;
  z-index: 5;
  min-width: 160px;
  background: var(--a-low);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  padding: 6px 0;
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--a-on);
  font-size: 15px;
  padding: 10px 16px;
  cursor: pointer;
}

.menu button:hover { background: var(--a-soft); }

.app-button {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: 26px;
  background: var(--a-primary);
  color: var(--a-on-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.recent-title { font-size: 16px; font-weight: 600; margin: 18px 4px 8px; }

.recent-item {
  background: var(--a-low);
  border: 1px solid var(--a-outline);
  border-radius: 16px;
  padding: 10px 14px;
  margin: 0 0 8px;
  font-size: 14px;
  animation: pop 0.3s ease both;
}

.recent-item .when { color: var(--a-muted); font-size: 12px; margin-bottom: 2px; }

.snackbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 14px 16px;
  border-radius: 6px;
  background: #1E293B;
  color: #F1F5F9;
  font-size: 14px;
  transform: translateY(140%);
  transition: transform 0.25s;
}

.snackbar.show { transform: none; }

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Two kinds of curious ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }

.tab {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.tab-panel p { margin: 0; font-size: 18px; }
.tab-panel[hidden] { display: none; }

/* ---------- Extras grid ---------- */
.extras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.extras .card { padding: 18px; }
.extras .emoji { font-size: 26px; line-height: 1; }
.extras h3 { font-size: 17px; margin: 10px 0 4px; }
.extras p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Private strip ---------- */
.private {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 22px;
  text-align: center;
}

.private h2 { margin: 0 0 16px; font-size: 24px; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 600;
  font-size: 15px;
}

.private .small { color: var(--muted); font-size: 15px; margin: 16px 0 0; }

/* ---------- Examples strip ---------- */
.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.examples span {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.closing { text-align: center; }
.closing h2 { font-size: 28px; margin: 0 0 18px; }

/* ---------- Guide and privacy pages ---------- */
.page h1 { font-size: 32px; margin: 24px 0 4px; }
.page h2 { font-size: 19px; margin: 28px 0 6px; }
.page .updated, .page .lead { color: var(--muted); margin: 0 0 20px; }
.page ul { padding-left: 22px; }

.guide-step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  margin: 12px 0;
}

.guide-step summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  font-weight: 600;
  font-size: 18px;
}

.guide-step summary::-webkit-details-marker { display: none; }

.guide-step .num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 15px;
}

.guide-step summary .hint { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 15px; }
.guide-step[open] summary .hint { display: none; }

.guide-step .body { padding: 0 18px 16px 62px; color: var(--muted); }
.guide-step .body p { margin: 0 0 8px; }
.guide-step .body strong { color: var(--text); }

@media (max-width: 520px) {
  .guide-step .body { padding-left: 18px; }
}

/* ---------- Footer ---------- */
footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .def-card, .form-field, .recent-item, .rotator .example { animation: none; transition: none; }
}
