body {
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 200, 75, 0.28), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(232, 98, 62, 0.18), transparent 24%),
    var(--bg);
}

.auth-page,
.app {
  min-height: 100vh;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card,
.app {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.auth-card {
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 24px;
  padding: 22px 20px 24px;
  background: var(--card);
  box-shadow: var(--shadow-ink);
}

.auth-card::before,
.auth-card::after {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  content: "";
}

.auth-card::before {
  top: -34px;
  right: -30px;
  width: 96px;
  height: 96px;
  border: 10px solid var(--gold-d);
  background: var(--gold);
  opacity: 0.3;
}

.auth-card::after {
  left: -26px;
  bottom: 90px;
  width: 54px;
  height: 54px;
  border: 7px solid var(--coral-d);
  background: var(--coral);
  opacity: 0.2;
}

.illustrated-brand,
.nav-logo,
.app-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.illustrated-brand {
  justify-content: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.brand-coin {
  display: inline-flex;
  flex: none;
}

.brand-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-bonus {
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  margin-bottom: 24px;
  padding: 18px;
  color: var(--gold);
  background: var(--ink);
  box-shadow: var(--shadow-ink-sm);
}

.auth-bonus::after {
  position: absolute;
  right: -26px;
  top: -30px;
  width: 118px;
  height: 118px;
  border: 12px solid var(--coral-d);
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.55;
  content: "";
}

.auth-bonus span,
.auth-bonus small {
  position: relative;
  z-index: 1;
  display: block;
  color: #F8E8B5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.auth-bonus strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 4px;
  font-size: 70px;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -3px;
}

.auth-form[hidden] {
  display: none;
}

.h1,
.page-h {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.7px;
}

.page-h {
  font-size: 24px;
}

.sub,
.page-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14.5px;
}

.sub b {
  color: var(--ink);
}

.lbl {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field {
  width: 100%;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-ink-sm);
  font-size: 16px;
  outline: none;
}

.field:focus {
  border-color: var(--coral);
  box-shadow: 2px 2px 0 var(--ink), 0 0 0 4px rgba(245, 200, 75, 0.35);
}

.code-field {
  letter-spacing: 0.28em;
  text-align: center;
}

.field[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field-error {
  min-height: 18px;
  margin-top: 5px;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 800;
}

.err {
  min-height: 20px;
  margin: 10px 0;
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 800;
  text-align: center;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.auth-consent-note {
  text-align: left;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--coral-d);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold);
}

.btn {
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 15px 22px;
  color: var(--ink);
  background: var(--gold);
  box-shadow: var(--shadow-ink);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
  cursor: pointer;
}

.btn:hover {
  background: #FFD45F;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-ink-sm);
}

.btn.block {
  display: block;
  width: 100%;
}

.btn.ghost {
  color: var(--ink);
  background: var(--card);
}

.btn.ghost:hover {
  background: #fff;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.btn + .btn {
  margin-top: 10px;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
}

.abar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1.5px solid var(--ink);
  padding: 10px 18px;
  background: rgba(255, 251, 241, 0.94);
  backdrop-filter: blur(10px);
}

.app-brand,
.nav-logo {
  font-size: 16px;
}

.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.scr {
  flex: 1;
  padding: 20px 20px 92px;
  background: var(--bg);
}

.cabinet-kicker,
.sec-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.cabinet-kicker {
  margin-bottom: 10px;
}

.sec-title {
  margin: 22px 0 10px;
}

.balcard {
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  padding: 22px 22px 20px;
  color: var(--gold);
  background: var(--ink);
  box-shadow: var(--shadow-ink);
}

.bc-label,
.bc-sub {
  color: #F8E8B5;
  font-size: 13px;
  font-weight: 700;
}

.bc-num {
  margin-top: 2px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 42px;
  font-weight: 800;
  font-feature-settings: "tnum";
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.bc-num small {
  margin-left: 6px;
  color: #F8E8B5;
  font-size: 17px;
  font-weight: 700;
}

.bc-deco {
  position: absolute;
  border: 4px solid var(--gold-d);
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.9;
}

.bc-d1 {
  top: -12px;
  right: -10px;
  width: 46px;
  height: 46px;
}

.bc-d2 {
  top: 30px;
  right: 34px;
  width: 26px;
  height: 26px;
}

.quick {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.qbtn {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 16px 10px;
  gap: 7px;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-ink-sm);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.qbtn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.qbtn .qi {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: var(--gold);
  font-size: 20px;
  font-weight: 800;
}

.card,
.taskcard {
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
  box-shadow: var(--shadow-ink-sm);
}

.card {
  margin-bottom: 14px;
}

.taskcard {
  margin-bottom: 11px;
}

.taskcard.done {
  background: #F7F0E0;
}

.tc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tc-ic {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: var(--gold);
  font-size: 20px;
  font-weight: 800;
}

.tc-body {
  flex: 1;
  min-width: 0;
}

.tc-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.tc-desc,
.card-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--ink);
  background: var(--gold);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.ok,
.taskcard.done .badge {
  color: var(--ink);
  background: var(--mint);
}

.badge.warn {
  color: var(--ink);
  background: #F3B09E;
}

.tc-foot {
  margin-top: 12px;
}

.taskcard.locked {
  opacity: 0.62;
  background: #F7F0E0;
}

.taskcard.locked .tc-ic {
  filter: grayscale(1);
}

.tc-lock {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.tc-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.btn.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.empty-state {
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: var(--card);
  box-shadow: var(--shadow-ink-sm);
  font-size: 14px;
  text-align: center;
}

.appnav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  width: 100%;
  max-width: 460px;
  border-top: 1.5px solid var(--ink);
  margin: 0 auto;
  background: rgba(255, 251, 241, 0.97);
  backdrop-filter: blur(10px);
}

.nav-logo,
.nav-exit {
  display: none;
}

.nav-items {
  display: flex;
  flex: 1;
}

.tab {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  border: 0;
  padding: 9px 0 11px;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.tab .ti {
  font-size: 21px;
  opacity: 0.55;
}

.tab.active {
  color: var(--coral-d);
}

.tab.active .ti {
  opacity: 1;
}

.toast {
  position: fixed;
  bottom: 108px;
  left: 50%;
  z-index: 60;
  max-width: 88%;
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  padding: 11px 18px;
  color: var(--gold);
  background: var(--ink);
  box-shadow: var(--shadow-ink);
  font-size: 13.5px;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 39, 66, 0.54);
}

.modal {
  width: 100%;
  max-width: 380px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  padding: 22px;
  background: var(--card);
  box-shadow: var(--shadow-ink);
}

.modal h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.msub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.form-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .auth-card {
    max-width: 430px;
  }

  .app {
    max-width: 1080px;
    flex-direction: row;
    align-items: stretch;
    border-right: 1.5px solid var(--ink);
    border-left: 1.5px solid var(--ink);
    box-shadow: var(--shadow-ink);
  }

  .appnav {
    position: static;
    flex: none;
    flex-direction: column;
    width: 236px;
    max-width: none;
    border-top: 0;
    border-right: 1.5px solid var(--ink);
    padding: 20px 14px;
    background: var(--card);
    backdrop-filter: none;
  }

  .nav-logo {
    display: flex;
    padding: 6px 10px 18px;
  }

  .nav-items {
    flex: none;
    flex-direction: column;
    gap: 6px;
  }

  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 11px 12px;
    gap: 11px;
    font-size: 14.5px;
  }

  .tab:hover,
  .tab.active {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--gold);
    box-shadow: var(--shadow-ink-sm);
  }

  .nav-exit {
    display: block;
    margin-top: auto;
  }

  .abar {
    display: none;
  }

  .scr {
    padding: 32px 36px;
  }

  .wgrid,
  .taskgrid,
  .spendgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 18px;
  }
}
