:root {
  --bg-primary: #FAF6F0;
  --bg-secondary: #F0E5D5;
  --bg-tertiary: #F4EBE0;
  --card-bg: #FFFFFF;
  --border: #EEE4D4;
  --text-primary: #3D332A;
  --text-secondary: #7A6E5F;
  --text-muted: #B8AB97;
  --accent-green: #7A8B6B;
  --accent-terracotta: #C6856E;
  --accent-gold: #D4A857;
  --accent-red: #C95C4A;
  --state-done-bg: #DCE3D2;
  --state-done-text: #4F5C42;
  --state-urgent-bg: #FCE0DC;
  --state-urgent-text: #6E2E26;

  --kitchen-bg: #F2D2C5; --kitchen-text: #6E3F2E;
  --bedroom-bg: #E0D2E5; --bedroom-text: #5F4B6E;
  --bathroom-bg: #CFDDE0; --bathroom-text: #3F5560;
  --living-bg: #E8D9BE; --living-text: #6E5A36;
  --dressing-bg: #ECC9CC; --dressing-text: #6E3F4D;
  --helper_room-bg: #EBD4A5; --helper_room-text: #6E5223;
  --shoes-bg: #EBD4A5; --shoes-text: #6E5223;
  --general-bg: #F0E5D5; --general-text: #5F5447;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { height: 100%; }
body {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-image:
    radial-gradient(circle at 10% 5%, rgba(198, 133, 110, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(122, 139, 107, 0.06) 0%, transparent 40%);
  min-height: 100vh;
}
.helper { font-family: 'Plus Jakarta Sans', sans-serif; direction: ltr; }
.admin { font-family: 'Almarai', sans-serif; direction: rtl; }

button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* Responsive app shell — full screen on mobile, card on desktop */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
}
@media (min-width: 600px) {
  .app {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(61, 51, 42, 0.12);
    overflow: hidden;
  }
}

.screen { padding: 0; display: none !important; flex: 1; }
.screen.active { display: block !important; }
.screen.active.welcome-screen,
.screen.active.login-screen { display: flex !important; }

/* Headers */
.s-header {
  padding: 22px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.helper .s-greeting { font-family: 'Lora', serif; font-size: 22px; font-weight: 700; }
.admin .s-greeting { font-family: 'Markazi Text', serif; font-size: 26px; font-weight: 700; }
.s-date { font-size: 11px; color: var(--text-secondary); margin-top: 2px; letter-spacing: 0.5px; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.s-stats {
  background: var(--bg-secondary);
  padding: 6px 14px;
  border-radius: 14px;
  text-align: center;
}
.s-stats-num {
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-terracotta);
  line-height: 1;
}
.admin .s-stats-num { font-family: 'Markazi Text', serif; font-size: 22px; }
.s-stats-label { font-size: 9px; color: var(--text-secondary); margin-top: 2px; font-weight: 700; }
.admin .s-stats-label { font-size: 10px; }

.s-section-title {
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 700;
  margin: 8px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin .s-section-title { font-family: 'Markazi Text', serif; font-size: 20px; }
.s-section-title .meta { font-size: 11px; color: var(--text-secondary); font-weight: 600; }

/* Buttons */
.btn-primary {
  background: var(--accent-green);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(122, 139, 107, 0.3);
  font-family: inherit;
}
.btn-secondary {
  background: transparent;
  color: var(--accent-green);
  border: 2px solid var(--accent-green);
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 12px;
  font-family: inherit;
}
.btn-block { width: 100%; }
.btn-warning {
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(201, 92, 74, 0.3);
}
.btn-gold {
  background: var(--accent-gold);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
}

/* Welcome */
.welcome-screen {
  background: linear-gradient(180deg, #F4DCC9 0%, #FAF6F0 100%);
  padding: 60px 28px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80vh;
}
.welcome-icon { font-size: 80px; margin-bottom: 24px; }
.welcome-greeting { font-family: 'Lora', serif; font-size: 30px; font-weight: 700; margin-bottom: 8px; }
.welcome-msg { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.welcome-date { font-size: 13px; color: var(--text-muted); margin-bottom: 40px; letter-spacing: 0.5px; }

/* Hygiene */
.hygiene-title { text-align: center; font-family: 'Lora', serif; font-size: 26px; font-weight: 700; margin: 28px 0 6px; }
.hygiene-subtitle { text-align: center; font-size: 11px; color: var(--accent-terracotta); font-weight: 800; margin-bottom: 18px; letter-spacing: 0.5px; }
.hygiene-list { padding: 0 16px; }
.hygiene-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 7px;
  background: white; border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.hygiene-item.unchecked { background: #FCE8E5; border: 1.5px solid #E8B9B0; color: var(--state-urgent-text); }
.hygiene-emoji { font-size: 18px; flex-shrink: 0; }
.hygiene-item span { flex: 1; }
.hygiene-check {
  width: 22px; height: 22px;
  border: 2px solid #DCD2C2; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: transparent;
}
.hygiene-check.checked { background: var(--accent-green); border-color: var(--accent-green); color: white; font-size: 12px; }

/* Warning */
.warning-screen {
  background: linear-gradient(180deg, #FCE0DC 0%, #FAF6F0 100%);
  padding: 60px 28px;
  text-align: center;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  border: 3px solid var(--accent-red);
  min-height: 80vh;
}
.warning-icon { font-size: 80px; margin-bottom: 16px; }
.warning-title {
  font-family: 'Lora', serif;
  font-size: 24px; font-weight: 800;
  color: var(--accent-red); margin-bottom: 20px;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.warning-message { font-size: 15px; color: var(--state-urgent-text); font-weight: 600; line-height: 1.7; margin-bottom: 40px; }

/* Message */
.message-screen { padding: 60px 28px; text-align: center; flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 80vh; }
.message-screen.morning { background: linear-gradient(180deg, #F4DCC9 0%, #FAF6F0 100%); }
.message-screen.evening { background: linear-gradient(180deg, #D4C5E0 0%, #FAF6F0 100%); }
.message-emoji { font-size: 64px; margin-bottom: 24px; }
.message-text {
  font-family: 'Lora', serif;
  font-size: 21px; font-weight: 500; font-style: italic;
  line-height: 1.5; margin-bottom: 40px;
}

/* Task cards */
.task-list { padding: 0 4px; }
.task-card {
  background: white;
  margin: 0 14px 8px;
  padding: 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  transition: background 0.2s;
}
.task-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.task-info { flex: 1; min-width: 0; }
.task-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.task-tag { font-size: 11px; color: var(--text-secondary); }
.task-check {
  width: 28px; height: 28px;
  border: 2px solid #DCD2C2;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
}
.task-check.done {
  background: var(--accent-green); border-color: var(--accent-green);
  color: white; font-size: 15px; font-weight: 800;
}
.task-card.done { background: #F6F2E8; }
.task-card.done .task-name { text-decoration: line-through; color: var(--text-muted); }
.task-card.guest {
  background: linear-gradient(135deg, #FDF5E0 0%, #F5E8C5 100%);
  border: 1.5px solid var(--accent-gold);
  position: relative;
}
.task-card.urgent {
  background: #FCE0DC;
  border: 1.5px solid var(--accent-red);
}
.task-card.readonly .task-check { display: none; }

.task-icon.kitchen { background: var(--kitchen-bg); color: var(--kitchen-text); }
.task-icon.bedroom { background: var(--bedroom-bg); color: var(--bedroom-text); }
.task-icon.bathroom { background: var(--bathroom-bg); color: var(--bathroom-text); }
.task-icon.living { background: var(--living-bg); color: var(--living-text); }
.task-icon.dressing { background: var(--dressing-bg); color: var(--dressing-text); }
.task-icon.helper_room { background: var(--helper_room-bg); color: var(--helper_room-text); }
.task-icon.shoes { background: var(--shoes-bg); color: var(--shoes-text); }
.task-icon.general { background: var(--general-bg); color: var(--general-text); }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: white;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 10px 4px max(14px, env(safe-area-inset-bottom));
  z-index: 50;
}
@media (min-width: 600px) {
  .bottom-nav {
    position: sticky;
    bottom: 0;
  }
}
.nav-item {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  background: none;
  border: none;
  padding: 4px;
}
.nav-item.active { color: var(--accent-terracotta); }
.nav-icon { font-size: 20px; display: block; margin-bottom: 2px; }

/* Tabs */
.tabs {
  display: flex;
  padding: 0 14px;
  gap: 6px;
  margin-bottom: 12px;
}
.tab {
  flex: 1;
  padding: 10px 6px;
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: none;
}
.tab.active { background: var(--accent-terracotta); color: white; }

/* Notes / history */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-state .emo { font-size: 40px; margin-bottom: 8px; }

.note-card {
  background: white;
  margin: 0 14px 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.note-task { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.note-stars { color: var(--accent-terracotta); font-size: 14px; margin-bottom: 6px; }
.note-text { font-size: 12px; color: #5F5447; line-height: 1.5; font-style: italic; font-family: 'Lora', serif; }
.admin .note-text { font-family: 'Almarai', sans-serif; font-style: normal; }
.note-date { font-size: 10px; color: var(--text-muted); margin-top: 6px; }

/* Send screen */
.send-toggle {
  display: flex;
  margin: 0 14px 14px;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.send-toggle-btn {
  flex: 1;
  padding: 11px 8px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  background: transparent;
  border: none;
}
.send-toggle-btn.active { background: white; color: var(--text-primary); box-shadow: 0 2px 6px rgba(61, 51, 42, 0.08); }
.send-toggle-btn.problem.active { color: var(--accent-red); }
.send-form-card { background: white; margin: 0 14px 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); }
.send-form-label { font-size: 12px; font-weight: 800; margin-bottom: 8px; color: #5F5447; }
.send-form-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.send-btn {
  background: var(--accent-green);
  color: white;
  border: none;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}
.send-history-title { font-family: 'Lora', serif; font-size: 16px; font-weight: 700; margin: 8px 18px 10px; }
.admin .send-history-title { font-family: 'Markazi Text', serif; font-size: 18px; }
.history-card {
  background: white;
  margin: 0 14px 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.history-icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.history-icon.supply { background: var(--state-done-bg); }
.history-icon.problem { background: var(--state-urgent-bg); }
.history-info { flex: 1; min-width: 0; }
.history-text { font-size: 13px; font-weight: 700; margin-bottom: 2px; line-height: 1.4; }
.history-meta { font-size: 10px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.history-status { padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 700; }
.history-status.open { background: var(--bg-secondary); color: var(--text-secondary); }
.history-status.resolved { background: var(--state-done-bg); color: var(--state-done-text); }

/* Banners */
.guest-banner {
  margin: 8px 14px 12px;
  background: linear-gradient(135deg, #E5C896 0%, #D4A857 100%);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(212, 168, 87, 0.3);
}
.guest-banner-icon { font-size: 24px; }
.guest-banner-content { flex: 1; min-width: 0; color: #5C4015; }
.guest-banner-title { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; }
.guest-banner-sub { font-size: 10px; margin-top: 1px; font-weight: 600; opacity: 0.85; }
.browse-banner {
  background: linear-gradient(135deg, #E5DBC8 0%, #D4C8B0 100%);
  margin: 8px 14px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5F5447;
}
.browse-banner-icon { font-size: 22px; flex-shrink: 0; }
.browse-banner-text { flex: 1; min-width: 0; }
.browse-banner-title { font-size: 12px; font-weight: 800; }
.browse-banner-sub { font-size: 10px; margin-top: 1px; opacity: 0.75; }
.btn-start-day {
  background: var(--accent-green);
  color: white;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  border: none;
}

/* Urgent overlay */
.urgent-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #FCE0DC 0%, #F5C5BC 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  z-index: 9999;
  overflow: hidden;
}
.urgent-overlay.show { display: flex; }
.urgent-pulse {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(201, 92, 74, 0.2) 0%, transparent 70%);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.3; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
.urgent-overlay > * { position: relative; z-index: 1; }
.urgent-icon { font-size: 90px; margin-bottom: 16px; animation: shake 0.5s ease-in-out infinite; }
@keyframes shake { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.urgent-badge { background: var(--accent-red); color: white; font-size: 11px; font-weight: 800; letter-spacing: 2px; padding: 6px 16px; border-radius: 100px; margin-bottom: 16px; }
.urgent-title { font-family: 'Lora', serif; font-size: 26px; font-weight: 800; color: var(--state-urgent-text); margin-bottom: 14px; line-height: 1.2; }
.admin .urgent-title { font-family: 'Markazi Text', serif; }
.urgent-message { font-size: 15px; color: var(--state-urgent-text); font-weight: 600; line-height: 1.6; margin-bottom: 18px; max-width: 360px; }
.urgent-sound { font-size: 12px; color: var(--accent-red); font-weight: 800; margin-bottom: 24px; animation: blink 0.8s ease-in-out infinite; letter-spacing: 0.5px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Header bell + buttons */
.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: #5F5447;
  border: none;
}
.icon-btn.small { width: 32px; height: 32px; font-size: 14px; }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--accent-red);
  color: white;
  font-size: 10px; font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 100px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
}

/* House Rules */
.rules-color-guide {
  margin: 0 14px 12px;
  background: white;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
}
.rules-color-title { font-family: 'Lora', serif; font-size: 14px; font-weight: 700; margin-bottom: 8px; color: #5F5447; }
.admin .rules-color-title { font-family: 'Markazi Text', serif; font-size: 16px; }
.rules-color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rules-color-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid;
}
.rules-color-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.rules-color-text { font-size: 11px; font-weight: 700; line-height: 1.2; }
.rules-cat-card {
  background: white;
  margin: 0 14px 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.rules-cat-card.expanded { background: var(--bg-tertiary); border-color: var(--accent-terracotta); }
.rules-cat-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.rules-cat-info { flex: 1; min-width: 0; }
.rules-cat-name { font-size: 14px; font-weight: 800; }
.rules-cat-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.rules-cat-arrow { font-size: 18px; color: var(--text-muted); }
.rules-rule-item {
  display: flex; gap: 10px;
  margin: 0 24px 5px;
  padding: 10px 12px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--bg-secondary);
}
.rules-rule-num {
  background: var(--accent-terracotta);
  color: white;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.rules-rule-text { font-size: 12px; line-height: 1.5; color: var(--text-primary); flex: 1; }

/* Notifications */
.notif-card {
  background: white;
  margin: 0 14px 8px;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}
.notif-card.unread { background: #FCF7EC; border-color: #E8D9BE; }
.notif-card-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.notif-card-info { flex: 1; min-width: 0; }
.notif-card-title { font-size: 13px; font-weight: 800; margin-bottom: 3px; }
.notif-card-text { font-size: 12px; color: #5F5447; line-height: 1.5; margin-bottom: 4px; }
.notif-card-time { font-size: 10px; color: var(--text-muted); font-weight: 700; }
.unread-dot { position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; background: var(--accent-red); border-radius: 50%; }

/* Login */
.login-screen {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 28px;
  text-align: center;
  min-height: 80vh;
}
.login-icon { font-size: 70px; margin-bottom: 20px; }
.login-title { font-family: 'Markazi Text', serif; font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.helper .login-title { font-family: 'Lora', serif; }
.login-input {
  width: 100%; padding: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 16px;
  margin-bottom: 14px;
  text-align: center;
}

/* Admin extras */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 10px; }
.stat-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px;
}
.stat-num { font-family: 'Markazi Text', serif; font-size: 30px; font-weight: 700; color: var(--accent-terracotta); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 700; }
.stat-card.green .stat-num { color: var(--accent-green); }
.stat-card.red .stat-num { color: var(--accent-red); }
.stat-card.gold .stat-num { color: var(--accent-gold); }

.action-card {
  background: white;
  margin: 0 14px 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.action-card .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.action-card .info { flex: 1; }
.action-card .title { font-size: 14px; font-weight: 800; }
.action-card .sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.action-card .arrow { color: var(--text-muted); font-size: 18px; }
.admin .action-card .arrow { transform: rotate(180deg); }

.row-card {
  background: white;
  margin: 0 14px 6px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-card .title { font-size: 13px; font-weight: 700; }
.row-card .meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.star-row { display: flex; gap: 4px; }
.star { font-size: 22px; cursor: pointer; user-select: none; color: var(--text-muted); }
.star.filled { color: var(--accent-gold); }

.toggle-switch {
  position: relative;
  width: 56px; height: 32px;
  background: var(--bg-secondary);
  border-radius: 100px;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  background: white;
  border-radius: 50%;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.toggle-switch.on { background: var(--accent-green); }
.toggle-switch.on::after { left: 27px; }
/* RTL override: dot starts on the right (off), moves to the left (on) */
.admin .toggle-switch::after { left: auto; right: 3px; }
.admin .toggle-switch.on::after { left: auto; right: 27px; }
.toggle-switch:disabled { opacity: 0.6; }

/* Forms */
.form-row { margin-bottom: 12px; padding: 0 14px; }
.form-label { font-size: 12px; font-weight: 800; margin-bottom: 6px; color: #5F5447; display: block; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-size: 14px;
  color: var(--text-primary);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-actions { padding: 6px 14px; display: flex; gap: 8px; }

/* Spinner / toasts */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
  font-weight: 700;
}
.toast.show { opacity: 1; }

.spacer { height: 60px; }

/* Misc */
.text-center { text-align: center; }
.muted { color: var(--text-secondary); font-size: 12px; }
.fade-in { animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(61, 51, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--bg-primary);
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
}
.modal h3 { font-family: 'Markazi Text', serif; font-size: 22px; margin-bottom: 14px; }
.helper .modal h3 { font-family: 'Lora', serif; }

.chat-thread { padding: 8px 14px; max-height: 50vh; overflow-y: auto; }
.chat-bubble {
  background: white;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 6px;
  max-width: 85%;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border);
}
.chat-bubble.left { margin-right: auto; }
.chat-bubble.right { margin-left: auto; background: var(--state-done-bg); border-color: var(--accent-green); }
.admin .chat-bubble.left { margin-left: auto; margin-right: 0; }
.admin .chat-bubble.right { margin-right: auto; margin-left: 0; }
.chat-bubble .meta { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* === Larger font overrides (readability boost) === */
.helper .s-greeting { font-size: 26px; }
.admin .s-greeting { font-size: 30px; }
.s-date { font-size: 13px; }
.s-section-title { font-size: 19px; }
.admin .s-section-title { font-size: 22px; }
.s-section-title .meta { font-size: 13px; }

.welcome-greeting { font-size: 34px; }
.welcome-msg { font-size: 18px; }
.welcome-date { font-size: 14px; }
.welcome-icon { font-size: 90px; }

.hygiene-title { font-size: 28px; }
.hygiene-subtitle { font-size: 13px; }
.hygiene-item { font-size: 15px; padding: 14px 16px; }
.hygiene-emoji { font-size: 22px; }
.hygiene-check { width: 26px; height: 26px; }

.warning-title { font-size: 26px; }
.warning-message { font-size: 17px; }
.warning-icon { font-size: 90px; }

.message-text { font-size: 23px; }
.message-emoji { font-size: 72px; }

.task-card { padding: 16px; }
.task-icon { width: 48px; height: 48px; font-size: 22px; }
.task-name { font-size: 16px; }
.task-tag { font-size: 13px; }
.task-check { width: 30px; height: 30px; }

.s-stats-num { font-size: 22px; }
.admin .s-stats-num { font-size: 26px; }
.s-stats-label { font-size: 11px; }
.admin .s-stats-label { font-size: 12px; }

.btn-primary { font-size: 17px; padding: 16px 30px; }
.btn-secondary { font-size: 16px; padding: 14px 30px; }
.btn-warning { font-size: 16px; padding: 16px 30px; }

.tab { font-size: 14px; padding: 12px 8px; }

.nav-item { font-size: 12px; }
.nav-icon { font-size: 22px; }

.note-task { font-size: 15px; }
.note-stars { font-size: 17px; }
.note-text { font-size: 14px; }
.note-date { font-size: 11px; }

.send-toggle-btn { font-size: 14px; padding: 13px 8px; }
.send-form-label { font-size: 14px; }
.send-form-input { font-size: 14px; min-height: 70px; padding: 14px; }
.send-btn { font-size: 16px; padding: 14px; }
.send-history-title { font-size: 18px; }
.admin .send-history-title { font-size: 20px; }
.history-text { font-size: 15px; }
.history-meta { font-size: 12px; }
.history-status { font-size: 11px; }
.history-icon { width: 34px; height: 34px; font-size: 17px; }

.guest-banner-title { font-size: 14px; }
.guest-banner-sub { font-size: 12px; }
.guest-banner-icon { font-size: 28px; }
.browse-banner-title { font-size: 14px; }
.browse-banner-sub { font-size: 12px; }
.browse-banner-icon { font-size: 26px; }
.btn-start-day { font-size: 13px; padding: 9px 16px; }

.rules-color-title { font-size: 15px; }
.admin .rules-color-title { font-size: 17px; }
.rules-color-text { font-size: 12px; }
.rules-cat-name { font-size: 16px; }
.rules-cat-meta { font-size: 13px; }
.rules-cat-icon { width: 40px; height: 40px; font-size: 20px; }
.rules-rule-num { width: 26px; height: 26px; font-size: 13px; }
.rules-rule-text { font-size: 14px; }

.notif-card-title { font-size: 15px; }
.notif-card-text { font-size: 13px; }
.notif-card-time { font-size: 11px; }
.notif-card-icon { width: 42px; height: 42px; font-size: 19px; }

.icon-btn { width: 42px; height: 42px; font-size: 19px; }
.icon-btn.small { width: 36px; height: 36px; font-size: 16px; }
.notif-badge { font-size: 11px; min-width: 20px; height: 20px; }

.login-title { font-size: 32px; }
.login-input { font-size: 17px; padding: 16px; }

.stat-num { font-size: 34px; }
.stat-label { font-size: 14px; }
.action-card .title { font-size: 16px; }
.action-card .sub { font-size: 13px; }
.action-card .icon { width: 48px; height: 48px; font-size: 24px; }
.action-card .arrow { font-size: 20px; }

.row-card .title { font-size: 15px; }
.row-card .meta { font-size: 12px; }

.form-label { font-size: 14px; }
.form-input, .form-select, .form-textarea { font-size: 15px; padding: 13px 14px; }

.modal h3 { font-size: 26px; }
.chat-bubble { font-size: 15px; padding: 12px 16px; }
.chat-bubble .meta { font-size: 11px; }

.toast { font-size: 15px; padding: 12px 20px; }

.muted { font-size: 14px; }
.empty-state { font-size: 16px; }
.empty-state .emo { font-size: 48px; }

.urgent-title { font-size: 30px; }
.urgent-message { font-size: 17px; }
.urgent-icon { font-size: 100px; }
.urgent-badge { font-size: 13px; padding: 8px 18px; }
.urgent-sound { font-size: 14px; }

