/* ============================
   融易伴 RongYiBan - Core Styles
   Mobile-first H5 Demo
   ============================ */

:root {
  --primary: #FF8C42;
  --primary-light: #FFB380;
  --primary-dark: #E07030;
  --secondary: #4ECDC4;
  --secondary-light: #7EDDD6;
  --accent-green: #2ECC71;
  --accent-red: #E74C3C;
  --accent-purple: #9B59B6;
  --accent-blue: #3498DB;
  --bg: #FFF8F0;
  --bg-card: #FFFFFF;
  --bg-gray: #F5F0EA;
  --text-primary: #2D2D2D;
  --text-secondary: #7A7A7A;
  --text-light: #AAAAAA;
  --border: #EDE8E0;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius: 14px;
  --radius-sm: 8px;
  --tab-height: 65px;
  --topbar-height: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Top Bar */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}
.app-logo {
  font-size: 20px; font-weight: 700;
  color: var(--primary);
}
.today-date {
  font-size: 13px; color: var(--text-secondary);
}

/* Page Container */
.page-container {
  position: fixed;
  top: var(--topbar-height);
  bottom: calc(var(--tab-height) + var(--safe-bottom));
  left: 0; right: 0;
  overflow: hidden;
}
.page {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 24px;
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}
.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Tab Bar */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: space-around;
  border-top: 1px solid var(--border);
  z-index: 100;
}
.tab-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 8px 0;
  color: var(--text-light);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
}
.tab-item i { font-size: 20px; }
.tab-item.active { color: var(--primary); }
.tab-item:active { transform: scale(0.92); }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-title {
  font-size: 15px; font-weight: 600;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--primary); font-size: 16px; }

/* Section Title */
.section-title {
  font-size: 17px; font-weight: 700;
  margin-bottom: 14px;
  margin-top: 8px;
}

/* Greeting */
.greeting {
  padding: 12px 0 4px;
}
.greeting-text {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
}
.greeting-sub {
  font-size: 13px; color: var(--text-secondary);
  margin-top: 4px;
}

/* Stats Row */
.stats-row {
  display: flex; gap: 10px;
}
.stat-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card[onclick]:active, .stat-card[style*="cursor"]:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.stat-number {
  font-size: 28px; font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 2px;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.quick-action-btn:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-lg);
}
.quick-action-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: white;
}
.quick-action-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-primary);
}

/* Tag Chips */
.tag-group { margin-bottom: 14px; }
.tag-group-title {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tag-chip {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.tag-chip:active { transform: scale(0.95); }
.tag-chip.selected {
  border-color: var(--primary);
  background: rgba(255,140,66,0.1);
  color: var(--primary);
  font-weight: 500;
}
.tag-chip.green.selected {
  border-color: var(--accent-green);
  background: rgba(46,204,113,0.1);
  color: var(--accent-green);
}

/* Voice Recording */
.voice-record-area {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0;
}
.voice-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,140,66,0.4);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.voice-btn:active { transform: scale(0.93); }
.voice-btn.recording {
  animation: pulse 1.2s infinite;
  background: linear-gradient(135deg, var(--accent-red), #C0392B);
  box-shadow: 0 4px 20px rgba(231,76,60,0.4);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(231,76,60,0.4); }
  50% { box-shadow: 0 4px 35px rgba(231,76,60,0.6); transform: scale(1.05); }
}
.voice-hint {
  font-size: 13px; color: var(--text-secondary);
  margin-top: 12px;
}
.voice-text-preview {
  width: 100%;
  min-height: 60px;
  background: var(--bg-gray);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  display: none;
}
.voice-text-preview.show { display: block; }

/* AI Result Card */
.ai-result {
  background: linear-gradient(135deg, #FFF8F0, #F0FAF8);
  border: 1.5px solid var(--secondary-light);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 14px;
  display: none;
}
.ai-result.show { display: block; }
.ai-result-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--secondary);
  margin-bottom: 10px;
}
.ai-result-field {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; margin-bottom: 6px;
}
.ai-field-label {
  color: var(--text-secondary);
  min-width: 48px;
  flex-shrink: 0;
}
.ai-field-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Child Selector */
.child-selector {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 4px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.child-selector::-webkit-scrollbar { display: none; }
.child-avatar-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.child-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  border: 2.5px solid transparent;
  transition: border-color 0.2s;
}
.child-avatar-btn.selected .child-avatar {
  border-color: var(--primary);
}
.child-avatar-name {
  font-size: 11px; color: var(--text-secondary);
  max-width: 52px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.child-avatar-btn.selected .child-avatar-name {
  color: var(--primary); font-weight: 600;
}

/* Timeline */
.timeline-item {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.timeline-content { flex: 1; }
.timeline-meta {
  font-size: 12px; color: var(--text-light);
  margin-top: 4px;
  display: flex; gap: 10px;
}
.timeline-text {
  font-size: 14px; line-height: 1.6;
}
.timeline-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 6px;
}
.timeline-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,140,66,0.1);
  color: var(--primary);
}
.timeline-tag.green {
  background: rgba(46,204,113,0.1);
  color: var(--accent-green);
}

