* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #06020a;
  --card: rgba(24, 12, 34, 0.92);
  --card2: rgba(42, 18, 58, 0.72);
  --text: #fff7fb;
  --muted: #cdbfe0;
  --line: rgba(255, 255, 255, 0.13);
  --red: #ef4444;
  --purple: #8b5cf6;
  --green: #22c55e;
  --yellow: #facc15;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(127, 29, 29, 0.45), transparent 34%),
    radial-gradient(circle at top right, rgba(88, 28, 135, 0.42), transparent 38%),
    linear-gradient(180deg, #050008 0%, #13071b 55%, #050008 100%);
  color: var(--text);
}

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

.app {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 92px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 2px 10px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #fecdd3;
  font-weight: 900;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 8vw, 54px);
  line-height: 1.02;
  letter-spacing: -1.5px;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.icon-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-radius: 16px;
  min-width: 46px;
  min-height: 46px;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.card,
.hero-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card), rgba(10, 4, 16, 0.94));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.hero-card {
  border-color: rgba(239, 68, 68, 0.25);
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

label {
  display: block;
  margin-top: 13px;
  margin-bottom: 7px;
  color: #f5e9ff;
  font-weight: 900;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  outline: none;
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(3, 1, 8, 0.75);
  color: var(--text);
  margin-top: 10px;
}

textarea {
  resize: none;
  min-height: 54px;
  line-height: 1.5;
  overflow: hidden;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(239, 68, 68, 0.78);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.13);
}

.row,
.two {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.two > * {
  flex: 1;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  color: white;
  font-weight: 950;
  cursor: pointer;
  min-height: 46px;
}

.primary {
  background: linear-gradient(135deg, var(--red), #7c2d12);
}

.ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
}

.danger {
  background: rgba(127, 29, 29, 0.95);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-top: 14px;
}

.stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 25px;
}

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

.card-head h2 {
  margin: 0;
}

.card-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.list {
  display: grid;
  gap: 11px;
  margin-top: 13px;
}

.empty-box,
.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.item.done {
  opacity: 0.58;
}

.item-title {
  font-weight: 950;
  font-size: 16px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.item-body {
  margin-top: 8px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
}

.item-meta {
  margin-top: 9px;
  color: #ddd6fe;
  font-size: 12px;
  font-weight: 900;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.item-actions button {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 13px;
  font-size: 13px;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-weight: 950;
  white-space: nowrap;
}

.chip.active {
  color: white;
  background: rgba(239, 68, 68, 0.55);
  border-color: rgba(239, 68, 68, 0.75);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 18px));
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(8, 3, 13, 0.92);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.nav-btn {
  border: 0;
  border-radius: 17px;
  min-height: 46px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
}

.nav-btn.active {
  color: white;
  background: rgba(239, 68, 68, 0.55);
}

.data-count {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 99;
  max-width: calc(100% - 30px);
  padding: 13px 16px;
  border-radius: 999px;
  color: white;
  background: rgba(127, 29, 29, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  font-weight: 950;
}

.hidden {
  display: none !important;
}

@media (max-width: 620px) {
  .app {
    padding: 14px;
    padding-bottom: 92px;
  }

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

  .row,
  .two {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

  .nav-btn {
    font-size: 11px;
    min-height: 44px;
    padding: 0;
  }

  .item-actions button {
    width: 100%;
  }
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(127, 29, 29, 0.45), transparent 34%),
    radial-gradient(circle at top right, rgba(88, 28, 135, 0.42), transparent 38%),
    rgba(5, 0, 8, 0.98);
}

.lock-card {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, var(--card), rgba(10, 4, 16, 0.96));
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.55);
}

.lock-card .btn {
  width: 100%;
  margin-top: 10px;
}

.lock-hint,
.mini-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.progress-wrap {
  margin-top: 10px;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--purple));
}

