:root {
  --bg: #06131b;
  --bg-alt: #0d1f2a;
  --panel: rgba(10, 28, 39, 0.78);
  --panel-strong: rgba(12, 34, 47, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf6f6;
  --muted: #8ea8b6;
  --primary: #f4a261;
  --secondary: #2a9d8f;
  --danger: #ef476f;
  --success: #63d471;
  --warning: #ffd166;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --heading-font: "Aptos Display", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --body-font: "Aptos", "Segoe UI", sans-serif;
}

body[data-theme="light"] {
  --bg: #f4efe8;
  --bg-alt: #ffffff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(13, 31, 42, 0.09);
  --text: #16313c;
  --muted: #5f7583;
  --shadow: 0 24px 60px rgba(55, 71, 79, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--body-font);
  background:
    radial-gradient(circle at top left, rgba(244, 162, 97, 0.18), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(42, 157, 143, 0.14), transparent 24%),
    linear-gradient(135deg, var(--bg), var(--bg-alt));
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.aurora,
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.aurora-one {
  background: radial-gradient(circle at 15% 10%, rgba(244, 162, 97, 0.16), transparent 22%);
  animation: drift 12s ease-in-out infinite alternate;
}

.aurora-two {
  background: radial-gradient(circle at 85% 20%, rgba(42, 157, 143, 0.12), transparent 24%);
  animation: drift 16s ease-in-out infinite alternate-reverse;
}

.noise {
  background-image: linear-gradient(transparent 50%, rgba(255, 255, 255, 0.02) 50%);
  background-size: 100% 4px;
  opacity: 0.1;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1600px, calc(100% - 32px));
  margin: 24px auto 40px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

.hero-card,
.panel,
.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  overflow: hidden;
}

.hero-card h1,
.panel h2,
.metric-headline,
.result-value {
  font-family: var(--heading-font);
  letter-spacing: -0.03em;
}

.eyebrow,
.panel-kicker,
.chip-label,
.chart-title {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.hero-copy,
.micro-copy {
  color: var(--muted);
  line-height: 1.6;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 6px;
}

.hero-logo {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  background: rgba(0, 0, 0, 0.24);
}

.hero-tags,
.hero-actions,
.quick-actions,
.report-actions,
.history-tools,
.module-toolbar,
.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.hero-tag-btn,
.glass-chip,
.summary-pill,
.planner-item,
.history-tag {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.hero-tags span,
.hero-tag-btn {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.hero-tag-btn {
  color: var(--text);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-actions {
  justify-content: flex-end;
  align-items: flex-start;
}

.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.chip-copy {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 220px;
  line-height: 1.35;
}

.status-chip {
  min-width: 180px;
  justify-content: center;
}

.install-chip {
  align-items: center;
  max-width: 100%;
}

.mobile-dock {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: none;
  gap: 10px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(8, 24, 34, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  z-index: 20;
}

.mobile-pane-tabs {
  display: none;
}

.mobile-pane-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  min-height: 42px;
  padding: 10px 14px;
  white-space: nowrap;
}

.mobile-pane-btn.active,
.dock-btn.active,
.calc-tab.active,
.hero-tag-btn.active {
  background: linear-gradient(135deg, rgba(244, 162, 97, 0.2), rgba(244, 162, 97, 0.32));
  border-color: rgba(244, 162, 97, 0.5);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(244, 162, 97, 0.16);
}

.calculator-panel .calc-tab.active {
  color: #1b2730;
}

.mobile-pane-block {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-view {
  background:
    radial-gradient(circle at top left, rgba(244, 162, 97, 0.08), transparent 24%),
    linear-gradient(180deg, #f8f4ec, #eef3f4 48%, #eef2f3);
  color: #1b2730;
}

.app-view .aurora,
.app-view .noise,
.app-view .hero-card,
.app-view #summaryGrid,
.app-view #quickBudgetPanel {
  display: none !important;
}

.app-view .app-shell {
  width: min(100% - 20px, 920px);
  margin: 10px auto 96px;
}

.app-view .workspace-grid,
.app-view .rail {
  display: block;
}

.app-view .mobile-pane-tabs {
  position: sticky;
  top: 10px;
  z-index: 22;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.app-view .mobile-pane-tabs::-webkit-scrollbar,
.app-view .mobile-dock::-webkit-scrollbar {
  display: none;
}

.app-view .mobile-pane-btn,
.app-view .dock-btn {
  border: 1px solid rgba(22, 49, 60, 0.14);
  background: rgba(255, 255, 255, 0.76);
  color: #20313b;
  box-shadow: 0 10px 24px rgba(18, 34, 45, 0.08);
}

.app-view .mobile-pane-btn.active,
.app-view .dock-btn.active,
.app-view .calc-tab.active,
.app-view .hero-tag-btn.active {
  background: #ece6ff;
  border-color: rgba(124, 92, 255, 0.22);
  color: #5f48d2;
  box-shadow: 0 12px 26px rgba(124, 92, 255, 0.14);
}

.app-view .mobile-pane-block {
  display: none;
}

.app-view .mobile-pane-block[data-pane="calc"] {
  display: block;
}

.app-view[data-mobile-pane="calc"] .mobile-pane-block[data-pane="calc"],
.app-view[data-mobile-pane="smart"] .mobile-pane-block[data-pane="smart"],
.app-view[data-mobile-pane="expenses"] .mobile-pane-block[data-pane="expenses"],
.app-view[data-mobile-pane="voice"] .mobile-pane-block[data-pane="voice"],
.app-view[data-mobile-pane="advisor"] .mobile-pane-block[data-pane="advisor"],
.app-view[data-mobile-pane="dashboard"] .mobile-pane-block[data-pane="dashboard"],
.app-view[data-mobile-pane="history"] .mobile-pane-block[data-pane="history"],
.app-view[data-mobile-pane="more"] .mobile-pane-block[data-pane="more"] {
  display: block;
}

.app-view .panel,
.app-view .summary-card {
  background: rgba(255, 255, 255, 0.86);
  color: #1b2730;
  border: 1px solid rgba(22, 49, 60, 0.08);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(26, 43, 54, 0.08);
  backdrop-filter: blur(12px);
}

.app-view .panel-head,
.app-view .history-head,
.app-view .history-foot,
.app-view .advisor-head {
  gap: 12px;
}

.app-view .panel-kicker,
.app-view .micro-copy,
.app-view .history-meta,
.app-view .chart-title {
  color: #6e7d87;
}

.app-view .panel h2,
.app-view .metric-headline,
.app-view .result-value,
.app-view .history-amount,
.app-view .advisor-item strong {
  color: #18242d;
}

.app-view .calculator-panel,
.app-view .analytics-panel,
.app-view .mobile-pane-block[data-pane="history"],
.app-view .mobile-pane-block[data-pane="advisor"],
.app-view .mobile-pane-block[data-pane="more"],
.app-view .mobile-pane-block[data-pane="expenses"],
.app-view .mobile-pane-block[data-pane="voice"],
.app-view .mobile-pane-block[data-pane="smart"] {
  max-width: 780px;
  margin: 0 auto 14px;
}

.app-view .calc-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.app-view .calc-tabs::-webkit-scrollbar {
  display: none;
}

.app-view .calc-tab {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(27, 39, 48, 0.12);
  color: #1b2730;
  white-space: nowrap;
}

.app-view .calculator-panel .expression-input,
.app-view select,
.app-view input,
.app-view textarea {
  background: rgba(255, 255, 255, 0.92);
  color: #1f2b34;
  border-color: rgba(31, 43, 52, 0.12);
}

.app-view .calculator-panel .result-card {
  background: rgba(255, 255, 255, 0.94);
}

.app-view .calc-mode-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app-view .calc-mode-chip {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 43, 52, 0.12);
  color: #1f2b34;
}

.app-view .calc-mode-chip.active {
  background: #7c5cff;
  color: #ffffff;
  border-color: #7c5cff;
}

.app-view .primary-btn {
  background: linear-gradient(135deg, #ffb97b, #ffa45e);
  color: #182229;
}

.app-view .ghost-btn,
.app-view .mini-btn {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(27, 39, 48, 0.12);
  color: #1b2730;
}

.app-view .keyboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.app-view .key-btn {
  min-height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 39, 48, 0.1);
  color: #1b2730;
  box-shadow: none;
}

.app-view .key-btn.shortcut,
.app-view .key-btn.shortcut-wide {
  background: #f3efff;
  color: #5f48d2;
  border-color: rgba(124, 92, 255, 0.16);
}

.app-view .key-btn.operator,
.app-view .key-btn.equals {
  background: rgba(245, 240, 255, 0.96);
  color: #5f48d2;
  border-color: rgba(124, 92, 255, 0.18);
}

.app-view .analytics-grid,
.app-view .chart-stack,
.app-view .history-tools,
.app-view .report-actions,
.app-view .admin-form,
.app-view .quick-actions,
.app-view .module-toolbar,
.app-view .two-col {
  gap: 10px;
}

.app-view .mobile-dock {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  width: min(calc(100% - 20px), 760px);
  justify-content: space-between;
  padding: 8px;
  gap: 6px;
  overflow-x: auto;
  border-radius: 999px;
  background: rgba(248, 244, 236, 0.92);
  border: 1px solid rgba(22, 49, 60, 0.08);
  box-shadow: 0 18px 40px rgba(26, 43, 54, 0.12);
  backdrop-filter: blur(14px);
  z-index: 30;
}

.app-view .dock-btn {
  flex: 1 0 auto;
  min-width: 74px;
  padding: 12px 10px;
}

.dock-btn {
  min-width: 74px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
}

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

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea {
  color-scheme: dark;
}

body[data-theme="light"] input,
body[data-theme="light"] textarea {
  color-scheme: light;
}

select {
  background: #f7f8fa;
  color: #16313c;
  border-color: rgba(22, 49, 60, 0.16);
  -webkit-text-fill-color: #16313c;
  color-scheme: light;
  font-weight: 600;
}

select:focus {
  border-color: rgba(244, 162, 97, 0.9);
}

option,
optgroup {
  color: #16313c;
  background: #ffffff;
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(244, 162, 97, 0.7);
  box-shadow: 0 0 0 3px rgba(244, 162, 97, 0.12);
  transform: translateY(-1px);
}

button {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  transform: translateY(-2px) scale(1.01);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), #ffbf86);
  color: #182229;
  font-weight: 700;
  box-shadow: 0 16px 28px rgba(244, 162, 97, 0.25);
}

.ghost-btn,
.mini-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.mini-btn {
  padding: 8px 12px;
  border-radius: 999px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.quick-budget-panel {
  margin-bottom: 18px;
}

.quick-budget-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-budget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.summary-card {
  border-radius: 24px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  animation: floatUp 0.8s ease both;
}

.summary-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.summary-edit-btn {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -50% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 162, 97, 0.24), transparent 65%);
}

.summary-value {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  margin: 6px 0 12px;
}

.summary-pill {
  display: inline-flex;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.1fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.rail {
  display: grid;
  gap: 18px;
}

.panel {
  border-radius: 28px;
  padding: 22px;
  animation: floatUp 0.9s ease both;
}

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

.panel h2 {
  margin: 0;
  font-size: 1.35rem;
}

.calculator-panel {
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(247, 240, 228, 0.93));
  color: #1f2b34;
  border-color: rgba(30, 45, 56, 0.1);
}

.calculator-panel .panel-kicker,
.calculator-panel .micro-copy,
.calculator-panel #resultInsight {
  color: #6f7b84;
}

.calculator-panel h2,
.calculator-panel .result-value,
.calculator-panel .calc-tab,
.calculator-panel .calc-mode-chip {
  color: #1b2730;
}

.calc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.calc-tab,
.calc-mode-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 43, 52, 0.14);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.calc-tab.active,
.hero-tag-btn.active,
.dock-btn.active,
.calc-mode-chip.active {
  background: rgba(116, 91, 214, 0.14);
  border-color: rgba(116, 91, 214, 0.22);
  color: #5f4ac9;
}

.expression-input,
.voice-input {
  min-height: 96px;
}

.calculator-panel .expression-input {
  min-height: 108px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(31, 43, 52, 0.1);
  color: #1f2b34;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.result-card {
  margin: 16px 0;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(244, 162, 97, 0.16), rgba(42, 157, 143, 0.11));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(244, 162, 97, 0.22);
}

.calculator-panel .result-card {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(31, 43, 52, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.result-value {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
}

.result-mood {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 230px;
}

.emoji-burst {
  font-size: 2.4rem;
  animation: bob 2.4s ease-in-out infinite;
}

.calc-mode-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.keyboard-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.key-btn {
  min-height: 56px;
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  color: #1f2b34;
  border: 1px solid rgba(31, 43, 52, 0.12);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.key-btn.shortcut {
  background: rgba(116, 91, 214, 0.12);
  border-color: rgba(116, 91, 214, 0.14);
  color: #5f4ac9;
}

.key-btn.shortcut-wide {
  grid-column: span 2;
}

.calc-command-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
}

.calculator-panel .ghost-btn {
  background: rgba(255, 255, 255, 0.72);
  color: #1f2b34;
  border-color: rgba(31, 43, 52, 0.1);
}

.calculator-panel #saveResultBtn {
  background: rgba(255, 255, 255, 0.72);
  color: #1f2b34;
}

.module-fields,
.module-result,
.advisor-feed,
.planner-feed,
.due-alerts,
.admin-metrics,
.mini-metrics {
  display: grid;
  gap: 12px;
}

.module-fields .two-col,
.expense-form .two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.module-result,
.advisor-item,
.planner-item,
.history-item,
.metric-card,
.alert-card,
.admin-card,
.cloud-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.cloud-card {
  margin: 14px 0;
  display: grid;
  gap: 12px;
}

.module-result {
  min-height: 72px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}

.ring-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(42, 157, 143, 0.06));
  border: 1px solid var(--line);
}