/* Child List */
.child-list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.child-list-item:active { transform: scale(0.98); }
.child-list-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.child-list-info { flex: 1; }
.child-list-name {
  font-size: 15px; font-weight: 600;
}
.child-list-meta {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 2px;
}
.child-list-count {
  font-size: 12px; color: var(--text-light);
  text-align: right;
}

/* Add Button */
.fab {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 20px);
  right: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(255,140,66,0.4);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(0.9); }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.modal-overlay.show {
  display: block;
  opacity: 1;
}
.modal-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
  max-height: 85vh;
  overflow-y: auto;
}
.modal-sheet.show { transform: translateY(0); }
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.modal-title {
  font-size: 17px; font-weight: 700;
  margin-bottom: 16px;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
}
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A7A7A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.btn-secondary {
  background: var(--bg-gray);
  color: var(--text-primary);
}
.btn-danger {
  background: var(--accent-red);
  color: white;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
  border-radius: 20px;
}

/* Save button (record page) */
.save-record-btn {
  margin-top: 14px;
}

/* Toast */
.toast {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-primary);
  color: white;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1100;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Profile Page */
.profile-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: white;
}
.profile-name {
  font-size: 18px; font-weight: 700;
  margin-top: 10px;
}
.profile-role {
  font-size: 13px; color: var(--text-secondary);
}
.settings-group {
  margin-top: 16px;
}
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.settings-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.settings-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.settings-item:only-child { border-radius: var(--radius); }
.settings-left {
  display: flex; align-items: center; gap: 12px;
}
.settings-left i {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: white;
}
.settings-label { font-size: 15px; }
.settings-right {
  color: var(--text-light);
  font-size: 14px;
}

/* Empty State */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px;
  text-align: center;
}
.empty-icon {
  font-size: 48px; color: var(--border);
  margin-bottom: 12px;
}
.empty-text {
  font-size: 14px; color: var(--text-secondary);
}

/* Chip radio group for form */
.chip-radio-group {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip-radio {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  transition: all 0.2s;
}
.chip-radio.selected {
  border-color: var(--primary);
  background: rgba(255,140,66,0.1);
  color: var(--primary);
  font-weight: 500;
}

/* Utility */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.text-center { text-align: center; }
.flex-between {
  display: flex; align-items: center; justify-content: space-between;
}
.hidden { display: none !important; }

/* ---- Dashboard Charts ---- */
.dashboard-bar-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 120px; padding: 0 2px;
}
.bar-column {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; height: 100%; gap: 2px;
}
.bar-value {
  font-size: 10px; font-weight: 600; color: var(--text-secondary);
  height: 16px; line-height: 16px;
}
.bar-stack {
  flex: 1; width: 100%; display: flex; flex-direction: column-reverse;
  gap: 1px; align-items: stretch;
}
.bar-segment { border-radius: 3px; min-height: 2px; transition: height 0.4s ease; }
.bar-positive { background: var(--accent-green); }
.bar-concern { background: var(--primary); }
.bar-empty { background: var(--border); }
.bar-label {
  font-size: 10px; color: var(--text-light); white-space: nowrap;
}
.chart-legend {
  display: flex; gap: 14px; justify-content: center; margin-top: 10px;
}
.legend-item {
  font-size: 11px; color: var(--text-light);
  display: flex; align-items: center; gap: 4px;
}
.legend-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
}

