:root {
  --bg: #08101f;
  --bg-2: #0f1930;
  --panel: rgba(19, 31, 56, 0.78);
  --panel-2: rgba(24, 38, 68, 0.9);
  --border: rgba(240, 201, 106, 0.14);
  --gold: #d4a63a;
  --gold-2: #f0c96a;
  --text: #f6f2e8;
  --muted: #9faecc;
  --danger: #de5b5b;
  --success: #56c38b;
  --amber: #d9a53f;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top right, rgba(212, 166, 58, 0.14), transparent 22%),
    radial-gradient(circle at top left, rgba(240, 201, 106, 0.06), transparent 18%),
    linear-gradient(180deg, #07101d 0%, #0a1325 40%, #091120 100%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

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

.app-shell {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 16px 110px;
}

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

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(240, 201, 106, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  background: #0d162a;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-text p {
  margin: 6px 0 0;
  color: var(--gold-2);
  font-weight: 600;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--gold-2);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.screen.active {
  display: flex;
}

.hero-card,
.panel,
.stat-card {
  background: linear-gradient(180deg, rgba(21, 33, 59, 0.88), rgba(14, 24, 46, 0.88));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero-left {
  flex: 1;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-2);
  font-weight: 700;
}

.hero-card h2,
.panel h3 {
  margin: 0;
  font-size: 1.35rem;
}

.hero-sub {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.progress-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.progress-ring {
  transform: rotate(-90deg);
}

.ring-bg,
.ring-progress {
  fill: none;
  stroke-width: 10;
}

.ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.ring-progress {
  stroke: url(#goldGradient);
  stroke: var(--gold-2);
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.45s ease;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-center span {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.ring-center small {
  color: var(--muted);
  margin-top: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-lg);
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 1.35rem;
  color: var(--text);
}

.panel {
  padding: 18px;
}

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

.mini-btn {
  border: 1px solid rgba(240, 201, 106, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-2);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.primary-btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: #101217;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 10px 24px rgba(212, 166, 58, 0.22);
}

.primary-btn:active {
  transform: translateY(1px);
}

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

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 14px;
}

.check-item-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.check-item-title {
  font-weight: 700;
}

.check-item-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.check-toggle {
  width: 24px;
  height: 24px;
  accent-color: var(--gold);
}

.form-grid,
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(240, 201, 106, 0.1);
  background: rgba(9, 16, 31, 0.78);
  color: var(--text);
  padding: 14px 14px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 92px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  color: var(--text);
}

.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
}

.result-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(3, 8, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 14px;
  color: #cdd6ea;
  font-size: 0.82rem;
  max-height: 240px;
  overflow: auto;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  text-align: center;
  padding: 16px 0;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.dot.green {
  background: var(--success);
}

.dot.amber {
  background: var(--amber);
}

.dot.red {
  background: var(--danger);
}

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

.calendar-day {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1px solid transparent;
  color: var(--text);
}

.calendar-day.valid {
  background: rgba(86, 195, 139, 0.18);
  border-color: rgba(86, 195, 139, 0.3);
}

.calendar-day.partial {
  background: rgba(217, 165, 63, 0.18);
  border-color: rgba(217, 165, 63, 0.28);
}

.calendar-day.failed {
  background: rgba(222, 91, 91, 0.16);
  border-color: rgba(222, 91, 91, 0.26);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(430px, calc(100vw - 18px));
  background: rgba(13, 20, 37, 0.94);
  border: 1px solid rgba(240, 201, 106, 0.1);
  border-radius: 22px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  padding: 12px 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(212, 166, 58, 0.18), rgba(240, 201, 106, 0.08));
  color: var(--gold-2);
}

@media (max-width: 420px) {
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-ring-wrap {
    align-self: center;
  }

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

  .brand-text h1 {
    font-size: 1.45rem;
  }

  .bottom-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .nav-btn {
    font-size: 0.72rem;
    padding: 10px 4px;
  }
}