:root {
  --bg: #f6efe4;
  --bg-strong: #f0e0c6;
  --surface: rgba(255, 249, 240, 0.82);
  --surface-strong: rgba(255, 250, 244, 0.95);
  --surface-border: rgba(78, 56, 40, 0.12);
  --text: #25160f;
  --muted: #6c5649;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.14);
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(77, 54, 30, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(224, 122, 95, 0.14), transparent 28rem),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.14), transparent 24rem),
    linear-gradient(180deg, var(--bg-strong), var(--bg));
}

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

.page-shell {
  padding: 32px 18px 48px;
}

.app {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.hero,
.panel,
.day-group,
.entry-card {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero,
.panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  display: grid;
  gap: 20px;
}

.eyebrow,
.meta-label,
.status-text,
.day-count,
.entry-date,
.entry-id,
.entry-time {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow,
.meta-label {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-copy h1,
.panel-head h2,
.day-title {
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.96;
  max-width: 12ch;
}

.hero-text {
  margin: 12px 0 0;
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.hero-meta strong {
  display: block;
  font-size: 1.2rem;
}

.refresh-button {
  justify-self: end;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  background: var(--text);
  color: #fff7f1;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.refresh-button:hover {
  transform: translateY(-1px);
}

.refresh-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.message-banner {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
}

.message-banner.error {
  border-color: rgba(180, 35, 24, 0.2);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.hidden {
  display: none;
}

.groups-root {
  display: grid;
  gap: 18px;
}

.day-group {
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 18px;
}

.day-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.day-title {
  font-size: 1.3rem;
}

.day-count {
  color: var(--muted);
  font-size: 0.76rem;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.location-groups,
.ungrouped-entry-grid {
  display: grid;
  gap: 14px;
}

.location-groups:empty,
.ungrouped-entry-grid:empty {
  display: none;
}

.location-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(78, 56, 40, 0.08);
  background: rgba(255, 253, 249, 0.72);
}

.location-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.location-group-title,
.location-group-count {
  margin: 0;
}

.location-group-title {
  font-size: 1rem;
}

.location-group-count {
  color: var(--muted);
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
}

.entry-card {
  background: #fffdf9;
  border: 1px solid rgba(78, 56, 40, 0.08);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

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

.entry-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.entry-time,
.entry-location,
.entry-date,
.entry-id {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.entry-card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.entry-id {
  word-break: break-all;
}

.entry-delete-button {
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.entry-delete-button:hover {
  transform: translateY(-1px);
  background: rgba(180, 35, 24, 0.14);
}

@media (max-width: 760px) {
  .page-shell {
    padding-inline: 12px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .refresh-button {
    justify-self: start;
  }

  .panel-head,
  .day-heading,
  .location-group-head,
  .entry-card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}