/* Ratio Chart */
.ratio-chart {
  display: flex; gap: 8px; align-items: flex-end;
}
.ratio-column {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.ratio-value { font-size: 13px; font-weight: 700; }
.ratio-bar-bg {
  width: 100%; height: 80px; background: var(--bg-gray);
  border-radius: 6px; overflow: hidden;
  display: flex; flex-direction: column-reverse;
}
.ratio-bar-fill {
  border-radius: 6px 6px 0 0; transition: height 0.4s ease; min-height: 2px;
}
.ratio-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.ratio-sub { font-size: 10px; color: var(--text-light); }

/* Tag Ranking */
.tag-rank-item {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.tag-rank-num {
  font-size: 13px; font-weight: 700; min-width: 18px; text-align: center;
}
.tag-rank-name {
  font-size: 13px; font-weight: 500; min-width: 64px;
}
.tag-rank-bar-bg {
  flex: 1; height: 16px; background: var(--bg-gray);
  border-radius: 8px; overflow: hidden;
}
.tag-rank-bar-fill {
  height: 100%; border-radius: 8px; transition: width 0.4s ease;
}
.tag-rank-count {
  font-size: 12px; color: var(--text-light); min-width: 24px; text-align: right;
}

/* Emotion Ring */
.emotion-ring-container {
  display: flex; align-items: center; gap: 16px;
}
.emotion-ring { flex-shrink: 0; }
.emotion-legend { flex: 1; }
.emotion-legend-item {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 5px; font-size: 12px;
}
.emotion-legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.emotion-legend-label { min-width: 28px; font-weight: 500; }
.emotion-legend-value { color: var(--text-secondary); min-width: 30px; }
.emotion-legend-count { color: var(--text-light); }

/* Child Compare */
.child-compare-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  transition: transform 0.15s;
}
.child-compare-row:active { transform: scale(0.98); }
.child-compare-info {
  display: flex; align-items: center; gap: 6px;
  min-width: 60px;
}
.child-compare-name { font-size: 13px; font-weight: 500; }
.child-compare-bar-bg {
  flex: 1; height: 18px; background: var(--bg-gray);
  border-radius: 9px; overflow: hidden;
  display: flex;
}
.child-compare-bar {
  height: 100%; transition: width 0.4s ease;
}
.child-compare-bar:first-child { border-radius: 9px 0 0 9px; }
.child-compare-bar:last-child { border-radius: 0 9px 9px 0; }
.child-compare-count {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  min-width: 24px; text-align: right;
}

/* Connection Indicator */
.conn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-left: 8px; vertical-align: middle;
  transition: background 0.3s;
}
.conn-online { background: var(--accent-green); }
.conn-offline { background: var(--accent-red); }
.conn-warn { background: var(--primary); }

/* Photo Preview */
.photo-thumb-wrap {
  position: relative; display: inline-block;
}
.photo-thumb {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
}
.photo-thumb-remove {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-red); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Record photo in timeline */
.record-photo {
  width: 100%; max-width: 200px; border-radius: var(--radius-sm);
  margin-top: 8px; border: 1px solid var(--border);
}

/* Trend alert card animation */
.card[style*="border-left"] {
  transition: transform 0.15s;
}
.card[style*="border-left"]:active {
  transform: scale(0.98);
}

/* Photo upload area */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-gray);
}
.photo-upload-area:active {
  border-color: var(--primary);
  background: var(--primary)08;
  transform: scale(0.98);
}

/* Network Offline Banner */
.offline-banner {
  position: fixed;
  top: var(--topbar-height);
  left: 0; right: 0;
  background: var(--accent-red);
  color: white;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  z-index: 150;
  display: none;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.offline-banner.show {
  display: block;
  transform: translateY(0);
}

/* iOS Safe Area enhanced modal support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .modal-sheet {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* Onboarding Overlay */
.onboarding-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.onboarding-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.onboarding-step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.onboarding-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.onboarding-dot.active {
  background: var(--primary);
  width: 20px;
  border-radius: 4px;
}

/* Retry Button */
.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.retry-btn:active {
  transform: scale(0.95);
  background: var(--primary);
  color: white;
}

/* Unified active feedback for all interactive elements */
.settings-item:active,
.child-list-item:active,
.quick-action-btn:active,
.tab-item:active {
  transform: scale(0.96);
}

/* Network-dependent button disabled state */
.network-required.net-disabled,
button.net-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.voice-btn.net-disabled {
  background: var(--border) !important;
  box-shadow: none !important;
}
