:root {
  --bg: #0e0f12;
  --panel: rgba(18, 20, 25, 0.82);
  --panel-strong: rgba(10, 11, 14, 0.95);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6f1e8;
  --muted: #bbb3a7;
  --accent: #fc4c02;
  --accent-soft: rgba(252, 76, 2, 0.18);
  --ok: #12715b;
  --warn: #d68c1e;
  --danger: #dc4d4d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(252, 76, 2, 0.24), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(24, 121, 92, 0.22), transparent 20%),
    linear-gradient(180deg, #15161a 0%, #090a0d 100%);
  color: var(--text);
  font-family: "Sora", sans-serif;
}

body {
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 85%);
}

.app-root {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 20px 16px 80px;
  position: relative;
  z-index: 1;
}

.hero,
.surface,
.bike-section {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px 22px;
  margin-bottom: 18px;
}

.hero.compact {
  padding-bottom: 22px;
}

.hero::before,
.surface::before,
.bike-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(252, 76, 2, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 50%);
  pointer-events: none;
}

.surface,
.bike-section {
  padding: 20px;
  margin-bottom: 18px;
}

.attention-surface {
  border-color: rgba(252, 76, 2, 0.26);
  background:
    linear-gradient(180deg, rgba(252, 76, 2, 0.08), rgba(255, 255, 255, 0.03)),
    var(--panel);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  max-width: 11ch;
}

h2 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

h3 {
  font-size: 1.45rem;
}

.hero-copy,
.task-copy,
.detail-line,
.empty-copy,
.warning-line,
.preview-card p,
.setup-card p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-copy {
  margin: 16px 0 0;
  max-width: 56ch;
}

.preview-grid,
.bike-grid,
.stat-grid,
.resource-grid,
.component-grid {
  display: grid;
  gap: 14px;
}

.setup-card-list,
.setup-grid {
  display: grid;
  gap: 14px;
}

.preview-grid {
  margin-top: 22px;
}

.preview-card,
.setup-card,
.stat-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 18px;
}

.setup-card {
  margin-top: 18px;
}

.notice-surface {
  border-color: rgba(18, 113, 91, 0.34);
  background:
    linear-gradient(180deg, rgba(18, 113, 91, 0.14), rgba(255, 255, 255, 0.03)),
    var(--panel);
}

.notice-copy {
  margin: 0;
  color: #a8e6d4;
  font-weight: 600;
}

.preview-card h3 {
  margin-bottom: 8px;
}

.solid-button,
.ghost-button,
.icon-button,
.resource-link {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.solid-button.small {
  padding: 10px 16px;
}

.solid-button:hover,
.ghost-button:hover,
.icon-button:hover,
.resource-link:hover {
  transform: translateY(-1px);
}

.solid-button:disabled,
.ghost-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ghost-button,
.icon-button {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
}

.icon-button {
  padding: 10px 14px;
  font-size: 1.4rem;
}

.hero-button {
  margin-top: 20px;
}

.action-row,
.chip-row,
.source-row,
.topbar,
.task-row,
.bike-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.action-row,
.chip-row {
  margin-top: 18px;
}

.chip-row {
  gap: 8px;
}

.stat-chip,
.source-chip,
.status-pill,
.guide-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  line-height: 1;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.status-pill {
  font-weight: 700;
}

.guide-chip {
  color: var(--text);
  text-decoration: none;
  background: rgba(252, 76, 2, 0.09);
  border-color: rgba(252, 76, 2, 0.22);
}

.status-pill.due {
  color: white;
  background: rgba(220, 77, 77, 0.18);
  border-color: rgba(220, 77, 77, 0.35);
}

.status-pill.soon {
  color: #ffd58c;
  background: rgba(214, 140, 30, 0.16);
  border-color: rgba(214, 140, 30, 0.32);
}

.status-pill.ok {
  color: #87dbc0;
  background: rgba(18, 113, 91, 0.16);
  border-color: rgba(18, 113, 91, 0.32);
}

.status-pill.needs-baseline {
  color: #f0c28c;
  background: rgba(252, 76, 2, 0.14);
  border-color: rgba(252, 76, 2, 0.3);
}

.status-pill.inspect-now {
  color: #ffd58c;
  background: rgba(214, 140, 30, 0.16);
  border-color: rgba(214, 140, 30, 0.32);
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(252, 76, 2, 0.4);
  object-fit: cover;
}

.task-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.task-stack.compact {
  margin-top: 16px;
}

.component-shelf {
  margin-top: 18px;
}

.baseline-shelf {
  margin-top: 18px;
}

.component-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
}

