/* The three themes are Compass's palettes (compass_app/lib/services/theme_service.dart). */
/* Glass is the default (:root) and comes first: a theme chosen later in this file must win at equal specificity. */
:root, [data-theme="glass"] { color-scheme: light; --bg1: #eaf4fb; --bg2: #bfd8ea; --bg3: #8fb4d0; --bg4: #6e97b8; --card: rgba(255, 255, 255, .62); --text: #0f2434; --muted: #2e4658; --line: rgba(255, 255, 255, .94); --accent: #1f6fa8; --accent2: #e8574a; --glow1: #ffffff; --glow2: #3b7fe0; --glow3: #e8574a; --logo-sq: var(--accent); --logo-l: var(--accent2); --logo-dark: #0f2434; --logo-light: #eaf4fb; }
[data-theme="classic"] { color-scheme: dark; --bg1: #0b1120; --bg2: #131e2e; --bg3: #1a2840; --bg4: #0b1120; --card: rgba(26, 40, 64, .78); --text: #e8f0fe; --muted: #9db0c6; --line: #243552; --accent: #4fc3f7; --accent2: #7c4dff; --glow1: #4fc3f7; --glow2: #7c4dff; --glow3: #0277bd; --logo-sq: var(--accent); --logo-l: var(--accent2); --logo-dark: #0b1120; --logo-light: #e8f0fe; }
[data-theme="metallic"] { color-scheme: dark; --bg1: #15120c; --bg2: #060606; --bg3: #0e0b07; --bg4: #040404; --card: rgba(28, 25, 18, .85); --text: #fff6df; --muted: #bfae86; --line: #6b5522; --accent: #f2c75c; --accent2: #ffe9a6; --glow1: #f2c75c; --glow2: #b8902e; --glow3: #a8731a; --logo-sq: var(--accent); --logo-l: var(--accent2); --logo-dark: #060606; --logo-light: #fff6df; }

* { box-sizing: border-box; }
html { background: var(--bg2); }
body { position: relative; margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: linear-gradient(135deg, var(--bg1), var(--bg2) 42%, var(--bg3) 78%, var(--bg4)); background-attachment: fixed; }
body::before, body::after, .glow { content: ""; position: fixed; z-index: 0; border-radius: 50%; filter: blur(70px); opacity: .45; pointer-events: none; }
body::before { top: -18vmax; left: -12vmax; width: 55vmax; height: 55vmax; background: var(--glow1); animation: drift1 19s ease-in-out infinite alternate; }
body::after { right: -16vmax; bottom: -20vmax; width: 60vmax; height: 60vmax; background: var(--glow2); animation: drift2 23s ease-in-out infinite alternate; }
.glow { top: 35%; left: 40%; width: 34vmax; height: 34vmax; background: var(--glow3); opacity: .3; animation: drift3 17s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(24vw, 18vh) scale(1.2); } }
@keyframes drift2 { to { transform: translate(-26vw, -16vh) scale(.85); } }
@keyframes drift3 { to { transform: translate(-22vw, 20vh) scale(1.3); } }

main { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 56px 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 28px; }
h1 { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: -0.01em; }
/* the lyu.si mark: classes, not inline styles (brand/README.md) */
.lm-f-sq { fill: var(--logo-sq); } .lm-f-l { fill: var(--logo-l); } .lm-f-dark { fill: var(--logo-dark); } .lm-f-light { fill: var(--logo-light); }
.lm-s-sq { stroke: var(--logo-sq); } .lm-s-dark { stroke: var(--logo-dark); } .lm-s-light { stroke: var(--logo-light); }
.mark { width: 48px; height: 48px; margin-right: 12px; vertical-align: -10px; border-radius: 9px; }
.name { background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: -200% center; } }
.beta { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #b7791f; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; vertical-align: middle; }

.settings { position: relative; }
.settings summary { padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary:focus-visible, .settings select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel { position: absolute; right: 0; z-index: 2; width: min(280px, calc(100vw - 32px)); margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); box-shadow: 0 12px 34px rgba(0, 0, 0, .35); }
.panel label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.panel label:last-child { margin-bottom: 0; }
.panel select { display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg1); color: var(--text); font: inherit; font-weight: 400; }
.panel select:disabled { opacity: .55; }

#tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: rise .55s cubic-bezier(.2, .8, .3, 1) both; transition: transform .25s, box-shadow .25s, border-color .25s; }
.tile:nth-child(2) { animation-delay: .09s; }
.tile:nth-child(3) { animation-delay: .18s; }
.tile:nth-child(n+4) { animation-delay: .27s; }
.tile:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 32%, transparent); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.tile.is-default { border-color: var(--accent); }
.tile-open { flex: 1; display: block; padding: 20px; color: inherit; text-decoration: none; }
.tile-open:focus-visible, .tile-default:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile-badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; font-size: 22px; font-weight: 700; box-shadow: 0 6px 16px rgba(0, 0, 0, .28); transition: transform .3s; }
.tile:hover .tile-badge { transform: rotate(-6deg) scale(1.1); }
.tile h2 { margin: 12px 0 4px; font-size: 18px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile-signin { display: inline-block; margin-top: 10px; padding: 2px 10px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 12px; font-weight: 700; }
.tile-flag { position: absolute; top: 20px; right: 20px; color: var(--accent); font-size: 13px; font-weight: 600; }
.tile-default { border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font: inherit; font-size: 14px; padding: 12px; cursor: pointer; }
.tile-default:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#note { margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.report { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.report a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.account { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 14px; }
.account-name { color: var(--muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link { padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-weight: 600; text-decoration: none; }
.account-link:hover, .account-link:focus-visible { border-color: var(--accent); outline: none; }
.signin-hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.signin-hint:empty { display: none; }
.opening { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--card); font-size: 14px; }
.opening a { color: var(--accent); font-weight: 600; }
.opening button { margin-left: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.splash-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.splash-box { width: min(480px, 100%); max-height: 85vh; overflow: auto; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.splash-box h2 { margin: 0 0 10px; font-size: 20px; }
.splash-text { margin: 0 0 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.splash-ok { padding: 8px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

.ad { margin: 28px 0 0; }
.ad h2 { margin: 0 0 10px; font-size: 18px; }
.ad video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 16px; background: var(--bg2); box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }

/* Aero: every tile is a glass window, as on Windows 7: a frosted, sky-tinted frame you can see through, a glossy
   title bar with the window buttons, and a light pane inside. The buttons are drawing only; the tile still opens
   from anywhere on it. */
[data-theme="aero"] { color-scheme: light; --bg1: #0f4c8a; --bg2: #2a7fc9; --bg3: #66b4ea; --bg4: #bfe3fa; --card: rgba(255, 255, 255, .9); --text: #0b2238; --muted: #34506a; --line: rgba(255, 255, 255, .75); --accent: #1a5fa8; --accent2: #23a0d8; --glow1: #bfe8ff; --glow2: #1a4f9c; --glow3: #5dd0ff; --logo-sq: var(--accent); --logo-l: #e8574a; --logo-dark: #0b2238; --logo-light: #eaf4fb; --frame: rgba(150, 200, 240, .42); }
.tile-bar { display: none; }
[data-theme="aero"] h1 { color: #fff; text-shadow: 0 0 18px rgba(255, 255, 255, .55), 0 1px 2px rgba(0, 0, 0, .45); }
[data-theme="aero"] .name { background: none; color: #fff; animation: none; }
[data-theme="aero"] .tile { padding: 0 7px 7px; border: 1px solid rgba(0, 20, 50, .55); border-radius: 9px; background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 26px), var(--frame); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), 0 10px 30px rgba(0, 15, 40, .45); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); }
[data-theme="aero"] .tile:hover { border-color: rgba(0, 20, 50, .7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), 0 0 22px rgba(120, 200, 255, .75), 0 14px 34px rgba(0, 15, 40, .5); }
[data-theme="aero"] .tile.is-default { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), 0 0 0 2px #7fd0ff, 0 10px 30px rgba(0, 15, 40, .45); }
[data-theme="aero"] .tile-bar { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 0 0 3px; color: #04182c; font-size: 13px; text-shadow: 0 0 10px #fff, 0 0 4px #fff; }
.tile-bar-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile-bar-buttons { display: flex; align-self: flex-start; margin-right: -1px; }
.tile-bar-buttons span { display: grid; place-items: center; width: 26px; height: 18px; border: 1px solid rgba(0, 20, 50, .55); border-top: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .25) 50%, rgba(160, 200, 235, .35) 51%, rgba(255, 255, 255, .5)); color: #fff; font: 700 11px/1 "Segoe UI", system-ui, sans-serif; text-shadow: 0 0 2px #000, 0 0 3px #000; }
.tile-bar-buttons span + span { border-left: 0; }
.tile-bar-buttons span:first-child { border-bottom-left-radius: 5px; }
.tile-bar-buttons .x { width: 44px; border-bottom-right-radius: 5px; background: linear-gradient(180deg, #f0b0a0, #d9694f 50%, #c13b20 51%, #e2795a); }
[data-theme="aero"] .tile-open, [data-theme="aero"] .tile-default { background: var(--card); border: 1px solid rgba(0, 20, 50, .4); }
[data-theme="aero"] .tile-open { border-bottom: 0; border-radius: 3px 3px 0 0; }
[data-theme="aero"] .tile-default { border-top-color: rgba(0, 20, 50, .15); border-radius: 0 0 3px 3px; background: linear-gradient(180deg, #f3f8fc, #dfeaf4); }
[data-theme="aero"] .tile-flag { top: 50px; right: 22px; }
[data-theme="aero"] .settings summary, [data-theme="aero"] .account-link { background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(220, 236, 250, .85) 50%, rgba(190, 220, 245, .85) 51%, rgba(225, 240, 252, .9)); border-color: rgba(0, 20, 50, .45); }
[data-theme="aero"] .account-name, [data-theme="aero"] #note, [data-theme="aero"] .signin-hint, [data-theme="aero"] .report, [data-theme="aero"] .ad h2 { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
[data-theme="aero"] .report a { color: #dff3ff; }
[data-theme="aero"] .ad video { border: 7px solid var(--frame); border-radius: 9px; box-shadow: 0 0 0 1px rgba(0, 20, 50, .55), 0 12px 34px rgba(0, 15, 40, .45); }

/* A window, in every theme (the tips): an Aero-style glass frame with a title bar, drawn in the theme's colours */
.win-back { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 10, 25, .35); animation: fadein .2s both; }
@keyframes fadein { from { opacity: 0; } }
.win { width: min(460px, 100%); padding: 0 7px 7px; border: 1px solid rgba(0, 0, 0, .5); border-radius: 9px; background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 30px), color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 18px 50px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); animation: winin .28s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes winin { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.win-bar { display: flex; align-items: center; gap: 8px; height: 32px; padding-left: 4px; color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.win-bar b { flex: 1; }
.win-close { align-self: flex-start; width: 44px; height: 19px; margin-right: -1px; border: 1px solid rgba(0, 0, 0, .5); border-top: 0; border-radius: 0 0 5px 5px; background: linear-gradient(180deg, #f0b0a0, #d9694f 50%, #c13b20 51%, #e2795a); color: #fff; font: 700 12px/1 "Segoe UI", system-ui, sans-serif; text-shadow: 0 0 3px #000; cursor: pointer; }
.win-close:hover, .win-close:focus-visible { background: linear-gradient(180deg, #ffc4b4, #f07a5c 50%, #d84b2c 51%, #f58e6c); outline: none; box-shadow: 0 0 10px #ff9a7a; }
.win-body { padding: 18px 20px 16px; border: 1px solid rgba(0, 0, 0, .35); border-radius: 3px; background: var(--bg1); color: var(--text); }
[data-theme="aero"] .win-body, [data-theme="glass"] .win-body { background: #fbfdff; }
.tip-kicker { margin: 0 0 4px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tip-title { margin: 0 0 6px; font-size: 19px; }
.tip-text { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.tip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tip-actions a, .tip-actions button { padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tip-actions .tip-go { border-color: var(--accent); background: var(--accent); color: #fff; }
.tip-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.tip-off { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 13px; }

/* Square tiles: every tile is as tall as it is wide. Its type, icon and spacing grow with the tile (cqw: a
   hundredth of the tile's width), so a wide tile on a phone reads like the smaller ones on a computer. A
   description that still doesn't fit scrolls inside its tile (a thin scroll bar); the whole text is the tooltip too. */
#tiles .tile { aspect-ratio: 1 / 1; container-type: inline-size; }
#tiles .tile-open { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: clamp(14px, 5.6cqw, 24px) clamp(14px, 5.6cqw, 24px) clamp(10px, 4cqw, 16px); }
#tiles .tile-badge { flex: none; align-self: flex-start; width: clamp(36px, 13cqw, 56px); height: clamp(36px, 13cqw, 56px); border-radius: clamp(10px, 3.8cqw, 16px); font-size: clamp(17px, 6.2cqw, 26px); }
#tiles .tile-open h2 { flex: none; margin: clamp(8px, 3.4cqw, 14px) 0 clamp(3px, 1.3cqw, 6px); font-size: clamp(15px, 5.6cqw, 23px); }
#tiles .tile-open p { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding-right: 6px; font-size: clamp(12.5px, 4.5cqw, 18px); line-height: 1.45; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 55%, transparent) transparent; overscroll-behavior: contain; }
#tiles .tile-open p::-webkit-scrollbar { width: 6px; }
#tiles .tile-open p::-webkit-scrollbar-thumb { border-radius: 3px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
#tiles .tile-signin { flex: none; align-self: flex-start; margin-top: clamp(6px, 2.6cqw, 12px); font-size: clamp(11px, 3.8cqw, 15px); }
#tiles .tile-flag { top: clamp(14px, 5.6cqw, 24px); right: clamp(14px, 5.6cqw, 24px); font-size: clamp(12px, 4cqw, 15px); }
#tiles .tile-default { flex: none; padding: clamp(8px, 3cqw, 13px); font-size: clamp(13px, 4.4cqw, 17px); }
#tiles .tile-bar { font-size: clamp(12px, 4.2cqw, 15px); }
[data-theme="aero"] #tiles .tile-flag { top: calc(30px + clamp(14px, 5.6cqw, 24px)); right: clamp(18px, 6.5cqw, 28px); }
/* Phones: one tile per row, so the tile is nearly the screen's width: type and icon a step larger again */
@media (max-width: 600px) {
  #tiles .tile-open { padding: 7cqw 7cqw 4.5cqw; }
  #tiles .tile-badge { width: 16cqw; height: 16cqw; border-radius: 4.6cqw; font-size: 7.6cqw; }
  #tiles .tile-open h2 { margin: 4.2cqw 0 1.6cqw; font-size: 6.8cqw; }
  #tiles .tile-open p { font-size: 5.1cqw; line-height: 1.45; }
  #tiles .tile-signin { margin-top: 3.2cqw; font-size: 4.2cqw; }
  #tiles .tile-default { padding: 3.6cqw; font-size: 4.8cqw; }
  #tiles .tile-flag { top: 7cqw; right: 7cqw; font-size: 4.4cqw; }
}
