/* pages.css v20 — saved charts, view switching, settings, referral, mobile tabs, input form, global lang switcher */

/* ── Global language switcher (fixed top-right, always visible) ── */
.global-lang-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: inline-flex;
  background: rgba(26, 26, 26, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 999px;
  padding: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', sans-serif;
}
.global-lang-switcher button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.global-lang-switcher button:hover {
  color: #fff;
  background: rgba(217, 119, 6, 0.18);
}
.global-lang-switcher button.active {
  background: #d97706;
  color: #fff;
}
@media (max-width: 768px) {
  .global-lang-switcher {
    top: 8px;
    right: 8px;
  }
  .global-lang-switcher button {
    padding: 4px 7px;
    font-size: 0.72rem;
  }
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}
.view-tab {
  flex: 1;
  padding: 0.5rem 0;
  text-align: center;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.view-tab.active { color: var(--accent); background: var(--bg-secondary); }
.view-tab-panel { display: none; }
.view-tab-panel.active { display: block; }
/* View switching */
.view { display: none; }
.view.active { display: block; }

/* Settings section */
.settings-header {
  margin-bottom: 1.5rem;
}
.settings-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.settings-grid .card {
  margin-bottom: 0;
}
.settings-grid .card.full-width {
  grid-column: 1 / -1;
}
.settings-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-base);
}
.settings-label {
  color: var(--text-secondary);
  font-size: var(--text-base);
}
.settings-value {
  font-weight: 600;
  font-size: var(--text-base);
}
.settings-credits {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.settings-buy, .settings-earn, .settings-language {
  padding: 0.5rem;
}
.settings-buy .note, .settings-earn .note, .settings-language .note {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: 1rem;
}
.settings-language .lang-select {
  width: 100%;
}

/* Referral section */
.referral-code-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.referral-code {
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-copy:hover { background: var(--border); }
.btn-copy.copied { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.btn-copy svg { width: 16px; height: 16px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}
.stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.stat-box.highlight .stat-value { color: var(--accent); }

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-base);
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.rule-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

.referral-list-table {
  width: 100%;
  border-collapse: collapse;
}
.referral-list-table th,
.referral-list-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-base);
}
.referral-list-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
}
.referral-list-table tr:last-child td { border-bottom: none; }
.referral-list-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: var(--text-base);
}

/* Bottom tab bar — mobile only */
.mobile-tabs {
  display: none;
}

/* Input form: vertical single-column layout */
#inputCard .row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#inputCard .row .field {
  width: 100%;
  min-width: unset !important;
  max-width: unset !important;
  flex: unset !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#inputCard .row .field label {
  min-width: 5rem;
  flex-shrink: 0;
  white-space: nowrap;
  margin-bottom: 0;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
#inputCard .row .field select,
#inputCard .row .field input {
  flex: 1;
  min-width: 0;
}
/* Time field inner flex wrapper */
#inputCard .row .field > div[style*="display:flex"] {
  flex: 1;
}
#inputCard label {
  color: var(--text-primary);
  font-size: var(--text-base);
}

