:root {
  --bg: #0a1017;
  --bg-deep: #121c28;
  --panel: rgba(16, 24, 34, 0.82);
  --panel-strong: #111924;
  --line: rgba(154, 181, 214, 0.14);
  --text: #e7eef7;
  --muted: #8ea0b8;
  --accent: #6dc5ff;
  --accent-strong: #c7ebff;
  --accent-soft: rgba(109, 197, 255, 0.16);
  --good: #44d39f;
  --warn: #ffb454;
  --danger: #ff7d7d;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(55, 102, 160, 0.26), transparent 26%),
    radial-gradient(circle at 80% 10%, rgba(109, 197, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #091019 0%, #0d1520 42%, #101924 100%);
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.5;
}

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

.hidden {
  display: none !important;
}

.page-shell {
  position: relative;
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.hero {
  display: block;
  margin-bottom: 28px;
}
.hero-panel,
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.04;
}

h1 {
  max-width: 10ch;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

h2 {
  font-size: clamp(1.55rem, 2vw, 2rem);
}

h3 {
  font-size: 1.08rem;
}

.workspace-hint,
.detail-description,
.narrative,
.empty-state p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions,
.workspace-row,
.detail-actions,
.calendar-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
}

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

.button-primary {
  background: linear-gradient(135deg, #2a6ea8 0%, #4bb4ff 100%);
  color: #eef8ff;
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.button-danger {
  background: rgba(255, 125, 125, 0.08);
  border-color: rgba(255, 125, 125, 0.18);
  color: var(--danger);
}

.button-block {
  width: 100%;
}

.workspace-card {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.subtle-note {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 18px;
}

.filter-chip.is-active {
  border-color: rgba(109, 197, 255, 0.45);
  background: rgba(109, 197, 255, 0.12);
}

.filter-input {
  max-width: 180px;
  min-height: 34px;
  padding: 10px 14px;
}

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

.metric-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.metric-card:hover,
.metric-card.is-active {
  transform: translateY(-1px);
  border-color: rgba(109, 197, 255, 0.38);
  background: rgba(109, 197, 255, 0.08);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.metric-value {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.45fr);
  gap: 28px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  padding: 24px;
}

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

.panel-head.compact {
  margin-bottom: 18px;
}

.form-stack,
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-stack {
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mood-field {
  margin: 0;
  padding: 0;
  border: 0;
}

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

.field-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.text-input,
.text-area,
.select-input {
  width: 100%;
  border: 1px solid rgba(154, 181, 214, 0.15);
  border-radius: 14px;
  background: rgba(3, 8, 15, 0.34);
  color: var(--text);
  padding: 14px 15px;
}

.text-area {
  resize: vertical;
}

.mood-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mood-option {
  position: relative;
}

.mood-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mood-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mood-option input:checked + span {
  border-color: rgba(109, 197, 255, 0.45);
  background: rgba(109, 197, 255, 0.12);
  color: var(--text);
}

.mood-option span:hover {
  transform: translateY(-1px);
}

.field-advanced {
  gap: 12px;
}

.advanced-toggle {
  align-self: flex-start;
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-picker label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
}

.streak-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.streak-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.streak-card:hover,
.streak-card.is-selected {
  transform: translateY(-1px);
  border-color: rgba(109, 197, 255, 0.4);
  background: rgba(109, 197, 255, 0.08);
}

.streak-card.is-archived {
  opacity: 0.78;
}

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

.streak-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.streak-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.streak-meta,
.streak-card footer,
.status-row,
.summary-columns,
.stats-band {
  display: grid;
  gap: 12px;
}

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

.status-row {
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: start;
  margin-top: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-chip.is-good {
  border-color: rgba(68, 211, 159, 0.24);
  background: rgba(68, 211, 159, 0.14);
  color: #c8ffe9;
}

.status-chip.is-warn {
  border-color: rgba(255, 180, 84, 0.26);
  background: rgba(255, 180, 84, 0.12);
  color: #ffe0ae;
}

.status-chip.is-muted {
  background: rgba(255, 255, 255, 0.025);
}

.streak-meta span,
.stats-band article span {
  color: var(--muted);
  font-size: 0.82rem;
}

.streak-meta strong,
.stats-band article strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.stats-band {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.stats-band article {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(109, 197, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.inset-panel {
  padding: 20px;
  background: rgba(255, 255, 255, 0.025);
}

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

.summary-list,
.checkin-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li,
.checkin-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.checkin-item-header,
.checkin-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.checkin-item p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.summary-list li + li,
.checkin-item + .checkin-item {
  margin-top: 10px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-day {
  min-height: 92px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.calendar-day:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 197, 255, 0.34);
}

.calendar-day.is-selected {
  border-color: rgba(109, 197, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(109, 197, 255, 0.22);
}

.calendar-day.is-expected {
  border-color: rgba(109, 197, 255, 0.16);
}

.calendar-day.is-complete {
  background: linear-gradient(180deg, rgba(68, 211, 159, 0.18), rgba(109, 197, 255, 0.08));
}

.calendar-day.is-faded {
  opacity: 0.45;
  cursor: default;
}

.calendar-day strong {
  font-size: 0.92rem;
}

.calendar-note {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.streak-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.empty-state {
  padding: 40px 18px;
  text-align: center;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 15, 0.7);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(620px, calc(100vw - 28px));
  margin: 6vh auto 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(12, 18, 27, 0.96);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(11, 16, 24, 0.96);
  color: #f2f7ff;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.toast.is-error {
  background: rgba(133, 35, 35, 0.95);
}

@media (max-width: 1180px) {
  .layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 40px;
  }

  .hero-copy,
  .modal-panel,
  .hero-panel,
  .panel {
    padding: 18px;
  }

  .field-grid,
  .summary-columns,
  .day-picker,
  .dashboard-grid,
  .stats-band,
  .streak-meta {
    grid-template-columns: 1fr;
  }

  .detail-header,
  .panel-head,
  .checkin-item-header,
  .streak-card-header {
    flex-direction: column;
  }
}
