/* Foundry, Android (Material 3) look. Everything is scoped to html.md, so iPhone and desktop are untouched.
   Palette follows the Stoat screenshots: near-black surface, lifted containers, soft indigo accent. */
html.md{
  --md-surface:#0e0f13; --md-c1:#17181d; --md-c2:#1e1f25; --md-c3:#27282e; --md-c4:#31323a;
  --md-primary:#bcc3ff; --md-on-primary:#1c2678; --md-sec:#3b4379; --md-on-sec:#dfe0ff; --md-outline:#46464f;
  --bg:var(--md-surface); --side-bg:var(--md-c2); --panel:var(--md-c1); --panel2:var(--md-c2); --studio-bg:var(--md-c3); --menu-bg:var(--md-c3);
  --accent:var(--md-primary); --hov:rgba(188,195,255,.08); --line:rgba(255,255,255,.07);
  --font:Roboto,"Google Sans",system-ui,-apple-system,"Segoe UI","Plus Jakarta Sans",sans-serif;
  --nav-bg:var(--md-c2); --nav-pill:var(--md-sec); --nav-ic:#c7c5d0;
  -webkit-tap-highlight-color:transparent;
}
html.md,html.md body{background:var(--md-surface);overscroll-behavior:none}
html.md *{scrollbar-width:none}html.md *::-webkit-scrollbar{display:none}

/* ripple */
.md-clip{overflow:hidden}
.md-rip{position:absolute;border-radius:50%;background:currentColor;opacity:.16;transform:scale(0);pointer-events:none;animation:mdRip .6s cubic-bezier(.2,0,0,1) forwards;z-index:0}
@keyframes mdRip{to{transform:scale(1);opacity:0}}
html.md .tabs .md-rip{display:none}

/* Material icons sit on a 24px grid and are never stroked */
html.md i[data-i] svg.mdi{fill:currentColor;stroke:none}

