/* App mode: the phone interface of the member area (Android/iOS app and phone browsers, up to 675px - the width
   where the tab bar appears). Loaded last. Tokens and the shared components (buttons, sheets, lists, empty states)
   are global; everything that changes the layout of existing pages sits inside the phone media query, so the
   desktop layout is untouched. Colours come from the logo: Aare teal and Aare blue on the night background. */
:root {
  --app-night:#0f141c; --app-deep:#141b26; --app-card:#1a2331; --app-raised:#212c3d; --app-line:#263142;
  --app-text:#eef2f6; --app-mut:#9aa7b8; --app-teal:#00aaaa; --app-teal-soft:#00aaaa29; --app-blue:#0697db; --app-coral:#ff6b5e;
  --app-water:linear-gradient(135deg,#00b3a7 0%,#0697db 100%);
  --app-top:52px; --app-tabs:58px;
  --app-safe-top:env(safe-area-inset-top,0px); --app-safe-bottom:env(safe-area-inset-bottom,0px);
  --app-ease:cubic-bezier(.2,.8,.2,1);
}

/* ---- Shared components (any width) ---- */
.app-btn {display:flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;width:100%;min-height:52px;padding:12px 22px;border:0;border-radius:26px;background:var(--app-water);color:#fff !important;font:700 16px/1.25 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-decoration:none;cursor:pointer;box-shadow:0 10px 26px #0697db4d;-webkit-tap-highlight-color:transparent;}
.app-btn:active {transform:scale(.98);}
.app-btn[disabled],.app-btn[aria-disabled="true"] {opacity:.55;box-shadow:none;cursor:default;}
.app-btn-line {background:transparent;border:1.5px solid var(--app-line);color:var(--app-text) !important;box-shadow:none;}
.app-btn-glass {background:#ffffff1f;border:1.5px solid #ffffff8c;box-shadow:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);}
.app-btn-danger {background:transparent;border:1.5px solid #ff6b5e80;color:var(--app-coral) !important;box-shadow:none;}
.app-btn-small {width:auto;min-height:40px;padding:8px 16px;font-size:14px;box-shadow:none;}

.app-list {margin:0 0 14px;padding:0;list-style:none;background:var(--app-card);border:1px solid var(--app-line);border-radius:18px;overflow:hidden;}
.app-list > li,.app-list > a,.app-list > button {display:flex;align-items:center;gap:14px;box-sizing:border-box;width:100%;min-height:54px;margin:0;padding:12px 16px;border:0;border-bottom:1px solid var(--app-line);background:transparent;color:var(--app-text);font-weight:500;font-size:16px;line-height:1.3;font-family:inherit;text-align:left;text-decoration:none;cursor:pointer;}
.app-list > :last-child {border-bottom:0;}
.app-list .app-list-icon {display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;border-radius:10px;background:var(--app-teal-soft);color:var(--app-teal);}
.app-list .app-list-icon svg {width:18px;height:18px;}
.app-list .app-list-value {display:flex;align-items:center;gap:8px;margin-left:auto;color:var(--app-mut);font-size:14px;font-weight:400;white-space:nowrap;}
.app-list .app-list-value::after,.app-list .app-chevron::after {content:"";width:8px;height:8px;border-top:2px solid var(--app-mut);border-right:2px solid var(--app-mut);transform:rotate(45deg);}
.app-list .is-danger {color:var(--app-coral);font-weight:600;}

.app-seg {display:flex;gap:0;margin:0 0 14px;padding:4px;border:1px solid var(--app-line);border-radius:14px;background:var(--app-card);overflow-x:auto;scrollbar-width:none;}
.app-seg::-webkit-scrollbar {display:none;}
.app-seg > a,.app-seg > button {flex:1 0 auto;min-height:38px;padding:8px 12px;border:0;border-radius:10px;background:transparent;color:var(--app-mut);font-weight:600;font-size:14px;line-height:1.3;font-family:inherit;text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;}
.app-seg > .is-active,.app-seg > [aria-current="page"],.app-seg > [aria-selected="true"] {background:var(--app-night);color:var(--app-text);box-shadow:0 1px 4px #0004;}

.app-chip {display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:5px 12px;border:1px solid var(--app-line);border-radius:18px;background:var(--app-card);color:var(--app-text);font-weight:600;font-size:13px;line-height:1.3;font-family:inherit;}
.app-chip-same {border-color:transparent;background:#00b3a7d9;color:#fff;}
.app-card {margin:0 0 12px;padding:16px;border:1px solid var(--app-line);border-radius:18px;background:var(--app-card);color:var(--app-text);}
.app-card > small {display:block;margin-bottom:6px;color:var(--app-teal);font-size:12.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;}
.app-card > p {margin:0;font-size:16px;line-height:1.45;}
.app-verified {display:inline-grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;background:var(--app-blue);color:#fff;vertical-align:middle;}
.app-verified svg {width:12px;height:12px;}
.app-count {display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--app-water);color:#fff;font:700 12px/1 system-ui,sans-serif;}

.app-empty {display:flex;flex-direction:column;align-items:center;gap:10px;max-width:420px;margin:24px auto;padding:0 20px;text-align:center;color:var(--app-mut);}
.app-empty img {width:min(100%,300px);aspect-ratio:1;border-radius:28px;object-fit:cover;-webkit-mask-image:radial-gradient(closest-side,#000 82%,transparent);mask-image:radial-gradient(closest-side,#000 82%,transparent);}
.app-empty h2 {margin:8px 0 0;color:var(--app-text);font:800 24px/1.15 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:-.02em;text-wrap:balance;}
.app-empty p {margin:0;font-size:16px;line-height:1.45;}
.app-empty .app-btn {margin-top:10px;}

/* Bottom sheet and confirmation (assets/js/app-shell.js: appShell.sheet(), appShell.confirm()). */
.app-sheet-backdrop {position:fixed;inset:0;z-index:1200;background:#05080cb3;opacity:0;transition:opacity .2s;}
.app-sheet-backdrop.is-open {opacity:1;}
.app-sheet {position:fixed;left:0;right:0;bottom:0;z-index:1201;box-sizing:border-box;max-height:min(88vh,720px);max-height:min(88dvh,720px);margin:0 auto;max-width:520px;padding:10px 16px calc(18px + var(--app-safe-bottom));overflow-y:auto;overscroll-behavior:contain;border-radius:26px 26px 0 0;background:var(--app-deep);color:var(--app-text);font:400 15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;transform:translateY(102%);transition:transform .28s var(--app-ease);}
.app-sheet.is-open {transform:none;}
.app-sheet::before {content:"";display:block;width:44px;height:5px;margin:0 auto 14px;border-radius:3px;background:#3a4759;}
.app-sheet h2 {margin:0 6px 4px;font-weight:800;font-size:21px;line-height:1.2;font-family:inherit;color:var(--app-text);}
.app-sheet .app-sheet-text {margin:0 6px 14px;color:var(--app-mut);}
.app-sheet p {line-height:1.45;}
.app-sheet .app-sheet-actions {display:flex;flex-direction:column;gap:10px;margin-top:6px;}
@media(min-width:676px) {.app-sheet {bottom:auto;top:50%;border-radius:22px;transform:translateY(-46%) scale(.98);opacity:0;transition:transform .2s,opacity .2s;} .app-sheet.is-open {transform:translateY(-50%);opacity:1;} .app-sheet::before {display:none;}}

/* Loading placeholder: a slow shimmer in the water colours instead of a blank block. */
.app-skeleton {border-radius:14px;background:linear-gradient(100deg,var(--app-card) 30%,#1f3040 50%,var(--app-card) 70%) 0 0/300% 100%;animation:app-shimmer 1.4s linear infinite;color:transparent !important;}
@keyframes app-shimmer {to {background-position:-150% 0;}}

/* Toasts are sentences: the old theme title-cased every word of them. */
.member-app .toast,.member-auth .toast {text-transform:none;height:auto;min-height:34px;padding:6px 16px;border-radius:17px;line-height:1.4;font-weight:600;font-size:13px;}
.app-only {display:none !important;}
.member-app #nav-logged-in .nav-wrapper.nav-dev {background-color:#3f5f98;}

/* ---- Phone shell ---- */
@media(max-width:675px) {
 .app-only {display:revert !important;}
 .app-hide {display:none !important;}
 .member-app {--ui-bg:var(--app-night);--ui-surface:var(--app-card);--ui-raised:var(--app-raised);--ui-text:var(--app-text);--ui-muted:var(--app-mut);--ui-line:var(--app-line);--ui-bar:var(--app-top);
   background:var(--app-night);color:var(--app-text);padding-bottom:calc(var(--app-tabs) + var(--app-safe-bottom));-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none;}
 /* The city photograph behind every page belongs to the desktop site; on a phone it only costs contrast. */
 .member-app.front-rand-bg {background-image:none;}

 /* Top bar: mark, screen title, the screen's own actions, notifications. */
 .member-app #nav-logged-in {height:calc(var(--app-top) + var(--app-safe-top));padding-top:var(--app-safe-top);border-bottom:0;background:#0f141ceb !important;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);}
 .member-app #nav-logged-in .nav-wrapper,.member-app #nav-logged-in .nav-wrapper.nav-dev {height:var(--app-top);padding:0 14px 0 18px;background:transparent !important;}
 .member-app #nav-logged-in .header_logo,.member-app #nav-logged-in .header_msg,.member-app #nav-logged-in .header_user,.member-app #nav-logged-in .dt_slide_menu {display:none !important;}
 .member-app #nav-logged-in .nav-wrapper > .valign-wrapper {flex:1;min-width:0;justify-content:space-between;}
 .member-app #nav-logged-in .header_home_link {display:flex;align-items:center;gap:8px;margin:0;}
 /* One line that drops what does not fit: items wrap onto a clipped second line, so with two screen buttons or a long
    title the Aare chip goes first, then the dev label - the title is cut only when it alone is too wide. */
 .app-bar-brand {display:flex !important;flex:1 1 0;flex-wrap:wrap;align-items:center;align-content:flex-start;column-gap:8px;row-gap:20px;height:34px;min-width:0;margin-right:8px;overflow:hidden;color:var(--app-text);}

 .app-bar-brand svg {flex:none;width:28px;height:auto;}
 .app-bar-brand #app-title {flex:0 1 auto;min-width:0;max-width:calc(100% - 36px);height:34px;overflow:hidden;font:800 23px/34px system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:-.02em;white-space:nowrap;text-overflow:ellipsis;}
 .app-bar-brand #app-aare {flex:none;padding:4px 9px;border-radius:12px;background:var(--app-teal-soft);color:#7fe3dd;font:600 12px/1.2 system-ui,sans-serif;text-decoration:none;white-space:nowrap;}
 .app-bar-brand #app-aare:empty {display:none;}
 .app-bar-brand .app-dev {padding:2px 6px;border-radius:6px;background:#3f5f98;color:#fff;font:700 10px/1.3 system-ui,sans-serif;letter-spacing:.06em;}
 /* Pushed screens (data-app-title/-back, app-shell.js): a back arrow instead of the mark, a smaller title. */
 .app-bar-brand .app-bar-back {flex:none;width:40px;height:34px;margin:0 -6px 0 -12px;border:0;border-radius:12px;background:transparent;}
 .app-bar-brand .app-bar-back svg {width:24px;height:24px;}
 .app-bar-brand .app-bar-back[hidden],.member-app.app-pushed .app-bar-brand > svg,.member-app.app-pushed .app-bar-brand #app-aare {display:none !important;}
 .member-app.app-pushed .app-bar-brand #app-title {font-size:19px;font-weight:700;}
 .app-bar-brand .app-dev {flex:none;}
 /* A screen's own top-bar link (template data-app-actions) keeps the round button shape against the header link rules. */
 .member-app #nav-logged-in #app-bar-actions > .app-icon-btn {display:flex;height:40px;padding:0;}
 #app-bar-actions {display:flex !important;align-items:center;gap:8px;}
 #app-bar-actions:empty {display:none !important;}
 /* Flex, not grid: the bell's hidden label would take a row of its own and push the icon off centre. */
 .app-icon-btn,.member-app #nav-logged-in #notificationbtn {display:flex;align-items:center;justify-content:center;gap:0;position:relative;box-sizing:border-box;width:40px;height:40px;min-height:0;margin:0;padding:0;border:1px solid var(--app-line);border-radius:50%;background:var(--app-card);color:var(--app-text);font-size:0;line-height:0;box-shadow:none !important;cursor:pointer;}
 .app-icon-btn svg,.member-app #nav-logged-in #notificationbtn svg {flex:none;width:20px;height:20px;margin:0;}
 .member-app #nav-logged-in #notificationbtn.active {border-color:var(--app-teal);color:var(--app-teal);}
 .member-app #nav-logged-in .notification_badge,.app-tab .badge,.app-icon-btn .badge {position:absolute;top:-3px;right:-3px;float:none;box-sizing:border-box;min-width:18px;height:18px;margin:0;padding:0 5px;border:2px solid var(--app-night);border-radius:9px;background:var(--app-coral);color:#fff;font:700 11px/14px system-ui,sans-serif;text-align:center;}
 .member-app #nav-logged-in li {float:none;}
 #notif_dropdown {top:calc(var(--app-top) + var(--app-safe-top) + 6px) !important;left:12px !important;right:12px;width:auto;border-radius:18px;background:var(--app-deep);}

 /* Tab bar */
 .member-app .to_sidebar_mini.app-tabs {transition:none;display:flex;align-items:flex-start;justify-content:space-around;box-sizing:border-box;position:fixed;left:0;right:0;bottom:0;z-index:100;width:100%;height:calc(var(--app-tabs) + var(--app-safe-bottom));margin:0;padding:6px 6px var(--app-safe-bottom);overflow:visible;border-top:1px solid var(--app-line);background:#141b26eb;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);box-shadow:none;}
 .app-tabs #deselectMobileMenu {display:contents;}
 .app-tab {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;position:relative;flex:1 1 0;max-width:110px;height:46px;border-radius:14px;color:var(--app-mut) !important;font:600 11px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-decoration:none;}
 .app-tab svg {width:25px;height:25px;}
 .app-tab img {width:25px;height:25px;border-radius:50%;object-fit:cover;border:1.5px solid transparent;}
 .app-tab.is-active {color:var(--app-teal) !important;}
 .app-tab.is-active img {border-color:var(--app-teal);}
 .app-tab:active {background:#ffffff0d;}
 .app-tab .badge {top:0;right:calc(50% - 24px);border-color:var(--app-deep);}
 .member-app.steps-page .to_sidebar_mini.app-tabs {display:none;}
 .member-app .to_sidebar {bottom:calc(var(--app-tabs) + var(--app-safe-bottom));background:var(--app-deep);}
 .member-app .sidenav_overlay {bottom:calc(var(--app-tabs) + var(--app-safe-bottom));}

 /* No website footer on a phone: the legal links live under Profil. */
 .member-app #footer.landing-footer,.member-app .member-footer-waves {display:none !important;}

 /* Page frame */
 .member-app #container > .container {width:auto;max-width:none;margin-left:14px;margin-right:14px;}
 .member-app .page-margin {margin-top:8px;margin-bottom:16px;}
 .member-app #loader {position:fixed;top:calc(var(--app-top) + var(--app-safe-top));left:0;right:0;z-index:120;height:3px;border-radius:0;background:var(--app-water) 0 0/200% 100%;animation:app-loader 1s linear infinite;}
 .member-app #loader > * {display:none;}
 /* The sideways entrance must not widen the page: a phone would keep the wider layout viewport (zoomed out). */
 /* Two rules: a browser without :has() (system WebViews before Chrome 105) drops a whole selector list with it. */
 .member-app {overflow-x:clip;}
 html:has(> body.member-app) {overflow-x:clip;}
 .app-enter {animation:app-enter .22s var(--app-ease) both;}
 .app-enter-back {animation:app-enter-back .22s var(--app-ease) both;}
 .app-enter-fade {animation:app-enter-fade .16s ease-out both;}
}
@keyframes app-loader {to {background-position:-200% 0;}}
@keyframes app-enter {from {opacity:0;transform:translateX(18px);}}
@keyframes app-enter-back {from {opacity:0;transform:translateX(-18px);}}
@keyframes app-enter-fade {from {opacity:.35;}}
@media(prefers-reduced-motion:reduce) {.app-enter,.app-enter-back,.app-enter-fade,.app-skeleton,.member-app #loader {animation:none !important;} .app-sheet,.app-sheet-backdrop {transition:none !important;}}