.radial-meter {
  --angle: 180deg;
  width: 130px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--panel-strong) 56%, transparent 57%),
    conic-gradient(var(--secondary) 0deg, var(--primary) var(--angle), rgba(255, 255, 255, 0.08) var(--angle));
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
  position: relative;
}

.radial-meter::before {
  content: attr(data-label);
  font-weight: 800;
  font-size: 1rem;
}

.metric-card {
  display: grid;
  gap: 6px;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
}

.chart-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.chart-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.bar-chart,
.category-breakdown,
.history-list {
  display: grid;
  gap: 12px;
}

.bar-row,
.category-row {
  display: grid;
  gap: 8px;
}

.bar-track,
.category-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill,
.category-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  animation: grow 0.9s ease both;
}

.history-list {
  max-height: 1020px;
  overflow: auto;
  padding-right: 4px;
}

.calculator-panel,
.analytics-panel,
#advisorFeed,
#historyList,
#expenseForm,
#voiceInput,
#exportPdfBtn {
  scroll-margin-top: 18px;
}

.history-item {
  display: grid;
  gap: 10px;
}

.history-head,
.history-foot,
.advisor-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-amount {
  font-size: 1.25rem;
  font-weight: 800;
}

.history-meta,
.advisor-body,
.planner-item p,
.admin-card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.admin-form {
  margin: 14px 0 18px;
}