@media (max-width:820px){
  html.md{--tabH:80px}

  /* ---- navigation bar: 64x32 indicator pill, label under the icon ---- */
  html.md body .tabs{height:calc(80px + var(--safe-b));padding:12px 8px calc(16px + var(--safe-b));align-items:flex-start;background:var(--md-c2);border:0;box-shadow:none;gap:0}
  html.md body .tabs button{height:auto;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;border-radius:0;color:#c7c5d0;font-size:12px;font-weight:500;letter-spacing:.02em;transition:color .2s}
  html.md body .tabs button:active{transform:none}
  html.md body .tabs button span{position:static;width:auto;height:auto;margin:0;clip:auto;overflow:visible;font-size:12px;line-height:16px;white-space:nowrap}
  html.md body .tabs button i{position:relative;width:64px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:16px;animation:none!important}
  html.md body .tabs button i::before{display:block;content:"";position:absolute;inset:0;border-radius:16px;background:var(--md-sec);opacity:0;transform:scaleX(.3);transition:opacity .2s,transform .3s cubic-bezier(.2,0,0,1)}
  html.md body .tabs button.on i::before,html.md body .tabs button.on-more i::before{opacity:1;transform:none}
  html.md body .tabs button i svg{position:relative;width:24px;height:24px}
  html.md body .tabs button.on,html.md body .tabs button.on-more{color:var(--md-on-sec)}
  html.md body .tabs button.on span,html.md body .tabs button.on-more span{font-weight:700;color:#fff}

  /* ---- mini player: a tonal card that sits on the bar ---- */
  html.md .player{left:12px;right:12px;bottom:calc(80px + var(--safe-b) + 8px);height:64px;border-radius:20px;background:var(--md-c4);border:0;box-shadow:0 2px 10px rgba(0,0,0,.35)}
  html.md .main{padding-bottom:calc(80px + 64px + 32px + var(--safe-b))}
  html.md .toast{bottom:calc(80px + 64px + 24px + var(--safe-b))}

  /* ---- top app bar ---- */
  html.md .top{background:var(--md-c2);border:0;box-shadow:none}
  html.md .top-search{border-radius:28px;background:var(--md-c3);border:0;height:48px}
  html.md .top-search input{font-size:16px}
}

@media (max-width:820px){html.md #topAdd,html.md #topPlans{display:none!important}html.md .page-head{flex-wrap:wrap;gap:12px}html.md .head-actions{flex-wrap:wrap}}

/* ---- snackbar instead of a pill toast ---- */
html.md .toast{border-radius:6px;background:#e3e1ec;color:#1b1b21;font-weight:500;font-size:14px;padding:14px 16px;box-shadow:0 3px 10px rgba(0,0,0,.4)}

/* ---- buttons: full-pill filled / tonal / text ---- */
html.md .pill,html.md .top-pill,html.md .auth-btn,html.md .solid,html.md .hm-acts button,html.md .quick button,html.md .abp,html.md .relp{border-radius:20px;font-weight:600;letter-spacing:.01em}
html.md .pill,html.md .solid,html.md .solid-w,html.md .auth-btn.su,html.md .abp.white,html.md .relp.white,html.md .ad-go{background:var(--md-primary)!important;color:var(--md-on-primary)!important}
html.md .hm-acts button:not(.solid),html.md .quick button,html.md .relp.glass,html.md .auth-btn.li{background:var(--md-c4);color:var(--md-on-sec);border:0}
html.md .relc,html.md .gl-round,html.md .gl-pill{background:var(--md-c4)!important;color:var(--md-on-sec)!important;border:0!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

/* ---- dialogs and sheets: 28dp corners, text buttons in the accent colour ---- */
html.md .studio{border:0;border-radius:28px;background:var(--md-c3);box-shadow:0 8px 32px rgba(0,0,0,.5)}
html.md .studio::backdrop{background:rgba(0,0,0,.5);backdrop-filter:none}
html.md .studio h2{font-size:24px;font-weight:400;letter-spacing:0}
html.md .studio footer button,html.md .studio .acts button{color:var(--md-primary);font-weight:600;border-radius:20px;background:none}
html.md .asheet-bg{background:rgba(0,0,0,.5);backdrop-filter:none;-webkit-backdrop-filter:none}
html.md .asheet-card{background:var(--md-c3);border:0;border-radius:28px 28px 0 0;box-shadow:none}
html.md .asheet-grab{width:32px;height:4px;background:#c7c5d0;opacity:.4}
html.md .menu{background:var(--md-c3);border:0;border-radius:12px;backdrop-filter:none;box-shadow:0 4px 14px rgba(0,0,0,.45);padding:8px 0}
html.md .menu button{border-radius:0;padding:12px 16px}

/* ---- switches: Material 3 ---- */
html.md .sw{width:52px;height:32px;background:var(--md-c4);border:2px solid #918f9a;box-sizing:border-box}
html.md .sw i{top:6px;left:6px;width:16px;height:16px;background:#918f9a;box-shadow:none;transition:transform .2s cubic-bezier(.2,0,0,1),width .2s,height .2s,top .2s,left .2s,background .2s}
html.md .sw[aria-checked="true"]{background:var(--md-primary);border-color:var(--md-primary)}
html.md .sw[aria-checked="true"] i{top:2px;left:2px;width:24px;height:24px;background:var(--md-on-primary);transform:translateX(20px)}

/* ---- cards, rows, chips, inputs ---- */
html.md .card .art{border-radius:16px}
html.md .tr:active,html.md .trk:active,html.md .arow:active{background:var(--hov)}
html.md input[type=text],html.md input[type=search],html.md input[type=email],html.md input[type=password],html.md textarea{border-radius:28px}
html.md .seg{background:var(--md-c4);border-radius:20px}
html.md .seg button{border-radius:20px}
html.md .seg button.on,html.md .seg button[aria-pressed="true"]{background:var(--md-sec);color:var(--md-on-sec)}
html.md input[type=range]{accent-color:var(--md-primary)}

/* ---- Messages (chat): Stoat-style header, pill composer, squircle send button ---- */
html.md .ch-top{background:var(--md-c2);border-radius:0;padding:4px 0}
html.md .ch-nav,html.md .ch-pill,html.md .ch-total{background:var(--md-c3);backdrop-filter:none}
html.md .ch-title b{font-weight:500;font-size:22px;letter-spacing:0}
html.md .ch-rooms .ch-room{border-radius:8px;background:var(--md-c3);color:#c7c5d0}
html.md .ch-room.on{background:var(--md-sec);color:var(--md-on-sec)}
html.md .ch-list{background:var(--md-surface);border-radius:0;padding:14px 4px}
html.md .ch-bub{background:var(--md-c3);border-radius:20px 20px 20px 6px}
html.md .ch-msg.mine .ch-bub{background:var(--md-sec);color:var(--md-on-sec);border-radius:20px 20px 6px 20px}
html.md .ch-compose{display:flex;align-items:center;gap:8px;padding:0}
html.md .ch-compose .ch-in{flex:1;min-width:0;border:0;border-radius:28px;background:var(--md-c3);padding:14px 18px;font-size:16px;color:var(--text);outline:0}
html.md .ch-compose .ch-pill{width:48px;height:48px;padding:0;justify-content:center;border-radius:50%}
html.md .ch-compose .ch-send{border-radius:20px;width:56px;background:var(--md-c3);color:var(--md-on-sec)}
html.md .ch-compose .ch-send span,html.md .ch-top .ch-pill span{display:none}

/* ---- Android app only: edge-to-edge handled by the native bars ---- */
html.is-android .tabs{--safe-b:0px}

/* ===== loaders: one Material arc everywhere ===== */
html.md .aspin{animation:mdSpin 1.568s linear infinite}
html.md .aspin circle{stroke-width:4;animation:mdDash 1.333s cubic-bezier(.4,0,.2,1) infinite}
html.md .xload .aspin,html.md .loadpill .aspin{color:var(--md-primary)}
@keyframes mdSpin{to{transform:rotate(360deg)}}
@keyframes mdDash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:80 200;stroke-dashoffset:-30}100%{stroke-dasharray:80 200;stroke-dashoffset:-117}}

/* ===== Chromebook: Material navigation rail layout, bigger touch targets, no Mac download ===== */
.is-chromeos #dlGo,.is-chromeos #topDl{display:none!important}
@media (pointer:coarse){html.cros button,html.cros .nav button{min-height:44px}}
@media (min-width:821px){
  html.cros{--side-bg:var(--md-c1)}
  html.cros .side{background:var(--md-c1);border:0;padding:12px 12px}
  html.cros .nav button{height:56px;border-radius:28px;padding:0 20px;gap:14px;font-size:14px;font-weight:500;letter-spacing:.1px;color:#c7c5d0}
  html.cros .side .nav button{background:none!important;box-shadow:none!important}
  html.cros .side .nav button.on{background:var(--md-sec)!important;color:var(--md-on-sec)!important;font-weight:700}
  html.cros .side .nav button:hover:not(.on){background:var(--hov)!important}
  html.cros .side .side-pl-list button,html.cros .side .side-pl-h button{background:none}
  html.cros .side-pl-h{font-size:12px;font-weight:500;letter-spacing:.5px;color:#c7c5d0}
  html.cros .top{background:transparent;border:0}
  html.cros .top-search{height:48px;border-radius:28px;background:var(--md-c3);border:0}
  html.cros .main{background:var(--md-surface)}
  html.cros .player{border-radius:28px;background:var(--md-c4);border:0;box-shadow:0 2px 12px rgba(0,0,0,.4)}
  html.cros .card:hover .art{box-shadow:0 4px 14px rgba(0,0,0,.45)}
  html.cros .top-me .me-av,html.cros .side-me .me-av{border-radius:50%}
}

/* ===== iPhone / iPad / Mac: X-style button states. White buttons soften to light grey when hovered and a touch darker when pressed; every other button gets a quiet tint ===== */
html:not(.md) :is(.abp.white,.relp.white,.bigbtn.light,.pill:not(.alt):not(.unavail),.solid,.auth-btn.su,.top-pill.solid-w,.ad-go,#instPrimary,.lk-sub,button:not(.card):not(.sw):not(.tr):not(.trk):not(.p-info):not(.abp):not(.relp):not(.bigbtn):not(.pill):not(.solid):not(.auth-btn.su):not(.solid-w):not(.ad-go):not(#instPrimary):not(.lk-sub):not(.more):not([class*="art"]):not(.np-ic):not(.vw-x)){transition:background-color .2s ease,box-shadow .2s ease,filter .2s ease,transform .12s ease,opacity .2s ease}
html:not(.md) :is(.abp.white,.relp.white,.bigbtn.light):active{background-color:#c3c7c8!important;opacity:1!important}
html:not(.md) :is(.pill:not(.alt):not(.unavail),.solid,.auth-btn.su,.top-pill.solid-w,.ad-go,#instPrimary,.lk-sub):active{filter:brightness(.78);opacity:1}
html:not(.md) :is(button:not(.card):not(.sw):not(.tr):not(.trk):not(.p-info):not(.abp):not(.relp):not(.bigbtn):not(.pill):not(.solid):not(.auth-btn.su):not(.solid-w):not(.ad-go):not(#instPrimary):not(.lk-sub):not(.more):not([class*="art"]):not(.np-ic):not(.vw-x)):not(:disabled):active{box-shadow:inset 0 0 0 999px rgba(239,243,244,.16)}
@media (hover:hover){
  html:not(.md) :is(.abp.white,.relp.white,.bigbtn.light):hover{background-color:#d7dbdc!important;transform:none}
  html:not(.md) :is(.pill:not(.alt):not(.unavail),.solid,.auth-btn.su,.top-pill.solid-w,.ad-go,#instPrimary,.lk-sub):hover{filter:brightness(.86);transform:none}
  html:not(.md) :is(button:not(.card):not(.sw):not(.tr):not(.trk):not(.p-info):not(.abp):not(.relp):not(.bigbtn):not(.pill):not(.solid):not(.auth-btn.su):not(.solid-w):not(.ad-go):not(#instPrimary):not(.lk-sub):not(.more):not([class*="art"]):not(.np-ic):not(.vw-x)):not(:disabled):hover{box-shadow:inset 0 0 0 999px rgba(239,243,244,.1)}
}

/* ===== swipe: the slide animation replaces the default page fade-up ===== */
.main.pgslide{animation:none!important}

/* ===== hearts on Android: outline when not liked, solid when liked (the Material heart is a solid shape, so it looked liked all the time) ===== */
html.md :is(.plsave,#npAdd):not(.on) i svg.mdi{fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}
html.md :is(.plsave,#npAdd).on i svg.mdi{fill:currentColor;stroke:currentColor;stroke-width:1}