/* Responsive — pages */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(33,33,33,0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: none;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.4);
    z-index: 100;
  }
  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: var(--text-xs);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
    user-select: none;
    border: none;
    background: none;
    font: inherit;
    padding: 0;
  }
  .mobile-tab.active { color: var(--accent); }
  .mobile-tab:active { transform: scale(0.95); }
  .mobile-tab svg { width: 22px; height: 22px; }
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
}
.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}
.empty-state-text {
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.empty-state-cta {
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: var(--text-sm);
}

/* Payment packages */
.payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.payment-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}
.payment-card.recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
  transform: scale(1.04);
}
.payment-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.25rem;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
}
.payment-credits {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}
.payment-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.payment-price {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.25rem 0;
}
.payment-btn {
  width: 100%;
  margin-top: 0.25rem;
}
.payment-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.payment-save-badge {
  position: absolute;
  bottom: -0.4rem;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* P1#2 v0.1 60s onboarding welcome carousel */
.welcome-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.welcome-card {
  background: var(--bg-secondary, #1f2937);
  color: var(--text-primary, #f3f4f6);
  border: 1px solid var(--border, #374151);
  border-radius: 1rem;
  padding: 1.75rem 1.5rem 1.25rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.welcome-slides { min-height: 200px; display: flex; flex-direction: column; justify-content: center; }
.welcome-slide[hidden] { display: none; }
.welcome-icon { font-size: 2.5rem; margin-bottom: 0.75rem; line-height: 1; }
.welcome-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.625rem; color: var(--text-primary); line-height: 1.3; }
.welcome-body { color: var(--text-muted); font-size: 0.9375rem; line-height: 1.65; margin: 0 0 1.25rem; }
.welcome-dots { display: flex; justify-content: center; gap: 6px; margin: 0.5rem 0 1rem; }
.welcome-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border, #e5e7eb);
  transition: background 0.2s, width 0.2s;
}
.welcome-dot.active { background: var(--accent, #d97706); width: 18px; border-radius: 999px; }
.welcome-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.welcome-next, .welcome-start { width: 100%; padding: 0.75rem 1rem; font-size: 0.9375rem; font-weight: 600; }
.welcome-skip {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.875rem; cursor: pointer; padding: 0.5rem;
}
.welcome-skip:hover { color: var(--text-primary); }

/* v0.1 Daily push banner (above computeView tabs) */
.daily-push-banner {
  margin: 0 0 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-left: 4px solid #d97706;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
}
.daily-push-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  position: relative;
}
.daily-push-inner:hover { background: rgba(217, 119, 6, 0.05); }
.daily-push-inner:active { background: rgba(217, 119, 6, 0.08); }
.daily-push-meta {
  font-size: 11px;
  color: #92400e;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.daily-push-main {
  font-size: 14px;
  color: #1f2937;
  line-height: 1.5;
  font-weight: 500;
  padding-right: 24px;
}
.daily-push-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #d97706;
  font-weight: 600;
}

/* YunGouOS (mainland CNY payment) section */
.payment-yungouos-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border, #e5e7eb);
}
.payment-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text-default, #1f2937);
}
.payment-provider-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.payment-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 0.5rem);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
}
.payment-tab.active {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
}

/* Payment toast */
.payment-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 0.75rem 1.5rem;
  font-size: var(--text-base);
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease;
}
.payment-toast.success {
  border-color: var(--success);
  color: var(--success);
}
/* Desktop: input form fields horizontal layout */
@media (min-width: 769px) {
  #inputCard .row {
    flex-direction: row;
    flex-wrap: wrap;
  }
  #inputCard .row .field {
    flex: 1 1 auto !important;
    min-width: 150px !important;
    max-width: 300px !important;
  }
}

/* ─── Zeri (择日) ─────────────────────────────────────────────── */
.zeri-form-card { margin-bottom: 0.75rem; }
.zeri-form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.zeri-form-row .field-group { flex: 1 1 120px; min-width: 0; }
.zeri-run-btn { width: 100%; }

/* legend */
.zeri-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.zeri-legend-item { display: flex; align-items: center; gap: 0.25rem; }
.zeri-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* calendar grid */
.zeri-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 0.75rem;
}
.zeri-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
  padding: 2px;
  min-height: 44px;
  border: 1px solid transparent;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.zeri-cell:hover  { transform: scale(1.05); opacity: 0.9; }
