:root {
  --cream: #fff7ea;
  --beige: #f8eedc;
  --brown: #4a3528;
  --soft-brown: #8a6f5a;
  --rose: #f4a7b9;
  --mango: #f7c948;
  --mint: #a8d5ba;
  --sky: #9ecdf2;
  --lavender: #c7b7f3;
  --coral: #f28b82;
  --orange: #f6b26b;
  --white: #ffffff;
  --border: #e8d8c3;
  --shadow: rgba(74,53,40,0.10);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --transition: 0.18s ease;

  /* Category color palette — used on schedule/chore cards */
  --cat-prayer:    #f4a7b9;   /* rose */
  --cat-meals:     #f6b26b;   /* mango */
  --cat-school:    #9ecdf2;   /* sky */
  --cat-work:      #c7b7f3;   /* lavender */
  --cat-childcare: #f7c948;   /* yellow */
  --cat-cleaning:  #a8d5ba;   /* mint */
  --cat-laundry:   #b6d7e8;   /* soft sky */
  --cat-admin:     #c7b7f3;   /* lavender */
  --cat-errands:   #f6b26b;   /* orange */
  --cat-medical:   #f28b82;   /* coral */
  --cat-exercise:  #a8d5ba;   /* mint */
  --cat-rest:      #d5c6a1;   /* warm tan */
  --cat-planning:  #9ecdf2;   /* sky */
  --cat-family:    #f4a7b9;   /* rose */
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--brown);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.8rem; margin-bottom: 4px; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { line-height: 1.55; }

a { color: inherit; text-decoration: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--brown);
  transition: transform var(--transition), opacity var(--transition);
}
button:active { transform: scale(0.96); }

/* ---- #1: Global keyboard focus states ---- */
:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(244, 167, 185, 0.22);
  border-radius: 4px;
}
/* Suppress focus ring for mouse/touch — only show for keyboard */
:focus:not(:focus-visible) { outline: none; box-shadow: none; }

/* Inputs already show a border change; add focus ring too */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 0;
  box-shadow: 0 0 0 4px rgba(244, 167, 185, 0.18);
}

input, select, textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: var(--white);
  color: var(--brown);
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--soft-brown);
}
textarea { resize: vertical; min-height: 80px; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--soft-brown);
  margin-bottom: 5px;
}

.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  border: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--brown);
  color: var(--cream);
  box-shadow: 0 3px 10px var(--shadow);
}
.btn-primary:hover { opacity: 0.88; }
.btn-secondary {
  background: var(--beige);
  color: var(--brown);
  border: 2px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: var(--coral);
  color: var(--white);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
}
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--beige);
  font-size: 1rem;
}
.btn-icon:hover { background: var(--border); }

.sched-header-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  background: var(--beige);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.sched-header-btn:hover { background: var(--border); }
.sched-header-btn.active {
  background: var(--brown);
}
.sched-header-icon { font-size: 1.1rem; line-height: 1; }
.sched-header-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--soft-brown);
  line-height: 1;
  white-space: nowrap;
}
.sched-header-btn.active .sched-header-label { color: rgba(255,255,255,0.85); }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.text-muted { color: var(--soft-brown); font-size: 0.88rem; }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition);
  white-space: nowrap;
}
.chip:active { transform: scale(0.94); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--soft-brown);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; line-height: 1.5; }

/* Onboarding-style empty state card */
.empty-state-card {
  background: var(--beige);
  border-radius: var(--radius-lg);
  padding: 28px 22px 24px;
  text-align: center;
  color: var(--brown);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.empty-state-illustration {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 2px;
}
.empty-state-headline {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brown);
  margin: 0;
  line-height: 1.3;
}
.empty-state-body {
  font-size: 0.88rem;
  color: var(--soft-brown);
  line-height: 1.55;
  margin: 0;
  max-width: 300px;
}
.empty-state-hint {
  font-size: 0.78rem;
  color: var(--soft-brown);
  margin: 0;
  opacity: 0.8;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* Section label — small, readable, no all-caps */
.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--soft-brown);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

/* Section header — h2-weight divider titles like "Audit Snapshot", "Chore Library" */
.section-header {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header-sub {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--soft-brown);
  margin-left: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--beige);
  color: var(--brown);
  border: 1.5px solid var(--border);
}

.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes confettiBurst {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(1.4); opacity: 0.7; }
  100% { transform: scale(0.8); opacity: 0; }
}

.anim-fade-in { animation: fadeIn 0.25s ease forwards; }
.anim-pop { animation: pop 0.3s ease; }

/* ---- Urdu / Bilingual Typography ---- */
:root {
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Nafees Web Naskh",
               "Traditional Arabic", "Arabic Typesetting", "Scheherazade New", serif;
}

/* Stacked multi-language label wrapper */
.multilang-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1;
}
.lang-en {
  font-size: 1em;
  line-height: 1.2;
}
.lang-ur, .urdu-label {
  font-family: var(--font-urdu);
  font-size: 1.05em;
  line-height: 1.9;
  direction: rtl;
  color: var(--brown);
  display: block;
  margin-left: 0;
}
.lang-roman, .roman-urdu-hint {
  font-size: 0.78em;
  color: var(--soft-brown);
  font-style: italic;
  line-height: 1.2;
}

/* Block standalone Urdu text (single-lang mode) */
.urdu-text {
  font-family: var(--font-urdu);
  font-size: 1.15em;
  line-height: 2.1;
  direction: rtl;
  display: block;
}
.sched-urdu-row,
.task-lang-subtitle {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  margin-top: 3px;
}
.urdu-script {
  font-size: 0.92rem; color: var(--brown);
  direction: rtl; font-family: var(--font-urdu);
  line-height: 1.9;
}
.urdu-input {
  font-size: 1rem; text-align: right;
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  line-height: 1.8;
}
.lang-chip {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--beige);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--brown);
  transition: background var(--transition);
  white-space: nowrap;
}
.lang-chip:hover { background: var(--border); }
