body {
  background: #EAEFF6;
}

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

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 50% 0, rgba(26, 109, 245, 0.12), transparent 34%),
    var(--bg);
}

.auth-card,
.app {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(11, 79, 214, 0.14);
}

.auth-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px 20px 24px;
  background: var(--card);
}

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

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

.brand-eq {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.brand-x {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.brand-partner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-d);
  font-size: 14px;
  font-weight: 800;
}

.brand-check {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--green);
}

.brand-check svg {
  width: 11px;
  height: 11px;
}

.auth-bonus {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  border-radius: 22px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-d) 72%, var(--primary-deep));
  box-shadow: var(--shadow-blue);
}

.auth-bonus::after {
  position: absolute;
  right: -26px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  content: "";
}

.auth-bonus span,
.auth-bonus small {
  display: block;
  color: #CFE0FF;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.auth-bonus strong {
  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(--line);
  border-radius: 12px;
  padding: 14px;
  color: var(--ink);
  background: var(--card);
  font-size: 16px;
  outline: none;
}

.field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26, 109, 245, 0.12);
}

.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(--primary-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(--primary);
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 13px;
  padding: 15px 22px;
  color: #fff;
  background: var(--primary);
  box-shadow: var(--shadow-blue);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  transition: background 0.15s, transform 0.08s;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-d);
}

.btn:active {
  transform: scale(0.98);
}

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

.btn.ghost {
  border: 1.5px solid var(--primary);
  color: var(--primary-d);
  background: var(--card);
  box-shadow: none;
}

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

.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: 1px solid var(--line);
  padding: 10px 18px;
  background: rgba(255, 255, 255, 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 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.sec-title {
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.balcard {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 22px 22px 20px;
  color: #fff;
  background: linear-gradient(150deg, var(--primary), var(--primary-d) 75%, var(--primary-deep));
  box-shadow: var(--shadow-blue);
}

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

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

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

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

.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;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 10px;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.qbtn:active {
  transform: scale(0.98);
}

.qbtn .qi {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--primary-d);
  background: #EAF1FF;
  font-size: 20px;
}

.card,
.taskcard {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.card {
  margin-bottom: 14px;
}

.taskcard {
  margin-bottom: 11px;
}

.taskcard.done {
  background: #F2F6FB;
}

.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-radius: 12px;
  color: var(--primary-d);
  background: #EAF1FF;
  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-radius: 999px;
  padding: 5px 11px;
  color: var(--primary-d);
  background: #EAF1FF;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.badge.warn {
  color: var(--danger);
  background: var(--danger-soft);
}

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

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

.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: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  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;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 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;
  gap: 2px;
  border: 0;
  padding: 9px 0 11px;
  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(--primary-d);
}

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

.toast {
  position: fixed;
  bottom: 108px;
  left: 50%;
  z-index: 60;
  max-width: 88%;
  border-radius: 22px;
  padding: 11px 18px;
  color: #fff;
  background: var(--primary-deep);
  box-shadow: 0 8px 24px rgba(3, 24, 70, 0.35);
  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(10, 42, 102, 0.5);
}

.modal {
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  padding: 22px;
  background: var(--card);
  box-shadow: 0 20px 70px rgba(10, 42, 102, 0.22);
}

.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) {
  body {
    background: #EAEFF6;
  }

  .auth-card {
    max-width: 430px;
  }

  .app {
    max-width: 1080px;
    flex-direction: row;
    align-items: stretch;
  }

  .appnav {
    position: static;
    flex: none;
    flex-direction: column;
    width: 236px;
    max-width: none;
    border-top: 0;
    border-right: 1px solid var(--line);
    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: 4px;
  }

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

  .tab:hover,
  .tab.active {
    background: #EAF1FF;
  }

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

  .abar {
    display: none;
  }

  .scr {
    padding: 32px 36px;
  }

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