:root {
  color-scheme: dark;
  --bg: #0f1110;
  --bg-strong: #17130f;
  --surface: #211b15;
  --surface-soft: #2b241d;
  --surface-raised: #342a20;
  --text: #f7edd8;
  --muted: #c9bfae;
  --dim: #8e8374;
  --line: rgba(247, 237, 216, 0.16);
  --gold: #e2b65f;
  --gold-strong: #f3cf7a;
  --red: #b6463f;
  --red-soft: #6f2e31;
  --teal: #82d5c2;
  --green: #7ac084;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8e0d2;
  --bg-strong: #d3c4ad;
  --surface: #fff8ec;
  --surface-soft: #f3eadb;
  --surface-raised: #eadcc7;
  --text: #211b15;
  --muted: #5f5244;
  --dim: #837361;
  --line: rgba(39, 28, 17, 0.16);
  --gold: #a36d17;
  --gold-strong: #7a4d0e;
  --red: #9f3934;
  --red-soft: #f1d0cc;
  --teal: #197d72;
  --green: #2f7d3f;
  --shadow: 0 24px 72px rgba(72, 47, 20, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(130, 213, 194, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(182, 70, 63, 0.18), transparent 40%),
    linear-gradient(180deg, var(--bg-strong), var(--bg));
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.028) 0,
      rgba(255, 255, 255, 0.028) 1px,
      transparent 1px,
      transparent 92px
    ),
    transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 112px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 24px rgba(226, 182, 95, 0.26));
}

.eyebrow,
.progress-copy p,
.region-header p,
.summary-strip p,
.sync-note,
.boss-copy p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: 2.25rem;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-button,
.primary-action,
.ghost-action,
.segment,
.boss-check {
  border: 1px solid var(--line);
  cursor: pointer;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-action {
  border-color: rgba(226, 182, 95, 0.48);
  color: #21170b;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  box-shadow: 0 14px 34px rgba(226, 182, 95, 0.22);
}

.ghost-action {
  color: var(--text);
  background: var(--surface-soft);
}

.ghost-action.danger {
  color: var(--red);
}

.command-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(226, 182, 95, 0.12), transparent 42%),
    color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.progress-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
}

.progress-copy h2 {
  margin-top: 5px;
  font-size: 1.45rem;
}

.progress-ring {
  --progress: 0%;
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 55%, transparent 56%),
    conic-gradient(var(--gold) var(--progress), rgba(255, 255, 255, 0.12) 0);
}

.progress-ring span {
  color: var(--gold-strong);
  font-size: 1.1rem;
  font-weight: 900;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 0.8fr);
  gap: 12px;
  margin-top: 14px;
}

.search-field,
.select-field {
  display: grid;
  gap: 7px;
}

.search-field span,
.select-field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-soft);
  outline: none;
}

input {
  padding: 0 14px;
}

select {
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 42%, transparent);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
}

.segmented[aria-label="Progress filter"] {
  grid-template-columns: repeat(3, 1fr);
}

.segment {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 800;
}

.segment.is-active {
  color: #21170b;
  border-color: transparent;
  background: var(--gold);
}

.utility-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 46px;
  margin-top: 14px;
}

.sync-note {
  margin-left: auto;
  font-size: 0.9rem;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.summary-strip > div {
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.summary-strip span {
  display: block;
  color: var(--teal);
  font-size: 1.7rem;
  font-weight: 900;
}

.summary-strip p {
  margin-top: 6px;
  font-size: 0.9rem;
}

.region-stack {
  display: grid;
  gap: 16px;
}

.region-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.region-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(226, 182, 95, 0.14), transparent),
    color-mix(in srgb, var(--surface-raised) 68%, transparent);
}

.region-header h2 {
  font-size: 1.2rem;
}

.region-header p {
  margin-top: 5px;
  font-size: 0.9rem;
}

.region-progress {
  display: grid;
  min-width: 54px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(226, 182, 95, 0.38);
  border-radius: 999px;
  color: var(--gold-strong);
  font-weight: 900;
}

.boss-list {
  display: grid;
}

.boss-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.boss-row:last-child {
  border-bottom: 0;
}

.boss-row.slain {
  background: color-mix(in srgb, var(--green) 11%, transparent);
}

.boss-check {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #10120f;
  background: transparent;
  font-weight: 900;
}

.boss-check[aria-pressed="true"] {
  border-color: transparent;
  background: var(--green);
}

.boss-copy {
  min-width: 0;
}

.boss-copy h3 {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.boss-copy p {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.boss-row.slain .boss-copy {
  opacity: 0.62;
}

.boss-row.slain h3 {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.boss-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 280px;
}

.time-pill,
.region-pill {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.time-pill.night {
  color: #f1d7e0;
  border-color: color-mix(in srgb, var(--red) 56%, transparent);
  background: color-mix(in srgb, var(--red-soft) 72%, transparent);
}

.time-pill.day {
  color: var(--gold-strong);
}

.empty-state {
  margin-top: 28px;
  padding: 48px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.empty-state img {
  width: 74px;
  height: 74px;
}

.empty-state h2 {
  margin-top: 10px;
}

.empty-state p {
  max-width: 430px;
  margin: 8px auto 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .sync-note {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
  }

  .masthead-actions,
  .utility-row {
    width: 100%;
  }

  .primary-action,
  .ghost-action {
    flex: 1 1 auto;
  }

  .progress-panel,
  .region-header,
  .boss-row {
    padding: 14px;
  }

  .progress-panel {
    grid-template-columns: 1fr;
  }

  .progress-ring {
    width: 78px;
    height: 78px;
  }

  .segmented,
  .segmented[aria-label="Progress filter"] {
    grid-template-columns: 1fr 1fr;
  }

  .boss-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .boss-meta {
    grid-column: 2;
    justify-content: flex-start;
    max-width: none;
  }
}
