:root {
  --sand-50: #f7f1e8;
  --sand-100: #eee2d2;
  --sand-200: #decbb2;
  --sandstone: #aa8262;
  --terracotta: #a94f3f;
  --red: #a9363f;
  --red-dark: #0b2147;
  --olive: #23845c;
  --blue: #2c6fbe;
  --blue-dark: #123b67;
  --jordan-red: #b82d3b;
  --jordan-green: #16784a;
  --ink: #101f36;
  --muted: #596779;
  --white: #fff;
  --green-bg: #e7f1e5;
  --green: #42643e;
  --yellow-bg: #fff1cd;
  --yellow: #7a5815;
  --red-bg: #f8e3df;
  --danger: #9d2f32;
  --line: #ddcfbd;
  --shadow: 0 12px 30px rgba(66, 43, 25, 0.1);
  --radius: 18px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background-color: var(--sand-50); background-image: linear-gradient(30deg, rgba(169,79,63,.035) 12%, transparent 12.5%, transparent 87%, rgba(169,79,63,.035) 87.5%), linear-gradient(150deg, rgba(22,120,74,.03) 12%, transparent 12.5%, transparent 87%, rgba(22,120,74,.03) 87.5%); background-size: 46px 80px; font-family: var(--font); font-size: 16px; line-height: 1.5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue-dark); }
