/* =====================================================================
   Handlane main site.
   Mobile-first layout borrowed from the phone-side web surface.
   Safe-area aware, responsive, and shared by landing, account, checkout,
   and the browser host transfer tool.
===================================================================== */

:root {
  color-scheme: light dark;
  --blue: #4285f4;
  --red: #ea4335;
  --yellow: #fbbc05;
  --green: #34a853;

  --ink: #0c1428;
  --muted: #4d5b75;
  --soft: #f3f6fb;
  --page: #f8fbff;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-deep: rgba(255, 255, 255, 0.94);
  --line: rgba(40, 55, 85, 0.11);
  --line-strong: rgba(40, 55, 85, 0.18);
  --shadow: 0 16px 40px rgba(61, 86, 122, 0.12);
  --shadow-soft: 0 6px 18px rgba(61, 86, 122, 0.08);
  --inner: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --radius: 18px;
  --radius-lg: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-inline-start: env(safe-area-inset-left, 0px);
  --safe-inline-end: env(safe-area-inset-right, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f6fc;
    --muted: #a9b6cb;
    --soft: #1a2030;
    --page: #0d1320;
    --panel: rgba(28, 36, 54, 0.74);
    --panel-deep: rgba(28, 36, 54, 0.96);
    --line: rgba(255, 255, 255, 0.11);
    --line-strong: rgba(255, 255, 255, 0.18);
    --shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.3);
    --inner: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

html,
body {
  min-height: 100vh;
  min-height: 100dvh;
}

html {
  direction: ltr;
  overflow-x: hidden;
}

body {
  width: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  direction: ltr;
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.14)),
    repeating-linear-gradient(90deg, rgba(40, 55, 85, 0.045) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(40, 55, 85, 0.04) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, #f8fbff 0%, #eef6ff 56%, #eafaf3 100%);
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 64px),
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 64px),
      linear-gradient(180deg, #0d1320 0%, #131a2a 100%);
  }
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  min-height: 42px;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