.component-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.task-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.task-card.due {
  background: linear-gradient(180deg, rgba(220, 77, 77, 0.08), rgba(255, 255, 255, 0.03));
}

.task-card.needs-baseline {
  background: linear-gradient(180deg, rgba(252, 76, 2, 0.08), rgba(255, 255, 255, 0.03));
}

.task-copy {
  margin: 10px 0 0;
}

.meter {
  margin: 14px 0 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff9b63);
  border-radius: inherit;
}

.resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.prep-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.prep-block + .prep-block {
  margin-top: 10px;
}

.prep-summary {
  max-width: 60ch;
}

.resource-link {
  padding: 12px 14px;
  text-align: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.practice-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.practice-list.compact {
  margin-top: 10px;
}

.practice-list li + li {
  margin-top: 6px;
}

.detail-line {
  margin: 6px 0 0;
}

code {
  padding: 0.2em 0.45em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.warning-line {
  color: #f0bf8a;
}

.prep-have {
  color: #87dbc0;
  border-color: rgba(18, 113, 91, 0.28);
  background: rgba(18, 113, 91, 0.12);
}

.prep-missing {
  color: #ffd1c0;
  border-color: rgba(220, 77, 77, 0.28);
  background: rgba(220, 77, 77, 0.12);
}

.prep-difficulty {
  background: rgba(252, 76, 2, 0.1);
  border-color: rgba(252, 76, 2, 0.24);
}

.prep-state.missing {
  color: #ffd1c0;
  border-color: rgba(220, 77, 77, 0.28);
  background: rgba(220, 77, 77, 0.12);
}

.prep-state.partial,
.prep-state.advanced {
  color: #ffd58c;
  border-color: rgba(214, 140, 30, 0.28);
  background: rgba(214, 140, 30, 0.12);
}

.prep-state.ready {
  color: #87dbc0;
  border-color: rgba(18, 113, 91, 0.28);
  background: rgba(18, 113, 91, 0.12);
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.9rem;
}

.settings-panel {
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px;
}

.settings-panel summary {
  cursor: pointer;
  font-weight: 600;
}

.settings-form,
.log-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.setup-form {
  gap: 18px;
}

.question-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.guide-row {
  margin-top: 14px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
}

label span,
fieldset legend {
  font-size: 0.88rem;
  color: var(--muted);
}

select,
input,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 7, 10, 0.78);
  color: var(--text);
  padding: 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
}

.record-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.record-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.record-item p,
.record-item span,
.record-item strong {
  margin: 0;
}

.record-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.log-shelf {
  margin-top: 16px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 6, 8, 0.6);
  backdrop-filter: blur(14px);
  display: grid;
  place-items: end center;
  padding: 16px;
}

.modal-card {
  width: min(100%, 640px);
  padding: 20px;
  border-radius: 28px;
  background: var(--panel-strong);
}

.inventory-form-grid,
.inventory-grid {
  display: grid;
  gap: 14px;
}

.plan-grid,
.admin-grid {
  margin-top: 18px;
}

.inventory-form-grid {
  margin-top: 18px;
}

.inventory-form,
.inventory-card,
.inventory-mini-form {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.inventory-form,
.inventory-mini-form {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.inventory-grid {
  margin-top: 18px;
}

.inventory-card {
  overflow: hidden;
}

.inventory-content {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.admin-card .inventory-content {
  gap: 16px;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-photo {
  position: relative;
  min-height: 220px;
  background:
    radial-gradient(circle at top left, rgba(252, 76, 2, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
}

.inventory-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: cover;
}

.inventory-photo.placeholder {
  display: grid;
  place-items: center;
  padding: 22px;
}

.inventory-photo.placeholder div {
  max-width: 28ch;
  text-align: center;
}

.inventory-photo.placeholder p,
.inventory-photo.placeholder strong {
  margin: 0;
}

.inventory-photo.placeholder p {
  margin-top: 10px;
  color: var(--muted);
}

.highlight-box {
  position: absolute;
  border: 3px solid var(--accent);
  border-radius: 16px;
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.28) inset;
  pointer-events: none;
}

.highlight-box span {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(252, 76, 2, 0.95);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  max-width: calc(100% - 16px);
}

.danger-button {
  border-color: rgba(220, 77, 77, 0.4);
  color: #ffd0d0;
}

@media (max-width: 720px) {
  .app-root {
    padding: 14px 12px 84px;
  }

  .stat-grid,
  .resource-grid,
  .setup-grid,
  .setup-card-list,
  .inventory-form-grid,
  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .record-item {
    flex-direction: column;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 721px) {
  .preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bike-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}