svg { width: 1.25rem; fill: currentColor; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #e2a53d; outline-offset: 3px; }

.skip-link { position: fixed; inset-block-start: .75rem; inset-inline-start: .75rem; z-index: 100; transform: translateY(-160%); background: var(--ink); color: white; padding: .7rem 1rem; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.welcome-screen { min-height: 100svh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 3.25rem 1rem 2rem; background: linear-gradient(90deg, rgba(4,16,29,.92) 0%, rgba(4,16,29,.68) 48%, rgba(4,16,29,.28) 100%), url("assets/miyahi-amman-hero.webp") center / cover no-repeat; }
.welcome-pattern { position: absolute; inset: 0 0 auto; height: 15px; background: linear-gradient(to bottom, #151515 0 33%, #fff 33% 66%, var(--jordan-green) 66% 100%); border-bottom: 1px solid rgba(0,0,0,.1); }
.welcome-pattern::before { content: ""; position: absolute; inset: 0 auto 0 0; width: min(24vw, 180px); background: var(--jordan-red); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.welcome-pattern::after { display: none; }
.welcome-shell { width: min(100%, 1180px); display: grid; gap: 1rem; align-items: end; position: relative; z-index: 1; }
.welcome-inner { width: min(100%, 620px); text-align: center; padding: 1.25rem; border: 1px solid rgba(255,255,255,.2); border-radius: 22px; background: rgba(5,20,37,.76); box-shadow: 0 25px 60px rgba(0,0,0,.27); backdrop-filter: blur(7px); }
.welcome-inner h1 { font-size: clamp(2.55rem, 10vw, 4.8rem); line-height: .95; color: #fff; margin: .35rem 0 1.25rem; letter-spacing: -.05em; }
.welcome-arabic { margin: .25rem 0 0; color: #83d3a9; font-size: 1.35rem; font-weight: 800; line-height: 1; }
.welcome-inner > .eyebrow { color: #e9b4aa; }
.jordan-pill { width: fit-content; display: flex; align-items: center; gap: .45rem; margin: .35rem auto .55rem; padding: .35rem .7rem; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); border-radius: 99px; font-size: .78rem; font-weight: 700; }
.jordan-flag { width: 24px; height: 14px; display: inline-block; position: relative; background: linear-gradient(to bottom, #111 0 33%, #fff 33% 66%, var(--jordan-green) 66%); border: 1px solid rgba(0,0,0,.14); overflow: hidden; }
.jordan-flag::after { content: ""; position: absolute; inset: -1px auto -1px -1px; width: 12px; background: var(--jordan-red); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.welcome-lede { font-size: 1.15rem; max-width: 520px; margin: 0 auto 1.4rem; color: #eef4fb; }
.welcome-note { display: flex; text-align: start; gap: .65rem; max-width: 520px; padding: .9rem 1rem; margin: 0 auto 1.35rem; color: #e7edf5; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; font-size: .9rem; }
.welcome-note svg { flex: 0 0 auto; color: #82b8e8; margin-top: .1rem; }
.welcome-inner .button--primary { background: var(--jordan-red); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.welcome-inner .button--primary:hover { background: #982532; }
.welcome-account { width: min(100%, 420px); min-height: 62px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; margin: .8rem auto 0; padding: .7rem .9rem; border: 1px solid rgba(255,255,255,.3); border-radius: 14px; background: rgba(255,255,255,.12); color: #fff; text-align: start; }
.welcome-account:hover { background: rgba(255,255,255,.18); }
.welcome-account strong, .welcome-account small { display: block; }
.welcome-account small { margin-top: .08rem; color: #d7e1ec; font-size: .76rem; }
.account-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--jordan-green); color: #fff; font-size: .55rem; box-shadow: inset 0 0 0 7px rgba(255,255,255,.22); }
.language-picker { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; margin-top: 1.25rem; font-size: .85rem; color: #d2dce8; }
.language-picker > span { width: 100%; }
.language-option { padding: .4rem .75rem; border-radius: 99px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.09); color: #e4ebf4; }
.language-option.is-active { background: #fff; color: var(--red-dark); border-color: #fff; }
.welcome-photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.welcome-photo-grid figure { min-width: 0; height: 150px; position: relative; overflow: hidden; margin: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 15px; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.welcome-photo-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.welcome-photo-grid figure::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(3,13,24,.88)); }
.welcome-photo-grid figcaption { position: absolute; z-index: 1; inset: auto .75rem .65rem; color: #fff; font-size: .78rem; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.6); }

.brand-mark { display: inline-grid; place-items: center; position: relative; width: 42px; height: 48px; }
.brand-mark--large { width: 92px; height: 98px; }
.brand-drop { display: block; width: 30px; height: 38px; color: var(--blue); filter: drop-shadow(0 3px 2px rgba(18,59,103,.2)); }
.brand-drop svg { width: 100%; height: 100%; display: block; }
.brand-drop .drop-body { fill: currentColor; }
.brand-drop .drop-shine { fill: rgba(255,255,255,.38); }
.brand-mark--large .brand-drop { width: 56px; height: 68px; }
.brand-ripple { position: absolute; bottom: 2px; width: 84px; height: 15px; border: 3px solid var(--sandstone); border-top: 0; border-radius: 50%; opacity: .65; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: .73rem; color: var(--terracotta); margin: 0 0 .25rem; }

.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .7rem; padding: .7rem 1.25rem; border: 1px solid transparent; border-radius: 13px; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: linear-gradient(135deg, #2d72d5, #1f56b3); color: white; box-shadow: 0 6px 15px rgba(31,86,179,.2); }
.button--primary:hover { background: linear-gradient(135deg, #245fb7, #173f86); }
.button--large { min-width: min(100%, 270px); min-height: 56px; font-size: 1.05rem; }
.button--ghost { background: transparent; color: var(--red-dark); border-color: var(--line); }
.button--ghost:hover { background: var(--sand-100); }
.button--small { min-height: 38px; padding: .4rem .75rem; font-size: .84rem; }
.button--danger { background: var(--danger); color: white; }
.text-button { padding: .4rem; border: 0; background: transparent; color: var(--blue-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.app-shell { min-height: 100svh; }
.jordan-service-bar { height: 28px; display: flex; align-items: center; justify-content: center; gap: .5rem; color: #fff; background: var(--red-dark); font-size: .75rem; font-weight: 600; letter-spacing: .015em; }
.topbar { min-height: 72px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: rgba(251,247,241,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand-button { display: flex; align-items: center; gap: .55rem; border: 0; background: transparent; color: var(--red-dark); text-align: start; padding: 0; }
.brand-button strong, .brand-button small { display: block; }
.brand-button strong { font-size: 1.08rem; line-height: 1; }
.brand-button strong > span:first-child { color: var(--olive); }
.brand-button strong i { color: #a9b5c4; font-style: normal; font-weight: 400; margin: 0 .15rem; }
.brand-button small { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.header-language { display: flex; padding: 3px; background: var(--sand-100); border: 1px solid var(--line); border-radius: 10px; }
.header-language button { min-height: 34px; display: flex; align-items: center; gap: .35rem; padding: .25rem .5rem; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .72rem; }
.header-language button span { display: none; }
.header-language button b { font-size: .7rem; }
.header-language button.header-language__active { color: #fff; background: var(--jordan-green); }
.account-button { max-width: 130px; min-width: 42px; padding-inline: .55rem; }
.account-button > span:last-child { max-width: 85px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button .account-icon { width: 25px; height: 25px; }
.app-layout { max-width: none; margin: 0 auto; }
.main-nav { position: sticky; z-index: 30; top: 72px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; gap: .2rem; padding: .45rem .3rem; background: rgba(255,250,244,.97); border-bottom: 1px solid var(--line); box-shadow: 0 7px 22px rgba(73,48,27,.08); backdrop-filter: blur(10px); }
.main-nav::-webkit-scrollbar { display: none; }
.nav-kicker { display: none; }
.nav-secondary { display: flex; }
.nav-item { min-width: 0; min-height: 58px; padding: .35rem .15rem; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); display: flex; flex-direction: column; gap: .2rem; align-items: center; justify-content: center; font-weight: 700; font-size: .67rem; line-height: 1.15; text-align: center; }
.main-nav .nav-secondary { display: flex; }
.nav-item svg { width: 1.25rem; }
.nav-item.is-active { color: #fff; background: var(--jordan-red); border-color: var(--jordan-red); box-shadow: 0 4px 12px rgba(184,45,59,.2); }
main { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1rem 3rem; min-width: 0; }
main:focus { outline: none; }
.view { animation: fade-in .25s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: grid; gap: .55rem; margin: 0 0 1.25rem; }
.page-heading h1, .page-heading h2 { color: var(--red-dark); margin: 0; line-height: 1.1; }
.page-heading h1 { font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: -.03em; }
.page-heading > p, .page-heading > div + p { color: var(--muted); margin: 0; max-width: 650px; }
.page-heading--dashboard > p { font-size: .9rem; }
.page-heading--small h2 { font-size: 1.7rem; }
.page-hero { min-height: 230px; align-content: end; position: relative; overflow: hidden; padding: 1.35rem; border: 1px solid rgba(255,255,255,.35); border-bottom: 5px solid var(--terracotta); border-radius: 22px; box-shadow: 0 16px 36px rgba(45,30,18,.16); background-position: center; background-size: cover; }
.page-hero::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, #151515 0 34%, #f7f3ed 34% 66%, var(--jordan-green) 66% 100%); }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(0deg, rgba(7,20,27,.85), rgba(7,20,27,.08) 82%); }
.page-hero > * { position: relative; z-index: 1; }
.page-hero--amman { background-image: url("assets/miyahi-amman-hero.webp"); }
.page-hero--tank { background-image: url("assets/miyahi-rooftop-tank.webp"); }
.page-hero--daily { background-image: url("assets/miyahi-daily-kitchen.webp"); background-position: center 43%; }
.page-hero--tips { background-image: url("assets/miyahi-leak-repair.webp"); background-position: center 42%; }
.page-hero--courtyard { background-image: url("assets/miyahi-jordan-courtyard.webp"); background-position: center 52%; }
.page-hero h1, .page-hero h2 { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.page-hero > p, .page-hero > div + p { color: #f4eee6; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.page-hero .eyebrow { color: #f1bdb4; }
.page-heading--dashboard > p { text-align: start; }
.card { background: #fffaf4; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.card-heading h2, .card-heading p { margin: 0; }
.card-heading h2 { color: var(--red-dark); font-size: 1.25rem; }
.card-heading p:not(.eyebrow) { color: var(--muted); font-size: .9rem; }

.setup-form { position: relative; overflow: hidden; width: 100%; max-width: none; padding: 1.25rem; }
.setup-form::before { content: ""; display: block; height: 9px; margin: -1.25rem -1.25rem 1.25rem; background: repeating-linear-gradient(45deg, var(--jordan-red) 0 8px, var(--jordan-red) 8px 12px, #f5eee4 12px 20px, var(--jordan-green) 20px 28px, var(--jordan-green) 28px 32px, #191919 32px 40px); }
.form-section-heading { display: flex; gap: .8rem; margin-bottom: 1rem; }
.form-section-heading h2, .form-section-heading p { margin: 0; }
.form-section-heading h2 { color: var(--red-dark); font-size: 1.15rem; }
.form-section-heading p { color: var(--muted); font-size: .88rem; }
.step-number { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: white; font-weight: 800; }
.field-grid { display: grid; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 700; color: #403a35; }
.field input:not([type="range"]), .field select { width: 100%; min-height: 49px; padding: .65rem .75rem; border: 1.5px solid #cfc2b2; border-radius: 11px; background: white; color: var(--ink); }
.field input:hover, .field select:hover { border-color: var(--sandstone); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); background: #fff9f8; }
.field small { color: var(--muted); font-size: .8rem; }
.field-helper-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.field-helper-row small { flex: 1 1 190px; }
.helper-button { min-height: 34px; padding: .35rem .65rem; border: 1px solid #b7cbe0; border-radius: 9px; background: #edf5fc; color: var(--blue-dark); font-size: .78rem; font-weight: 800; }
.helper-button:hover { border-color: var(--blue); background: #e1eef9; }
.field-error { min-height: 1.1em; color: var(--danger); font-weight: 600; font-size: .8rem; }
.input-with-suffix { position: relative; }
.input-with-suffix input { padding-inline-end: 5.2rem !important; }
.input-with-suffix span { position: absolute; inset-inline-end: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; }
.range-row { display: flex; align-items: center; min-height: 49px; gap: 1rem; }
.range-row input { flex: 1; accent-color: var(--blue); min-height: 28px; }
.range-row output { min-width: 58px; text-align: center; padding: .45rem; border-radius: 9px; background: var(--blue-dark); color: white; font-weight: 800; }
.form-divider { height: 1px; background: var(--line); margin: 1.5rem 0; }
.form-actions { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.form-assurance { display: flex; gap: .45rem; align-items: center; color: var(--muted); font-size: .8rem; margin: 0; }
.form-assurance svg { flex: 0 0 auto; width: 1.1rem; color: var(--olive); }

.task-launcher { margin-bottom: 1.15rem; padding: 1.05rem; background-color: var(--red-dark); background-image: linear-gradient(30deg, rgba(255,255,255,.045) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.045) 87.5%), linear-gradient(150deg, rgba(255,255,255,.045) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.045) 87.5%); background-size: 36px 62px; border-radius: var(--radius); color: #fff; box-shadow: 0 12px 30px rgba(11,33,71,.16); }
.task-launcher__heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.task-launcher__heading .eyebrow { color: #9dc2f5; }
.task-launcher__heading h2 { margin: 0; color: #fff; font-size: 1.12rem; }
.task-grid { display: grid; gap: .55rem; }
.task-grid button { min-height: 62px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .7rem; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.09); color: #fff; text-align: start; }
.task-grid button:hover { background: rgba(255,255,255,.16); }
.task-grid strong, .task-grid small { display: block; }
.task-grid small { color: #c8d7eb; margin-top: .1rem; }
.task-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--olive); color: #fff; font-weight: 800; }

.status-banner { display: flex; gap: 1rem; padding: 1.15rem; border: 1px solid; border-radius: var(--radius); margin-bottom: 1rem; }
.status-banner.green { background: var(--green-bg); color: var(--green); border-color: #b6d2b0; }
.status-banner.yellow { background: var(--yellow-bg); color: var(--yellow); border-color: #e7ca7d; }
.status-banner.red { background: var(--red-bg); color: var(--danger); border-color: #e0ada4; }
.status-icon { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: currentColor; color: white; font-size: 1.35rem; font-weight: 900; }
.status-banner h2, .status-banner p { margin: 0; }
.status-banner h2 { color: var(--ink); font-size: 1.15rem; }
.status-banner p { color: #5c554d; font-size: .88rem; margin-top: .2rem; }
.status-label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.dashboard-grid { display: grid; gap: 1rem; }
.tank-card, .countdown-card { padding: 1.2rem; }
.tank-content { display: grid; justify-items: center; gap: 1.2rem; padding-top: 1.5rem; }
.tank-visual { width: 180px; height: 225px; position: relative; overflow: hidden; border: 7px solid #8c8176; border-top-width: 10px; border-radius: 20px 20px 35px 35px; background: #f1eee9; box-shadow: inset 0 0 0 4px rgba(255,255,255,.7); }
.tank-visual::before { content: ""; position: absolute; z-index: 3; top: -10px; left: 25%; width: 50%; height: 12px; background: #6d655d; border-radius: 4px; }
.tank-fill { position: absolute; inset: auto 0 0; height: 0; background: linear-gradient(#47a0b2, #1d6c80); transition: height .55s ease; }
.tank-wave { position: absolute; top: -8px; left: -10%; width: 120%; height: 17px; background: rgba(255,255,255,.3); border-radius: 50%; }
.tank-reading { position: absolute; z-index: 4; inset: 0; display: grid; place-content: center; text-align: center; text-shadow: 0 1px 2px rgba(255,255,255,.8); }
.tank-reading strong { font-size: 2.3rem; color: var(--ink); line-height: 1; }
.tank-reading span { font-size: .75rem; font-weight: 700; }
.tank-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tank-stats div { padding: .8rem; border-radius: 13px; background: var(--sand-50); border: 1px solid var(--line); }
.tank-stats span, .tank-stats strong { display: block; }
.tank-stats span { color: var(--muted); font-size: .78rem; }
.tank-stats strong { font-size: 1.15rem; color: var(--blue-dark); }
.countdown-card .eyebrow { margin-bottom: 1rem; }
.metric { display: flex; align-items: baseline; gap: .6rem; }
.metric strong { color: var(--red-dark); font-size: clamp(4rem, 19vw, 6rem); line-height: .85; }
.metric span { max-width: 100px; color: var(--muted); font-weight: 700; }
.comparison-line { display: flex; align-items: center; gap: .5rem; margin: 1.5rem 0 1rem; color: var(--muted); font-size: .8rem; }
.comparison-line::before, .comparison-line::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.delivery-row { display: flex; gap: .9rem; align-items: center; }
.calendar-icon { flex: 0 0 auto; overflow: hidden; width: 58px; text-align: center; border: 1px solid var(--line); border-radius: 10px; }
.calendar-icon span, .calendar-icon strong { display: block; }
.calendar-icon span { background: var(--red); color: white; font-size: .65rem; font-weight: 800; padding: .15rem; text-transform: uppercase; }
.calendar-icon strong { color: var(--red-dark); font-size: 1.35rem; padding: .2rem; }
.delivery-row > div:last-child span, .delivery-row > div:last-child strong, .delivery-row > div:last-child small { display: block; }
.delivery-row > div:last-child span, .delivery-row > div:last-child small { color: var(--muted); }
.delivery-row > div:last-child span { font-size: .78rem; }
.delivery-row > div:last-child small { font-size: .75rem; }
.calculation-note { display: flex; gap: .5rem; margin-top: 1.3rem; padding: .7rem; border-radius: 10px; background: var(--sand-50); color: var(--muted); font-size: .78rem; }
.calculation-note svg { flex: 0 0 auto; color: var(--blue); width: 1rem; }
.quick-actions { margin-top: 1.5rem; }
.quick-actions h2 { color: var(--red-dark); font-size: 1.3rem; }
.quick-grid { display: grid; gap: .75rem; }
.quick-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; text-align: start; padding: 1rem; border: 1px solid var(--line); border-radius: 15px; background: white; color: var(--ink); }
.quick-card:hover { border-color: var(--sandstone); box-shadow: var(--shadow); }
.quick-card strong, .quick-card small { display: block; }
.quick-card small { color: var(--muted); margin-top: .15rem; }
.quick-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; font-size: 1.25rem; font-weight: 800; }
.quick-icon--blue { background: var(--blue); }
.quick-icon--olive { background: var(--olive); }

.daily-layout { display: grid; gap: 1rem; align-items: start; }
.compact-form { padding: 1.2rem; display: grid; gap: 1rem; border-block-start: 5px solid var(--jordan-red); }
.button-row { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.weekly-column { display: grid; gap: 1rem; min-width: 0; }
.summary-card, .entries-card { padding: 1.2rem; }
.summary-card { border-block-start: 5px solid var(--jordan-green); }
.date-pill { padding: .3rem .65rem; border-radius: 99px; background: var(--sand-100); color: var(--muted); font-size: .76rem; white-space: nowrap; }
.summary-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1.2rem 0; }
.summary-metrics div { min-width: 0; padding: .6rem; background: var(--sand-50); border-radius: 11px; }
.summary-metrics span, .summary-metrics strong { display: block; }
.summary-metrics span { color: var(--muted); font-size: .7rem; }
.summary-metrics strong { color: var(--blue-dark); font-size: clamp(.9rem, 4vw, 1.25rem); overflow-wrap: anywhere; }
.usage-notice { min-height: 44px; padding: .65rem .8rem; border-radius: 10px; font-size: .84rem; font-weight: 600; }
.usage-notice.good { color: var(--green); background: var(--green-bg); }
.usage-notice.warn { color: var(--yellow); background: var(--yellow-bg); }
.usage-notice.empty { color: var(--muted); background: var(--sand-50); }
.week-chart { height: 165px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: .35rem; margin-top: 1.3rem; padding-top: .5rem; border-bottom: 1px solid var(--line); }
.chart-day { display: grid; grid-template-rows: 1fr auto; height: 100%; align-items: end; gap: .3rem; text-align: center; }
.chart-bar-wrap { height: 120px; display: flex; align-items: end; justify-content: center; }
.chart-bar { width: min(70%, 30px); min-height: 3px; background: var(--blue); border-radius: 6px 6px 0 0; }
.chart-day span { color: var(--muted); font-size: .67rem; }
.entries-card .card-heading { margin-bottom: .75rem; }
.entry-list { display: grid; gap: .55rem; }
.entry-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.entry-row:last-child { border-bottom: 0; }
.entry-row strong, .entry-row span { display: block; }
.entry-row span { color: var(--muted); font-size: .78rem; }
.entry-actions { display: flex; gap: .3rem; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--blue-dark); background: white; }
.icon-button--danger { color: var(--danger); }
.empty-state { padding: 1.4rem; text-align: center; color: var(--muted); background: var(--sand-50); border-radius: 12px; }

.context-card { padding: 1rem 1.1rem; margin-bottom: 1rem; border-inline-start: 5px solid var(--blue); border-radius: 5px 14px 14px 5px; background: #e6f2f4; color: var(--blue-dark); }
.context-card strong { display: block; }
.suggestions-grid { display: grid; gap: .8rem; }
.suggestion-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.15rem; }
.suggestion-card:nth-child(3n + 1) { border-block-start: 4px solid var(--jordan-red); }
.suggestion-card:nth-child(3n + 2) { border-block-start: 4px solid var(--jordan-green); }
.suggestion-card:nth-child(3n) { border-block-start: 4px solid var(--sandstone); }
.suggestion-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50% 50% 50% 12px; background: var(--sandstone); color: white; font-weight: 800; }
.suggestion-card h2, .suggestion-card p { margin: 0; }
.suggestion-card h2 { color: var(--red-dark); font-size: 1.08rem; }
.suggestion-card p { margin-top: .25rem; color: var(--muted); font-size: .9rem; }
.gentle-note { display: flex; gap: 1rem; padding: 1.2rem; margin-top: 1rem; background: var(--olive); color: white; border-radius: var(--radius); }
.gentle-note svg { flex: 0 0 auto; }
.gentle-note h2, .gentle-note p { margin: 0; }
.gentle-note h2 { font-size: 1.1rem; }
.gentle-note p { margin-top: .2rem; opacity: .92; }

.about-grid { display: grid; gap: 1rem; }
.story-card { overflow: hidden; }
.story-card > div:last-child { padding: 1.2rem; }
.story-card h2, .story-card p { margin-top: 0; }
.story-card h2 { color: var(--red-dark); }
.story-card p { color: var(--muted); }
.story-arch { height: 220px; overflow: hidden; background: var(--sand-100); border-end-start-radius: 82px; border-end-end-radius: 82px; }
.story-arch img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 42%; }
.formula-card { padding: 1.2rem; color: #fff; background-color: var(--red-dark); background-image: linear-gradient(30deg, rgba(255,255,255,.045) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.045) 87.5%), linear-gradient(150deg, rgba(255,255,255,.045) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.045) 87.5%); background-size: 34px 59px; }
.formula-card h2 { color: #fff; margin-top: 0; }
.formula-card .eyebrow { color: #e9b4aa; }
.formula-card > p:last-child { color: #d9e2ed; }
.formula { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: .35rem; margin: .65rem 0; padding: .75rem; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; text-align: center; font-size: .75rem; }
.formula strong { color: #f4bd65; font-size: 1rem; }
.sources-section { margin-top: 2rem; }
.sources-list { display: grid; gap: .65rem; }
.source-link { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: 1rem; background: white; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; }
.source-link:hover { border-color: var(--sandstone); box-shadow: var(--shadow); }
.source-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--sand-100); color: var(--red-dark); font-weight: 800; }
.source-link strong, .source-link small { display: block; }
.source-link small { color: var(--muted); }
.source-link > span:last-child { color: var(--blue); font-size: 1.25rem; }
.official-note { display: flex; flex-direction: column; margin-top: 1rem; padding: 1rem; border: 1px dashed var(--sandstone); border-radius: 12px; color: var(--muted); }
.official-note strong { color: var(--red-dark); }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 85px; transform: translate(-50%, 130px); width: min(calc(100% - 2rem), 420px); padding: .8rem 1rem; border-radius: 12px; background: var(--ink); color: white; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.dialog { width: min(calc(100% - 2rem), 430px); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 25px 70px rgba(0,0,0,.3); }
.dialog::backdrop { background: rgba(39,36,32,.6); backdrop-filter: blur(3px); }
.dialog form { padding: 1.5rem; text-align: center; }
.dialog h2 { color: var(--red-dark); margin-bottom: .5rem; }
.dialog p { color: var(--muted); }
.dialog-icon { margin: auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--red-bg); color: var(--danger); font-size: 1.8rem; font-weight: 800; }
.dialog .button-row { margin-top: 1.2rem; }
.auth-dialog { width: min(calc(100% - 1.5rem), 500px); max-height: calc(100svh - 1rem); overflow-y: auto; }
.auth-dialog__inner { padding: 1.35rem; }
.auth-dialog__header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .85rem; margin-bottom: 1rem; }
.auth-dialog__header h2, .auth-dialog__header p { margin: 0; text-align: start; }
.auth-dialog__header h2 { color: var(--red-dark); }
.dialog-close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; background: var(--sand-50); color: var(--red-dark); font-size: 1.5rem; line-height: 1; }
.auth-intro { margin: 0 0 1rem; color: var(--muted); text-align: start; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .3rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--sand-100); }
.auth-tabs button { min-height: 43px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 800; }
.auth-tabs button[aria-selected="true"] { background: var(--jordan-red); color: #fff; box-shadow: 0 4px 12px rgba(184,45,59,.2); }
#auth-form { display: grid; gap: .8rem; text-align: start; }
#auth-form > .button { width: 100%; margin-top: .2rem; }
.auth-message { min-height: 1.4em; margin: 0; color: var(--muted); font-size: .86rem; font-weight: 600; }
.auth-message.error { color: var(--danger); }
.auth-message.success { color: var(--green); }
.signed-in-panel { display: grid; justify-items: center; gap: .45rem; padding: .6rem 0 .2rem; text-align: center; }
.signed-in-avatar { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: var(--green-bg); color: var(--jordan-green); font-size: .8rem; box-shadow: inset 0 0 0 16px rgba(22,120,74,.13); }
.signed-in-panel p, .signed-in-panel span { margin: 0; color: var(--muted); }
.signed-in-panel strong { color: var(--red-dark); font-size: 1.35rem; overflow-wrap: anywhere; }
.signed-in-panel .button { margin-top: .75rem; }
noscript { display: block; padding: 2rem; text-align: center; }

@media (min-width: 640px) {
  .header-language button span { display: inline; }
  main { padding-inline: 1.5rem; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
  .form-actions { flex-direction: row; align-items: center; justify-content: space-between; }
  .task-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-grid, .suggestions-grid, .about-grid { grid-template-columns: 1fr 1fr; }
  .sources-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .welcome-screen { padding: 3rem; }
  .welcome-shell { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
  .welcome-inner { text-align: start; padding: 2rem; }
  .welcome-inner .brand-mark { margin-inline-start: .25rem; }
  .welcome-inner .jordan-pill { margin-inline: 0; }
  .welcome-lede, .welcome-note { margin-inline: 0; }
  .welcome-account { margin-inline: 0; }
  .language-picker { justify-content: flex-start; }
  .language-picker > span { width: auto; margin-inline-end: .25rem; }
  .welcome-photo-grid { align-self: stretch; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .welcome-photo-grid figure { height: auto; min-height: 220px; }
  .topbar { padding-inline: 2rem; }
  .app-layout { display: block; max-width: none; }
  .main-nav { position: sticky; inset: auto; top: 72px; display: flex; justify-content: center; gap: .4rem; padding: .55rem 2rem; border-top: 0; }
  .main-nav .nav-secondary { display: flex; }
  .nav-item { min-height: 45px; flex-direction: row; justify-content: center; gap: .5rem; padding-inline: 1rem; font-size: .88rem; }
  .nav-item.is-active { background: var(--jordan-red); color: #fff; }
  main { max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(2rem, 5vw, 4.5rem) 4rem; }
  .page-heading { grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr); align-items: end; margin-bottom: 1.8rem; }
  .page-heading--dashboard { align-items: start; }
  .page-heading--dashboard > p { text-align: end; }
  .setup-form { padding: 2rem; }
  .field--wide { grid-column: auto; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); }
  .tank-card, .countdown-card { padding: 1.6rem; }
  .tank-content { grid-template-columns: 200px 1fr; align-items: center; }
  .tank-stats { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .daily-layout { grid-template-columns: minmax(280px, .65fr) minmax(0, 1.35fr); }
  .compact-form { position: sticky; top: 95px; }
  .toast { bottom: 28px; }
}

html[lang="ar"] body { font-family: "Tajawal", system-ui, sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .button, html[lang="ar"] .nav-item { font-family: "Noto Kufi Arabic", "Tajawal", sans-serif; }
html[dir="rtl"] .eyebrow { text-transform: none; letter-spacing: 0; }
html[dir="rtl"] .welcome-inner h1, html[dir="rtl"] .page-heading h1 { letter-spacing: 0; }
html[dir="rtl"] .welcome-screen { background-image: linear-gradient(270deg, rgba(4,16,29,.92) 0%, rgba(4,16,29,.68) 48%, rgba(4,16,29,.28) 100%), url("assets/miyahi-amman-hero.webp"); }
html[dir="rtl"] .welcome-pattern::before { inset: 0 0 0 auto; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
html[dir="rtl"] .jordan-flag::after { inset: -1px -1px -1px auto; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
html[dir="rtl"] .button span[aria-hidden="true"], html[dir="rtl"] .task-grid button > span:last-child { transform: rotate(180deg); }

@media (min-width: 1200px) {
  .suggestions-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