a { color: inherit; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
[hidden], .hidden { display: none !important; }

/* =====================================================================
   Side-margin floating decoration. Drift slowly through the empty gutter
   on either side of the centered content. Hidden under 1100px so we never
   collide with the main column.
===================================================================== */
.side-flair {
  position: fixed;
  top: 0;
  bottom: 0;
  width: clamp(140px, 14vw, 220px);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  display: none;
}

@media (min-width: 1100px) and (prefers-reduced-motion: no-preference) {
  .side-flair { display: block; }
}

.side-flair-left  { left: 0; }
.side-flair-right { right: 0; }

.flair {
  position: absolute;
  width: 60px;
  height: 76px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: white;
  box-shadow: 0 12px 26px rgba(40, 55, 85, 0.18);
  opacity: 0.45;
  animation: flair-float 22s ease-in-out infinite;
  /* Folded-corner tab so each flair reads as a generic "file". */
  background:
    linear-gradient(225deg, transparent 12px, currentColor 12px) top right / 14px 14px no-repeat,
    var(--flair-bg, var(--blue));
}
.flair::before {
  content: attr(data-kind);
  display: block;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.flair::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  background: linear-gradient(225deg, rgba(255, 255, 255, 0.32) 50%, transparent 50%);
}

@media (prefers-color-scheme: dark) {
  .flair { opacity: 0.34; }
}

/* Color one swatch per kind so the row reads as different file types. */
.flair-image   { --flair-bg: linear-gradient(135deg, var(--blue), #1a4a96);   color: rgba(255, 255, 255, 0.92); }
.flair-video   { --flair-bg: linear-gradient(135deg, var(--red), #c92a1d);    color: rgba(255, 255, 255, 0.92); }
.flair-pdf     { --flair-bg: linear-gradient(135deg, #ef5350, #6a1414);       color: rgba(255, 255, 255, 0.92); }
.flair-archive { --flair-bg: linear-gradient(135deg, #ff9800, #c54c00);       color: rgba(255, 255, 255, 0.92); }
.flair-doc     { --flair-bg: linear-gradient(135deg, var(--blue), #2d5fc7);   color: rgba(255, 255, 255, 0.92); }
.flair-audio   { --flair-bg: linear-gradient(135deg, #9c27b0, #4a148c);       color: rgba(255, 255, 255, 0.92); }
.flair-text    { --flair-bg: linear-gradient(135deg, #607d8b, #37474f);       color: rgba(255, 255, 255, 0.92); }

/* Stagger positions and animation delays so the column doesn't feel
   like a single moving block. Left side runs upward, right side downward. */
.side-flair-left  .flair-image   { left: 14%; top: 8%;  animation-delay: -0s;  }
.side-flair-left  .flair-video   { left: 60%; top: 28%; animation-delay: -6s;  }
.side-flair-left  .flair-pdf     { left: 18%; top: 56%; animation-delay: -11s; }
.side-flair-left  .flair-archive { left: 56%; top: 78%; animation-delay: -16s; }

.side-flair-right .flair-doc     { right: 18%; top: 14%; animation-delay: -3s;  animation-direction: reverse; }
.side-flair-right .flair-audio   { right: 58%; top: 38%; animation-delay: -8s;  animation-direction: reverse; }
.side-flair-right .flair-image   { right: 14%; top: 64%; animation-delay: -13s; animation-direction: reverse; }
.side-flair-right .flair-text    { right: 56%; top: 86%; animation-delay: -19s; animation-direction: reverse; }

@keyframes flair-float {
  0%   { transform: translateY(0)     rotate(-4deg) scale(1);    }
  25%  { transform: translateY(-26px) rotate(2deg)  scale(1.05); }
  50%  { transform: translateY(-12px) rotate(6deg)  scale(0.98); }
  75%  { transform: translateY(20px)  rotate(-2deg) scale(1.02); }
  100% { transform: translateY(0)     rotate(-4deg) scale(1);    }
}

.maintenance-banner {
  width: min(960px, calc(100% - 24px));
  margin: 12px auto 0;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(251, 188, 5, 0.36);
  background: linear-gradient(90deg, rgba(251, 188, 5, 0.18), rgba(234, 67, 53, 0.10));
  color: #6a4400;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
@media (prefers-color-scheme: dark) {
  .maintenance-banner { color: #ffe082; }
}

/* Theme accent overrides — switch the global brand colors when an admin
   picks a non-default accent in Site Settings. */
:root[data-accent="ocean"] {
  --blue: #4285f4;
  --green: #00b4d8;
}
:root[data-accent="sunset"] {
  --blue: #ea4335;
  --green: #fbbc05;
}
:root[data-accent="forest"] {
  --blue: #34a853;
  --green: #166534;
}

main {
  min-height: 100vh;
  min-height: 100dvh;
}

.landing-view,
.page-view,
.tool-view {
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

[dir="rtl"] .landing-view,
[dir="rtl"] .page-view,
[dir="rtl"] .tool-view,
[dir="rtl"] .paywall {
  direction: rtl;
}

[dir="ltr"] .landing-view,
[dir="ltr"] .page-view,
[dir="ltr"] .tool-view,
[dir="ltr"] .paywall {
  direction: ltr;
}

.landing-view,
.page-view {
  padding: max(8px, var(--safe-top)) max(8px, var(--safe-inline-end)) calc(36px + var(--safe-bottom)) max(8px, var(--safe-inline-start));
}

.landing-view.hidden,
.page-view.hidden,
.tool-view.hidden {
  display: none;
}

/* =====================================================================
   Brand and navigation
===================================================================== */

.site-nav {
  width: min(560px, 100%);
  max-width: 100%;
  min-height: 58px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 auto;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(150%);
}

.page-nav {
  margin-top: 4px;
}

.nav-brand,
.identity {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-brand {
  flex: 1 1 auto;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
}

.nav-brand > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  flex: 0 0 auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
}

.logo span { border-radius: 999px; }
.blue { background: var(--blue); }
.red { background: var(--red); }
.yellow { background: var(--yellow); }
.green { background: var(--green); }

.nav-controls {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.language-select {
  position: relative;
  display: inline-grid;
  min-width: 0;
}

.language-select select,
.nav-action,
.nav-link,
.home-link,
.hero-primary,
.primary,
.secondary,
.danger,
.primary-lite,
.ghost-lite,
.plan-primary,
.plan-ghost,
.plan-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.language-select select {
  width: 100%;
  padding-inline: 14px 34px;
  border: 1px solid var(--line);
  appearance: none;
  color: var(--ink);
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

[dir="rtl"] .language-select select {
  padding-inline: 34px 14px;
}

.language-select::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 13px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  opacity: 0.6;
}

.nav-action,
.hero-primary,
.primary,
.primary-lite,
.plan-primary {
  color: white;
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: var(--shadow-soft);
}

.nav-link,
.home-link,
.secondary,
.ghost-lite,
.plan-ghost,
.plan-link {
  color: #17396f;
  border: 1px solid rgba(66, 133, 244, 0.16);
  background: rgba(66, 133, 244, 0.1);
}

@media (prefers-color-scheme: dark) {
  .nav-link,
  .home-link,
  .secondary,
  .ghost-lite,
  .plan-ghost,
  .plan-link {
    color: #cad9ff;
    background: rgba(66, 133, 244, 0.16);
  }
}

.danger {
  color: #9b2118;
  border: 1px solid rgba(234, 67, 53, 0.18);
  background: rgba(234, 67, 53, 0.12);
}

@media (prefers-color-scheme: dark) {
  .danger { color: #ffb4ab; }
}

/* =====================================================================
   Landing hero
===================================================================== */

.hero {
  width: min(1060px, 100%);
  max-width: 100%;
  min-height: 470px;
  position: relative;
  display: grid;
  place-items: center;
  margin: 12px auto 0;
  padding: 42px 14px 54px;
  isolation: isolate;
  overflow: hidden;
}

.hero-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.96;
  transform: perspective(900px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transform-style: preserve-3d;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

/*
  The bordered backdrop box that used to sit behind the hero copy was
  removed — it framed the floating files into a visible rectangle that
  clashed with the open, airy feel we want. The hero scene (signal
  map, packets, floating files) now floats free against the page
  gradient. If a subtle backdrop is needed later, prefer a radial
  glow under the headline rather than a hard-edged rectangle.
*/

.signal-map {
  position: absolute;
  inset: 38px 12px 34px;
  border-radius: 28px;
  overflow: hidden;
}

.node {
  position: absolute;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
}

.node::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.node.desktop { left: 8%; top: 46%; }
.node.phone {
  right: 8%;
  top: 20%;
  width: 46px;
  height: 70px;
  border-radius: 16px;
}
.node.tablet { right: 22%; bottom: 15%; }

.line {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, transparent, rgba(66, 133, 244, 0.6), rgba(52, 168, 83, 0.42), transparent);
}

.line.one {
  width: 72%;
  left: 14%;
  top: 50%;
  transform: rotate(-12deg);
}

.line.two {
  width: 54%;
  left: 32%;
  top: 62%;
  transform: rotate(18deg);
}

.packet {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 8px rgba(66, 133, 244, 0.11);
  animation: drift 7s linear infinite;
}

.packet.p1 { left: 20%; top: 49%; }
.packet.p2 { left: 52%; top: 42%; animation-delay: -2s; background: var(--green); }
.packet.p3 { left: 62%; top: 64%; animation-delay: -4s; background: var(--red); }

.floating-file,
.floating-qr {
  position: absolute;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(140%);
}

.floating-file {
  width: 86px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  opacity: 0.18;
}

.image-file {
  right: -18px;
  bottom: 22px;
  background:
    linear-gradient(145deg, rgba(66, 133, 244, 0.1), rgba(52, 168, 83, 0.13)),
    linear-gradient(135deg, #f6b9c5 0 42%, #fbbc05 42% 58%, #34a853 58% 100%);
}

.stack-file {
  left: -24px;
  top: 118px;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.stack-file span {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.stack-file span:nth-child(2) { width: 72%; }
.stack-file span:nth-child(3) { width: 48%; }

/* =====================================================================
   File-extension tiles
   =====================================================================
   Scattered around the hero to immediately communicate "this is for
   moving files". Each tile shows a colour-coded extension badge
   (PDF, DOCX, MP4, etc.). They're decorative — pointer-events:none so
   they never intercept clicks meant for the Get Started button. The
   `floatTile` animation gives each a slow, individual drift to make
   the page feel alive without distracting.
*/
.file-tile {
  position: absolute;
  width: 76px;
  height: 94px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px) saturate(140%);
  opacity: 0.85;
  pointer-events: none;
  text-align: center;
  animation: floatTile var(--tile-dur, 8s) ease-in-out infinite;
  animation-delay: var(--tile-delay, 0s);
}

.file-tile strong {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: white;
  padding: 4px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--tile-c1, var(--blue)), var(--tile-c2, var(--green)));
  line-height: 1;
}

.file-tile span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.4px;
}

/* === Site-wide tile backdrop ===========================================
   .page-tiles is the absolute-positioned layer covering the WHOLE
   landing-view. Tiles inside it are placed with pixel `top` values so
   they're scattered through every section: hero, strip, storyboard,
   why-handlane, plans. The wrapper is non-interactive — clicks fall
   through to the content above it. */
.page-tiles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Re-anchor .file-tile to the .page-tiles container (instead of the
   hero-scene as before) so the `top` values below are measured from
   the very top of the landing view. */
.page-tiles .file-tile { position: absolute; }

/* =====================================================================
   Per-tile placement.
   =====================================================================
   `top` is in pixels from the top of the landing-view so tiles are
   distributed through every section. Horizontal placement uses
   left/right percentages of the landing-view width, but always
   restricted to the OUTER edge bands (< 14% or > 86%) so they never
   overlap the centred section copy.

   Section anchors (approximate desktop heights):
     ~0–600px    Hero
     ~600–800    Landing strip (3 highlights)
     ~800–1300   Storyboard (4 steps)
     ~1300–1900  Why Handlane (compare cards + stats)
     ~1900–2500  Plans (4 pricing cards)
     ~2500+      Footer area
*/

/* --- Hero region (top ~ 60–600 px) -------------------------------- */
.tile-pdf  { top: 70px;  left: 3%;       --tile-c1: #ea4335; --tile-c2: #c5221f; --tile-dur: 9s;  --tile-delay: -1s; }
.tile-doc  { top: 80px;  left: 20%;      --tile-c1: #4285f4; --tile-c2: #1a73e8; --tile-dur: 11s; --tile-delay: -3s; --tile-rot: -3deg; }
.tile-xls  { top: 80px;  right: 20%;     --tile-c1: #1e8e3e; --tile-c2: #137333; --tile-dur: 12s; --tile-delay: -2s; --tile-rot: 3deg; }
.tile-ppt  { top: 70px;  right: 3%;      --tile-c1: #ff7043; --tile-c2: #e64a19; --tile-dur: 10s; --tile-delay: -5s; }
.tile-jpg  { top: 260px; left: 1%;       --tile-c1: #fbbc05; --tile-c2: #ea4335; --tile-dur: 13s; --tile-delay: -2s; --tile-rot: -4deg; }
.tile-psd  { top: 260px; right: 1%;      --tile-c1: #ff5722; --tile-c2: #d84315; --tile-dur: 11s; --tile-delay: -3s; --tile-rot: 4deg; }
.tile-svg  { top: 440px; left: 2%;       --tile-c1: #00bcd4; --tile-c2: #0097a7; --tile-dur: 10s; --tile-delay: -8s; --tile-rot: -5deg; opacity: 0.65; }
.tile-gif  { top: 440px; right: 2%;      --tile-c1: #e91e63; --tile-c2: #ad1457; --tile-dur: 10s; --tile-delay: -9s; --tile-rot: 5deg; opacity: 0.65; }

/* --- Strip / Storyboard region (top ~ 700–1300 px) ---------------- */
.tile-ai   { top: 760px;  left: 3%;      --tile-c1: #fbbc05; --tile-c2: #ff8a00; --tile-dur: 14s; --tile-delay: -7s; --tile-rot: 4deg; }
.tile-eps  { top: 760px;  right: 3%;     --tile-c1: #c2185b; --tile-c2: #880e4f; --tile-dur: 12s; --tile-delay: -4s; --tile-rot: -3deg; }
.tile-png  { top: 1080px; left: 1%;      --tile-c1: #00acc1; --tile-c2: #006978; --tile-dur: 11s; --tile-delay: -5s; opacity: 0.7; }
.tile-heic { top: 1080px; right: 1%;     --tile-c1: #9c27b0; --tile-c2: #d81b60; --tile-dur: 13s; --tile-delay: -4s; opacity: 0.7; }

/* --- Why-Handlane region (top ~ 1300–1900 px) --------------------- */
.tile-mp3  { top: 1380px; left: 2%;      --tile-c1: #9c27b0; --tile-c2: #6a1b9a; --tile-dur: 12s; --tile-delay: -6s; }
.tile-wav  { top: 1380px; right: 2%;     --tile-c1: #00bcd4; --tile-c2: #006978; --tile-dur: 12s; --tile-delay: -5s; }
.tile-mp4  { top: 1640px; left: 1%;      --tile-c1: #34a853; --tile-c2: #1e8e3e; --tile-dur: 10s; --tile-delay: -5s; --tile-rot: -3deg; }
.tile-mov  { top: 1640px; right: 1%;     --tile-c1: #1976d2; --tile-c2: #0d47a1; --tile-dur: 13s; --tile-delay: -7s; --tile-rot: 3deg; }

/* --- Plans region (top ~ 1900–2500 px) ---------------------------- */
.tile-zip  { top: 1960px; left: 3%;      --tile-c1: #fbbc05; --tile-c2: #d99a00; --tile-dur: 12s; --tile-delay: -4s; --tile-rot: 3deg; }
.tile-rar  { top: 1960px; right: 3%;     --tile-c1: #795548; --tile-c2: #4e342e; --tile-dur: 13s; --tile-delay: -6s; }
.tile-7z   { top: 2280px; left: 1%;      --tile-c1: #5d4037; --tile-c2: #3e2723; --tile-dur: 11s; --tile-delay: -2s; opacity: 0.7; }
.tile-txt  { top: 2280px; right: 1%;     --tile-c1: #607d8b; --tile-c2: #37474f; --tile-dur: 11s; --tile-delay: -3s; --tile-rot: -2deg; opacity: 0.7; }

/* --- Code / footer region (top ~ 2500+ px) ------------------------ */
.tile-html { top: 2560px; left: 4%;      --tile-c1: #e34c26; --tile-c2: #b03613; --tile-dur: 10s; --tile-delay: -2s; --tile-rot: -3deg; }
.tile-css  { top: 2560px; left: 24%;     --tile-c1: #1572b6; --tile-c2: #0e4d80; --tile-dur: 12s; --tile-delay: -5s; }
.tile-js   { top: 2560px; right: 24%;    --tile-c1: #f7df1e; --tile-c2: #b89c00; --tile-dur: 11s; --tile-delay: -7s; --tile-rot: 4deg; }
.tile-json { top: 2560px; right: 4%;     --tile-c1: #607d8b; --tile-c2: #455a64; --tile-dur: 13s; --tile-delay: -3s; }

@keyframes floatTile {
  0%, 100% { transform: translateY(0) rotate(var(--tile-rot, 0deg)); }
  50%      { transform: translateY(-10px) rotate(calc(var(--tile-rot, 0deg) + 1deg)); }
}

/* Ensure section content draws ABOVE the tile backdrop. landing-view
   keeps z-index:auto; sections create their own stacking context with
   position:relative so .page-tiles (z-index:0) sits underneath them. */
.landing-view > section,
.landing-view > header { position: relative; z-index: 1; }

.floating-qr {
  left: 16px;
  bottom: 20px;
  width: 92px;
  height: 92px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 15px;
  border-radius: 20px;
  opacity: 0.32;
}

.floating-qr span {
  border-radius: 4px;
  background: var(--ink);
}

.floating-qr span:nth-child(3n) { background: var(--blue); }

.hero-copy {
  width: min(680px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.hero-kicker,
.section-copy p,
.page-hero p,
.account-heading span,
.paywall-panel > span {
  color: #2d5f9e;
  font-weight: 900;
}

@media (prefers-color-scheme: dark) {
  .hero-kicker,
  .section-copy p,
  .page-hero p,
  .account-heading span,
  .paywall-panel > span {
    color: #b9d2ff;
  }
}

.hero h1 {
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  padding: 0.06em 0 0.12em;  /* room for descenders so 'g' isn't clipped */
}

.hero-lead {
  width: min(600px, 100%);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.hero-actions {
  width: min(360px, 100%);
  display: grid;
  gap: 10px;
}

.hero-primary {
  min-height: 46px;
  width: 100%;
  font-size: 15px;
}

.hero-metrics {
  width: min(520px, 100%);
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.hero-metrics article {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.hero-metrics strong {
  font-size: 15px;
}

.hero-metrics span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.landing-strip {
  width: min(560px, 100%);
  display: grid;
  gap: 8px;
  margin: 0 auto 28px;
}

.landing-strip article,
.story-grid article,
.plan-card,
.account-card,
.checkout-shell {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(140%);
}

.landing-strip article {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
}

.landing-strip strong { font-size: 16px; }
.landing-strip span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* =====================================================================
   Marketing sections and pages
===================================================================== */

.storyboard,
.plans,
.pricing-grid {
  width: min(560px, 100%);
  margin: 28px auto 0;
}

.section-copy,
.page-hero {
  display: grid;
  gap: 10px;
  justify-items: start;
  text-align: start;
  margin: 0 auto 14px;
}

.section-copy h2,
.page-hero h1,
.account-heading h1 {
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.section-copy span,
.page-hero span {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

/* =====================================================================
   "Why Handlane" comparison section
   =====================================================================
   Two side-by-side cards (cloud-upload pains vs Handlane benefits)
   plus a row of headline stats below. The cloud-side card is muted
   (the "problem") and the Handlane side has a green-tinted glow
   (the "fix"). Stats below summarize the value in four numbers.
*/
.why-handlane {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 14px 36px;
  display: grid;
  gap: 18px;
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 760px) {
  .why-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
}

.why-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.why-card-cloud {
  opacity: 0.92;
}

.why-card-handlane {
  border-color: rgba(52, 168, 83, 0.4);
  background:
    linear-gradient(155deg, rgba(52, 168, 83, 0.10), rgba(66, 133, 244, 0.06) 60%, transparent),
    var(--panel);
  box-shadow: 0 8px 22px rgba(52, 168, 83, 0.12);
}

.why-card header {
  display: grid;
  gap: 6px;
}

.why-tag {
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(120, 120, 130, 0.16);
}

.why-tag.is-primary {
  color: white;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.why-card header strong {
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
}

.why-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.why-card li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.why-x,
.why-y {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.why-x {
  background: rgba(234, 67, 53, 0.16);
  color: #c5221f;
}

.why-y {
  background: rgba(52, 168, 83, 0.18);
  color: #1e7a3f;
}

@media (prefers-color-scheme: dark) {
  .why-x { background: rgba(234, 67, 53, 0.22); color: #ff8a80; }
  .why-y { background: rgba(52, 168, 83, 0.24); color: #7be59e; }
}

/* Four-stat strip below the comparison cards. Each stat is a big
   number (0 / ∞ / E2E / <1s) over a short caption. Used as a
   "summary of the summary" — visitors who scan should still
   absorb the four most important facts. */
.why-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(66, 133, 244, 0.06), rgba(52, 168, 83, 0.04)),
    var(--panel);
}

@media (min-width: 720px) {
  .why-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
}

.why-stats article {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: 14px;
  text-align: center;
}

.why-stats strong {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(90deg, var(--blue), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.why-stats span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  max-width: 22ch;
}

.story-grid,
.plan-grid {
  display: grid;
  gap: 10px;
}

.story-grid article,
.plan-card {
  position: relative;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 15px;
  border-radius: var(--radius);
  overflow: hidden;
}

.story-grid article::after,
.plan-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  opacity: 0.55;
}

.story-grid article > span,
.plan-card > span {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #17396f;
  font-size: 12px;
  font-weight: 900;
  background: rgba(66, 133, 244, 0.12);
}

@media (prefers-color-scheme: dark) {
  .story-grid article > span,
  .plan-card > span {
    color: #cad9ff;
    background: rgba(66, 133, 244, 0.18);
  }
}

.story-grid strong,
.plan-card strong {
  font-size: 19px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.story-grid p,
.plan-card p,
.account-card p,
.paywall-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.plan-card {
  min-height: 214px;
}

.plan-card.featured {
  border-color: rgba(66, 133, 244, 0.32);
  background:
    linear-gradient(135deg, rgba(66, 133, 244, 0.12), rgba(52, 168, 83, 0.08)),
    var(--panel);
}

/* =====================================================================
   Landing-page plans section polish
   =====================================================================
   The plans grid itself reuses `.pricing-grid-4` so the cards are
   pixel-identical to /pricing. We only add a thin link below the
   grid that nudges visitors to the full pricing page (where they
   get the monthly/yearly toggle, currency switch, etc.) and ensure
   the landing-specific grid centres the cards within the section.
*/
.landing-plans .landing-pricing-grid {
  margin: 0 auto;
}

.plans-see-full {
  display: inline-flex;
  align-self: center;
  margin: 14px auto 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #17396f;
  text-decoration: none;
  border: 1px solid rgba(66, 133, 244, 0.2);
  background: rgba(66, 133, 244, 0.06);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.plans-see-full:hover {
  background: rgba(66, 133, 244, 0.12);
  border-color: rgba(66, 133, 244, 0.4);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .plans-see-full {
    color: #cad9ff;
    border-color: rgba(202, 217, 255, 0.22);
    background: rgba(202, 217, 255, 0.05);
  }
  .plans-see-full:hover {
    background: rgba(202, 217, 255, 0.1);
    border-color: rgba(202, 217, 255, 0.4);
  }
}

.plan-card button,
.plan-link {
  align-self: end;
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(66, 133, 244, 0.16);
  border-radius: 12px;
  color: #17396f;
  font-weight: 800;
  text-decoration: none;
  background: rgba(66, 133, 244, 0.1);
}

@media (prefers-color-scheme: dark) {
  .plan-card button,
  .plan-link {
    color: #cad9ff;
    background: rgba(66, 133, 244, 0.16);
  }
}

.plan-card .plan-primary {
  color: white;
  border: 0;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.plan-card .plan-ghost {
  color: #17396f;
  border: 1px solid rgba(66, 133, 244, 0.16);
  background: rgba(66, 133, 244, 0.1);
}

@media (prefers-color-scheme: dark) {
  .plan-card .plan-ghost {
    color: #cad9ff;
    background: rgba(66, 133, 244, 0.16);
  }
}

.plan-card-actions {
  align-self: end;
  display: grid;
  gap: 8px;
  width: 100%;
}

.page-view {
  overflow: hidden;
  padding-bottom: calc(48px + var(--safe-bottom));
}

.page-hero {
  width: min(700px, 100%);
  margin-top: 38px;
}

.pricing-grid {
  margin-top: 18px;
}

.pricing-toggle {
  width: min(460px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px auto 18px;     /* always block-level + centered */
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
}

.pricing-toggle-button {
  flex: 1 1 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border: 0;
}

.pricing-toggle-button.is-active {
  color: white;
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: var(--shadow-soft);
}

.pricing-toggle-savings {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.16);
}

@media (prefers-color-scheme: dark) {
  .pricing-toggle-savings { color: #b8f3cf; }
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0;
}

.plan-price-value {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.plan-price-cycle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.plan-features li {
  position: relative;
  padding-inline-start: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.plan-features li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 6px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

/* Force the 4-card row earlier so Plus / Pro / Free / Team line up cleanly.
   The selector is doubled so it wins specificity against `.plan-grid` rules
   defined later in the file (otherwise the 960px 3-col rule clobbers ours). */
.pricing-grid-4.pricing-grid-4 { width: min(1280px, 100%); align-items: stretch; }
@media (min-width: 760px) {
  .pricing-grid-4.pricing-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 600px) and (max-width: 759px) {
  .pricing-grid-4.pricing-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Card polish: equal heights, push CTA to bottom, glassy panel.
   Forces explicit height: 100% so cards stretch to the row's tallest
   sibling regardless of how short their feature list is. */
.pricing-grid-4 .plan-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 26px 20px 20px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%),
    var(--panel);
  border: 1px solid var(--line-strong);
  height: 100%;
  min-height: 0;
  align-self: stretch;
  transition: transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 200ms ease;
}
/* Make the features list itself flexible so empty space lives BELOW it,
   above the CTA — keeps CTAs aligned at the same row across all cards. */
.pricing-grid-4 .plan-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pricing-grid-4 .plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.pricing-grid-4 .plan-card.featured {
  /* Distinguish via gradient border + animated glow, NOT vertical offset.
     The breathing animation gives subtle motion to draw attention without
     displacing the card and breaking the row's horizontal alignment. */
  border-color: rgba(66, 133, 244, 0.55);
  box-shadow:
    0 0 0 1px rgba(66, 133, 244, 0.20) inset,
    0 16px 40px rgba(66, 133, 244, 0.18);
  animation: featured-card-breathe 3.4s ease-in-out infinite;
}
.pricing-grid-4 .plan-card.featured:hover {
  transform: translateY(-4px) scale(1.01);
  animation-play-state: paused;
  box-shadow:
    0 0 0 1px rgba(66, 133, 244, 0.30) inset,
    0 22px 52px rgba(66, 133, 244, 0.32);
}
@keyframes featured-card-breathe {
  0%, 100% {
    border-color: rgba(66, 133, 244, 0.55);
    box-shadow:
      0 0 0 1px rgba(66, 133, 244, 0.20) inset,
      0 16px 40px rgba(66, 133, 244, 0.18);
  }
  50% {
    border-color: rgba(66, 133, 244, 0.85);
    box-shadow:
      0 0 0 1px rgba(66, 133, 244, 0.32) inset,
      0 20px 50px rgba(66, 133, 244, 0.34),
      0 0 0 6px rgba(66, 133, 244, 0.05);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pricing-grid-4 .plan-card.featured,
  .pricing-grid-4 .plan-card.featured[data-popular-label]::before {
    animation: none !important;
  }
}

.pricing-grid-4 .plan-card > span {
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

/* "Most popular" — a full-width banner across the top of the featured
   card. Visually integrated with the card (not a floating pill), uses
   the card's exact width and top border-radius. A subtle shimmer keeps
   it lively without displacing anything. */
.pricing-grid-4 .plan-card.featured {
  position: relative;
  padding-top: 48px;
}
.pricing-grid-4 .plan-card.featured[data-popular-label]::before {
  content: attr(data-popular-label);
  position: absolute;
  top: -1px;                    /* sit on the border so it replaces it */
  inset-inline-start: -1px;
  inset-inline-end: -1px;
  padding: 10px 12px;
  /* Match the card's top corners; flat bottom so the banner sits
     against the card's content area cleanly. */
  border-radius: 22px 22px 0 0;
  background:
    linear-gradient(90deg,
      #4285f4 0%,
      #6aa3ff 25%,
      #1a4a96 50%,
      #6aa3ff 75%,
      #4285f4 100%);
  background-size: 200% 100%;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.18),
    0 4px 14px rgba(66, 133, 244, 0.35);
  z-index: 2;
  /* Shimmer: slide the brighter gradient stops across the banner. */
  animation: featured-banner-shimmer 5s linear infinite;
}
@keyframes featured-banner-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.pricing-grid-4 .plan-features { margin-top: 4px; }
.pricing-grid-4 .plan-card button { align-self: end; }

/* Strikethrough features = "this plan does NOT include this". Makes the
   comparison between tiers obvious at a glance without needing a table.
   Replaces the green checkmark with a muted X so the icon column lines up. */
.plan-features li.strike {
  text-decoration: line-through;
  text-decoration-color: var(--muted);
  color: var(--muted);
  opacity: 0.55;
}
.plan-features li.strike::before {
  /* Hide the green checkmark (drawn with borders) and replace with an X. */
  content: "✕";
  width: auto;
  height: auto;
  border: 0;
  transform: none;
  top: 0;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  line-height: 1.45;
}

/* Pricing hero — wider container so the title fits on one line in Arabic
   and English alike. text-wrap: balance gives a more even break when it
   does need to wrap on narrow screens. */
.pricing-hero {
  width: min(880px, 100%);
  margin-inline: auto;
}
.pricing-hero h1 {
  font-size: clamp(22px, 3vw, 32px);
  text-wrap: balance;
  white-space: normal;
}
@media (min-width: 760px) {
  .pricing-hero h1 { white-space: nowrap; }
}

/* Increase the gap between pricing cards so they don't look squished. */
.pricing-grid-4.pricing-grid-4 { gap: 16px; }

/* =====================================================================
   Account and checkout
===================================================================== */

.account-shell {
  width: min(560px, 100%);
  margin: 34px auto 0;
  display: grid;
  gap: 14px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(66, 133, 244, 0.08);
  border: 1px solid var(--line);
}

.account-identity img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  background: rgba(66, 133, 244, 0.16);
}

.account-identity-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.account-identity-meta strong {
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity-meta span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.google-signin {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel-deep);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.google-signin:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.google-signin .google-mark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.usage-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
}

.usage-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.usage-card #usageToday {
  unicode-bidi: isolate;       /* keep "8 / 10" in stable visual order */
  direction: ltr;              /* force LTR so digits read used / limit in any language */
}

.usage-track {
  /* The fill bar must always grow from the inline-start of the track so it
     visually "fills up" — same direction the document reads in. */
  direction: inherit;
}

.usage-card span { color: var(--muted); font-size: 13px; }
.usage-card strong { font-size: 18px; }

.usage-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(66, 133, 244, 0.13);
}

.usage-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 200ms ease;
}

.usage-reset {
  font-size: 12px;
  color: var(--muted);
}

.account-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.account-heading {
  display: grid;
  gap: 8px;
}

.account-heading strong {
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.15);
}

.account-heading strong.plan-pro {
  color: #0f4d8a;
  background: rgba(66, 133, 244, 0.18);
}

.account-heading strong.plan-trial {
  color: #7a4b00;
  background: rgba(251, 188, 5, 0.22);
}

@media (prefers-color-scheme: dark) {
  .account-heading strong,
  .account-heading strong.plan-pro,
  .account-heading strong.plan-trial {
    color: #e7ecf5;
  }
}

.account-actions,
.license-actions {
  display: grid;
  gap: 8px;
}

.account-expiry,
.license-message {
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  color: #17396f;
  background: rgba(66, 133, 244, 0.1);
  border: 1px solid rgba(66, 133, 244, 0.16);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.license-message {
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.11);
  border-color: rgba(52, 168, 83, 0.22);
}

.license-message.error {
  color: #8a1f17;
  background: rgba(234, 67, 53, 0.1);
  border-color: rgba(234, 67, 53, 0.22);
}

@media (prefers-color-scheme: dark) {
  .account-expiry,
  .license-message { color: #e7ecf5; }
  .license-message.error { color: #ffb4ab; }
}

.license-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.license-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2d5f9e;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.license-details summary::-webkit-details-marker { display: none; }

.license-details summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-inline-start: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform 160ms ease;
}

.license-details[open] summary::after {
  transform: translateY(15%) rotate(225deg);
}

.license-details > * + * {
  margin-top: 12px;
}

.license-field {
  display: grid;
  gap: 8px;
}

.license-field span {
  color: var(--ink);
  font-weight: 800;
}

.license-field input {
  min-height: 46px;
  width: 100%;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-deep);
  outline: none;
}

.license-field input:focus {
  border-color: rgba(66, 133, 244, 0.48);
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.1);
}

.checkout-shell {
  color: var(--ink);
}

.checkout-line {
  border-color: var(--line) !important;
}

.checkout-result.ok {
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.11);
  border: 1px solid rgba(52, 168, 83, 0.22);
}

.checkout-result.err {
  color: #8a1f17;
  background: rgba(234, 67, 53, 0.1);
  border: 1px solid rgba(234, 67, 53, 0.22);
}

.page-message {
  position: fixed;
  left: 50%;
  bottom: max(16px, var(--safe-bottom));
  z-index: 60;
  width: min(440px, calc(100% - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(52, 168, 83, 0.22);
  border-radius: 14px;
  color: #0f6f3f;
  background: var(--panel-deep);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}

.page-message.error {
  color: #8a1f17;
  border-color: rgba(234, 67, 53, 0.22);
}

@media (prefers-color-scheme: dark) {
  .page-message { color: #b8f3cf; }
  .page-message.error { color: #ffb4ab; }
}

/* =====================================================================
   Transfer tool
===================================================================== */

.app-shell {
  width: min(560px, 100%);
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(10px, var(--safe-top)) max(8px, var(--safe-inline-end)) calc(24px + var(--safe-bottom)) max(8px, var(--safe-inline-start));
}

.topbar,
.panel,
.status-pill {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(150%);
}

.topbar {
  min-height: 72px;
  display: grid;
  gap: 10px;
  padding: 11px;
  border-radius: var(--radius-lg);
}

.identity {
  width: 100%;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-copy h1 {
  order: 1;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  order: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.top-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.status-pill {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.status-pill.connected {
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.15);
}

@media (prefers-color-scheme: dark) {
  .status-pill.connected { color: #b8f3cf; }
}

.workspace {
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.panel {
  max-width: 100%;
  border-radius: var(--radius-lg);
  padding: 13px;
}

.setup-panel,
.transfer-panel {
  min-height: 0;
}

.mode-view,
.device-panel,
.transfer-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.mode-view h2,
.queue-header h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.mode-view > p,
.drop-copy span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.52;
}

.notice {
  padding: 12px;
  border: 1px solid rgba(234, 67, 53, 0.22);
  border-radius: 13px;
  color: #8a1f17;
  background: rgba(234, 67, 53, 0.09);
  line-height: 1.65;
  white-space: pre-line;
}

@media (prefers-color-scheme: dark) {
  .notice { color: #ffb4ab; }
}

.device-header,
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
  flex-wrap: wrap;
}

.files-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-inline-start: auto;
}

.files-tool {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-deep);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.files-tool-primary {
  color: white;
  border: 0;
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: var(--shadow-soft);
}

.select-file {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.select-file input { position: absolute; opacity: 0; pointer-events: none; }

.select-file span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.select-file span::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  transition: background 120ms ease;
}

.select-file input:checked + span::after { background: var(--blue); }

.device-header strong,
.queue-header span {
  min-width: 32px;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.15);
}

@media (prefers-color-scheme: dark) {
  .device-header strong,
  .queue-header span {
    color: #b8f3cf;
  }
}

.host-device-card,
.device-empty,
.device-row,
.join-card,
.dropzone,
.file-row,
.quota-card {
  border: 1px solid var(--line);
  background: var(--panel-deep);
  box-shadow: var(--shadow-soft);
}

.host-device-card {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 9px;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 14px;
}

.device-list {
  display: grid;
  gap: 7px;
  max-height: 172px;
  overflow: auto;
  overscroll-behavior: contain;
}

.device-empty,
.device-row {
  min-height: 44px;
  display: grid;
  align-items: center;
  border-radius: 13px;
}

.device-empty {
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.device-row {
  grid-template-columns: 34px minmax(0, 1fr) 9px;
  gap: 9px;
  padding: 7px 9px;
}

.device-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #1a4a96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), var(--shadow-soft);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
}

.device-icon.ios,
.device-icon.mac {
  color: white;
  background: linear-gradient(135deg, #313746, #5a6678);
}

.device-icon.android {
  color: white;
  background: linear-gradient(135deg, var(--green), #1f7a3f);
}

.device-icon.windows {
  color: white;
  background: linear-gradient(135deg, var(--blue), #1a4a96);
}

.device-icon.linux {
  color: #2a1d00;
  background: linear-gradient(135deg, var(--yellow), #d99a00);
}

.device-name,
.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.device-meta,
.file-state {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.device-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(150, 162, 184, 0.42);
}

.device-row.connected .device-dot,
.host-device-card .device-dot {
  background: var(--green);
}

.join-card {
  min-height: 214px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
}

.join-card img {
  width: 150px;
  height: 150px;
  border-radius: 14px;
  background: white;
  object-fit: contain;
}

.join-card img:not([src]) { opacity: 0; }

.join-info {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.join-info span {
  color: var(--muted);
  font-size: 12px;
}

.join-info strong {
  font-size: 24px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.session-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quota-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 9px;
  min-height: 0;
  padding: 12px;
  border-radius: var(--radius);
}

.quota-card > div:first-child {
  display: grid;
  gap: 3px;
}

.quota-card span {
  color: var(--muted);
  font-size: 13px;
}

.quota-card strong {
  font-size: 18px;
}

.quota-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(66, 133, 244, 0.13);
}

.quota-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 180ms ease;
}

.quota-card button {
  min-height: 38px;
  border-radius: 12px;
  color: white;
  font-weight: 900;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.dropzone {
  position: relative;
  min-height: 132px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius);
  border-style: dashed;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.dropzone.dragover {
  border-color: rgba(66, 133, 244, 0.5);
  background:
    linear-gradient(135deg, rgba(66, 133, 244, 0.12), rgba(52, 168, 83, 0.08)),
    var(--panel-deep);
}

.dropzone:active { transform: scale(0.99); }

.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid rgba(66, 133, 244, 0.18);
  color: #1a4a96;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.18), rgba(52, 168, 83, 0.12));
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .drop-icon { color: #b9d2ff; }
}

.drop-copy {
  display: grid;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
}

.drop-copy strong {
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.file-list {
  min-height: 0;
  max-height: min(560px, 70dvh);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 12px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.file-row {
  position: relative;
  min-width: 0;
  min-height: 226px;
  display: grid;
  grid-template-rows: auto minmax(54px, auto) 36px;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
  overflow: hidden;
}

.file-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-icon {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
}

.file-icon strong {
  font-size: 24px;
  line-height: 1;
  word-break: break-all;
}

.file-icon span {
  font-size: 11px;
  opacity: 0.86;
}

.file-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.file-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.32;
}

.file-state {
  overflow-wrap: anywhere;
}

.file-action {
  display: grid;
}

.file-action a {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.remove-file {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  color: #9b2118;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

/* =====================================================================
   Inline checkout modal — replaces /checkout navigation entirely.
===================================================================== */

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-inline-end)) max(16px, var(--safe-bottom)) max(16px, var(--safe-inline-start));
  background: rgba(21, 32, 51, 0.32);
  backdrop-filter: blur(20px);
}

.checkout-modal-panel {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-deep);
  box-shadow: var(--shadow);
}

.checkout-modal-panel h2 {
  font-size: 24px;
  line-height: 1.18;
}

.checkout-modal-panel p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.checkout-modal-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 34px;
  min-height: 34px;
  border-radius: 999px;
  color: #17396f;
  background: rgba(66, 133, 244, 0.12);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

@media (prefers-color-scheme: dark) {
  .checkout-modal-close { color: #cad9ff; }
}

.checkout-modal-tag {
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #7a4b00;
  background: rgba(251, 188, 5, 0.22);
}

@media (prefers-color-scheme: dark) {
  .checkout-modal-tag { color: #ffe082; }
}

.checkout-modal-lines {
  display: grid;
  gap: 0;
}

.checkout-modal-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.checkout-modal-lines > div:first-child { border-top: 0; }
.checkout-modal-lines strong { color: #2d5f9e; font-weight: 800; }

@media (prefers-color-scheme: dark) {
  .checkout-modal-lines strong { color: #b9d2ff; }
}

.checkout-modal-actions {
  display: grid;
  gap: 8px;
}

.checkout-modal-actions button {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 900;
}

.checkout-modal-result {
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.55;
  font-weight: 700;
  font-size: 14px;
}

.checkout-modal-result.ok {
  color: #0f6f3f;
  background: rgba(52, 168, 83, 0.12);
  border: 1px solid rgba(52, 168, 83, 0.24);
}

.checkout-modal-result.err {
  color: #8a1f17;
  background: rgba(234, 67, 53, 0.1);
  border: 1px solid rgba(234, 67, 53, 0.22);
}

@media (prefers-color-scheme: dark) {
  .checkout-modal-result.ok { color: #b8f3cf; }
  .checkout-modal-result.err { color: #ffb4ab; }
}

@media (min-width: 600px) {
  .checkout-modal-actions { grid-template-columns: 1fr 1fr; }
}

body.modal-open { overflow: hidden; }

/* =====================================================================
   Paywall
===================================================================== */

.paywall {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-inline-end)) max(16px, var(--safe-bottom)) max(16px, var(--safe-inline-start));
  background: rgba(21, 32, 51, 0.28);
  backdrop-filter: blur(18px);
}

.paywall-panel {
  position: relative;
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-deep);
  box-shadow: var(--shadow);
}

.paywall-panel h2 {
  font-size: 28px;
  line-height: 1.12;
}

.paywall-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 34px;
  min-height: 34px;
  border-radius: 999px;
  color: #17396f;
  background: rgba(66, 133, 244, 0.12);
}

.paywall-actions {
  display: grid;
  gap: 8px;
}

.paywall-actions button {
  min-height: 42px;
  border-radius: 12px;
  color: white;
  font-weight: 900;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.paywall-actions .paywall-secondary {
  color: #17396f;
  border: 1px solid rgba(66, 133, 244, 0.16);
  background: rgba(66, 133, 244, 0.1);
}

@media (prefers-color-scheme: dark) {
  .paywall-actions .paywall-secondary,
  .paywall-close {
    color: #cad9ff;
  }
}

/* =====================================================================
   Responsive expansion
===================================================================== */

@media (max-width: 360px) {
  .nav-controls,
  .file-list,
  .session-actions,
  .paywall-actions {
    grid-template-columns: 1fr;
  }

  .hero h1 { font-size: 44px; }
  .file-row { min-height: 0; }
}

@media (max-width: 599px) {
  .floating-file {
    display: none;
  }

  .floating-qr {
    opacity: 0.28;
  }

  /* Phones: 24 tiles would dominate every section. Hide them all by
     default, then re-enable a curated 8-tile subset that signals
     "we move many file types" without crowding any section's copy.
     Picked extensions span office (PDF/DOC), images (JPG), video
     (MP4), archives (ZIP), audio (MP3), and code (HTML). */
  .file-tile { display: none; }
  .tile-pdf,
  .tile-doc,
  .tile-jpg,
  .tile-mp4,
  .tile-zip,
  .tile-mp3,
  .tile-html,
  .tile-svg {
    display: grid;
    opacity: 0.45;
  }
}

@media (max-width: 899px) and (min-width: 600px) {
  /* Tablet: hide the tiles that share a vertical row with each
     other (we keep one per row) so the hero / sections still feel
     decorated without doubling up. */
  .tile-xls, .tile-ppt, .tile-eps, .tile-heic, .tile-mov,
  .tile-rar, .tile-7z, .tile-txt, .tile-css, .tile-js, .tile-json,
  .tile-gif, .tile-psd, .tile-wav, .tile-png {
    display: none;
  }
}

@media (min-width: 600px) {
  .landing-view,
  .page-view {
    padding-inline: 14px;
  }

  .hero h1 { font-size: 72px; }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-metrics article {
    min-height: 68px;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .landing-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(900px, 100%);
  }

  .storyboard,
  .plans,
  .pricing-grid,
  .account-shell {
    width: min(900px, 100%);
  }

  .story-grid,
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-actions,
  .license-actions,
  .paywall-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .file-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .site-nav {
    width: min(1120px, 100%);
    min-height: 64px;
    flex-wrap: nowrap;
    padding: 10px 12px;
  }

  .nav-brand {
    flex: 0 0 auto;
    font-size: 20px;
  }

  .nav-brand .logo,
  .logo {
    width: 42px;
    height: 42px;
    padding: 7px;
    border-radius: 14px;
  }

  .nav-controls {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
  }

  .language-select {
    min-width: 124px;
  }

  .nav-action,
  .nav-link {
    min-width: 98px;
  }

  .hero {
    min-height: calc(100dvh - 174px);
    max-height: 720px;
    padding: 58px 24px 70px;
  }

  .hero::after {
    inset: 26px 8px 34px;
    border-radius: 34px;
  }

  .hero h1 { font-size: 92px; }
  .hero-lead { font-size: 18px; }

  .floating-file {
    width: 108px;
    height: 132px;
    border-radius: 22px;
  }

  .floating-qr {
    width: 116px;
    height: 116px;
    gap: 7px;
    padding: 18px;
    border-radius: 24px;
  }

  .stack-file { left: 8%; top: 18%; opacity: 0.74; }
  .image-file { right: 8%; bottom: 17%; opacity: 0.72; }
  .floating-qr { left: 14%; bottom: 14%; opacity: 0.72; }

  .node {
    width: 74px;
    height: 74px;
    border-radius: 22px;
  }

  .node::before {
    inset: 20px;
    border-radius: 10px;
  }

  .node.phone {
    width: 58px;
    height: 86px;
  }

  .section-copy,
  .page-hero {
    justify-items: center;
    text-align: center;
  }

  .section-copy h2,
  .page-hero h1,
  .account-heading h1 {
    font-size: 42px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .identity {
    width: auto;
  }

  .top-actions {
    grid-template-columns: auto auto auto;
    align-items: center;
  }

  .home-link,
  .status-pill {
    min-width: 96px;
  }
}

@media (min-width: 960px) {
  .landing-view,
  .page-view {
    padding-inline: 22px;
  }

  .storyboard,
  .plans,
  .pricing-grid {
    width: min(1120px, 100%);
  }

  .story-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell {
    width: min(1180px, 100%);
    padding-inline: 14px;
  }

  .workspace {
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
  }

  .setup-panel,
  .transfer-panel {
    /* Was `min-height: 100dvh - 116px` which forced both to fill the
       viewport vertically even when empty. Now each panel sizes to its
       own content (setup-panel ends at its buttons; transfer-panel is
       capped so the file-list scrolls inside instead of letting the
       panel grow to 25+ file heights). */
    min-height: 0;
    padding: 15px;
  }
  /* `align-items: start` so panels stay at their natural content height
     instead of stretching to match the taller one. This was making
     transfer-panel balloon to setup-panel's height (or vice versa). */
  .workspace { align-items: start; }
  /* Cap transfer-panel so it never grows past one screen of files.
     The file-list inside fills the remaining grid row via 1fr and
     scrolls internally. */
  .transfer-panel {
    height: calc(100dvh - 220px);    /* matches viewport minus chrome */
    max-height: 720px;
    min-height: 420px;
  }

  .transfer-panel {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .quota-card {
    grid-template-columns: minmax(0, 1fr) 180px auto;
  }

  .quota-card button {
    min-width: 100px;
  }

  .file-list {
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    max-height: none;
    overflow: auto;
    padding: 4px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .file-row {
    min-height: 220px;
  }
}

@media (min-width: 1180px) {
  .hero h1 { font-size: 104px; }
  .hero-lead { font-size: 20px; }
}

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

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.2;
  }

  35% {
    opacity: 1;
  }

  100% {
    transform: translate3d(190px, -42px, 0);
    opacity: 0;
  }
}

/* =====================================================================
   Brand-color flair for the landing page.
   Adds a constellation of orbiting dots, a subtle aurora behind the hero,
   and a 4-color accent bar threaded through the marketing strip. The
   classes here are injected by site/host.js when /landing is visible so
   the cost is paid only on the home page.
===================================================================== */

/*
  The aurora gradient backdrop was removed — its 380px height + four
  big radial gradients (red / blue / green / yellow) formed a visible
  rectangle behind the hero copy that competed with the floating-file
  tiles for attention. We rely on the floating tiles and the brand
  orbit dots alone for landing-page colour now; the page background
  comes from the body/document gradient.
*/
.hero-aurora { display: none; }

.brand-orbit {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.brand-orbit span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  filter: drop-shadow(0 6px 14px rgba(40, 55, 85, 0.18));
  animation: brand-orbit-float 9s ease-in-out infinite;
  opacity: 0.55;
}
.brand-orbit span.blue   { background: var(--blue);   left: 6%;  top: 22%; }
.brand-orbit span.red    { background: var(--red);    left: 92%; top: 16%; animation-delay: -2s; }
.brand-orbit span.yellow { background: var(--yellow); left: 8%;  top: 84%; animation-delay: -4s; }
.brand-orbit span.green  { background: var(--green);  left: 92%; top: 84%; animation-delay: -6s; }
@keyframes brand-orbit-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(14px, -16px, 0) scale(1.18); }
}

/* 4-color accent bar that runs across the hero CTA + landing strip.
   Both parents are grid containers, so each pseudo must span all columns
   instead of becoming a stand-alone grid item (which is what was making
   the landing strip wrap into a 2+1 layout). */
.hero-actions::after,
.landing-strip::before {
  content: "";
  display: block;
  width: 100%;
  max-width: 320px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--red) 25% 50%, var(--yellow) 50% 75%, var(--green) 75% 100%);
  opacity: 0.85;
  grid-column: 1 / -1;        /* span every column inside its grid parent */
}
.landing-strip::before { margin: 0 auto 18px; }

/* Each marketing strip card gets a tiny color tab matching one brand color. */
.landing-strip article { position: relative; padding-top: 18px; }
.landing-strip article::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 3px; border-radius: 0 0 999px 999px;
  background: var(--blue);
}
.landing-strip article:nth-child(2)::before { background: var(--red); }
.landing-strip article:nth-child(3)::before { background: var(--green); }
.landing-strip article:nth-child(4)::before { background: var(--yellow); }

/* Hero metrics get the same subtle treatment. */
.hero-metrics article {
  position: relative;
  overflow: hidden;
}
.hero-metrics article::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transform: translateY(100%);
  transition: transform 240ms ease;
}
.hero-metrics article:hover::after { transform: translateY(0); }
.hero-metrics article:nth-child(2)::after { background: linear-gradient(90deg, var(--red), var(--yellow)); }
.hero-metrics article:nth-child(3)::after { background: linear-gradient(90deg, var(--yellow), var(--green)); }

/* Story cards: each step gets its own color so the four-card row reads as a
   journey (start → scan → send → close). The gradient bar at the bottom
   matches the step's color so the cards aren't visually identical. */
.story-grid article {
  position: relative;
  padding-top: 28px;
  border-top: 3px solid transparent;
  background:
    linear-gradient(180deg, rgba(66, 133, 244, 0.05), transparent 40%),
    var(--panel);
}
.story-grid article > span {
  position: relative;
  overflow: hidden;
  color: white;
  background: var(--blue);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
}
.story-grid article:nth-child(1) { border-top-color: var(--blue); }
.story-grid article:nth-child(1) > span { background: var(--blue); }
.story-grid article:nth-child(2) { border-top-color: var(--red); }
.story-grid article:nth-child(2) > span { background: var(--red); }
.story-grid article:nth-child(3) { border-top-color: var(--yellow); }
.story-grid article:nth-child(3) > span { background: var(--yellow); color: #2a1d00; }
.story-grid article:nth-child(4) { border-top-color: var(--green); }
.story-grid article:nth-child(4) > span { background: var(--green); }

/* Each card's bottom bar mirrors its top accent so the colors line up. */
.story-grid article:nth-child(1)::after { background: linear-gradient(90deg, var(--blue), rgba(66, 133, 244, 0.2)); opacity: 1; }
.story-grid article:nth-child(2)::after { background: linear-gradient(90deg, var(--red), rgba(234, 67, 53, 0.2)); opacity: 1; }
.story-grid article:nth-child(3)::after { background: linear-gradient(90deg, var(--yellow), rgba(251, 188, 5, 0.2)); opacity: 1; }
.story-grid article:nth-child(4)::after { background: linear-gradient(90deg, var(--green), rgba(52, 168, 83, 0.2)); opacity: 1; }

/* Plan cards get their own brand color top stripe. */
.plan-card { position: relative; padding-top: 22px; }
.plan-card[data-plan-card="free"]::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--blue), #1a4a96); border-radius: 18px 18px 0 0; }
.plan-card[data-plan-card="plus"]::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--yellow), #d99a00); border-radius: 18px 18px 0 0; }
.plan-card[data-plan-card="pro"]::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--green), #1f7a3f); border-radius: 18px 18px 0 0; }
.plan-card[data-plan-card="team"]::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--red), #c92a1d); border-radius: 18px 18px 0 0; }
.plan-card.featured { transform: translateY(-4px); }

/* Title gradient that subtly cycles through the four brand colors. */
.hero h1 {
  background: linear-gradient(90deg, var(--blue), var(--red), var(--yellow), var(--green), var(--blue));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-title-shift 14s linear infinite;
}
@keyframes hero-title-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Reveal-on-scroll: the JS adds .is-revealed once the section enters. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-aurora,
  .brand-orbit span,
  .hero h1 { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =====================================================================
   Profile dashboard — themed to match the rest of Handlane.
   Hero with the brand-orbit gradient, themed tabs with the same blue
   accent as the landing page, panels that look like .plan-card.
===================================================================== */

.account-dashboard {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

/* Override the narrow .account-shell width when the dashboard is shown. */
.account-shell:has(.account-dashboard:not(.hidden)) {
  width: min(960px, 100%);
  gap: 0;
}

/* === Hero strip === */
.profile-hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--blue) 14%, transparent),
    color-mix(in oklab, #34a853 8%, transparent));
}
.profile-hero-bg {
  position: absolute; inset: -20%;
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.55;
}
.profile-hero-bg span {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
}
.profile-hero-bg span:nth-child(1) { top: 10%;  inset-inline-start: 6%;  background: var(--blue); }
.profile-hero-bg span:nth-child(2) { top: 50%;  inset-inline-start: 70%; background: #ea4335; }
.profile-hero-bg span:nth-child(3) { top: 70%;  inset-inline-start: 25%; background: #fbbc05; }
.profile-hero-bg span:nth-child(4) { top: -10%; inset-inline-start: 50%; background: #34a853; }

.profile-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 24px 26px;
  align-items: center;
}
@media (max-width: 720px) {
  .profile-hero-inner { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.profile-avatar {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  border-radius: 999px;
  overflow: hidden;
  display: grid; place-items: center;
  font-weight: 900; font-size: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #1a4a96);
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.32);
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.profile-avatar img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.profile-meta { min-width: 0; display: grid; gap: 2px; }
.profile-meta strong {
  font-size: 18px; font-weight: 900;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-meta span {
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.profile-plan-block {
  display: grid; gap: 6px;
  justify-items: end;
  text-align: end;
  min-width: 0;
}
@media (max-width: 720px) {
  .profile-plan-block { justify-items: start; text-align: start; }
}
.profile-plan-kicker {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); font-weight: 700;
}
.profile-plan-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 14px; font-weight: 900;
  letter-spacing: 0.02em;
  background: rgba(15, 23, 42, 0.10);
  color: inherit;
  border: 1px solid var(--line);
}
.profile-plan-badge[data-plan="plus"] {
  background: linear-gradient(135deg, #fbbc05, #d99a00);
  color: #2a1a00; border-color: transparent;
}
.profile-plan-badge[data-plan="pro"] {
  background: linear-gradient(135deg, var(--blue), #1a4a96);
  color: #fff; border-color: transparent;
}
.profile-plan-badge[data-plan="team"] {
  background: linear-gradient(135deg, #9c27b0, #5b2786);
  color: #fff; border-color: transparent;
}
.profile-plan-copy {
  margin: 0; font-size: 13px; color: var(--muted);
  line-height: 1.5; max-width: 320px;
}

/* ============================================================
   Billing picker — used inside the change-plan modal.
   3 cards (Plus / Pro / Team) + monthly/yearly toggle, identical
   visual language to the /pricing page so users don't see TWO
   different UIs for the same task.
============================================================ */
.billing-picker { display: grid; gap: 14px; }
.billing-picker-intro {
  margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55;
}
.billing-picker-toggle {
  display: inline-flex; padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(40, 55, 85, 0.06);
  align-self: center;
  margin: 0 auto;
  gap: 2px;
}
.billing-picker-toggle button {
  padding: 8px 16px;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700; font-size: 12.5px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 120ms ease, color 120ms ease;
}
.billing-picker-toggle button:hover { color: var(--ink); }
.billing-picker-toggle button.is-active {
  background: linear-gradient(90deg, var(--blue), var(--green));
  color: white;
  box-shadow: 0 4px 10px rgba(66, 133, 244, 0.22);
}
.billing-picker-toggle button.is-active small {
  color: white; opacity: 0.9; font-weight: 800;
  background: rgba(255, 255, 255, 0.18);
  padding: 1px 6px; border-radius: 999px; font-size: 9.5px;
}
.billing-picker-toggle button small {
  background: rgba(52, 168, 83, 0.18);
  color: #0f6f3f;
  padding: 1px 6px; border-radius: 999px; font-size: 9.5px;
  font-weight: 800;
}

.billing-picker-cards {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.billing-picker-card {
  position: relative;
  display: grid; gap: 4px; text-align: start;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.billing-picker-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(66, 133, 244, 0.5);
  background: linear-gradient(140deg, rgba(66, 133, 244, 0.05), rgba(52, 168, 83, 0.02)), var(--panel);
}
.billing-picker-card:disabled,
.billing-picker-card.is-current {
  cursor: not-allowed;
  opacity: 0.7;
  border-style: dashed;
}
.billing-picker-card .bp-direction {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  font-weight: 800; color: var(--muted);
}
.billing-picker-card.is-upgrade   .bp-direction { color: var(--green); }
.billing-picker-card.is-downgrade .bp-direction { color: var(--red); }
.billing-picker-card.is-cycle     .bp-direction { color: var(--blue); }
.billing-picker-card .bp-name {
  font-size: 17px; font-weight: 900; letter-spacing: -0.3px;
}
.billing-picker-card .bp-price {
  display: inline-flex; align-items: baseline; gap: 4px;
}
.billing-picker-card .bp-price strong {
  font-size: 22px; font-weight: 900; color: var(--ink);
}
.billing-picker-card .bp-price small {
  font-size: 11px; color: var(--muted); font-weight: 700;
}
.billing-picker-card .bp-hint {
  font-size: 11.5px; color: var(--muted); line-height: 1.4;
  margin-top: 2px;
}
/* Tier-specific accent rails on the left of each card */
.billing-picker-card-plus { border-left-color: rgba(251, 188, 5, 0.45); border-left-width: 4px; }
.billing-picker-card-pro  { border-left-color: rgba(66, 133, 244, 0.45); border-left-width: 4px; }
.billing-picker-card-team { border-left-color: rgba(156, 39, 176, 0.45); border-left-width: 4px; }

.billing-picker-foot {
  margin: 4px 0 0; font-size: 11px; color: var(--muted);
  text-align: center; line-height: 1.4;
}

/* ============================================================
   Branded modal dialog (replaces window.confirm/alert for billing).
   Used for upgrade/downgrade confirmations, "already on this plan",
   and async error reporting. The backdrop blurs the page so the
   user's focus is unambiguously on the modal.
============================================================ */
.handlane-modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  z-index: 1000;
  padding: 16px;
  animation: handlane-modal-in 160ms ease-out;
}
.handlane-modal.is-closing { animation: handlane-modal-out 140ms ease-in forwards; }
@keyframes handlane-modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes handlane-modal-out {
  to { opacity: 0; }
}
.handlane-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(13, 19, 32, 0.62);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.handlane-modal-card {
  position: relative;
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(66, 133, 244, 0.10), rgba(52, 168, 83, 0.04) 60%, rgba(251, 188, 5, 0.04)),
    var(--panel-deep);
  box-shadow: 0 24px 60px rgba(13, 19, 32, 0.5);
  color: var(--ink);
  overflow: hidden;
  animation: handlane-modal-card-in 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes handlane-modal-card-in {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
.handlane-modal-head {
  display: grid;
  grid-template-columns: 44px 1fr 36px;
  gap: 12px;
  align-items: center;
  padding: 18px 20px 14px;
}
.handlane-modal-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: rgba(66, 133, 244, 0.15);
}
.handlane-modal-warning .handlane-modal-icon,
.handlane-modal-info    .handlane-modal-icon { color: var(--blue); background: rgba(66, 133, 244, 0.15); }
.handlane-modal-success .handlane-modal-icon { color: var(--green); background: rgba(52, 168, 83, 0.16); }
.handlane-modal-warning .handlane-modal-icon { color: #b78600; background: rgba(251, 188, 5, 0.20); }
.handlane-modal-error   .handlane-modal-icon { color: var(--red); background: rgba(234, 67, 53, 0.16); }
@media (prefers-color-scheme: dark) {
  .handlane-modal-warning .handlane-modal-icon { color: var(--yellow); }
}
.handlane-modal-head h2 {
  margin: 0; font-size: 17px; font-weight: 900; letter-spacing: -0.2px;
  line-height: 1.3;
}
.handlane-modal-x {
  width: 36px; height: 36px;
  border: 0; border-radius: 999px;
  background: rgba(40, 55, 85, 0.06);
  color: var(--ink); font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background 120ms ease;
}
.handlane-modal-x:hover { background: rgba(40, 55, 85, 0.14); }
.handlane-modal-body {
  padding: 0 20px 16px;
  font-size: 14px; line-height: 1.55; color: var(--ink);
}
.handlane-modal-body p { margin: 0 0 8px; }
.handlane-modal-body .handlane-modal-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 6px;
}
.handlane-modal-body .handlane-modal-list li {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(40, 55, 85, 0.04);
  border: 1px solid var(--line);
  font-size: 13px;
}
.handlane-modal-body .handlane-modal-warn {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(234, 67, 53, 0.10);
  border: 1px solid rgba(234, 67, 53, 0.25);
  color: #8a1f17;
  font-size: 13px;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .handlane-modal-body .handlane-modal-warn { color: #ffb4ab; }
}
.handlane-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: rgba(40, 55, 85, 0.03);
}
.handlane-modal-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-weight: 800; font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease, background 120ms ease;
}
.handlane-modal-btn-ghost {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}
.handlane-modal-btn-ghost:hover { background: rgba(40, 55, 85, 0.06); }
.handlane-modal-btn-primary {
  color: white;
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.25);
}
.handlane-modal-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.handlane-modal-btn-primary.is-danger {
  background: linear-gradient(90deg, #ea4335, #c5221f);
  box-shadow: 0 4px 12px rgba(234, 67, 53, 0.30);
}
body.handlane-modal-open { overflow: hidden; }

/* Loading modal — non-dismissable, shown during async work such as
   creating a Lemon Squeezy checkout URL. */
.handlane-modal-loading .handlane-modal-icon { color: var(--blue); }
.handlane-spinner {
  animation: handlane-spin 900ms linear infinite;
  transform-origin: 50% 50%;
}

/* Meta note (small dim line) under the primary success message. Used
   by the change-plan success modal to spell out the charge/no-charge
   reality so the user is never surprised by a Lemon Squeezy receipt. */
.handlane-modal-meta {
  margin-top: 8px !important;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(40, 55, 85, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Pricing buttons take colour cues from their detected action so the
   user can see at a glance whether a card is an upgrade (green tint),
   downgrade (red tint), or already their plan (muted). */
.plan-primary.is-current {
  background: rgba(40, 55, 85, 0.10);
  color: var(--muted);
  cursor: not-allowed;
  border: 1px solid var(--line);
}
.plan-primary.is-downgrade {
  background: linear-gradient(90deg, #ea4335, #c5221f);
}
.plan-primary.is-switch {
  background: linear-gradient(90deg, #4285f4, #fbbc05);
}

/* Past-due payment banner — sits next to the scheduled-change
   banner in the profile hero. Red tint signals urgency (a charge
   failed) without being a full error toast. Click the CTA → opens
   Lemon Squeezy's customer portal in a new tab. */
.profile-payment-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(234, 67, 53, 0.36);
  background: linear-gradient(135deg, rgba(234, 67, 53, 0.12), rgba(234, 67, 53, 0.04));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 520px;
}
.profile-payment-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.profile-payment-text strong {
  font-size: 12.5px; font-weight: 900; color: #8a1f17;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.profile-payment-text span {
  font-size: 13px; color: var(--ink); line-height: 1.4;
}
.profile-payment-fix {
  padding: 8px 14px; border-radius: 10px;
  background: linear-gradient(90deg, #ea4335, #c5221f);
  color: white; font-weight: 800; font-size: 12.5px;
  text-decoration: none; white-space: nowrap;
  transition: transform 120ms ease, filter 120ms ease;
}
.profile-payment-fix:hover { transform: translateY(-1px); filter: brightness(1.06); }
@media (prefers-color-scheme: dark) {
  .profile-payment-text strong { color: #ffb4ab; }
}

/* ============================================================
   /success — post-payment landing page.
   Centered card with state-driven icon (pending/ready/timeout),
   meta panel showing plan/cycle/renewal, and a "Go to account"
   CTA that activates only after activation confirms.
============================================================ */
/* =====================================================================
   Privacy policy page (.privacy-view)
   =====================================================================
   Long-form text rendered inside the SPA so it inherits the site's
   translation system, navigation, and theme. Each section sits in a
   .privacy-card with subtle hover lift — emphasising that each item
   is a separate concrete promise, not a single wall of legalese.

   Layout: single column, max-width 760px so line length stays in the
   60–80ch readable range across viewports. Mobile gets full bleed.
*/
.privacy-view {
  padding-inline: 14px;
  padding-bottom: 60px;
}

.privacy-content {
  width: min(760px, 100%);
  margin: 8px auto 0;
  display: grid;
  gap: 22px;
}

.privacy-head {
  display: grid;
  gap: 8px;
  padding: 28px 0 4px;
  text-align: center;
}

.privacy-kicker {
  color: #2d5f9e;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  .privacy-kicker { color: #b9d2ff; }
}

.privacy-content h1 {
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.4px;
  margin: 0;
}

.privacy-updated {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.privacy-intro {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 60ch;
  margin: 8px auto 0;
}

.privacy-sections {
  display: grid;
  gap: 14px;
}

.privacy-card {
  padding: 22px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.privacy-card:hover {
  transform: translateY(-2px);
  border-color: rgba(66, 133, 244, 0.32);
  box-shadow: 0 8px 22px rgba(66, 133, 244, 0.08);
}

.privacy-card h2 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--ink);
}

.privacy-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.privacy-card p + p,
.privacy-card .privacy-list + p {
  margin-top: 10px;
}

.privacy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.privacy-list li {
  position: relative;
  padding-inline-start: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.privacy-list li::before {
  content: "•";
  position: absolute;
  inset-inline-start: 6px;
  top: 0;
  color: var(--blue);
  font-weight: 900;
}

.privacy-contact {
  margin-top: 8px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(66, 133, 244, 0.08), rgba(52, 168, 83, 0.05)),
    var(--panel);
  text-align: center;
}

.privacy-contact h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ink);
}

.privacy-contact p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 15px;
}

.privacy-contact-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: #17396f;
  text-decoration: none;
  border: 1px solid rgba(66, 133, 244, 0.3);
  background: rgba(66, 133, 244, 0.08);
  transition: background 150ms ease, border-color 150ms ease;
}

.privacy-contact-link:hover {
  background: rgba(66, 133, 244, 0.16);
  border-color: rgba(66, 133, 244, 0.5);
}

@media (prefers-color-scheme: dark) {
  .privacy-contact-link {
    color: #cad9ff;
    border-color: rgba(202, 217, 255, 0.22);
    background: rgba(202, 217, 255, 0.06);
  }
  .privacy-contact-link:hover {
    background: rgba(202, 217, 255, 0.12);
    border-color: rgba(202, 217, 255, 0.4);
  }
}

@media (min-width: 760px) {
  .privacy-content h1 { font-size: 48px; }
  .privacy-card { padding: 26px 28px; }
}

/* =====================================================================
   Landing-page footer (.site-footer)
   =====================================================================
   Sits at the very bottom of the home page. Small, single row of
   navigation links + copyright. Reused only on the landing page;
   the other SPA views (account / pricing / privacy) have their own
   top-nav with the same links.
*/
.site-footer {
  width: min(1120px, 100%);
  margin: 36px auto 0;
  padding: 28px 14px 14px;
  display: grid;
  gap: 12px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.site-footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
}

.site-footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 150ms ease, background 150ms ease;
}

.site-footer-link:hover {
  color: var(--ink);
  background: rgba(66, 133, 244, 0.08);
}

.site-footer-copy {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  opacity: 0.8;
}

.success-view {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.success-card {
  width: min(540px, 100%);
  padding: 32px 28px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(52, 168, 83, 0.10), transparent 60%),
    radial-gradient(circle at bottom left, rgba(66, 133, 244, 0.08), transparent 60%),
    var(--panel-deep);
  box-shadow: 0 24px 60px rgba(13, 19, 32, 0.20);
  text-align: center;
  color: var(--ink);
}
.success-icon-wrap {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  border-radius: 24px;
  display: grid; place-items: center;
  background: rgba(52, 168, 83, 0.12);
  color: var(--green);
}
.success-icon { transition: color 200ms ease; }
.success-icon.is-pending { color: var(--blue); }
.success-icon-wrap:has(.is-pending) { background: rgba(66, 133, 244, 0.12); }
.success-icon.is-pending circle {
  animation: success-spin 1.4s linear infinite;
  transform-origin: 50% 50%;
  stroke-dasharray: 28 28;
}
.success-icon.is-pending #successCheckPath,
.success-icon.is-pending .success-check-tick { opacity: 0; }
.success-icon.is-ready circle,
.success-icon.is-ready #successCheckPath { opacity: 0.5; }
.success-icon.is-ready .success-check-tick { opacity: 1; }
.success-icon.is-timeout { color: var(--yellow); }
.success-icon-wrap:has(.is-timeout) { background: rgba(251, 188, 5, 0.16); }
@keyframes success-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .success-icon.is-pending circle { animation-duration: 3s; }
}

.success-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.success-body {
  margin: 0 0 24px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}
.success-meta {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  margin: 0 0 24px;
  border-radius: 14px;
  background: rgba(40, 55, 85, 0.05);
  border: 1px solid var(--line);
  text-align: start;
}
.success-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}
.success-meta-row span { color: var(--muted); }
.success-meta-row strong { color: var(--ink); font-weight: 900; }
.success-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.success-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  color: white !important;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(66, 133, 244, 0.25);
  transition: transform 120ms ease, filter 120ms ease;
}
.success-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
.success-cta-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms ease;
}
.success-cta-ghost:hover { background: rgba(40, 55, 85, 0.05); }
.success-foot {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Modal link variant — used inside the payment-failed error modal. */
.handlane-modal-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, #ea4335, #c5221f);
  color: white !important;
  font-weight: 800; font-size: 12.5px;
  text-decoration: none;
  margin-top: 8px;
}
.handlane-modal-link:hover { filter: brightness(1.06); }
@keyframes handlane-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .handlane-spinner { animation-duration: 2s; }
}

/* Scheduled-change banner — appears in the hero only when the user
   has a deferred downgrade pending. Strong amber tint so it reads
   as "heads-up, your plan is about to change" without screaming. */
.profile-scheduled-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(251, 188, 5, 0.36);
  background: linear-gradient(135deg, rgba(251, 188, 5, 0.12), rgba(251, 188, 5, 0.04));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 460px;
}
.profile-scheduled-text { display: grid; gap: 2px; min-width: 0; }
.profile-scheduled-text strong {
  font-size: 12.5px; font-weight: 900; color: #8a5a00;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.profile-scheduled-text span {
  font-size: 13px; color: var(--ink); font-weight: 700;
}
.profile-scheduled-cancel {
  padding: 7px 12px; border-radius: 9px;
  border: 1px solid rgba(40, 55, 85, 0.16);
  background: var(--panel-deep); color: var(--ink);
  font-size: 12px; font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.profile-scheduled-cancel:hover { background: var(--panel); transform: translateY(-1px); }
.profile-scheduled-cancel:disabled { opacity: 0.6; cursor: not-allowed; }
@media (prefers-color-scheme: dark) {
  .profile-scheduled-text strong { color: #f5c14a; }
}

/* === Tabs === */
.account-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.account-tabs::-webkit-scrollbar { display: none; }

.account-tab {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
.account-tab svg { opacity: 0.85; }
.account-tab:hover {
  background: rgba(66, 133, 244, 0.08);
  color: inherit;
}
.account-tab.is-active {
  background: linear-gradient(135deg, var(--blue), #1a4a96);
  color: #fff;
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.35);
}
.account-tab.is-active svg { opacity: 1; }

/* === Panels === */
.account-panels { display: grid; gap: 16px; }
.account-tab-panel { display: grid; gap: 14px; }
.account-tab-panel.hidden { display: none; }

.profile-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  display: grid; gap: 12px;
}
.profile-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px;
}
.profile-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.profile-section-head strong {
  font-size: 14px; font-weight: 900;
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}
.profile-section-hint {
  font-size: 12px; color: var(--muted); margin: -6px 0 4px;
  line-height: 1.55;
}
.profile-fine-print {
  font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0;
}
.account-empty {
  text-align: center; color: var(--muted); padding: 14px 8px; font-size: 13px;
}

/* === Quick stats grid (Overview top) === */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 540px) {
  .profile-stats-grid { grid-template-columns: 1fr 1fr; }
  .profile-stats-grid > :nth-child(3) { grid-column: 1 / -1; }
}
.profile-stat {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: start;
  display: grid; gap: 4px;
  overflow: hidden;
}
.profile-stat::before {
  content: ""; position: absolute;
  inset: -30%; z-index: 0;
  background: radial-gradient(circle at 80% 0%, var(--tone, var(--blue)) 0%, transparent 60%);
  opacity: 0.12;
  pointer-events: none;
}
.profile-stat[data-tone="blue"]   { --tone: #4285f4; }
.profile-stat[data-tone="green"]  { --tone: #34a853; }
.profile-stat[data-tone="yellow"] { --tone: #fbbc05; }
.profile-stat[data-tone="red"]    { --tone: #ea4335; }

.profile-stat-icon {
  position: relative; z-index: 1;
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--tone, var(--blue)) 18%, transparent);
  color: var(--tone, var(--blue));
  margin-bottom: 4px;
}
.profile-stat strong {
  position: relative; z-index: 1;
  font-size: 22px; font-weight: 900;
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
  line-height: 1.1;
}
.profile-stat span {
  position: relative; z-index: 1;
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
}

/* === Plan benefits list === */
.profile-benefits {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 8px;
}
.profile-benefits li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; line-height: 1.45;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(66, 133, 244, 0.06);
}
.profile-benefits li::before {
  content: "✓"; flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--blue); color: #fff;
  font-weight: 900; font-size: 12px;
}

/* === Usage totals grid === */
.account-totals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 540px) { .account-totals-grid { grid-template-columns: 1fr 1fr; } }
.account-total {
  position: relative; overflow: hidden;
  text-align: center;
  padding: 16px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.account-total::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in oklab, var(--tone, var(--blue)) 14%, transparent), transparent);
  pointer-events: none;
}
.account-total[data-tone="blue"]   { --tone: #4285f4; }
.account-total[data-tone="green"]  { --tone: #34a853; }
.account-total[data-tone="yellow"] { --tone: #fbbc05; }
.account-total strong {
  position: relative;
  display: block; font-size: 22px; font-weight: 900;
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}
.account-total span {
  position: relative;
  display: block; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px;
  font-weight: 700;
}

/* === File-kind breakdown === */
.account-kind-list { display: grid; gap: 6px; }
.account-kind-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
}
.account-kind-row .kind-name {
  font-weight: 800; font-size: 12px; text-transform: capitalize;
}
.account-kind-row .kind-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(66, 133, 244, 0.14);
  overflow: hidden;
}
.account-kind-row .kind-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--blue), #1a4a96);
  border-radius: 3px;
}
.account-kind-row .kind-meta {
  font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}

/* === Daily bars === */
.account-daily-bars {
  display: flex; gap: 3px; align-items: flex-end;
  height: 88px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  overflow-x: auto; scrollbar-width: none;
}
.account-daily-bars::-webkit-scrollbar { display: none; }
.account-daily-bars .bar {
  flex: 0 0 12px;
  min-height: 3px;
  background: linear-gradient(180deg, var(--blue), #1a4a96);
  border-radius: 3px;
  transition: opacity 120ms ease, transform 120ms ease;
}
.account-daily-bars .bar:hover { opacity: 0.75; transform: scaleY(1.04); }

/* === Sessions / Devices lists === */
.account-sessions-list, .account-devices-list {
  display: grid; gap: 6px;
}
.account-session-row, .account-device-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  font-size: 12px;
  align-items: center;
}
.account-session-row .when, .account-device-row .when {
  font-weight: 800; font-size: 13px;
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}
.account-session-row .meta, .account-device-row .meta {
  color: var(--muted); margin-top: 2px;
}
.account-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(66, 133, 244, 0.16);
  color: var(--blue);
  border: 1px solid color-mix(in oklab, var(--blue) 40%, transparent);
}
.account-pill.completed { background: rgba(52, 168, 83, 0.16); color: #34a853; border-color: color-mix(in oklab, #34a853 40%, transparent); }
.account-pill.failed    { background: rgba(234, 67, 53, 0.16); color: #ea4335; border-color: color-mix(in oklab, #ea4335 40%, transparent); }

/* === Profile actions row === */
.profile-actions-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* === Settings: preference rows + toggles + danger zone === */
.profile-pref-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.profile-pref-row:first-of-type { border-top: 0; padding-top: 0; }
.profile-pref-label { display: grid; gap: 2px; min-width: 0; }
.profile-pref-label strong { font-size: 13px; font-weight: 800; }
.profile-pref-label span { font-size: 11px; color: var(--muted); }
.profile-pref-control {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  min-width: 140px;
}

.profile-toggle { position: relative; display: inline-block; }
.profile-toggle input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.profile-toggle-track {
  display: inline-block;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  position: relative;
  transition: background 140ms ease;
  cursor: pointer;
}
.profile-toggle-thumb {
  position: absolute;
  top: 2px; inset-inline-start: 2px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 140ms ease;
}
.profile-toggle input:checked + .profile-toggle-track {
  background: var(--blue);
}
.profile-toggle input:checked + .profile-toggle-track .profile-toggle-thumb {
  transform: translateX(18px);
}
[dir="rtl"] .profile-toggle input:checked + .profile-toggle-track .profile-toggle-thumb {
  transform: translateX(-18px);
}

.profile-section-danger { border-color: color-mix(in oklab, #ea4335 25%, var(--line)); }
.profile-danger-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.profile-danger-row:first-of-type { border-top: 0; padding-top: 0; }
.profile-danger-row > div { display: grid; gap: 2px; min-width: 0; flex: 1 1 200px; }
.profile-danger-row strong { font-size: 13px; font-weight: 800; }
.profile-danger-row span { font-size: 11px; color: var(--muted); }
.ghost-lite.danger {
  border-color: color-mix(in oklab, #ea4335 50%, var(--line));
  color: #ea4335;
}
.ghost-lite.danger:hover {
  background: rgba(234, 67, 53, 0.08);
}

/* =====================================================================
   Profile dashboard — refinements (dark-mode contrast, bounded lists,
   themed select/toggle, refresh button, themed dialog + toast).
===================================================================== */

/* === Profile section: stronger panel look with proper contrast === */
.profile-section {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
}
.profile-section-head h3 { color: var(--muted); }
.profile-section-head .profile-section-actions {
  display: inline-flex; gap: 6px; align-items: center;
}
.profile-refresh {
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: inline-grid; place-items: center;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 220ms ease;
}
.profile-refresh:hover { background: rgba(66, 133, 244, 0.10); color: var(--blue); }
.profile-refresh.is-busy { animation: profile-spin 800ms linear infinite; }
@keyframes profile-spin { to { transform: rotate(360deg); } }

/* === Bounded scroll lists (sessions, devices, kinds) === */
.profile-scroll {
  max-height: 320px;
  overflow-y: auto;
  display: grid; gap: 6px;
  padding-inline-end: 4px;
  scrollbar-width: thin;
}
.profile-scroll::-webkit-scrollbar { width: 6px; }
.profile-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

/* === Sessions list filter bar === */
.profile-filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.profile-filter-chip {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.profile-filter-chip:hover { color: var(--ink); }
.profile-filter-chip.is-active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* === Themed select (replaces ugly white in dark mode) === */
.profile-pref-control {
  background: var(--panel-deep);
  color: var(--ink);
  border-color: var(--line-strong);
  cursor: pointer;
}
.profile-pref-control:hover { border-color: var(--blue); }

/* === Themed toggle (visible off-state in dark mode) === */
.profile-toggle-track {
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}
.profile-toggle-thumb {
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.profile-toggle input:checked + .profile-toggle-track .profile-toggle-thumb {
  background: #fff;
}

/* === Member row: remove the heavy red-looking hover === */
.team-member-row {
  border-color: var(--line);
  background: color-mix(in oklab, var(--panel) 60%, transparent);
}
.team-member-row:hover {
  border-color: var(--line-strong);
  background: color-mix(in oklab, var(--panel-deep) 80%, transparent);
}
.team-member-row.is-paused {
  opacity: 0.78;
  border-color: color-mix(in oklab, #ea4335 30%, var(--line));
}
.team-member-row.is-paused::after {
  position: static;
  display: inline-block;
  margin-inline-start: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(234, 67, 53, 0.16);
  color: #ea4335;
  font-size: 9px; font-weight: 900;
  letter-spacing: 0.06em;
}

/* === Daily bars: brighter base so 0-bytes days are still readable === */
.account-daily-bars {
  background: var(--panel);
  border: 1px solid var(--line);
}
.account-daily-bars .bar {
  background: linear-gradient(180deg, var(--blue), color-mix(in oklab, var(--blue) 60%, #000));
  opacity: 0.95;
}
.account-daily-bars .bar.is-empty {
  background: var(--line-strong);
  opacity: 0.4;
}

/* === Stat icons: stronger contrast in dark mode === */
.profile-stat-icon { box-shadow: 0 0 0 1px color-mix(in oklab, var(--tone) 22%, transparent); }

/* === Plan benefits: slightly stronger background === */
.profile-benefits li {
  background: color-mix(in oklab, var(--blue) 8%, var(--panel));
  border: 1px solid var(--line);
}

/* === Kind row: better contrast === */
.account-kind-row {
  background: color-mix(in oklab, var(--panel) 70%, transparent);
  border: 1px solid var(--line);
}

/* === Sessions / devices rows === */
.account-session-row, .account-device-row {
  background: color-mix(in oklab, var(--panel) 70%, transparent);
  border: 1px solid var(--line);
}

/* === Themed dialog system (replaces alert/confirm/prompt) === */
.site-dialog-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: site-dialog-in 200ms ease;
}
.site-dialog-backdrop.is-closing {
  animation: site-dialog-out 160ms ease forwards;
}
@keyframes site-dialog-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes site-dialog-out {
  to { opacity: 0; }
}
.site-dialog {
  width: min(480px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel-deep);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: site-dialog-rise 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes site-dialog-rise {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.site-dialog-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 18px 22px 12px;
}
.site-dialog-head h3 {
  margin: 0; font-size: 16px; font-weight: 900;
  letter-spacing: -0.01em;
}
.site-dialog-close {
  width: 30px; height: 30px;
  border: 0; background: transparent;
  color: var(--muted);
  border-radius: 999px;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}
.site-dialog-close:hover { background: var(--line); color: var(--ink); }
.site-dialog-body {
  padding: 0 22px 14px;
  font-size: 14px; line-height: 1.55;
  color: var(--ink);
}
.site-dialog-body p { margin: 0 0 8px; color: var(--muted); }
.site-dialog-body .invite-link-row {
  display: flex; gap: 6px;
  margin: 12px 0;
}
.site-dialog-body .invite-link-input {
  flex: 1 1 auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  direction: ltr;
  unicode-bidi: isolate;
}
.site-dialog-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
}
.site-dialog-button {
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 800; font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: background 140ms ease, transform 140ms ease;
}
.site-dialog-button:hover { background: rgba(66, 133, 244, 0.08); }
.site-dialog-button.primary {
  background: linear-gradient(135deg, var(--blue), #1a4a96);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.35);
}
.site-dialog-button.primary:hover {
  filter: brightness(1.08);
  background: linear-gradient(135deg, var(--blue), #1a4a96);
}
.site-dialog-button.danger {
  border-color: color-mix(in oklab, #ea4335 50%, var(--line));
  color: #ea4335;
}
.site-dialog-button.danger:hover { background: rgba(234, 67, 53, 0.10); }
.site-dialog input[type="text"],
.site-dialog input[type="email"],
.site-dialog input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  margin-top: 4px;
}
.site-dialog input:focus { outline: 2px solid var(--blue); outline-offset: 2px; }

/* === Themed toast === */
.site-toast {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 110;
  padding: 12px 18px 12px 14px;
  border-radius: 12px;
  background: var(--panel-deep);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-size: 13px; font-weight: 700;
  display: flex; gap: 10px; align-items: center;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  max-width: 90vw;
}
[dir="rtl"] .site-toast {
  transform: translateX(50%) translateY(20px);
}
.site-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
[dir="rtl"] .site-toast.is-visible {
  transform: translateX(50%) translateY(0);
}
.site-toast::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--blue);
  flex: 0 0 auto;
}
.site-toast.success::before { background: var(--green); }
.site-toast.error::before   { background: var(--red); }
.site-toast.warning::before { background: var(--yellow); }

/* === Account info chip row (joined date, last active) === */
.profile-info-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.profile-info-chip {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  border: 1px solid var(--line);
  font-size: 11px; color: var(--muted); font-weight: 700;
}
.profile-info-chip strong { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* === Empty state with icon === */
.profile-empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
}
.profile-empty-state .icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--blue) 14%, transparent);
  color: var(--blue);
  display: grid; place-items: center;
}
.profile-empty-state h4 {
  margin: 0 0 4px;
  font-size: 14px; font-weight: 800;
  color: var(--ink);
}
.profile-empty-state p {
  margin: 0;
  font-size: 12px; line-height: 1.5;
}

/* === Plan badge: keep readable on dark ===
   The default badge had `background: rgba(15, 23, 42, 0.10)` which is
   nearly invisible on a dark panel. */
.profile-plan-badge[data-plan="free"] {
  background: color-mix(in oklab, var(--ink) 10%, var(--panel));
  color: var(--ink);
  border-color: var(--line-strong);
}

/* === Override profile section default to look better in dark mode === */
.profile-section {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--ink) 1%, transparent), transparent),
    var(--panel);
}

/* === Theme picker === */
.profile-theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.profile-theme-swatch {
  position: relative;
  aspect-ratio: 1.4 / 1;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
}
.profile-theme-swatch.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--blue) 30%, transparent);
}
.profile-theme-swatch[data-theme="default"] { background: linear-gradient(135deg, #4285f4, #34a853, #fbbc05, #ea4335); }
.profile-theme-swatch[data-theme="ocean"]   { background: linear-gradient(135deg, #0f3a5c, #4285f4, #34a853); }
.profile-theme-swatch[data-theme="sunset"]  { background: linear-gradient(135deg, #ea4335, #fbbc05, #ff6b9d); }
.profile-theme-swatch[data-theme="mono"]    { background: linear-gradient(135deg, #1a2030, #4d5b75, #a9b6cb); }
.profile-theme-swatch::after {
  content: attr(data-label);
  position: absolute;
  inset-block-end: 6px; inset-inline-start: 8px;
  font-size: 10px; font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
  text-transform: capitalize;
}

/* =====================================================================
   Final polish pass — fixes from user feedback:
   - ACTIVE pills weren't readable (no border-mix, distinct neutral color)
   - select dropdown options were white on dark bg
   - hero gradient was too chaotic (4 different blobs)
   - "you" marker now inline in meta line (not badge in heading)
   - team-create / member-row backgrounds toned down
   - section backgrounds raised for better readability
===================================================================== */

/* Pills: explicit neutral-blue active, distinct from completed/failed.
   No color-mix on the border (was rendering pink-ish in some browsers). */
.account-pill {
  background: rgba(66, 133, 244, 0.14);
  color: #4285f4;
  border: 1px solid rgba(66, 133, 244, 0.40);
}
.account-pill.active {
  background: rgba(123, 142, 178, 0.14);
  color: var(--muted);
  border-color: var(--line-strong);
}
.account-pill.completed {
  background: rgba(52, 168, 83, 0.16);
  color: #34a853;
  border-color: rgba(52, 168, 83, 0.40);
}
.account-pill.failed {
  background: rgba(234, 67, 53, 0.16);
  color: #ea4335;
  border-color: rgba(234, 67, 53, 0.40);
}

/* Inline "you" marker on the email line (replaces the heavy badge). */
.team-you-marker {
  display: inline-block;
  margin-inline-start: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(66, 133, 244, 0.16);
  color: var(--blue);
}

/* Style the actual <option> elements so the dropdown isn't blinding white
   in dark mode. (Browsers limit option styling, but bg + color is honored.) */
.profile-pref-control,
.team-invite-form select,
.account-modal-body select,
.languageSelectMirror {
  background: var(--panel-deep);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-inline-end: 30px;
  cursor: pointer;
}
[dir="rtl"] .profile-pref-control,
[dir="rtl"] .team-invite-form select,
[dir="rtl"] .account-modal-body select,
[dir="rtl"] .languageSelectMirror {
  background-position:
    18px 50%,
    12px 50%;
  padding-inline-end: 12px;
  padding-inline-start: 30px;
}
.profile-pref-control option,
.team-invite-form select option,
.account-modal-body select option,
.languageSelectMirror option {
  background: var(--panel-deep);
  color: var(--ink);
  padding: 6px 12px;
}

/* Hero gradient: tone down — single soft glow instead of 4 colored blobs.
   The previous design read as "messy paint splatter" on dark backgrounds. */
.profile-hero {
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, color-mix(in oklab, var(--blue) 18%, transparent), transparent 65%),
    radial-gradient(ellipse 50% 70% at 0% 100%, color-mix(in oklab, #34a853 12%, transparent), transparent 60%),
    color-mix(in oklab, var(--ink) 4%, var(--panel));
}
.profile-hero-bg { display: none; }

/* Plan badge: consistent contrast on the toned-down hero. */
.profile-plan-badge {
  font-size: 13px;
  padding: 7px 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.profile-plan-badge[data-plan="free"] {
  background: color-mix(in oklab, var(--ink) 12%, var(--panel));
  border-color: var(--line-strong);
}
.profile-plan-badge[data-plan="plus"] {
  background: linear-gradient(135deg, #fbbc05, #d99a00);
  color: #2a1a00;
}
.profile-plan-badge[data-plan="pro"] {
  background: linear-gradient(135deg, #4285f4, #1a4a96);
  color: #fff;
}
.profile-plan-badge[data-plan="team"] {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: #fff;
}

/* Plan copy: smaller, secondary. */
.profile-plan-copy {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
  max-width: 360px;
}

/* Profile section: slightly raised, clearer borders. */
.profile-section {
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--ink) 2%, transparent), transparent 60%),
    var(--panel);
}

/* Plan benefits: clearer separation, brand-lift. */
.profile-benefits li {
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  border: 1px solid var(--line);
}
.profile-benefits li::before {
  background: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--blue) 20%, transparent);
}

/* Team header: less saturated background; matches hero treatment. */
.team-header {
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, color-mix(in oklab, var(--blue) 14%, transparent), transparent 65%),
    color-mix(in oklab, var(--ink) 3%, var(--panel));
  border: 1px solid var(--line-strong);
}
.team-header::before { display: none; }

/* Team-create card: tone down. */
.team-create-card {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, color-mix(in oklab, var(--blue) 14%, transparent), transparent 60%),
    color-mix(in oklab, var(--ink) 3%, var(--panel));
  border: 1px solid var(--line-strong);
}
.team-create-card::before { display: none; }

/* Stats grid: tighter, clearer chips. */
.profile-stat::before { opacity: 0.10; }
.profile-stat strong { font-size: 24px; }

/* Member row: explicit visible bg, no faint hover glitch. */
.team-member-row {
  background: color-mix(in oklab, var(--ink) 3%, var(--panel));
}
.team-member-row:hover {
  background: color-mix(in oklab, var(--blue) 5%, var(--panel));
}

/* Daily bars: actually visible heights. */
.account-daily-bars { height: 96px; }
.account-daily-bars .bar { min-height: 4px; flex-basis: 14px; }
.account-daily-bars .bar.is-empty {
  background: var(--line-strong);
  opacity: 0.5;
}

/* Sections-head action area aligned end. */
.profile-section-head .profile-section-actions { margin-inline-start: auto; }

/* === Team tab === */
.team-section { display: grid; gap: 14px; }
.team-header {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  align-items: center;
  padding: 18px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--blue) 14%, transparent),
    color-mix(in oklab, #34a853 8%, transparent));
  border: 1px solid var(--line);
}
.team-header::before {
  content: ""; position: absolute;
  inset-inline-end: -40px; top: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 133, 244, 0.20), transparent 70%);
  pointer-events: none;
}
.team-header h2 {
  margin: 0; font-size: 20px; font-weight: 900;
  letter-spacing: -0.01em;
}
.team-header .team-meta {
  font-size: 12px; color: var(--muted);
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 6px;
}
.team-header .team-meta span { display: inline-flex; gap: 4px; align-items: center; }
.team-role-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px; font-weight: 900;
  background: rgba(66, 133, 244, 0.16);
  color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid color-mix(in oklab, var(--blue) 40%, transparent);
}
.team-role-badge.owner {
  background: linear-gradient(135deg, #fbbc05, #d99a00);
  color: #2a1a00; border-color: transparent;
}
.team-role-badge.admin {
  background: linear-gradient(135deg, #9c27b0, #5b2786);
  color: #fff; border-color: transparent;
}

.team-section-title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.team-section-title h3 {
  margin: 0; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}

.team-members { display: grid; gap: 8px; }
.team-member-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid transparent;
  transition: border-color 140ms ease, background 140ms ease;
}
.team-member-row:hover {
  border-color: var(--line);
  background: rgba(66, 133, 244, 0.05);
}
.team-member-row .avatar {
  width: 40px; height: 40px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), #1a4a96);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 900; font-size: 16px;
  overflow: hidden;
}
.team-member-row .avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.team-member-row .who { min-width: 0; }
.team-member-row .who strong {
  display: block; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-member-row .who span {
  display: block; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-member-row .who .usage-line {
  font-size: 10px; color: var(--muted); margin-top: 2px;
  font-variant-numeric: tabular-nums; direction: ltr;
}
.team-member-row .actions {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.team-member-row .actions button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}
.team-member-row .actions button:hover { background: rgba(66, 133, 244, 0.10); }
.team-member-row .actions button.danger:hover { background: rgba(234, 67, 53, 0.12); color: #ea4335; }
.team-member-row.is-paused { opacity: 0.7; }
.team-member-row.is-paused::after {
  content: "PAUSED";
  position: absolute;
  font-size: 9px; font-weight: 900;
  color: #ea4335;
}

.team-invite-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(66, 133, 244, 0.06);
  border: 1px solid var(--line);
}
.team-invite-form input,
.team-invite-form select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--ink);
  font-size: 13px;
}

.team-invite-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  font-size: 12px;
}
.team-invite-row .invite-email {
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-invite-row .invite-status {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.team-invite-row button {
  border: 0; background: transparent;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}
.team-invite-row button:hover { color: #ea4335; }

.team-byKind {
  display: grid; gap: 6px;
}
.team-byKind-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  font-size: 12px;
}

.team-create-card {
  position: relative; overflow: hidden;
  text-align: center;
  padding: 36px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--blue) 12%, transparent),
    color-mix(in oklab, #34a853 8%, transparent));
  border: 1px solid var(--line);
}
.team-create-card::before {
  content: ""; position: absolute;
  inset: -30%; z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(66, 133, 244, 0.30), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(52, 168, 83, 0.20), transparent 50%);
  filter: blur(30px);
  pointer-events: none;
}
.team-create-card > * { position: relative; z-index: 1; }
.team-create-card h2 {
  margin: 0 0 8px; font-size: 22px; font-weight: 900;
  letter-spacing: -0.01em;
}
.team-create-card p {
  color: var(--muted); margin: 0 auto 18px;
  font-size: 14px; line-height: 1.5;
  max-width: 400px;
}

/* === Invite banner (when ?invite=token in URL) === */
.account-invite-banner {
  width: min(960px, 100%);
  margin: 0 auto 14px;
  padding: 20px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--blue) 18%, transparent),
    color-mix(in oklab, #34a853 10%, transparent));
  border: 1px solid color-mix(in oklab, var(--blue) 40%, var(--line));
  box-shadow: 0 6px 24px rgba(66, 133, 244, 0.12);
  display: grid; gap: 10px;
}
.account-invite-banner h3 {
  margin: 0; font-size: 16px; font-weight: 900;
  letter-spacing: -0.01em;
}
.account-invite-banner p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.account-invite-banner .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* === Member limits modal === */
.account-modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 20px;
}
.account-modal.hidden { display: none; }
.account-modal-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel-deep);
  color: var(--ink);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.account-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.account-modal-head h2 { margin: 0; font-size: 16px; }
.account-modal-close {
  background: transparent; border: 0; font-size: 22px;
  cursor: pointer; padding: 4px 8px;
  color: var(--muted);
}
.account-modal-body {
  padding: 16px 18px;
  display: grid; gap: 14px;
}
.account-modal-body label {
  display: grid; gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.account-modal-body input,
.account-modal-body select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.account-modal-body .kind-pickers {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.account-modal-body .kind-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  text-transform: capitalize;
}
.account-modal-body .kind-chip.is-active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.account-modal-body .hours-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.account-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.account-actions.stacked {
  grid-template-columns: 1fr;
}

/* Mobile: collapse multi-column rows. */
@media (max-width: 540px) {
  .account-totals-grid { grid-template-columns: 1fr 1fr; }
  .team-invite-form { grid-template-columns: 1fr; }
  .team-member-row { grid-template-columns: 36px 1fr; }
  .team-member-row .actions {
    grid-column: 1 / -1; justify-content: flex-end;
  }
  .team-byKind-row { grid-template-columns: 60px 1fr 60px; }
}

/* =====================================================================
   Profile dashboard — brand-fixed palette
   --------------------------------------------------------------------
   Root cause of "everything is red" in the modal: --blue is overridden
   to #ea4335 when admin Site Settings sets accent="sunset".
   The dashboard chrome (chips, primary buttons, focus rings) should be
   stable Handlane blue regardless of accent — the accent variable is
   meant for the LANDING page primary CTA, not for every interactive
   surface. So the profile uses fixed brand RGB instead of var(--blue).
===================================================================== */
.account-dashboard {
  /* Locally re-pin brand colors so accent="sunset" doesn't bleed in. */
  --gl-blue: #4285f4;
  --gl-blue-deep: #1a4a96;
  --gl-blue-soft: rgba(66, 133, 244, 0.16);
  --gl-blue-line: rgba(66, 133, 244, 0.40);
  --gl-green: #34a853;
  --gl-yellow: #fbbc05;
  --gl-red: #ea4335;
}

/* Fix every component that was using var(--blue) for chrome —
   restate them with the fixed brand palette. */
.account-dashboard .account-tab.is-active {
  background: linear-gradient(135deg, var(--gl-blue), var(--gl-blue-deep));
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.35);
}
.account-dashboard .account-tab:hover { background: rgba(66, 133, 244, 0.10); }

.account-dashboard .profile-stat[data-tone="blue"]   { --tone: var(--gl-blue); }
.account-dashboard .profile-stat[data-tone="green"]  { --tone: var(--gl-green); }
.account-dashboard .profile-stat[data-tone="yellow"] { --tone: var(--gl-yellow); }
.account-dashboard .profile-stat[data-tone="red"]    { --tone: var(--gl-red); }

.account-dashboard .account-total[data-tone="blue"]   { --tone: var(--gl-blue); }
.account-dashboard .account-total[data-tone="green"]  { --tone: var(--gl-green); }
.account-dashboard .account-total[data-tone="yellow"] { --tone: var(--gl-yellow); }

.account-dashboard .profile-benefits li::before {
  background: var(--gl-blue);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.20);
}
.account-dashboard .profile-refresh:hover { color: var(--gl-blue); }

.account-dashboard .profile-filter-chip.is-active {
  background: var(--gl-blue);
  border-color: var(--gl-blue);
  color: #fff;
}

.account-dashboard .account-pill {
  background: var(--gl-blue-soft);
  color: var(--gl-blue);
  border: 1px solid var(--gl-blue-line);
}
.account-dashboard .account-pill.active {
  background: rgba(123, 142, 178, 0.14);
  color: var(--muted);
  border-color: var(--line-strong);
}
.account-dashboard .account-pill.completed {
  background: rgba(52, 168, 83, 0.16);
  color: var(--gl-green);
  border-color: rgba(52, 168, 83, 0.40);
}
.account-dashboard .account-pill.failed {
  background: rgba(234, 67, 53, 0.16);
  color: var(--gl-red);
  border-color: rgba(234, 67, 53, 0.40);
}

.account-dashboard .team-you-marker {
  background: var(--gl-blue-soft);
  color: var(--gl-blue);
}
.account-dashboard .team-role-badge {
  background: var(--gl-blue-soft);
  color: var(--gl-blue);
  border-color: var(--gl-blue-line);
}
.account-dashboard .team-role-badge.owner {
  background: linear-gradient(135deg, #fbbc05, #d99a00);
  color: #2a1a00;
  border-color: transparent;
}
.account-dashboard .team-role-badge.admin {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: #fff;
  border-color: transparent;
}

.account-dashboard .account-kind-row .kind-bar > span {
  background: linear-gradient(90deg, var(--gl-blue), var(--gl-blue-deep));
}
.account-dashboard .account-kind-row .kind-bar {
  background: rgba(66, 133, 244, 0.14);
}

.account-dashboard .account-daily-bars .bar {
  background: linear-gradient(180deg, var(--gl-blue), var(--gl-blue-deep));
}

.account-dashboard .profile-plan-badge[data-plan="pro"] {
  background: linear-gradient(135deg, var(--gl-blue), var(--gl-blue-deep));
}

.account-dashboard .profile-toggle input:checked + .profile-toggle-track {
  background: var(--gl-blue);
}
.account-dashboard .profile-pref-control:hover { border-color: var(--gl-blue); }

/* =====================================================================
   Member-limits modal — full rebuild with proper dark theme.
   Was: white modal background, red chips (because of --blue override),
   awful contrast. Now: panel-deep bg, ink text, fixed-brand-blue chips
   with explicit checkmark indicator on active.
===================================================================== */
.account-modal {
  /* Re-pin brand colors inside the modal too. */
  --gl-blue: #4285f4;
  --gl-blue-deep: #1a4a96;
  --gl-blue-soft: rgba(66, 133, 244, 0.16);
  --gl-blue-line: rgba(66, 133, 244, 0.40);
}

.account-modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: site-dialog-in 200ms ease;
}
.account-modal-card {
  width: min(540px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel-deep);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: site-dialog-rise 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.account-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.account-modal-head h2 {
  margin: 0;
  font-size: 17px; font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.account-modal-close {
  width: 30px; height: 30px;
  background: transparent; border: 0;
  border-radius: 999px;
  font-size: 20px; line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: grid; place-items: center;
}
.account-modal-close:hover { background: var(--line); color: var(--ink); }

.account-modal-body {
  padding: 18px 22px 6px;
  display: grid; gap: 16px;
  color: var(--ink);
}
.account-modal-body > p {
  margin: 0;
  font-size: 12px; color: var(--muted);
  line-height: 1.5;
}
.account-modal-body label {
  display: grid; gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.account-modal-body label > small {
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  opacity: 0.85;
  margin-top: 2px;
}
.account-modal-body input[type="number"],
.account-modal-body input[type="text"],
.account-modal-body input[type="email"],
.account-modal-body select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  width: 100%;
}
.account-modal-body input:focus,
.account-modal-body select:focus {
  outline: 2px solid var(--gl-blue);
  outline-offset: 1px;
  border-color: var(--gl-blue);
}

/* Kind chips: pill-shaped buttons with checkmark on active. */
.account-modal-body .kind-pickers {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.account-modal-body .kind-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  text-transform: capitalize;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  min-height: 32px;
}
.account-modal-body .kind-chip:hover {
  border-color: var(--gl-blue);
  color: var(--ink);
}
.account-modal-body .kind-chip.is-active {
  background: var(--gl-blue);
  border-color: var(--gl-blue);
  color: #fff;
}
.account-modal-body .kind-chip.is-active::before {
  content: "✓";
  font-weight: 900; font-size: 11px;
}

/* Hour-range row uses two equal columns. */
.account-modal-body .hours-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Footer with primary/cancel buttons (NOT the orange .primary-lite). */
.account-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.account-modal-foot button {
  min-height: 38px;
  padding: 9px 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease;
}
.account-modal-foot button:hover { background: rgba(66, 133, 244, 0.10); }
.account-modal-foot button.primary-lite,
.account-modal-foot button#memberLimitsSave {
  background: linear-gradient(135deg, var(--gl-blue), var(--gl-blue-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.35);
}
.account-modal-foot button.primary-lite:hover,
.account-modal-foot button#memberLimitsSave:hover {
  filter: brightness(1.08);
}

/* =====================================================================
   Role button group (replaces the native select for invite role).
   Two pill buttons sit side-by-side with a clear "Role:" label.
===================================================================== */
.role-group {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  padding: 3px;
  gap: 2px;
}
.role-group-label {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-inline-start: 10px;
  padding-inline-end: 6px;
}
.role-group button {
  min-height: 30px;
  padding: 5px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px; font-weight: 800;
  cursor: pointer;
  border-radius: 8px;
  transition: background 140ms ease, color 140ms ease;
}
.role-group button:hover { color: var(--ink); }
.role-group button.is-active {
  background: var(--gl-blue, #4285f4);
  color: #fff;
}

/* The team-invite-form was a 3-column grid with a select; switch it to
   accommodate the new role-group + email + invite-button layout. */
.team-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--ink) 4%, var(--panel));
  border: 1px solid var(--line-strong);
}
.team-invite-form input[type="email"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
}
.team-invite-form input[type="email"]:focus {
  outline: 2px solid var(--gl-blue, #4285f4);
  outline-offset: 1px;
  border-color: var(--gl-blue, #4285f4);
}
.team-invite-form button[type="submit"] {
  background: linear-gradient(135deg, #4285f4, #1a4a96);
  color: #fff;
  border: 0;
  padding: 0 18px;
  min-height: 38px;
  border-radius: 10px;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
}

@media (max-width: 540px) {
  .team-invite-form { grid-template-columns: 1fr; }
}

/* =====================================================================
   Theme picker actually changes the document accent.
   The existing CSS only acts on `data-accent`, so wire data-theme to it.
===================================================================== */
.profile-theme-swatch.is-active {
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.30);
}

/* =====================================================================
   Quick actions grid (Overview tab).
===================================================================== */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.quick-action {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  text-align: start;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
  min-height: 52px;
}
.quick-action:hover {
  background: rgba(66, 133, 244, 0.08);
  border-color: #4285f4;
  transform: translateY(-1px);
}
.quick-action-icon {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(66, 133, 244, 0.16);
  color: #4285f4;
}
.quick-action-label { flex: 1 1 auto; min-width: 0; }

/* =====================================================================
   Activity timeline (Overview tab).
===================================================================== */
.activity-timeline { display: grid; gap: 4px; max-height: 320px; }
.activity-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease;
}
.activity-item:hover {
  background: color-mix(in oklab, var(--ink) 4%, transparent);
  border-color: var(--line);
}
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(66, 133, 244, 0.14);
  color: #4285f4;
}
.activity-icon.session  { background: rgba(66, 133, 244, 0.14); color: #4285f4; }
.activity-icon.file     { background: rgba(52, 168, 83, 0.16);  color: #34a853; }
.activity-icon.team     { background: rgba(124, 58, 237, 0.18); color: #7c3aed; }
.activity-text { min-width: 0; }
.activity-text strong { display: block; font-size: 13px; font-weight: 800; }
.activity-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.activity-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
  white-space: nowrap;
}

/* =====================================================================
   Daily activity chart — proper labels, today highlight, scale.
===================================================================== */
.daily-chart {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 14px 14px 8px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.daily-chart-header {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--muted);
  font-weight: 700;
}
.daily-chart-header .scale-max {
  font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
  color: var(--ink);
  font-weight: 800;
}
.daily-chart-bars {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 3px;
  align-items: end;
  height: 96px;
}
.daily-chart-bars .day {
  position: relative;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #4285f4, #1a4a96);
  cursor: default;
  transition: opacity 120ms ease;
}
.daily-chart-bars .day.is-empty {
  background: var(--line-strong);
  opacity: 0.45;
}
.daily-chart-bars .day.is-today {
  outline: 2px solid #34a853;
  outline-offset: 1px;
}
.daily-chart-bars .day:hover { opacity: 0.85; }

.daily-chart-axis {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 3px;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
}
.daily-chart-axis .axis-tick { white-space: nowrap; }
.daily-chart-axis .axis-tick.muted { color: transparent; }

.daily-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--panel-deep);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  transform: translate(-50%, -120%);
  opacity: 0;
  transition: opacity 120ms ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.daily-chart-tooltip.is-visible { opacity: 1; }

/* =====================================================================
   Member action buttons — icon only with tooltips, no more cramped row.
===================================================================== */
.team-member-row .actions {
  display: flex; gap: 4px;
  flex-wrap: nowrap;
}
.team-member-row .actions .icon-btn {
  width: 32px; height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.team-member-row .actions .icon-btn:hover {
  background: rgba(66, 133, 244, 0.10);
  color: #4285f4;
  border-color: #4285f4;
}
.team-member-row .actions .icon-btn.danger:hover {
  background: rgba(234, 67, 53, 0.10);
  color: #ea4335;
  border-color: #ea4335;
}
/* Tooltip via aria-label + ::after */
.team-member-row .actions .icon-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-deep);
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  z-index: 5;
  transition: opacity 120ms ease;
}
.team-member-row .actions .icon-btn:hover::after { opacity: 1; }

/* =====================================================================
   Invite filters + improved invite rows.
===================================================================== */
.team-invites-section { display: grid; gap: 10px; }
.team-invites-list { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.team-invite-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--ink) 3%, var(--panel));
  border: 1px solid var(--line);
  font-size: 12px;
}
.team-invite-row .invite-email {
  font-weight: 800; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink);
}
.team-invite-row .invite-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.team-invite-row .invite-status-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.team-invite-row .invite-status-chip.pending {
  background: rgba(251, 188, 5, 0.18); color: #b48400;
  border: 1px solid rgba(251, 188, 5, 0.40);
}
.team-invite-row .invite-status-chip.accepted {
  background: rgba(52, 168, 83, 0.16); color: #34a853;
  border: 1px solid rgba(52, 168, 83, 0.40);
}
.team-invite-row .invite-status-chip.revoked,
.team-invite-row .invite-status-chip.expired {
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  color: var(--muted);
  border: 1px solid var(--line-strong);
}
.team-invite-row .invite-actions {
  display: flex; gap: 4px;
}
.team-invite-row .invite-actions button {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.team-invite-row .invite-actions button:hover {
  background: rgba(66, 133, 244, 0.10);
  color: #4285f4;
  border-color: #4285f4;
}
.team-invite-row .invite-actions button.danger:hover {
  background: rgba(234, 67, 53, 0.10);
  color: #ea4335;
  border-color: #ea4335;
}

/* =====================================================================
   Devices — real names + icons + better card design.
===================================================================== */
.account-devices-list { display: grid; gap: 8px; max-height: 480px; }
.device-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--ink) 3%, var(--panel));
  border: 1px solid var(--line);
}
.device-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(66, 133, 244, 0.14);
  color: #4285f4;
}
.device-card-icon.mobile { background: rgba(52, 168, 83, 0.16); color: #34a853; }
.device-card-icon.tablet { background: rgba(251, 188, 5, 0.16); color: #b48400; }
.device-card-meta { min-width: 0; }
.device-card-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.device-card-meta .device-line {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.device-card-meta .device-line strong {
  display: inline; font-size: 11px; font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
}
.device-card-flag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Light/Dark/Auto segmented control.
===================================================================== */
.profile-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}
.profile-segmented button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 14px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.profile-segmented button:hover { color: var(--ink); }
.profile-segmented button.is-active {
  background: linear-gradient(135deg, #4285f4, #1a4a96);
  color: #fff;
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
}

/* Force light/dark when user picks explicitly. */
:root[data-appearance="light"] {
  color-scheme: light;
  --ink: #0c1428; --muted: #4d5b75; --soft: #f3f6fb;
  --page: #f8fbff;
  --panel: rgba(255, 255, 255, 0.76); --panel-deep: rgba(255, 255, 255, 0.94);
  --line: rgba(40, 55, 85, 0.11); --line-strong: rgba(40, 55, 85, 0.18);
  --shadow: 0 16px 40px rgba(61, 86, 122, 0.12);
  --shadow-soft: 0 6px 18px rgba(61, 86, 122, 0.08);
}
:root[data-appearance="dark"] {
  color-scheme: dark;
  --ink: #f3f6fc; --muted: #a9b6cb; --soft: #1a2030;
  --page: #0d1320;
  --panel: rgba(28, 36, 54, 0.74); --panel-deep: rgba(28, 36, 54, 0.96);
  --line: rgba(255, 255, 255, 0.11); --line-strong: rgba(255, 255, 255, 0.18);
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* =====================================================================
   Account management rows (was "Danger zone" — softer naming).
===================================================================== */
.profile-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.profile-account-row:first-of-type { border-top: 0; padding-top: 0; }
.profile-account-row > div {
  display: grid; gap: 2px;
  min-width: 0;
  flex: 1 1 200px;
}
.profile-account-row strong { font-size: 13px; font-weight: 800; }
.profile-account-row span { font-size: 11px; color: var(--muted); line-height: 1.4; }
.profile-account-row.is-destructive { padding-top: 14px; margin-top: 2px; border-top: 1px solid color-mix(in oklab, #ea4335 20%, var(--line)); }
.profile-account-row.is-destructive strong { color: #ea4335; }

/* =====================================================================
   Pending team invitation cards (Overview tab, top priority placement).
   The link-based invite flow has been retired — invites now arrive as
   a card here when the user signs in with the invited email.
===================================================================== */
.pending-invites-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}
.pending-invites-stack.hidden { display: none; }

.pending-invite-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, color-mix(in oklab, #4285f4 20%, transparent), transparent 65%),
    radial-gradient(ellipse 50% 70% at 0% 100%, color-mix(in oklab, #34a853 14%, transparent), transparent 60%),
    color-mix(in oklab, var(--ink) 4%, var(--panel));
  border: 1px solid color-mix(in oklab, #4285f4 50%, var(--line));
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.15);
}

.pending-invite-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.pending-invite-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(66, 133, 244, 0.18);
  color: #4285f4;
  flex: 0 0 auto;
}
.pending-invite-meta { min-width: 0; }
.pending-invite-meta strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.pending-invite-meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.pending-invite-role-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(66, 133, 244, 0.16);
  color: #4285f4;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(66, 133, 244, 0.40);
}
.pending-invite-role-chip.admin {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: #fff;
  border-color: transparent;
}

.pending-invite-expires {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 12px;
  display: flex; align-items: center; gap: 6px;
}
.pending-invite-expires::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #fbbc05;
  display: inline-block;
}

.pending-invite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pending-invite-actions .btn {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  border: 0;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 140ms ease, background 140ms ease;
}
.pending-invite-actions .btn.accept {
  background: linear-gradient(135deg, #4285f4, #1a4a96);
  color: #fff;
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.35);
}
.pending-invite-actions .btn.accept:hover { filter: brightness(1.08); }
.pending-invite-actions .btn.decline {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.pending-invite-actions .btn.decline:hover {
  background: rgba(234, 67, 53, 0.10);
  color: #ea4335;
  border-color: rgba(234, 67, 53, 0.40);
}

/* === Plan change picker (in site dialog) === */
.plan-change-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}
.plan-change-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
  font: inherit;
}
.plan-change-option:hover:not(:disabled) {
  background: rgba(66, 133, 244, 0.08);
  border-color: #4285f4;
  transform: translateY(-1px);
}
.plan-change-option strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.plan-change-option span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}
.plan-change-option.is-current {
  opacity: 0.6;
  cursor: default;
  border-style: dashed;
}
.plan-change-option.is-current::after {
  content: "✓";
  font-weight: 900;
  color: #34a853;
  font-size: 18px;
}

/* =====================================================================
   Refresh auth-status button — kept because it's still useful inside
   the signed-out card (lets the user re-check after returning from
   Google OAuth without a full page reload). The red `.auth-diag-banner`
   it used to sit beside was a dev-only diagnostic and is removed in
   production.
===================================================================== */
.refresh-auth-status-btn {
  margin-top: 8px;
  font-size: 12px;
  padding: 6px 14px;
}

/* =====================================================================
   Session meter — top bar on /transfer with live stats.
   Replaces the old quota-card-with-upgrade-button-permanently-visible
   that showed even on paid plans.
===================================================================== */
.session-meter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--ink) 2%, transparent), transparent 60%),
    var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  margin-top: 22px;       /* breathing room under the top nav */
  margin-bottom: 14px;
  position: relative;
}

/* Idle state (no active session): only Plan (+ Quota for free) are
   visible. Switch to a centered flex layout so the lone badges don't
   stretch awkwardly across the full row width. */
.session-meter.is-idle {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.session-meter.is-idle .session-meter-item {
  min-width: 220px;
  flex: 0 1 auto;
}
.session-meter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
  border: 1px solid var(--line);
  min-width: 0;
}
.session-meter-item.is-warning {
  border-color: rgba(251, 188, 5, 0.45);
  background: rgba(251, 188, 5, 0.10);
}
.session-meter-item.is-critical {
  border-color: rgba(234, 67, 53, 0.50);
  background: rgba(234, 67, 53, 0.12);
}
.session-meter-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  background: color-mix(in oklab, #4285f4 18%, transparent);
  color: #4285f4;
}
.session-meter-item[data-tone="plan"] .session-meter-icon {
  background: color-mix(in oklab, #fbbc05 22%, transparent);
  color: #b48400;
}
.session-meter-item[data-tone="time"] .session-meter-icon {
  background: color-mix(in oklab, #ea4335 18%, transparent);
  color: #ea4335;
}
.session-meter-item[data-tone="devices"] .session-meter-icon {
  background: color-mix(in oklab, #34a853 18%, transparent);
  color: #34a853;
}
.session-meter-item[data-tone="transferred"] .session-meter-icon {
  background: color-mix(in oklab, #9c27b0 22%, transparent);
  color: #9c27b0;
}
.session-meter-item > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.session-meter-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-meter-value {
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  letter-spacing: -0.01em;
}
.session-meter-value[data-plan="free"]  { color: var(--muted); }
.session-meter-value[data-plan="plus"]  { color: #b48400; }
.session-meter-value[data-plan="pro"]   { color: #4285f4; }
.session-meter-value[data-plan="team"]  { color: #7c3aed; }

/* Upgrade button — only appears for users on free plan. */
.session-meter-upgrade {
  position: absolute;
  top: -10px;
  inset-inline-end: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #4285f4, #1a4a96);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
  text-decoration: none;
  transition: transform 140ms ease, filter 140ms ease;
}
.session-meter-upgrade:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Progress bar (time or quota) below meter — appears when applicable. */
.session-progress {
  display: grid;
  gap: 6px;
  margin: -6px 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
  border: 1px solid var(--line);
}
.session-progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
  overflow: hidden;
  position: relative;
}
#sessionProgressFill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #34a853 0%, #4285f4 100%);
  transition: width 600ms ease, background 300ms ease;
}
.session-progress.is-warning #sessionProgressFill {
  background: linear-gradient(90deg, #4285f4 0%, #fbbc05 100%);
}
.session-progress.is-critical #sessionProgressFill {
  background: linear-gradient(90deg, #fbbc05 0%, #ea4335 100%);
}
.session-progress-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.session-progress.is-warning .session-progress-hint { color: #b48400; }
.session-progress.is-critical .session-progress-hint { color: #ea4335; }

@media (max-width: 720px) {
  .session-meter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .session-meter-upgrade {
    position: static;
    margin: 4px auto 8px;
    align-self: center;
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* =====================================================================
   Setup-panel head: "Create session" title + status pill on one row.
   The status pill was previously in the topbar — moved here so the
   session-related state lives with the session controls.
===================================================================== */
.setup-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.setup-panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}
.setup-panel-head .status-pill {
  margin: 0;
  font-size: 11px;
  padding: 5px 12px;
}

/* Compress the setup-panel content: reduce gaps so the QR card sits
   closer to the action area and the panel isn't a tall mostly-empty
   column when the session hasn't started yet. */
.setup-panel .mode-view {
  gap: 10px;
}
.setup-panel .mode-view > p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  color: var(--muted);
}

/* Tighter wrapper: keep QR + token at their original visual size, but
   trim the outer box so it doesn't occupy a tall mostly-empty column
   when the session has just been started. The QR image keeps its 150px
   size from the original rule above. NO `!important` here — that
   would override the `.hidden` class and leave the card visible after
   the session ends. */
.join-card {
  min-height: 0;        /* was 214px — was forcing extra dead space */
  padding: 16px;
  gap: 8px;
}

/* =====================================================================
   File list scroll behaviour + themed scrollbar.
   No fixed max-height: the grid row `minmax(0, 1fr)` on transfer-panel
   makes the file-list fill ALL remaining space in the card. overflow-y
   keeps it scrolling internally — files reach the bottom of the panel
   instead of leaving a tall empty gap below them.
===================================================================== */
.file-list {
  min-height: 0;
  overflow-y: auto;
  padding-inline-end: 4px;
}
.file-list::-webkit-scrollbar {
  width: 8px;
}
.file-list::-webkit-scrollbar-track {
  background: transparent;
}
.file-list::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.file-list::-webkit-scrollbar-thumb:hover {
  background: color-mix(in oklab, var(--blue) 30%, var(--line-strong));
  background-clip: padding-box;
}
.file-list {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
