* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --fill: rgba(255, 255, 255, 0.5);
  --fill-solid: #ffffff;
  --inset: rgba(120, 120, 128, 0.16);
  --line: rgba(255, 255, 255, 0.72);
  --line-strong: rgba(60, 60, 67, 0.24);
  --hairline: rgba(60, 60, 67, 0.1);
  --blue: #007aff;
  --blue-press: #0066d6;
  --red: #ff3b30;
  --green: #248a3d;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.07);
  --radius: 26px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --ink: #f5f5f7;
    --ink-2: #aeaeb2;
    --fill: rgba(28, 28, 30, 0.48);
    --fill-solid: #1c1c1e;
    --inset: rgba(118, 118, 128, 0.24);
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.22);
    --hairline: rgba(255, 255, 255, 0.1);
    --blue: #0a84ff;
    --blue-press: #409cff;
    --red: #ff453a;
    --green: #30d158;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--blue) 28%, transparent); }

button, input { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.glow {
  position: absolute;
  top: -28vmax;
  left: 50%;
  width: 78vmax;
  height: 54vmax;
  transform: translateX(-50%);
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.38;
  background: linear-gradient(120deg, #64a8ff, #8fd9c0);
}

.bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wash.has-photo .glow { display: none; }
.wash.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
}
body.has-photo { --fill: rgba(255, 255, 255, 0.4); }

@media (prefers-color-scheme: dark) {
  .wash {
    background: var(--bg);
  }
  .glow { opacity: 0.2; background: linear-gradient(120deg, #0a66cc, #167659); }
  .wash.has-photo::after { background: rgba(0, 0, 0, 0.22); }
  body.has-photo { --fill: rgba(22, 22, 24, 0.42); }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 54px;
  padding: 5px 7px 5px 18px;
  border-radius: 999px;
  background: var(--fill);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
}

h1 {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.bar-actions, #barActions { display: flex; align-items: center; }
#mainActions { margin-left: auto; }

.text-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--spring), transform 0.2s var(--spring);
}
.text-btn:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.text-btn:active { transform: scale(0.96); }

main { display: flex; flex-direction: column; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--line);
  backdrop-filter: blur(40px) saturate(1.85);
  -webkit-backdrop-filter: blur(40px) saturate(1.85);
  padding: 24px;
}

.eyebrow {
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.setup h2, .spend h2 {
  margin-top: 7px;
  font-size: 1.55rem;
  line-height: 1.18;
  letter-spacing: -0.035em;
}
.section-copy { margin-top: 9px; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.5; }
.amount-label { display: block; margin: 22px 2px 0; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.field-hint { margin: 8px 2px 0; color: var(--ink-2); font-size: 0.8125rem; }

.setup { animation: rise 0.45s var(--spring) both; }

.field {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--inset);
  border: 1px solid var(--hairline);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.amount-field { margin-top: 8px; min-height: 76px; }
.field:focus-within {
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  background: color-mix(in srgb, var(--blue) 8%, var(--inset));
}
.field-unit {
  color: var(--ink-2);
  font-size: 1.35rem;
  font-weight: 600;
}
.field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.field input::placeholder { color: color-mix(in srgb, var(--ink-2) 55%, transparent); font-weight: 500; }
.field.compact { margin-top: 0; min-height: 48px; flex: 1; }
.field.compact input { font-size: 1.125rem; }

.note {
  flex: 1.15;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--inset);
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.note:focus {
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  background: color-mix(in srgb, var(--blue) 8%, var(--inset));
}
.note::placeholder { color: color-mix(in srgb, var(--ink-2) 70%, transparent); }

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.chips {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
#quickChips { grid-template-columns: repeat(5, 1fr); }
#categoryChips { grid-template-columns: repeat(3, 1fr); }
.chip {
  min-height: 44px;
  padding: 0 8px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--inset);
  color: var(--ink);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.2s var(--spring), color 0.2s ease, transform 0.2s var(--spring), border-color 0.2s ease;
}
.chip:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.chip:active { transform: scale(0.96); }
.chip.active {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
}
#categoryChips .chip {
  border-color: color-mix(in srgb, var(--category-color) 38%, transparent);
  background: color-mix(in srgb, var(--category-color) 17%, transparent);
  color: color-mix(in srgb, var(--category-color) 76%, var(--ink));
  font-weight: 600;
}
#categoryChips .chip:hover { background: color-mix(in srgb, var(--category-color) 25%, transparent); }
#categoryChips .chip.active {
  border-color: transparent;
  background: var(--category-color);
  color: var(--category-ink, #fff);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--category-color) 26%, transparent);
}

.error {
  min-height: 1.25em;
  margin: 10px 2px 0;
  color: var(--red);
  font-size: 0.8125rem;
}
.error.shake { animation: shake 0.36s var(--spring); }

.primary, .secondary {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border: none;
  border-radius: 15px;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--spring), background 0.18s ease, filter 0.18s ease;
}
.primary {
  background: var(--blue);
  color: #fff;
}
.primary:hover { background: var(--blue-press); }
.primary:active, .secondary:active { transform: scale(0.97); }
.secondary {
  background: var(--inset);
  color: var(--ink);
}
.primary:disabled { cursor: not-allowed; }

.hero { position: relative; overflow: hidden; animation: rise 0.5s var(--spring) both; }
.hero::after {
  content: "";
  position: absolute;
  inset: auto -70px -110px auto;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 9%, transparent);
  pointer-events: none;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--inset);
  color: var(--ink-2);
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pill.bad { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }

