:root {
    --ink: #29241f;
    --muted: #6d655f;
    --paper: #fff;
    --soft: #f5efe8;
    --line: #ded8d1;
    --coffee: #783d2b;
    --coffee-dark: #50271d;
    --gold: #d6aa6e;
    --green: #287a46;
    --danger: #b23b31;
    --shadow: 0 12px 32px rgba(48, 35, 26, .09);
}

/* CoffeeKawanMobile parity layer */
:root { --maui-cream:#FDF4D4; --maui-gold:#EED381; --maui-button:#D2A874; --maui-brown:#8C6846; --maui-selected:#51402D; --maui-ink:#261D12; }
body { background:#fff; color:#000; font-family:"Open Sans",Arial,sans-serif; }
.app-shell { max-width:520px; min-height:100vh; margin:auto; background:#fff; box-shadow:0 0 30px rgba(38,29,18,.12); }
.maui-header { height:64px; padding:6px 18px; justify-content:center; background:var(--maui-gold); border:0; }
.maui-header .brand img { width:auto; height:48px; }
.maui-header .desktop-nav,.maui-header .header-actions { display:none; }
.app-content { padding-bottom:76px; }
.mobile-nav { display:grid; grid-template-columns:repeat(4,1fr); position:fixed; z-index:20; bottom:0; left:50%; transform:translateX(-50%); width:min(520px,100%); height:72px; padding:5px 0; background:var(--maui-gold); border:0; }
.mobile-nav a { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:2px; color:var(--maui-brown); font-size:12px; font-weight:600; }
.mobile-nav a span { font-size:22px; line-height:1; }
.mobile-nav a.active { color:var(--maui-selected); }
.button,.auth-panel button { min-height:44px; padding:10px 14px; border:0; border-radius:20px; background:var(--maui-button); color:#000; font-size:14px; box-shadow:none; }
.button.primary { background:var(--maui-button); color:#fff; }
input,select,textarea { min-height:48px; padding:10px 16px; border:1px solid #777; border-radius:20px; background:#fff; }
.maui-login { display:block; max-width:none; min-height:calc(100vh - 136px); }
.maui-login .maui-page-hero { height:190px; display:flex; align-items:center; justify-content:center; background:var(--maui-cream); }
.maui-login .auth-brand img { width:230px; max-height:150px; object-fit:contain; }
.maui-login .auth-panel { padding:16px; border:0; box-shadow:none; }
.maui-login .segmented { gap:8px; margin-bottom:20px; }
.maui-login .segmented button { background:#f3f3f3; color:#000; }
.maui-login .segmented button.active { background:var(--maui-button); color:#fff; }
.maui-login h2 { font-size:20px; margin:4px 0 18px; }
.maui-reward-hero { min-height:210px; padding:12px 20px; background:#B5A28F; color:#000; text-align:center; }
.maui-reward-hero img { display:block; height:105px; margin:auto; object-fit:contain; }
.maui-reward-hero .eyebrow,.maui-reward-hero p { display:none; }
.maui-reward-hero h1 { font-size:22px; }
.reward-panel { margin:0; padding:18px 16px; border:0; }
.streak-grid { display:flex; justify-content:center; gap:4px; }
.streak-day { min-width:0; flex:1; padding:0; border:0; background:none; text-align:center; }
.streak-day strong { display:flex; align-items:center; justify-content:center; width:38px; height:38px; margin:auto; border-radius:50%; background:#fff; color:#000; font-size:11px; }
.streak-day span { display:block; margin-top:8px; font-size:10px; }
.streak-day.complete strong { background:#555; color:#fff; }
.streak-day.next strong { background:var(--maui-button); }
.reward-action { flex-direction:column; align-items:stretch; text-align:center; border:0; }
.maui-scanner { display:block; position:relative; height:calc(100vh - 136px); padding:0; background:#111; color:#fff; }
.maui-scanner>div:first-child { position:absolute; z-index:3; bottom:20px; width:100%; padding:16px; text-align:center; }
.maui-scanner>div:first-child h1,.maui-scanner>div:first-child .eyebrow,.maui-scanner>div:first-child>p:first-of-type,.maui-scanner details,.maui-scanner .privacy-note { display:none; }
.maui-scanner .scanner-frame { position:absolute; inset:0; min-height:0; border:0; background:#111; }
.maui-scanner .scanner-frame.active video { width:100%; height:100%; object-fit:cover; }
.maui-scanner .scanner-start-button { position:absolute; z-index:4; top:50%; left:50%; bottom:auto; transform:translate(-50%,-50%); min-width:180px; }
.maui-scanner .scanner-corners { width:250px; height:250px; border:0; background:linear-gradient(red,red) left top/20px 2px no-repeat,linear-gradient(red,red) left top/2px 20px no-repeat,linear-gradient(red,red) right top/20px 2px no-repeat,linear-gradient(red,red) right top/2px 20px no-repeat,linear-gradient(red,red) left bottom/20px 2px no-repeat,linear-gradient(red,red) left bottom/2px 20px no-repeat,linear-gradient(red,red) right bottom/20px 2px no-repeat,linear-gradient(red,red) right bottom/2px 20px no-repeat; }
@media(min-width:700px){.mobile-nav{display:grid}.app-header{position:sticky}.app-content{padding-bottom:76px}}
.maui-profile-guest { min-height:calc(100vh - 136px); padding:30px 20px; text-align:center; }
.maui-profile-guest img { display:block; max-width:100%; margin:20px auto; }
.mobile-home-top { display:block; background:#fff; }
.mobile-slideshow { position:relative; width:100%; height:30vh; min-height:190px; max-height:300px; overflow:hidden; background:var(--maui-button); }
.mobile-slideshow>img { display:block; width:100%; height:100%; object-fit:cover; }
.slide-indicators { position:absolute; left:0; right:0; bottom:9px; display:flex; justify-content:center; gap:7px; }
.slide-indicators button { width:8px; height:8px; min-height:0; padding:0; border:0; border-radius:50%; background:#888; }
.slide-indicators button.active { background:#111; }
.slide-arrow { position:absolute; z-index:3; top:50%; transform:translateY(-50%); display:flex; align-items:center; justify-content:center; width:48px; height:64px; min-height:0; padding:0; border:0; border-radius:0; color:#fff; background:rgba(0,0,0,.22); font-size:34px; line-height:1; }
.slide-arrow:hover,.slide-arrow:focus-visible { background:rgba(0,0,0,.5); }
.slide-arrow.previous { left:12px; }
.slide-arrow.next { right:12px; }
.slide-fallback { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:var(--maui-ink); font-weight:700; }
.slide-fallback img { width:160px; height:64px; object-fit:contain; }
.mobile-welcome { margin:0; padding:14px 20px 8px; color:#000; font-size:16px; }
.desktop-home-hero { display:none; }
.profile-layout { display:block; }
.profile-summary { padding:24px 20px; background:linear-gradient(#FDF4D4,#8C6846); border:0; }
.profile-summary img,.profile-summary .avatar { width:100px; height:100px; border-radius:50%; margin:auto; }
.profile-form { padding:20px; border:0; }
.profile-menu { display:flex; flex-direction:column; margin:20px -20px; }
.profile-menu a { padding:14px 20px; color:#000; font-weight:700; border-bottom:1px solid #eee; }
.avatar-picker { position:relative; display:block; width:150px; height:150px; margin:0 auto 16px; cursor:pointer; }
.avatar-picker>img:not(.camera-badge),.avatar-picker>.avatar { display:block; width:100%; height:100%; margin:0; border:1px solid #111; border-radius:50%; object-fit:cover; overflow:hidden; }
.avatar-picker input[type=file] { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; }
.avatar-picker .camera-badge { position:absolute; right:0; bottom:0; width:46px; height:46px; padding:7px; border-radius:50%; background:#fff; object-fit:contain; box-shadow:0 2px 8px rgba(0,0,0,.25); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Arial, "Helvetica Neue", sans-serif; color: var(--ink); background: #faf9f7; }
body { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; }
h2 { font-size: 1.55rem; }

.app-shell { min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 20; height: 76px; padding: 0 max(24px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; gap: 38px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 126px; height: 48px; object-fit: contain; background: #0e0e0e; }
.desktop-nav { display: flex; align-items: center; gap: 26px; flex: 1; }
.desktop-nav a { padding: 27px 0 24px; color: var(--muted); border-bottom: 3px solid transparent; }
.desktop-nav a.active { color: var(--ink); border-color: var(--coffee); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.profile-link { font-weight: 700; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); background: white; font-size: 1.25rem; }
.app-content { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 90px; }
.mobile-nav { display: none; }

.button { min-height: 46px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--coffee); border-radius: 4px; font-weight: 700; }
.button.primary { color: white; background: var(--coffee); }
.button.primary:hover { background: var(--coffee-dark); }
.button.secondary { color: var(--coffee); background: transparent; }
.button.compact { min-height: 38px; padding: 0 16px; }
.button.full { width: 100%; }
.button:disabled { opacity: .48; cursor: default; }
.eyebrow { margin-bottom: 9px; color: var(--coffee); font-size: .77rem; font-weight: 800; letter-spacing: .12em; }

.home-hero { min-height: 410px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; padding: 58px 6%; color: white; background: #17110e; overflow: hidden; }
.home-hero > div:first-child { max-width: 680px; z-index: 1; }
.home-hero h1 { margin-bottom: 20px; }
.home-hero p:not(.eyebrow) { max-width: 600px; color: #d8d0cb; font-size: 1.1rem; line-height: 1.65; }
.home-hero .eyebrow { color: var(--gold); }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; }
.home-hero .button.secondary { color: white; border-color: #8b7468; }
.hero-mark { display: flex; justify-content: center; }
.hero-mark img { width: min(390px, 100%); filter: drop-shadow(0 30px 38px rgba(0,0,0,.35)); }

.section-block { padding: 52px 0 12px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > a { color: var(--coffee); font-weight: 700; }
.summary-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); border: 1px solid var(--line); background: white; }
.metric { min-height: 142px; display: flex; flex-direction: column; justify-content: center; padding: 25px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric span, .metric small { color: var(--muted); }
.metric strong { margin: 7px 0; font-size: 1.75rem; }
.metric.feature { color: white; background: var(--coffee); }
.metric.feature span, .metric.feature small { color: #eadbd4; }
.metric.points-in strong { color: var(--green); }
.metric.points-out strong { color: var(--danger); }
.foc-strip { min-height: 78px; display: grid; grid-template-columns: minmax(180px, 260px) 1fr 48px; align-items: center; gap: 24px; padding: 18px 24px; border: 1px solid var(--line); border-top: 0; background: var(--soft); }
.foc-strip div:first-child { display: flex; flex-direction: column; gap: 3px; }
.foc-strip span { color: var(--muted); font-size: .88rem; }
.progress-track { height: 8px; background: #dfd4c8; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--coffee); }
.outlet-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.outlet-row { min-height: 104px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 14px; padding: 20px 18px; background: white; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.outlet-row h3 { margin: 0 0 5px; font-size: 1rem; }
.outlet-row p { margin: 0; color: var(--muted); font-size: .9rem; }
.outlet-pin { color: var(--coffee); }
.outlet-card { display:block; padding:12px; }
.outlet-image { width:100%; height:180px; margin-bottom:14px; overflow:hidden; background:var(--soft); }
.outlet-image img { display:block; width:100%; height:100%; object-fit:cover; }
.outlet-details { padding:0 6px 8px; }
.empty-inline { padding: 28px; color: var(--muted); background: white; border: 1px solid var(--line); }

.page-heading { max-width: 820px; margin-bottom: 34px; }
.page-heading p:last-child { color: var(--muted); font-size: 1.05rem; }
.auth-layout { min-height: calc(100vh - 210px); display: grid; grid-template-columns: 1fr 520px; background: white; border: 1px solid var(--line); }
.auth-brand { display: flex; flex-direction: column; justify-content: center; padding: 70px 9%; color: white; background: #111; }
.auth-brand img { width: min(430px, 100%); margin-bottom: 50px; }
.auth-brand h1 { font-size: 2.6rem; }
.auth-brand p { max-width: 520px; color: #cfc5bf; line-height: 1.65; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.auth-panel h2 { margin: 18px 0 28px; font-size: 2rem; }
label { display: block; margin: 17px 0 7px; font-weight: 700; font-size: .9rem; }
input, select, textarea { width: 100%; min-height: 50px; padding: 12px 14px; color: var(--ink); background: white; border: 1px solid #aaa29b; border-radius: 4px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(120,61,43,.13); border-color: var(--coffee); }
.phone-entry { display: grid; grid-template-columns: 165px 1fr; gap: 10px; }
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-self: flex-start; padding: 3px; background: var(--soft); border: 1px solid var(--line); }
.segmented button { min-width: 110px; height: 38px; border: 0; background: transparent; }
.segmented button.active { color: white; background: var(--coffee); }
.auth-panel > .button { margin-top: 24px; }
.auth-links { display: flex; justify-content: space-between; gap: 14px; margin-top: 22px; color: var(--coffee); font-weight: 700; font-size: .9rem; }
.form-error { margin: 12px 0 0; color: var(--danger); }
.success-message { margin: 14px 0 0; color: var(--green); font-weight: 700; }
.notice { margin: 20px 0; padding: 15px 17px; color: #594b43; background: var(--soft); border-left: 4px solid var(--gold); }

.signin-prompt, .empty-state { padding: 60px; text-align: center; background: white; border: 1px solid var(--line); }
.signin-prompt p, .empty-state p { color: var(--muted); }
.signin-prompt div { display: flex; justify-content: center; gap: 12px; }
.reward-panel { padding: 30px; background: white; border: 1px solid var(--line); }
.streak-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.streak-day { min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: var(--soft); border: 1px solid var(--line); }
.streak-day strong { margin: 8px 0 2px; color: var(--ink); font-size: 1.5rem; }
.streak-day.complete { color: white; background: var(--coffee); border-color: var(--coffee); }
.streak-day.complete strong { color: white; }
.streak-day.next { border: 2px solid var(--gold); }
.reward-action { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.reward-action div { display: flex; flex-direction: column; color: var(--muted); }
.reward-action strong { color: var(--ink); font-size: 1.4rem; }

.history-toolbar { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.history-toolbar select { width: 210px; }
.history-list { display: grid; gap: 14px; }
.history-group { background: white; border: 1px solid var(--line); }
.history-group > header { display: flex; justify-content: space-between; padding: 16px 20px; background: var(--soft); border-bottom: 1px solid var(--line); }
.history-group > header span { color: var(--green); font-weight: 700; }
.history-group > header .points-redeemed { color: var(--danger); }
.history-group > header .points-earned { color: var(--green); }
.history-group > p { padding: 20px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-item div { display: flex; flex-direction: column; gap: 5px; }
.history-item small { color: var(--muted); }

.scan-layout { min-height: 590px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 6%; align-items: center; padding: 50px 6%; background: white; border: 1px solid var(--line); }
.scan-layout > div:first-child p:not(.eyebrow) { color: var(--muted); line-height: 1.65; }
.privacy-note { margin-top: 14px; font-size: .85rem; }
.scanner-frame { aspect-ratio: 1; max-width: 520px; width: 100%; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; color: var(--muted); background: #171717; }
.scanner-frame.active { color: white; }
.scanner-frame video { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.scanner-frame.active p, .scanner-frame.active .button { position: relative; z-index: 2; }
.scanner-corners { position: absolute; inset: 12%; border: 2px solid var(--gold); }
.scanner-frame.active .scanner-corners { z-index: 1; box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.scan-icon { color: white; font-size: 5rem; }
.manual-scan { margin-top: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.manual-scan summary { color: var(--coffee); cursor: pointer; font-weight: 700; }
.manual-scan input { margin: 12px 0 8px; }

.profile-layout { display: grid; grid-template-columns: 330px 1fr; background: white; border: 1px solid var(--line); }
.profile-summary { display: flex; flex-direction: column; align-items: center; padding: 45px 30px; color: white; text-align: center; background: var(--coffee-dark); }
.profile-summary img, .avatar { width: 132px; height: 132px; margin-bottom: 22px; border-radius: 50%; object-fit: cover; }
.avatar { display: grid; place-items: center; color: var(--coffee); background: white; font-size: 2rem; font-weight: 800; }
.profile-summary p { color: #d9c8c1; }
.profile-form { padding: 40px 55px 50px; }
.support-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; }
.support-links { background: white; border: 1px solid var(--line); }
.support-links a { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.support-links a:last-child { border-bottom: 0; }
.support-links a:hover { color: var(--coffee); background: var(--soft); }
.support-grid form { padding: 30px; background: white; border: 1px solid var(--line); }
.support-grid form .button { margin-top: 22px; }
.contact-page { max-width:680px; margin:0 auto; }
.contact-page form { padding:28px; background:#fff; border:1px solid var(--line); }
.contact-page textarea { min-height:120px; }
.contact-page .button { margin-top:22px; }
.maui-back { display:none; }
.legal-page { max-width: 850px; margin: 0 auto; padding: 52px; background: white; border: 1px solid var(--line); }
.legal-page h2 { margin-top: 36px; }
.legal-page p { color: var(--muted); line-height: 1.75; }
.legal-viewer { display: flex; flex-direction: column; height: calc(100vh - 92px); background: white; }
.legal-viewer header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.legal-viewer h1 { margin: 0; font-size: 1.35rem; }
.legal-viewer iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: white; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(20,16,13,.65); }
.announcement-modal { width: min(580px, 100%); position: relative; overflow: hidden; background: white; box-shadow: var(--shadow); }
.announcement-modal > img { width: 100%; max-height: 320px; object-fit: cover; }
.announcement-modal > div { padding: 28px 32px 32px; }
.announcement-modal > div p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.6; white-space: pre-line; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 1; width: 38px; height: 38px; color: white; background: rgba(0,0,0,.72); border: 0; font-size: 1.5rem; }
.loading-state { min-height: 300px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid #d9d0c9; border-top-color: var(--coffee); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#blazor-error-ui { display: none; position: fixed; right: 20px; bottom: 20px; z-index: 100; padding: 14px 18px; color: white; background: var(--danger); box-shadow: var(--shadow); }
#blazor-error-ui .dismiss { margin-left: 12px; cursor: pointer; }

@media (max-width: 900px) {
    .app-header { height: 64px; padding: 0 18px; }
    .brand img { width: 104px; height: 40px; }
    .desktop-nav { display: none; }
    .header-actions { margin-left: auto; }
    .profile-link { display: none; }
    .app-content { width: 100%; padding: 0 0 84px; }
    .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 68px; display: grid; grid-template-columns: repeat(4, 1fr); background: white; border-top: 1px solid var(--line); }
    .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .72rem; }
    .mobile-nav a span { font-size: 1.3rem; }
    .mobile-nav a.active { color: var(--coffee); font-weight: 700; }
    .home-hero { min-height: 430px; grid-template-columns: 1fr; padding: 45px 24px; }
    .hero-mark { display: none; }
    .section-block, .page-heading { padding: 34px 20px 0; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .metric { min-height: 120px; border-bottom: 1px solid var(--line); }
    .metric:nth-child(3) { border-left: 0; }
    .foc-strip { grid-template-columns: 1fr 46px; margin: 0 20px; border-top: 1px solid var(--line); }
    .foc-strip .progress-track { grid-column: 1 / -1; grid-row: 2; }
    .outlet-grid { grid-template-columns: 1fr; }
    .outlet-row { border-right: 0; }
    .auth-layout { min-height: calc(100vh - 132px); grid-template-columns: 1fr; border: 0; }
    .auth-brand { min-height: 220px; padding: 35px 24px; }
    .auth-brand img { width: 260px; margin-bottom: 22px; }
    .auth-brand h1 { display: none; }
    .auth-panel { padding: 34px 24px 45px; }
    .phone-entry { grid-template-columns: 135px 1fr; }
    .signin-prompt, .empty-state { margin: 0 20px; padding: 42px 24px; }
    .reward-panel { margin: 0 20px; padding: 18px; }
    .streak-grid { grid-template-columns: repeat(4, 1fr); }
    .streak-day { min-height: 105px; }
    .reward-action { align-items: stretch; flex-direction: column; }
    .history-toolbar { padding: 0 20px; align-items: stretch; flex-direction: column; }
    .history-toolbar select { width: 100%; }
    .history-list { padding: 0 20px; }
    .scan-layout { min-height: calc(100vh - 132px); grid-template-columns: 1fr; padding: 36px 24px; }
    .scanner-frame { max-width: 430px; }
    .profile-layout { grid-template-columns: 1fr; margin: 0 20px; }
    .profile-summary { padding: 30px; }
    .profile-summary img, .avatar { width: 100px; height: 100px; }
    .profile-form { padding: 25px; }
    .support-grid { grid-template-columns: 1fr; padding: 0 20px; }
    .legal-page { margin: 0 20px; padding: 30px 24px; }
}

@media (max-width: 520px) {
    h1 { font-size: 2.15rem; }
    .home-hero { min-height: 390px; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .summary-grid { grid-template-columns: 1fr; margin: 0 20px; }
    .metric { border-left: 0; }
    .section-heading { align-items: start; flex-direction: column; }
    .streak-grid { grid-template-columns: repeat(2, 1fr); }
    .phone-entry { grid-template-columns: 1fr; }
    .auth-links { align-items: flex-start; flex-direction: column; }
}

/* Keep the MAUI tab bar geometry after the legacy responsive rules above. */
.mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed;
    z-index: 30;
    left: 50%;
    right: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: min(520px, 100%);
    height: 72px;
    padding: 5px 0;
    background: var(--maui-gold);
    border-top: 0;
}
.mobile-nav a { min-width: 0; color: var(--maui-brown); font-size: 12px; text-align: center; }
.mobile-nav a.active { color: var(--maui-selected); }
.scan-layout.maui-scanner { display:block; position:relative; width:100%; height:calc(100vh - 136px); min-height:0; padding:0; margin:0; overflow:hidden; border:0; background:#111; }
.maui-scanner .scanner-frame { position:absolute; inset:0; width:100%; max-width:none; height:100%; min-height:0; aspect-ratio:auto; margin:0; overflow:hidden; background:#111; }
.maui-scanner .scanner-frame video { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; }
.maui-scanner .scanner-corners { position:absolute; z-index:2; inset:50% auto auto 50%; transform:translate(-50%,-50%); width:250px; height:250px; box-shadow:none; }
.maui-scanner .scanner-instruction { position:absolute; z-index:3; left:0; right:0; bottom:30px; margin:0; color:#fff; font-size:20px; text-align:center; }
.maui-scanner .scanner-status { position:absolute; z-index:4; left:16px; right:16px; bottom:72px; padding:12px; border-radius:8px; background:rgba(255,255,255,.92); text-align:center; }
.maui-scanner .scanner-frame.active .scanner-start-button { position:absolute; z-index:4; top:50%; left:50%; right:auto; bottom:auto; margin:0; transform:translate(-50%,-50%); min-width:180px; }
.scan-success-overlay { position:absolute; inset:0; z-index:5; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(0,0,0,.72); }
.scan-success-popup { width:min(360px, 100%); padding:28px 22px; border-radius:18px; background:#fff; color:#171717; text-align:center; font-weight:700; box-shadow:0 18px 50px rgba(0,0,0,.3); }
.scan-success-icon { display:flex; align-items:center; justify-content:center; width:62px; height:62px; margin:0 auto 16px; border-radius:50%; background:var(--green); color:#fff; font-size:36px; line-height:1; }
.maui-scanner .scanner-signin { position:absolute; z-index:3; top:50%; left:20px; right:20px; transform:translateY(-50%); text-align:center; }

/* Desktop web keeps the original responsive website presentation. */
@media (min-width: 900px) {
    .app-shell { max-width:none; margin:0; box-shadow:none; }
    .app-header.maui-header { height:76px; padding:0 max(24px, calc((100vw - 1280px) / 2)); justify-content:flex-start; gap:38px; background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); }
    .maui-header .brand img { width:126px; height:48px; }
    .maui-header .desktop-nav { display:flex; }
    .maui-header .header-actions { display:flex; }
    .app-content { width:min(1280px, calc(100% - 48px)); margin:0 auto; padding:42px 0 90px; }
    .mobile-nav { display:none; }
    .mobile-home-top { display:block; }
    .desktop-home-hero { display:none; }
    .mobile-slideshow { height:clamp(320px,36vw,520px); min-height:320px; max-height:520px; }
    .mobile-welcome { padding:18px 4px 8px; font-size:18px; }

    .button,.auth-panel button { min-height:46px; padding:0 22px; border:1px solid var(--coffee); border-radius:4px; }
    input,select,textarea { min-height:50px; padding:12px 14px; border-radius:4px; }
    .maui-login { display:grid; max-width:none; min-height:calc(100vh - 210px); }
    .maui-login .maui-page-hero { height:auto; display:flex; align-items:flex-start; justify-content:center; background:#111; }
    .maui-login .auth-brand img { width:min(430px,100%); max-height:none; }
    .maui-login .auth-panel { padding:60px; }
    .maui-login .segmented button { border-radius:0; }

    .maui-reward-hero { min-height:0; padding:0; background:transparent; text-align:left; }
    .maui-reward-hero img { display:none; }
    .maui-reward-hero .eyebrow,.maui-reward-hero p { display:block; }
    .maui-reward-hero h1 { font-size:clamp(2rem,4vw,3.5rem); }
    .reward-panel { margin:0; padding:30px; border:1px solid var(--line); }
    .streak-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:10px; }
    .streak-day { min-height:128px; padding:12px; background:var(--soft); border:1px solid var(--line); }
    .streak-day strong { display:block; width:auto; height:auto; margin:8px 0 2px; border-radius:0; background:transparent; font-size:1.5rem; }
    .streak-day span { margin:0; font-size:inherit; }
    .reward-action { flex-direction:row; align-items:center; text-align:left; border-top:1px solid var(--line); }

    .profile-layout { display:grid; }
    .profile-summary { padding:45px 30px; background:var(--coffee-dark); }
    .profile-summary img,.profile-summary .avatar { width:132px; height:132px; }
    .profile-form { padding:40px 55px 50px; }
}

@media (max-width: 899px) {
    .home-hero.desktop-home-hero { display:none !important; }
    .mobile-home-top { display:block; }
    .mobile-welcome { display:block; margin:0; padding:12px 20px; font-size:16px; line-height:1.35; background:#fff; }
    .section-block { padding-top:18px; }
    .contact-heading { margin:0; padding:16px 20px 0; }
    .contact-heading h1 { font-size:20px; text-align:center; }
    .contact-page { max-width:none; padding:0 20px 24px; }
    .contact-page form { padding:0; border:0; }
    .mobile-subpage-heading { position:relative; min-height:58px; display:flex; align-items:center; justify-content:center; padding:10px 56px; }
    .mobile-subpage-heading .maui-back { position:absolute; left:14px; top:50%; transform:translateY(-50%); display:flex; align-items:center; justify-content:center; width:44px; height:44px; color:#000; background:transparent; font-size:28px; font-weight:400; }
    .mobile-subpage-heading h1 { margin:0; font-size:20px; text-align:center; }
    .orders-heading .eyebrow,.orders-heading>p:last-child { display:none; }
    .slide-arrow { width:40px; height:54px; font-size:28px; }
    .slide-arrow.previous { left:4px; }
    .slide-arrow.next { right:4px; }
}
