:root {
  color-scheme: light;
  --sand: #f4efe6;
  --sand-strong: #e5d7c0;
  --forest: #1f3a2a;
  --forest-soft: #355944;
  --accent: #c96f3e;
  --accent-strong: #a84d27;
  --accent-fade: rgba(201, 111, 62, 0.14);
  --ink: #18201a;
  --muted: #607164;
  --line: rgba(24, 32, 26, 0.12);
  --white: #fffdf8;
  --danger: #b14b3d;
  --shadow: 0 24px 60px rgba(31, 58, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(201, 111, 62, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(31, 58, 42, 0.2), transparent 34%),
    linear-gradient(160deg, #d8ccb7 0%, #f3eee4 50%, #e8ddcc 100%);
  color: var(--ink);
}

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

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

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

.app-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.phone-frame {
  position: relative;
  width: min(100%, 430px);
}

.phone-glow {
  position: absolute;
  inset: 18px;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0));
  filter: blur(18px);
}

.app-screen {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 36px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  position: relative;
  padding: 24px 20px 18px;
  background:
    linear-gradient(145deg, rgba(31, 58, 42, 0.96), rgba(46, 82, 62, 0.9)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  color: var(--white);
}

.hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -36px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 111, 62, 0.5), transparent 70%);
}

.hero__top,
.hero__content,
.section-heading,
.timeline__header,
.status-bar,
.inline-fields,
.action-row,
.history-card,
.hunter-card,
.hunter-card__select,
.hunter-card__actions {
  display: flex;
}