.zeri-cell:active { transform: scale(0.97); }
.zeri-cell.selected { border-color: #ffffff60; }
.zeri-cell-solar  { font-size: var(--text-sm); font-weight: 600; line-height: 1.2; }
.zeri-cell-lunar  { font-size: 0.6rem; line-height: 1.2; opacity: 0.85; }
.zeri-cell-label  { font-size: 0.6rem; font-weight: 700; line-height: 1.1; }

/* color classes — 中国传统吉凶配色 */
.zeri-daji    { background: #dc2626; color: #fff; }        /* 大吉：鲜红 */
.zeri-ji      { background: #fca5a5; color: #7f1d1d; }     /* 吉：淡红 */
.zeri-ping    { background: #f5f5f4; color: #57534e; }     /* 平：暖白 */
.zeri-xiong   { background: #a8a29e; color: #292524; }     /* 凶：灰 */
.zeri-daxiong { background: #44403c; color: #a8a29e; }     /* 大凶：深灰 */

/* detail panel */
.zeri-detail { margin-top: 0; }
.zeri-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}
.zeri-detail-date { font-size: var(--text-md); font-weight: 700; }
.zeri-detail-sub  { font-size: var(--text-sm); color: var(--text-muted); }
.zeri-detail-badge {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}
.zeri-reasons { display: flex; flex-direction: column; gap: 0.375rem; }
.zeri-reason {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}
.zeri-reason-icon { font-size: 0.875rem; flex-shrink: 0; }
.zeri-reason.good  { background: rgba(34,197,94,0.08); color: #86efac; }
.zeri-reason.bad   { background: rgba(239,68,68,0.08); color: #fca5a5; }
.zeri-reason.note  { background: var(--bg-tertiary); color: var(--text-muted); }
.zeri-detail-meta {
  display: flex; flex-wrap: wrap; gap: 0.375rem;
  margin-top: 0.5rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.zeri-meta-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.5rem;
  font-size: var(--text-xs);
}
.zeri-ai-btn {
  margin-top: 0.75rem;
  width: 100%;
}

/* mobile: smaller cells on narrow screens */
@media (max-width: 400px) {
  .zeri-calendar { gap: 2px; }
  .zeri-cell { min-height: 38px; }
  .zeri-cell-solar { font-size: 0.7rem; }
}

/* ── Zeri input fields inline layout ─────────────────────────────────────── */
#zeriCalcPanel .field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#zeriCalcPanel .field label {
  min-width: 6rem;
  flex-shrink: 0;
  white-space: nowrap;
  margin-bottom: 0;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
#zeriCalcPanel .field select {
  flex: 1;
  min-width: 0;
}

/* ── Zeri auspicious hours ────────────────────────────────────────────────── */
.zeri-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  margin-top: 0.75rem;
}
.zeri-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.zeri-hour-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.zeri-hour-chip.best {
  background: #fef3c7;
  color: #d97706;
  border-color: #fde68a;
}
/* Calendar cell auspicious hours small text */
.zeri-cell-hours {
  font-size: 0.625rem;
  color: #d97706;
  margin-top: 1px;
  letter-spacing: 0.5px;
}

/* ── 记录列表统一组件 ─────────────────────────────── */
.record-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-base);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.record-list-item:hover  { background: var(--bg-tertiary); }
.record-list-item:active { transform: scale(0.98); }
.record-list-item.active { background: var(--bg-tertiary); color: var(--accent); }
/* r7.2: rows with completed reading get a subtle emerald left accent so users
   can scan-spot which charts are ready for 追问 (the core interaction). */
.record-list-item.has-reading { border-left: 3px solid #10b981; padding-left: 0.5rem; }
.record-list-item.has-reading:not(.active) { background: rgba(16,185,129,0.03); }

.record-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.record-item-title {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-item-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ── 记录列表通用样式 ───────────────────── */

/* 方形性别徽章（命盘列表） */
.gender-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm, 4px);
  font-size: var(--text-xs);
  font-weight: 600;
  flex-shrink: 0;
}
.gender-badge.male   { background: rgba(96,165,250,0.18); color: #60a5fa; }
.gender-badge.female { background: rgba(244,114,182,0.18); color: #f472b6; }

/* r7.2: pill-style read/unread badge — visual hierarchy so 已解读 (ready-to-ask)
   reads as actionable, 未解读 reads as future-action gated. */
.reading-badge {
  display: inline-block;
  font-size: var(--text-xs);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.3;
}
.reading-badge.read   { background: rgba(16,185,129,0.12); color: #047857; }
.reading-badge.unread { background: rgba(156,163,175,0.15); color: var(--text-muted); }

/* ⋯ 菜单触发按钮 */
.record-menu-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  border-radius: var(--radius-base);
  line-height: 1;
}
.record-menu-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ⋯ 下拉菜单 */
.record-menu {
  position: absolute;
  right: 0.25rem;
  top: 2.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 200;
  min-width: 8rem;
  overflow: hidden;
}
.record-menu-item {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
}
.record-menu-item:hover { background: var(--bg-tertiary); }
.record-menu-item.danger { color: var(--error, #ef4444); }

/* ── Zeri calc panel: stack label above selects on narrow screens ─────────── */
@media (max-width: 480px) {
  #zeriCalcPanel .field {
    flex-direction: column;
    align-items: stretch;
  }
  #zeriCalcPanel .field label {
    min-width: unset;
    white-space: normal;
    margin-bottom: 0.375rem;
  }
}

/* ── Record list item: deleting state ────────────────────────────────────── */
.record-list-item.deleting {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* ── Detail Action Bar ───────────────────────────────────────────────────── */
.detail-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  margin: 0.5rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
}
.detail-action-bar:empty { display: none; }
.btn-detail-ai {
  background: var(--accent, #d97706);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm, 6px);
  padding: 0.35rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-detail-ai:hover { opacity: 0.9; }
