:root {
  --bg: #eef6fb;
  --bg-gradient: linear-gradient(180deg, #d4ecf9 0%, #eef6fb 28%, #f5f8fa 100%);
  --bg-card: #ffffff;
  --bg-input: #f4f7fa;
  --bg-elevated: #eef2f6;
  --text: #2c3e50;
  --text-secondary: #5a6d82;
  --text-muted: #8a9bae;
  --primary: #2db896;
  --primary-light: #3dccb8;
  --primary-dark: #24a07f;
  --primary-soft: rgba(45, 184, 150, 0.12);
  --blue: #5b9fd4;
  --blue-soft: rgba(91, 159, 212, 0.12);
  --orange: #f5a623;
  --orange-soft: rgba(245, 166, 35, 0.12);
  --purple-soft: rgba(139, 127, 216, 0.12);
  --success: #2db896;
  --warning: #f5a623;
  --danger: #ef6b6b;
  --shadow-sm: 0 2px 8px rgba(44, 62, 80, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 62, 80, 0.08);
  --shadow-lg: 0 8px 24px rgba(45, 184, 150, 0.2);
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 68px;
  --header-height: 52px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
  overflow: hidden;
  line-height: 1.5;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-gradient);
}

/* Header */
.app-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0px);
}

.app-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.config-status {
  font-size: 0.6875rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.config-status.ok {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.config-status.warn {
  background: var(--orange-soft);
  color: #c47d0e;
}

/* Main content */
.app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 12px 16px;
  padding-bottom: calc(var(--nav-height) + 16px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.tab-panel.active {
  display: block;
}

.tab-panel#panel-chat.active {
  display: flex;
}

#panel-chat {
  flex-direction: column;
  padding: 0;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  overflow: hidden;
  overflow-y: hidden;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding: 6px 12px var(--safe-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(44, 62, 80, 0.06);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(44, 62, 80, 0.06);
  display: flex;
  z-index: 100;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.625rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 6px 8px;
  position: relative;
}

.nav-tab .nav-icon {
  font-size: 1.375rem;
  line-height: 1;
  transition: transform 0.2s;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active .nav-icon {
  transform: scale(1.08);
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* Summary hero card */
.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  text-align: center;
}

@media (max-width: 380px) {
  .summary-card {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 12px 8px;
    padding: 16px 14px;
  }

  .summary-card .summary-item + .summary-item {
    border-left: none;
  }

  .summary-item--count {
    grid-row: 1;
    grid-column: 1;
  }

  .summary-item--pending {
    grid-row: 1;
    grid-column: 2;
    border-left: 1px solid rgba(44, 62, 80, 0.08);
  }

  .summary-item--income {
    grid-row: 2;
    grid-column: 1;
    border-top: 1px solid rgba(44, 62, 80, 0.08);
    padding-top: 12px;
  }

  .summary-item--expense {
    grid-row: 2;
    grid-column: 2;
    border-top: 1px solid rgba(44, 62, 80, 0.08);
    border-left: 1px solid rgba(44, 62, 80, 0.08);
    padding-top: 12px;
  }
}

.summary-item {
  padding: 4px 0;
}

.summary-item + .summary-item {
  border-left: 1px solid rgba(44, 62, 80, 0.08);
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.summary-value.expense {
  color: var(--orange);
}

.summary-value.income {
  color: var(--primary);
}

.summary-value.warn {
  color: var(--warning);
}

.summary-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Stats & filters */
.stats-bar {
  display: none;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.filter-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45, 184, 150, 0.3);
}

.status-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.status-tabs .filter-tab {
  flex: 1;
  text-align: center;
}

.type-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.type-option {
  padding: 12px 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(44, 62, 80, 0.1);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.type-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(45, 184, 150, 0.2);
}

.flow-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.flow-option {
  padding: 12px 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(44, 62, 80, 0.1);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.flow-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(45, 184, 150, 0.2);
}

.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-chip {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid rgba(44, 62, 80, 0.12);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: none;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.875rem;
  margin-bottom: 14px;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow-sm);
}

/* Note cards */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s, transform 0.15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.note-card:active {
  transform: scale(0.99);
}

.note-card.completed {
  opacity: 0.6;
}

.note-card.completed .note-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.note-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.note-icon-wrap.type-note { background: var(--blue-soft); }
.note-icon-wrap.type-expense { background: var(--orange-soft); }
.note-icon-wrap.type-reminder { background: rgba(245, 166, 35, 0.18); }
.note-icon-wrap.type-todo { background: var(--primary-soft); }

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

.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.note-card-main {
  flex: 1;
  min-width: 0;
}

.note-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.note-type-badge {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.note-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.note-time::before {
  content: '·';
  margin-right: 8px;
  color: var(--text-muted);
  opacity: 0.5;
}

.note-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

.note-amount.income {
  color: var(--primary);
}

.note-due {
  font-size: 0.6875rem;
  color: var(--warning);
  background: var(--orange-soft);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.note-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.note-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.note-content {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-category {
  display: inline-block;
  font-size: 0.625rem;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.note-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
}

.note-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.0625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.btn-icon:active {
  transform: scale(0.94);
  background: var(--bg-elevated);
}

.btn-icon.danger:hover {
  background: rgba(239, 107, 107, 0.15);
  color: var(--danger);
}

.btn-snooze {
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--orange-soft);
  color: #c47d0e;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.note-reminded {
  font-size: 0.625rem;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.empty-state .hint {
  font-size: 0.8125rem;
  margin-top: 8px;
  color: var(--text-muted);
}

/* FAB */
.fab {
  position: fixed;
  right: calc(50% - 220px);
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  min-width: 56px;
  height: 52px;
  padding: 0 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border: none;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.2s;
}

@media (max-width: 480px) {
  .fab {
    right: 20px;
  }
}

.fab:active {
  transform: scale(0.96);
}

/* Modal form */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 80, 0.35);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -8px 32px rgba(44, 62, 80, 0.12);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-sheet h2 {
  font-size: 1.0625rem;
  margin-bottom: 16px;
  color: var(--text);
  text-align: center;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(44, 62, 80, 0.08);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9375rem;
  outline: none;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 13px;
  border-radius: 24px;
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(45, 184, 150, 0.35);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
}

/* Chat */
.chat-header {
  padding: 12px 16px;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
}

.btn-text {
  background: var(--bg-card);
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.chat-welcome {
  text-align: center;
  padding: 24px 8px;
}

.welcome-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.welcome-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.chat-welcome h3 {
  color: var(--text);
  margin-bottom: 6px;
  font-size: 1.0625rem;
}

.chat-welcome > p {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.prompt-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.prompt-chip {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.prompt-chip:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.prompt-chip::before {
  content: '💬 ';
}

.chat-bubble {
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.chat-bubble.user {
  align-self: flex-end;
}

.chat-bubble.assistant {
  align-self: flex-start;
}

.bubble-content {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  line-height: 1.6;
  word-break: break-word;
}

.chat-bubble.user .bubble-content {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(45, 184, 150, 0.25);
}

.chat-bubble.assistant .bubble-content {
  background: var(--bg-card);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.action-note {
  font-size: 0.75rem;
  color: var(--primary-dark);
  margin-top: 4px;
  padding-left: 4px;
}

.mode-note {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 4px;
}

.chat-loading {
  animation: fadeIn 0.3s ease;
}

.loading-bubble {
  min-width: 180px;
  padding: 14px 16px !important;
}

.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loading-avatar {
  font-size: 1.25rem;
  line-height: 1;
  animation: loadingBob 1.2s ease-in-out infinite;
}

.loading-body {
  display: flex;
  align-items: center;
  gap: 6px;
}

.loading-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.loading-hint {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 16px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.35;
  animation: typingDot 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes loadingBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.btn-text:disabled,
.prompt-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 14px;
  background: var(--bg-card);
  flex-shrink: 0;
  z-index: 90;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -4px 16px rgba(44, 62, 80, 0.06);
}

.chat-input-bar textarea {
  flex: 1;
  padding: 10px 16px;
  border-radius: 22px;
  border: 1px solid rgba(44, 62, 80, 0.08);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9375rem;
  resize: none;
  outline: none;
  font-family: inherit;
  max-height: 120px;
  line-height: 1.4;
}

.chat-input-bar textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.btn-voice {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--bg-input);
  font-size: 1.125rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-voice.listening,
.btn-voice-inline.listening {
  background: rgba(239, 107, 107, 0.15);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.input-with-voice {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-voice-area {
  align-items: flex-start;
}

.input-with-voice input,
.input-with-voice textarea {
  flex: 1;
}

.btn-voice-inline {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: none;
  background: var(--bg-input);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-with-voice-area .btn-voice-inline {
  margin-top: 4px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  margin-top: 8px;
}

.checkbox-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.notify-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: var(--text);
}

.notify-hint {
  background: var(--orange-soft);
  color: #9a6410;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  line-height: 1.6;
}

.notify-diagnostics {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 0.75rem;
}

.diag-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--text-secondary);
}

.diag-row span:last-child {
  font-weight: 500;
  color: var(--text);
}

.notify-steps {
  margin: 0 0 12px 18px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.notify-steps li {
  margin-bottom: 2px;
}

.inapp-reminder-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fff8e6, #fff);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(245, 166, 35, 0.25);
  flex-shrink: 0;
  z-index: 50;
}

.inapp-reminder-icon {
  font-size: 1.25rem;
}

.inapp-reminder-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inapp-reminder-text strong {
  font-size: 0.8125rem;
  color: var(--text);
}

.inapp-reminder-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inapp-reminder-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(45, 184, 150, 0.3);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Settings */
.settings-section {
  margin-bottom: 20px;
}

.settings-entry {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}

.settings-entry:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-md);
}

.settings-entry-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.settings-entry-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.settings-entry-chevron {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
}

.settings-section h3 {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
  padding-left: 4px;
}

.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.input-with-toggle {
  display: flex;
  gap: 8px;
}

.input-with-toggle input {
  flex: 1;
}

.btn-toggle {
  padding: 0 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  white-space: nowrap;
}

.test-result {
  margin-top: 12px;
  font-size: 0.8125rem;
  padding: 10px 12px;
  border-radius: var(--radius);
  word-break: break-word;
}

.test-result.success {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.test-result.error {
  background: rgba(239, 107, 107, 0.1);
  color: var(--danger);
}

.settings-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.6;
}

.about-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.about-card p + p {
  margin-top: 8px;
}

.growth-status-bar {
  margin: 8px 0 4px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: rgba(239, 107, 107, 0.12);
  color: var(--danger);
  font-size: 0.8125rem;
  text-align: center;
  font-weight: 500;
}

.growth-status-bar[hidden] {
  display: none !important;
}

/* Install banner */
.install-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 300;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.install-banner.show {
  transform: translateX(-50%) translateY(0);
}

.install-banner p {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text);
}

.install-banner button {
  padding: 6px 14px;
  border-radius: 16px;
  border: none;
  font-size: 0.8125rem;
  cursor: pointer;
}

#btn-install {
  background: var(--primary);
  color: #fff;
}

#dismiss-install {
  background: var(--bg-input);
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(44, 62, 80, 0.88);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
