:root {
  color-scheme: dark;
  --bg: #04110d;
  --glass: rgba(9, 30, 23, 0.58);
  --glass-strong: rgba(14, 44, 34, 0.76);
  --line: rgba(184, 255, 211, 0.18);
  --line-bright: rgba(184, 255, 211, 0.38);
  --text: #edfdf2;
  --muted: #a9c9b8;
  --canopy: #0d3b28;
  --vine: #48c97c;
  --moss: #96d35f;
  --fern: #22b873;
  --orchid: #d16cff;
  --water: #4bd9d2;
  --amber: #efc66a;
  --danger: #ff6b6b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 5%, rgba(72, 201, 124, 0.18), transparent 28rem),
    radial-gradient(circle at 80% 0%, rgba(75, 217, 210, 0.14), transparent 26rem),
    linear-gradient(145deg, #020806 0%, #061912 48%, #020806 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

#canopy {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.58;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.panel-heading,
.date-chip,
.task-row,
.task-main,
.task-actions,
.tabs,
menu {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow,
.section-label {
  margin: 0 0 4px;
  color: var(--moss);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: 1.14rem;
}

.muted {
  color: var(--muted);
}

.date-chip,
.glass {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03)),
    var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.date-chip {
  min-height: 44px;
  gap: 10px;
  padding: 6px 7px 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.user-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 0.76rem;
}

.icon-button {
  width: auto;
  min-width: 52px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
}

.dashboard {
  display: grid;
  gap: 16px;
}

.auth-view,
.state-view {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  display: grid;
  gap: 18px;
  margin: 44px auto 0;
  padding: 24px;
  border-radius: 8px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

.status-line {
  min-height: 1.4em;
  margin-bottom: 0;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.hero {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  align-items: center;
  gap: 28px;
  padding: clamp(20px, 4vw, 44px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 17, 13, 0.78), transparent 62%),
    repeating-linear-gradient(115deg, transparent 0 23px, rgba(150, 211, 95, 0.04) 24px 25px);
  pointer-events: none;
}

.hero-copy,
.progress-orbit {
  position: relative;
  z-index: 1;
}

.hero h2 {
  max-width: 820px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 5.4vw, 5.6rem);
  line-height: 0.95;
}

.hero p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  font-size: 1.02rem;
}

.progress-orbit {
  width: 188px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.progress-orbit svg,
.orbit-center {
  grid-area: 1 / 1;
}

.progress-orbit svg {
  width: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 26px rgba(72, 201, 124, 0.18));
}

.orbit-track,
.orbit-fill {
  fill: none;
  stroke-width: 13;
}

.orbit-track {
  stroke: rgba(255, 255, 255, 0.12);
}

.orbit-fill {
  stroke: var(--vine);
  stroke-linecap: round;
  stroke-dasharray: 414.69;
  stroke-dashoffset: 414.69;
  transition: stroke-dashoffset 240ms ease;
}

.orbit-center {
  text-align: center;
}

.orbit-center strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
}

.orbit-center span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat,
.panel {
  border-radius: 8px;
}

.stat {
  padding: 18px;
}

.stat span,
.stat small {
  display: block;
  color: var(--muted);
}

.stat strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 1.75rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.45fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.primary-button,
.secondary-button,
.danger-button,
.tab {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
}

.primary-button {
  background: linear-gradient(135deg, var(--fern), #1b8e66);
  box-shadow: 0 12px 30px rgba(34, 184, 115, 0.22);
}

.secondary-button,
.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.danger-button {
  background: rgba(255, 107, 107, 0.14);
  color: #ffdede;
}

.tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.tab {
  min-height: 32px;
  padding: 0 10px;
}

.tab.active {
  background: rgba(72, 201, 124, 0.25);
  box-shadow: inset 0 0 0 1px rgba(184, 255, 211, 0.18);
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-row {
  min-height: 64px;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(1, 10, 7, 0.32);
}

.task-main {
  min-width: 0;
  gap: 12px;
}

.check {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  border: 1px solid var(--line-bright);
  color: transparent;
  background: rgba(255, 255, 255, 0.06);
}

.check::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 9px;
  width: 8px;
  height: 15px;
  border: solid #04110d;
  border-width: 0 3px 3px 0;
  opacity: 0;
  transform: rotate(42deg);
}

.task-row.done .check {
  color: #04110d;
  background: linear-gradient(135deg, var(--moss), var(--water));
}

.task-row.done .check::after {
  opacity: 1;
}

.task-title {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.task-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.task-actions {
  flex: 0 0 auto;
  gap: 6px;
}

.edit-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.chart-frame {
  position: relative;
  width: 100%;
  min-height: 320px;
}

#trendChart {
  display: block;
  width: 100%;
  height: 320px;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(30, minmax(18px, 1fr));
  gap: 6px;
}

.heat-day {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
}

dialog {
  width: min(430px, calc(100% - 32px));
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
}

.dialog-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.dialog-card input,
.dialog-card select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

menu {
  justify-content: end;
  gap: 8px;
  padding: 0;
  margin: 4px 0 0;
}

menu span {
  flex: 1;
}

@media (max-width: 920px) {
  .stats-grid,
  .workspace {
    grid-template-columns: 1fr 1fr;
  }

  .workspace {
    display: grid;
  }

  .workspace .panel {
    grid-column: 1 / -1;
  }

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

  .progress-orbit {
    width: 160px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1420px);
    padding-top: 14px;
  }

  .topbar,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero {
    min-height: 0;
    padding: 20px;
  }

  .hero h2 {
    font-size: 2.3rem;
  }

  .heatmap {
    grid-template-columns: repeat(10, 1fr);
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }
}