.balance {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  font-weight: 650;
  font-size: clamp(3rem, 14vw, 4.2rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.balance .dec {
  font-size: 0.46em;
  font-weight: 550;
  color: var(--ink-2);
  letter-spacing: -0.03em;
}
.balance.negative { color: var(--red); }
.balance.negative .dec { color: color-mix(in srgb, var(--red) 70%, var(--ink-2)); }
.balance.bump { animation: bump 0.42s var(--spring); }

.rate {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.track {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  height: 6px;
  border-radius: 999px;
  background: var(--inset);
  overflow: hidden;
}
.track-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.25s linear;
}

.meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.pair {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.pair div { display: flex; flex-direction: column; gap: 2px; }
.pair span { color: var(--ink-2); font-size: 0.8125rem; }
.pair strong {
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pair .out { color: var(--red); }
.pair .income { color: var(--green); }

.spend { animation: rise 0.55s var(--spring) 0.05s both; }
.spend-row { display: flex; gap: 8px; margin-top: 18px; }

.entry-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  border-radius: 14px;
  background: var(--inset);
}
.entry-switch button {
  min-height: 40px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--spring), color 0.2s ease, box-shadow 0.2s ease;
}
.entry-switch button.active {
  background: color-mix(in srgb, var(--fill-solid) 82%, transparent);
  color: var(--ink);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.08);
}
.spend.income-mode #entrySubmit { background: var(--green); }
.spend.income-mode .field:focus-within,
.spend.income-mode .note:focus { border-color: color-mix(in srgb, var(--green) 58%, transparent); }

.list { list-style: none; margin-top: 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
}
.item.is-new { animation: rise 0.35s var(--spring) both; }
.tag {
  flex-shrink: 0;
  min-width: 40px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--inset);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
}
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item-name {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-time { color: var(--ink-2); font-size: 0.75rem; }
.item-amt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--red);
  letter-spacing: -0.02em;
}
.item.income .tag { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.item.income .item-amt { color: var(--green); }
.del {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s var(--spring);
}
.del:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.del:active { transform: scale(0.92); }

.empty {
  text-align: center;
  color: var(--ink-2);
  font-size: 0.9375rem;
  padding: 18px 0 4px;
}

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade 0.25s ease;
}
.sheet {
  width: min(100%, 440px);
  border-radius: 28px;
  background: var(--fill);
  backdrop-filter: blur(32px) saturate(1.55);
  -webkit-backdrop-filter: blur(32px) saturate(1.55);
  animation: sheet 0.42s var(--spring);
}
.sheet h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.sheet .field { margin-top: 16px; }
.bg-frame {
  margin-top: 16px;
  height: 168px;
  border-radius: 18px;
  background: var(--inset) center / cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 0.9375rem;
  overflow: hidden;
}
.bg-frame.has-image span { display: none; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .primary,
.sheet-actions .secondary { margin-top: 0; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes sheet {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
}

@media (max-width: 420px) {
  .spend-row { flex-direction: column; }
  .note { min-height: 48px; }
}

.back { margin-left: -6px; }

.bill-total {
  margin-top: 8px;
  font-weight: 650;
  font-size: clamp(2.5rem, 12vw, 3.25rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.bill-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-btn {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.export-btn:active { transform: scale(0.96); }
.bill-income { margin-top: 14px; color: var(--ink-2); font-size: 0.875rem; }
.bill-income strong { margin-left: 6px; color: var(--green); font-variant-numeric: tabular-nums; }

.pie-box {
  display: grid;
  place-items: center;
  margin: 8px 0 4px;
}
#billPie { width: 196px; height: 196px; overflow: visible; outline: none; }
#billPie .slice {
  cursor: pointer;
  transform-box: view-box;
  transform-origin: center;
  outline: none;
  animation: pie-fade-in 0.7s var(--spring) both;
  animation-delay: calc(var(--slice-index, 0) * 70ms);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}
#billPie .slice > * {
  transform-box: fill-box;
  transform-origin: center;
  animation: pie-in 0.7s var(--spring) both;
  animation-delay: calc(var(--slice-index, 0) * 70ms);
}
#billPie .slice:focus,
#billPie .slice:focus-visible { outline: none; }
#billPie.has-hot .slice { opacity: 0.38; }
#billPie.has-hot .slice.is-hot {
  opacity: 1;
  transform: scale(1.12);
}
.pie-empty { transform-box: fill-box; transform-origin: center; animation: pie-in 0.65s var(--spring) both; }

@keyframes pie-in {
  from { opacity: 0; transform: scale(0.68) rotate(-7deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes pie-fade-in { from { opacity: 0; } to { opacity: 1; } }

.legend { list-style: none; }
.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0 -8px;
  padding: 0 8px;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  transition: background 0.45s ease;
}
.legend li:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.legend li.is-hot {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.list .item.is-hot {
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend .name { flex: 1; min-width: 0; }
.legend .pct {
  color: var(--ink-2);
  font-size: 0.8125rem;
  min-width: 3.2em;
  text-align: right;
}
.legend .amt { font-weight: 600; letter-spacing: -0.02em; }

#billView { padding-bottom: 92px; }
#billView .panel { animation: rise 0.45s var(--spring) both; }
#billView .panel:nth-child(2) { animation-delay: 0.06s; }

.share-dock {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(408px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 10px;
  border-radius: 22px;
  background: var(--fill);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 var(--line);
  backdrop-filter: blur(40px) saturate(1.85);
  -webkit-backdrop-filter: blur(40px) saturate(1.85);
  animation: dock-in 0.5s var(--spring) 0.18s both;
}
.share-dock .primary { margin-top: 0; }

@keyframes dock-in {
  from { opacity: 0; transform: translateX(-50%) translateY(28px) scale(0.98); }
  to { opacity: 1; transform: translateX(-50%); }
}

@media (prefers-reduced-transparency: reduce) {
  .bar, .panel, .sheet, .share-dock {
    background: var(--fill-solid);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .sheet-mask { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .bar, .panel, .chip, .field, .note {
    border-color: var(--line-strong);
  }
  .pair { border-top-color: var(--line-strong); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.brand { display: flex; align-items: center; gap: 10px; }
.cloud-status { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 0.6875rem; }
.cloud-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); opacity: 0.45; }
.cloud-status.online .cloud-dot { background: var(--green); opacity: 1; }
.cloud-status.busy .cloud-dot { background: #ff9f0a; opacity: 1; }
.auth-card { margin-top: clamp(24px, 7vh, 72px); animation: rise 0.45s var(--spring) both; }
.app-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  border-radius: 17px;
  background: linear-gradient(145deg, #2489ff, #0066cc);
  color: #fff;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--blue) 28%, transparent);
  font-size: 1.75rem;
  font-weight: 650;
}
.auth-card h2, .notice h2 { margin-top: 8px; font-size: 2rem; line-height: 1.1; letter-spacing: -0.045em; }
.auth-copy, .notice p:last-child { margin-top: 8px; color: var(--ink-2); line-height: 1.55; }
.plain-field { display: grid; gap: 6px; margin-top: 14px; }
.plain-field span { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.plain-field input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid transparent; border-radius: 16px; background: var(--inset); color: var(--ink); font-size: 1rem; outline: none; }
.plain-field input:focus { border-color: color-mix(in srgb, var(--blue) 55%, transparent); }
.wide { margin-top: 10px; }
.account-email { margin: 8px 0 2px; color: var(--ink-2); font-size: 0.875rem; word-break: break-all; }
.profile-actions { display: flex; gap: 10px; }
.profile-actions .secondary { flex: 1; }
.secondary.danger { color: var(--red); }
.notice code { padding: 2px 5px; border-radius: 6px; background: var(--inset); }
button:disabled { cursor: wait; filter: grayscale(0.4); opacity: 0.62; }

@media (min-width: 780px) {
  .app { max-width: 920px; padding-left: 24px; padding-right: 24px; }
  .bar { align-self: center; width: min(100%, 872px); }
  #dashboard, #billView { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr); align-items: start; gap: 18px; }
  #dashboard[hidden], #billView[hidden] { display: none; }
  .auth-card, .setup, .notice { width: 440px; margin-left: auto; margin-right: auto; }
  .hero { position: sticky; top: 84px; }
  .balance { font-size: clamp(3.2rem, 6.2vw, 4.5rem); }
}

@media (max-width: 390px) {
  .panel { padding: 21px 18px; }
  #quickChips { grid-template-columns: repeat(3, 1fr); }
  .cloud-status span:last-child { display: none; }
}