.hero__top,
.hero__content,
.section-heading,
.timeline__header,
.status-bar,
.history-card {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero__content {
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

.hero h1,
.hero h2,
.section-heading h3,
.timeline__header h4 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.05;
}

.hero h1 {
  font-size: 2rem;
}

.hero h2 {
  margin-top: 6px;
  font-size: 1.65rem;
}

.hero__label,
.hero__meta,
.timeline__item p,
.summary-card small,
.empty-state {
  margin: 0;
}

.hero__label {
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(255, 253, 248, 0.72);
}

.hero__meta {
  margin-top: 8px;
  max-width: 24ch;
  color: rgba(255, 253, 248, 0.82);
}

.hero__stats {
  display: grid;
  gap: 12px;
  min-width: 132px;
}

.hero__stats article {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero__stats span,
.summary-card span,
.timeline__header small,
.timeline__time {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__stats strong,
.summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.ghost-button,
.primary-button,
.secondary-button,
.mini-button,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
}

.ghost-button {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ghost-button--dark {
  color: var(--forest);
  border-color: rgba(31, 58, 42, 0.12);
  background: rgba(31, 58, 42, 0.06);
}

.status-bar {
  padding: 12px 16px 0;
}

.status-pill {
  padding: 8px 10px;
  background: rgba(31, 58, 42, 0.08);
  color: var(--forest-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.status-pill--offline {
  background: rgba(177, 75, 61, 0.12);
  color: var(--danger);
}

.status-pill--soft {
  background: rgba(201, 111, 62, 0.12);
  color: var(--accent-strong);
}

.segmented-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 16px 0;
  padding: 6px;
  border-radius: 18px;
  background: rgba(31, 58, 42, 0.06);
}

.segmented-nav__item {
  min-height: 42px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 800;
}

.segmented-nav__item.is-active {
  background: var(--white);
  color: var(--forest);
  box-shadow: 0 8px 22px rgba(31, 58, 42, 0.1);
}

.panel-stack {
  padding: 18px 16px 24px;
}

.panel {
  display: none;
  animation: rise-in 220ms ease;
}

.panel.is-active {
  display: block;
}

.editor-card,
.timeline,
.summary-card {
  border: 1px solid rgba(31, 58, 42, 0.08);
  background: rgba(255, 253, 248, 0.9);
}

.editor-card,
.timeline {
  padding: 18px;
  border-radius: 26px;
}

.editor-card + .editor-card,
.editor-card + .timeline,
.timeline + .editor-card {
  margin-top: 18px;
}

.editor-card--tight {
  padding-top: 16px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h3 {
  font-size: 1.45rem;
}

.hero__top {
  align-items: center;
}

.stack-form,
.capture-form,
.hunter-list,
.summary-grid,
.timeline__list,
.history-list {
  display: grid;
  gap: 14px;
}

.stack-form label,
.capture-form label {
  display: grid;
  gap: 10px;
}

.stack-form span,
.capture-form span {
  font-weight: 800;
}

.inline-fields {
  gap: 12px;
}

.inline-fields--history {
  margin-top: 14px;
}

.inline-fields > label {
  flex: 1;
}

.action-row {
  gap: 10px;
  align-items: center;
}

.action-row > * {
  flex: 1;
}

.primary-button {
  min-height: 54px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--white);
  box-shadow: 0 18px 30px rgba(201, 111, 62, 0.22);
}

.secondary-button {
  min-height: 54px;
  background: rgba(31, 58, 42, 0.08);
  color: var(--forest);
}

.secondary-button--danger {
  background: rgba(177, 75, 61, 0.12);
  color: var(--danger);
}

.hunter-card {
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: var(--sand);
  border: 1px solid transparent;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.hunter-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(31, 58, 42, 0.18);
  box-shadow: 0 16px 30px rgba(31, 58, 42, 0.12);
}

.hunter-card__select {
  width: 100%;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.hunter-card__avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--white);
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}

.hunter-card__avatar img,
.image-preview img,
.timeline__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hunter-card__info {
  display: grid;
  gap: 3px;
  flex: 1;
}

.hunter-card__info strong,
.timeline__item strong,
.history-card strong {
  font-size: 0.98rem;
}

.hunter-card__info small,
.timeline__item p,
.history-card small,
.empty-state {
  color: var(--muted);
}

.hunter-card__badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(31, 58, 42, 0.08);
  color: var(--forest-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.hunter-card__actions {
  gap: 8px;
  width: 100%;
}

.mini-button {
  min-height: 38px;
  padding: 0 12px;
  background: rgba(31, 58, 42, 0.08);
  color: var(--forest);
  flex: 1;
}

.mini-button--danger {
  background: rgba(177, 75, 61, 0.12);
  color: var(--danger);
}

.empty-state {
  padding: 10px 4px 0;
  line-height: 1.5;
}

.form-feedback {
  margin: 0;
  color: var(--forest-soft);
  font-weight: 700;
}

.image-preview {
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(31, 58, 42, 0.12);
  background: var(--sand);
}

.image-preview--wide {
  width: 100%;
  height: 168px;
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.animal-chip {
  min-height: 52px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(31, 58, 42, 0.06);
  color: var(--forest-soft);
  font-weight: 800;
  border: 1px solid transparent;
}

.animal-chip.is-selected {
  background: var(--accent-fade);
  border-color: rgba(201, 111, 62, 0.3);
  color: var(--accent-strong);
}

.stepper {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}

.stepper__button {
  height: 100%;
  background: rgba(31, 58, 42, 0.06);
  color: var(--forest);
  font-size: 1.35rem;
  font-weight: 700;
}

.stepper input {
  min-height: 52px;
  border: 0;
  text-align: center;
  background: transparent;
}

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

.summary-card {
  padding: 16px;
  border-radius: 22px;
  background: var(--sand);
}

.summary-card small {
  margin-top: 8px;
  line-height: 1.4;
  color: var(--muted);
}

.timeline__list {
  margin-top: 14px;
}

.timeline__item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline__time {
  padding-top: 3px;
  color: var(--accent-strong);
}

.timeline__item p {
  margin-top: 4px;
  line-height: 1.4;
}

.timeline__photo {
  display: block;
  width: 100%;
  max-width: 160px;
  height: 96px;
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(31, 58, 42, 0.08);
}

.history-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--sand);
  border: 1px solid rgba(31, 58, 42, 0.06);
  cursor: pointer;
}

.history-card.is-selected {
  border-color: rgba(31, 58, 42, 0.18);
  box-shadow: 0 14px 28px rgba(31, 58, 42, 0.1);
}

.history-card__meta {
  display: grid;
  gap: 4px;
}

.history-card__total {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(31, 58, 42, 0.08);
  color: var(--forest);
  font-weight: 800;
  white-space: nowrap;
}

.history-detail {
  margin-top: 16px;
}

.history-detail-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.95);
  border: 1px solid rgba(31, 58, 42, 0.08);
}

.history-detail-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.history-detail-card__title {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.3rem;
}

.history-detail-card__badge {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(201, 111, 62, 0.12);
  color: var(--accent-strong);
  font-weight: 800;
}

.history-detail-card__meta {
  margin: 10px 0 0;
  color: var(--muted);
}

.history-detail-card__summary,
.history-detail-card__hunters,
.history-detail-card__captures {
  margin-top: 16px;
}

.history-detail-card__hunters,
.history-detail-card__captures {
  display: grid;
  gap: 10px;
}

.history-detail-row {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--sand);
  border: 1px solid rgba(31, 58, 42, 0.06);
}

.history-detail-row strong,
.history-detail-row p {
  margin: 0;
}

.history-detail-row p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(31, 58, 42, 0.08);
  background: rgba(255, 250, 242, 0.9);
}

.bottom-nav__item {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 800;
}

.bottom-nav__item.is-active {
  color: var(--forest);
  background: rgba(31, 58, 42, 0.08);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 0;
  }

  .phone-frame,
  .app-screen {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
  }

  .phone-glow {
    display: none;
  }

  .inline-fields,
  .action-row--stack-mobile {
    flex-direction: column;
  }

  .action-row--stack-mobile > * {
    width: 100%;
  }
}