.admin-form input,
.admin-form select {
  flex: 1 1 180px;
}

.admin-form button {
  flex: 1 1 220px;
}

.advisor-item {
  border-left: 4px solid var(--primary);
}

.advisor-item.priority-high {
  border-left-color: var(--danger);
}

.advisor-item.priority-good {
  border-left-color: var(--success);
}

.advisor-head strong,
.planner-item strong,
.history-item strong,
.alert-card strong {
  font-size: 1rem;
}

.report-actions {
  margin-bottom: 16px;
}

.import-label {
  display: grid;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.scan-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  margin: 12px 0;
}

.bill-archive-card {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.bill-archive-list {
  display: grid;
  gap: 12px;
}

.bill-query-card {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.compact-item {
  gap: 8px;
}

.hidden {
  display: none;
}

.app-toast {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(8, 24, 34, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: floatUp 0.3s ease;
}

.alert-card {
  background: rgba(239, 71, 111, 0.08);
}

.admin-metrics {
  margin-top: 14px;
}

@keyframes grow {
  from {
    width: 0;
  }
}

@keyframes drift {
  from {
    transform: translate3d(-1%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(2%, 2%, 0) scale(1.06);
  }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(6deg);
  }
}

@media (max-width: 1200px) {
  .workspace-grid,
  .summary-grid,
  .analytics-grid,
  .quick-budget-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail-right {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-card,
  .workspace-grid,
  .summary-grid,
  .analytics-grid,
  .quick-budget-form,
  .rail-right {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-card {
    gap: 20px;
  }

  .hero-brand {
    align-items: flex-start;
  }

  .hero-logo {
    width: 74px;
    height: 74px;
    flex-basis: 74px;
  }

  .keyboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  body[data-mobile-pane="calc"] .mobile-pane-block:not([data-pane="calc"]),
  body[data-mobile-pane="smart"] .mobile-pane-block:not([data-pane="smart"]),
  body[data-mobile-pane="expenses"] .mobile-pane-block:not([data-pane="expenses"]),
  body[data-mobile-pane="voice"] .mobile-pane-block:not([data-pane="voice"]),
  body[data-mobile-pane="advisor"] .mobile-pane-block:not([data-pane="advisor"]),
  body[data-mobile-pane="dashboard"] .mobile-pane-block:not([data-pane="dashboard"]),
  body[data-mobile-pane="history"] .mobile-pane-block:not([data-pane="history"]),
  body[data-mobile-pane="more"] .mobile-pane-block:not([data-pane="more"]) {
    display: none !important;
  }

  .mobile-pane-tabs {
    position: sticky;
    top: 8px;
    z-index: 18;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    margin-bottom: 10px;
    scrollbar-width: none;
  }

  .mobile-pane-tabs::-webkit-scrollbar {
    display: none;
  }

  .workspace-grid,
  .rail {
    display: block;
  }

  .mobile-dock {
    display: flex;
    width: calc(100% - 20px);
    justify-content: space-between;
    padding: 8px;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-dock::-webkit-scrollbar {
    display: none;
  }

  .dock-btn {
    flex: 1 0 auto;
    min-width: 72px;
  }
}

@media (max-width: 640px) {
  body {
    min-height: 100dvh;
  }

  .app-shell {
    width: min(100% - 14px, 100%);
    margin: 8px auto 96px;
  }

  .hero-card,
  .panel,
  .summary-card {
    border-radius: 20px;
    padding: 16px;
  }

  .hero-card h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
    line-height: 1;
    margin: 4px 0 0;
  }

  .hero-copy {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .hero-card {
    gap: 14px;
  }

  .hero-tags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .calc-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-tag-btn {
    width: 100%;
    padding: 12px 10px;
  }

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

  .hero-tag-btn {
    min-height: 44px;
  }

  .glass-chip {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    padding: 14px;
  }

  .glass-chip .chip-label {
    margin-bottom: 0;
  }

  .glass-chip select,
  .glass-chip button,
  .glass-chip input {
    width: 100%;
  }

  .user-chip {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .user-chip .chip-label,
  .compact-chip .chip-label,
  .install-chip .chip-label {
    grid-column: 1 / -1;
  }

  .user-chip .mini-btn {
    width: auto;
    min-width: 72px;
  }

  .compact-chip {
    grid-template-columns: 1fr;
  }

  .status-chip {
    min-width: 0;
  }

  .status-chip #liveDate,
  .install-chip .chip-copy {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .summary-grid {
    gap: 12px;
  }

  .summary-value {
    font-size: 1.8rem;
  }

  .panel h2 {
    font-size: 1.16rem;
  }

  .quick-budget-form {
    gap: 10px;
  }

  .calc-mode-row,
  .calc-command-row {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .calc-command-row .primary-btn {
    grid-column: 1 / -1;
  }

  .result-card,
  .ring-card,
  .panel-head,
  .history-head,
  .history-foot,
  .advisor-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .module-fields .two-col,
  .expense-form .two-col {
    grid-template-columns: 1fr;
  }

  .history-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .history-tools,
  .quick-actions,
  .report-actions {
    gap: 8px;
  }

  .chip-copy {
    max-width: none;
  }

  .primary-btn,
  .ghost-btn {
    min-height: 46px;
  }

  .quick-actions button,
  .report-actions button,
  .history-tools button,
  .history-tools input {
    width: 100%;
  }

  .keyboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .key-btn {
    min-height: 46px;
    padding: 10px 8px;
  }

  .dock-btn {
    padding: 12px 8px;
    font-size: 0.92rem;
  }
}
