/* Talous visual system v2 — colourful, responsive and operational. */
:root {
  --ink: #12162b;
  --ink-soft: #626b84;
  --navy: #090d1a;
  --navy-2: #141a2d;
  --paper: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f9faff;
  --line: #e5e8f1;
  --line-strong: #d6dbea;
  --orange: #ff9f43;
  --orange-dark: #df7617;
  --mint: #19c896;
  --red: #f25770;
  --blue: #4776f5;
  --purple: #7c5cff;
  --cyan: #18bad3;
  --yellow: #ffd166;
  --shadow: 0 18px 50px rgba(31, 38, 71, .1);
  --shadow-lift: 0 26px 70px rgba(48, 36, 105, .16);
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 78% -10%, rgba(124, 92, 255, .09), transparent 30%),
    radial-gradient(circle at 15% 85%, rgba(24, 186, 211, .065), transparent 30%),
    var(--paper);
  letter-spacing: -.008em;
}

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(124, 92, 255, .25);
  outline-offset: 2px;
}

/* Brand */
.brand-lockup { gap: 12px; font-size: 1.22rem; letter-spacing: -.035em; }
.brand-lockup > span:last-child { display: grid; line-height: 1; }
.brand-lockup small { margin-top: 5px; color: #6d7896; font-size: .48rem; letter-spacing: .18em; font-weight: 800; }
.brand-mark {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 39px;
  height: 39px;
  padding-bottom: 9px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: linear-gradient(145deg, #8d6bff, #5c3df2 55%, #2e1f91);
  box-shadow: 0 10px 28px rgba(94, 61, 242, .34), inset 0 1px rgba(255,255,255,.25);
}
.brand-mark::after { content: ""; position: absolute; inset: -50% 20% 30% -20%; transform: rotate(35deg); background: rgba(255,255,255,.16); }
.brand-mark i { position: relative; z-index: 1; width: 4px; border-radius: 4px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.5); }
.brand-mark i:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 12px; opacity: .8; }
.brand-lockup--large .brand-mark { width: 45px; height: 45px; padding-bottom: 10px; }

/* Login experience */
.login-shell { grid-template-columns: minmax(620px, 1.35fr) minmax(410px, .65fr); background: #090c19; }
.login-brand {
  min-height: 100vh;
  isolation: isolate;
  padding: 42px clamp(42px, 6vw, 98px);
  background:
    linear-gradient(120deg, rgba(9, 12, 25, .96), rgba(15, 14, 40, .88)),
    linear-gradient(135deg, #090c19, #181248);
}
.login-brand::before {
  opacity: .72;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000 15%, transparent 96%);
}
.login-brand::after { right: -260px; bottom: -180px; width: 620px; height: 620px; border-color: rgba(126, 95, 255, .22); box-shadow: 0 0 0 85px rgba(124,92,255,.035), 0 0 0 170px rgba(24,186,211,.025); }
.login-brand .brand-lockup { align-self: flex-start; }
.login-brand .brand-lockup small { color: #807aab; }
.aurora { position: absolute; z-index: -1; border-radius: 50%; filter: blur(90px); opacity: .42; pointer-events: none; animation: aurora-drift 12s ease-in-out infinite alternate; }
.aurora--one { top: 7%; right: 2%; width: 360px; height: 360px; background: #703dff; }
.aurora--two { left: 12%; bottom: -10%; width: 320px; height: 320px; background: #0aa8d7; animation-delay: -5s; }
.login-stage { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(390px, 1fr) minmax(310px, .72fr); gap: clamp(32px, 5vw, 90px); align-items: center; }
.login-statement h1 { font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: clamp(4rem, 6.5vw, 7.7rem); line-height: .9; letter-spacing: -.078em; font-weight: 760; }
.login-statement h1 em { color: transparent; font-style: normal; font-weight: 760; background: linear-gradient(95deg, #a78bfa, #50e3ff 70%); background-clip: text; -webkit-background-clip: text; }
.login-copy { max-width: 600px; margin-top: 30px; color: #9aa4c1; font-size: clamp(.96rem, 1.2vw, 1.12rem); }
.login-showcase { position: relative; width: min(470px, 100%); overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.035)); box-shadow: 0 36px 100px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.12); backdrop-filter: blur(18px); transform: perspective(1200px) rotateY(-6deg) rotateX(2deg); animation: showcase-float 7s ease-in-out infinite; }
.showcase-top { display: flex; justify-content: space-between; padding: 16px 19px; color: #cdd4ea; border-bottom: 1px solid rgba(255,255,255,.09); font-size: .74rem; }
.showcase-top span { display: flex; align-items: center; gap: 9px; }
.showcase-top .pulse { width: 7px; height: 7px; }
.showcase-top b { color: #7f8ba9; font-family: ui-monospace, Consolas, monospace; font-size: .69rem; }
.showcase-body { display: grid; grid-template-columns: .78fr 1.22fr; gap: 22px; padding: 24px; }
.pos-preview { position: relative; width: 138px; height: 225px; margin: auto; padding: 18px 10px 12px; border: 1px solid #38415a; border-radius: 22px; background: linear-gradient(145deg, #30394d, #151a28); box-shadow: 0 26px 35px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.12); }
.pos-camera { position: absolute; top: 8px; left: 50%; width: 24px; height: 3px; transform: translateX(-50%); border-radius: 3px; background: #080b13; }
.pos-screen { height: 100%; display: flex; flex-direction: column; align-items: center; padding: 19px 11px 10px; border-radius: 12px; background: linear-gradient(160deg, #f8f7ff, #e9e7f8); }
.screen-logo { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 23px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #7c5cff, #4c33d2); font-size: .7rem; font-weight: 900; }
.pos-screen i { width: 82%; height: 5px; margin-bottom: 9px; border-radius: 6px; background: #d7d3e7; }
.pos-screen i:nth-of-type(2) { width: 60%; }
.pos-screen button { width: 86%; margin-top: auto; border: 0; border-radius: 8px; padding: 8px; color: #fff; background: linear-gradient(90deg, #7c5cff, #4877f5); font-size: .55rem; font-weight: 900; }
.showcase-steps { display: flex; flex-direction: column; justify-content: center; }
.showcase-kicker { color: #7c87a5; font-size: .58rem; letter-spacing: .12em; font-weight: 850; }
.showcase-steps > strong { margin: 5px 0 20px; font-size: 1.02rem; }
.showcase-step { position: relative; display: grid; grid-template-columns: 27px 1fr; gap: 10px; align-items: center; min-height: 49px; }
.showcase-step:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 37px; bottom: -8px; width: 1px; background: rgba(255,255,255,.13); }
.showcase-step > i { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; color: #8b97b4; font-size: .66rem; font-style: normal; }
.showcase-step.is-done > i { color: #54e0b6; border-color: rgba(84,224,182,.35); background: rgba(84,224,182,.1); }
.showcase-step.is-live > i { color: #fff; border-color: #8065ff; background: #6b4ff1; box-shadow: 0 0 0 5px rgba(124,92,255,.13), 0 0 22px rgba(124,92,255,.45); }
.showcase-step span { display: grid; color: #e3e7f3; font-size: .72rem; font-weight: 700; }
.showcase-step small { color: #69758f; font-size: .6rem; font-weight: 500; }
.showcase-step.is-live small { color: #aa9aff; }
.system-line { color: #7d88a6; }
.system-divider { width: 1px; height: 14px; background: rgba(255,255,255,.16); }
.login-panel { position: relative; background: #f7f8fc; }
.login-panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 100% 0, rgba(124,92,255,.09), transparent 34%), radial-gradient(circle at 0 100%, rgba(24,186,211,.06), transparent 32%); pointer-events: none; }
.login-card { position: relative; z-index: 1; width: min(440px, 100%); gap: 21px; padding: 38px; border: 1px solid rgba(222,226,239,.8); border-radius: 26px; background: rgba(255,255,255,.88); box-shadow: 0 25px 70px rgba(43, 49, 84, .13); backdrop-filter: blur(16px); }
.login-card-head { display: grid; grid-template-columns: 50px 1fr; gap: 15px; align-items: start; }
.login-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #7c5cff, #4776f5); box-shadow: 0 12px 26px rgba(91,74,226,.3); font-size: 1.35rem; }
.login-card h2 { font-size: 2.15rem; }
.login-card label { color: #434b63; }
.login-card input { min-height: 50px; padding-inline: 15px; border-radius: 12px; background: #fbfbfe; }
.login-card input:focus { background: #fff; border-color: #7c5cff; box-shadow: 0 0 0 4px rgba(124,92,255,.11); }
.trust-line { display: flex; align-items: center; justify-content: center; gap: 8px; color: #8a91a5; font-size: .62rem; }
.trust-line span { color: var(--mint); font-size: .55rem; }
.trust-line i { width: 2px; height: 2px; border-radius: 50%; background: #aab0bf; }

/* Core shell */
.app-shell { grid-template-columns: 268px minmax(0, 1fr); }
.sidebar { z-index: 30; padding: 26px 18px 18px; overflow: hidden; background: linear-gradient(180deg, #0b0f1e, #0c1020 62%, #111124); border-right-color: rgba(255,255,255,.055); box-shadow: 12px 0 38px rgba(16, 17, 40, .07); }
.sidebar::before { content: ""; position: absolute; left: -120px; top: 27%; width: 240px; height: 240px; border-radius: 50%; background: rgba(104, 74, 255, .12); filter: blur(60px); pointer-events: none; }
.sidebar .brand-lockup { position: relative; padding-bottom: 35px; }
.sidebar .brand-lockup small { color: #525d79; }
.primary-nav { position: relative; gap: 5px; }
.nav-item { min-height: 46px; padding: 0 13px; border-radius: 12px; color: #7e8aa6; font-weight: 660; transition: color .2s, background .2s, transform .2s; }
.nav-item:hover { color: #e7eaff; background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(124,92,255,.2), rgba(71,118,245,.09)); box-shadow: inset 0 0 0 1px rgba(145,123,255,.12); }
.nav-item.is-active::before { left: -18px; width: 4px; height: 28px; background: linear-gradient(#9a81ff, #40d5ed); box-shadow: 0 0 18px rgba(124,92,255,.7); }
.nav-icon { color: #596580; }
.nav-item.is-active .nav-icon { color: #a998ff; text-shadow: 0 0 16px rgba(124,92,255,.75); }
.nav-count { color: #fff; background: linear-gradient(135deg, #8b6cff, #4776f5); box-shadow: 0 5px 15px rgba(94,77,225,.3); }
.nav-section { color: #434d67; }
.cloud-health { position: relative; padding: 12px; overflow: hidden; border-color: rgba(255,255,255,.07); border-radius: 13px; background: rgba(255,255,255,.035); }
.cloud-health::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #19c896, #36d5e6); transition: transform .4s; }
.cloud-health.is-online::after { transform: scaleX(1); }
.user-chip { border-top-color: rgba(255,255,255,.07); }
.user-chip > span:first-child { color: #fff; background: linear-gradient(135deg, #795cff, #4776f5); box-shadow: 0 7px 18px rgba(91,74,226,.24); }
.text-button:hover { color: #fff; }
.main-shell { position: relative; min-height: 100vh; }
.topbar { position: sticky; z-index: 20; top: 0; min-height: 96px; padding: 18px 34px; border-bottom-color: rgba(216,220,234,.72); background: rgba(255,255,255,.78); box-shadow: 0 8px 30px rgba(43,49,84,.035); backdrop-filter: blur(20px) saturate(150%); }
.topbar h1 { font-size: 1.72rem; font-weight: 760; }
.breadcrumb { color: #9299ac; text-transform: uppercase; letter-spacing: .1em; font-size: .61rem; font-weight: 800; }
.topbar-actions { gap: 10px; }
.icon-button { border-color: var(--line); border-radius: 12px; color: #596179; background: rgba(255,255,255,.8); transition: transform .2s, border-color .2s, box-shadow .2s; }
.icon-button:hover { transform: translateY(-2px); border-color: #c9c3f3; box-shadow: 0 10px 22px rgba(63,55,115,.11); }
.icon-button.is-spinning { animation: spin .65s ease; }
.command-button { display: flex; align-items: center; gap: 9px; height: 40px; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px 0 12px; color: #70788e; background: rgba(255,255,255,.7); font-size: .76rem; font-weight: 680; }
.command-button > span { color: var(--purple); font-size: 1rem; }
kbd { border: 1px solid #e1e4ed; border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; color: #8b92a5; background: #f7f8fb; font-family: inherit; font-size: .61rem; }
.live-sync-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; border: 1px solid #cff1e7; border-radius: 999px; padding: 0 11px; color: #168062; background: #effbf7; font-size: .67rem; font-weight: 800; }
.live-sync-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(25,200,150,.12); }
.live-sync-chip.is-connecting { color: #855919; border-color: #f6e1ba; background: #fff8e9; }
.live-sync-chip.is-connecting i { background: var(--orange); animation: pulse-ring 1.2s infinite; }
.live-sync-chip.is-offline { color: #a74555; border-color: #f4d4da; background: #fff3f5; }
.live-sync-chip.is-offline i { background: var(--red); }
.mobile-menu-button { display: none; }
.sidebar-scrim { display: none; }
.page-content { width: min(1600px, 100%); margin-inline: auto; padding: 32px 34px 70px; }
.page-enter { animation: page-rise .38s var(--ease); }

/* Overview */
.overview-hero { display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(340px, .72fr); gap: 18px; margin-bottom: 20px; }
.hero-copy { position: relative; min-height: 350px; display: flex; align-items: center; overflow: hidden; border-radius: 26px; color: #fff; background: linear-gradient(125deg, #171340, #31236d 52%, #173b68); box-shadow: 0 24px 60px rgba(43,35,96,.22); }
.hero-copy::before { content: ""; position: absolute; inset: 0; opacity: .55; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(110deg, #000, transparent 78%); }
.hero-copy::after { content: ""; position: absolute; right: -120px; bottom: -210px; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 65px rgba(255,255,255,.035), 0 0 0 130px rgba(255,255,255,.02); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; }
.hero-orb--one { width: 220px; height: 220px; right: 5%; top: -25%; background: #8f61ff; }
.hero-orb--two { width: 180px; height: 180px; left: 35%; bottom: -40%; background: #16c7db; }
.hero-content { position: relative; z-index: 2; max-width: 820px; padding: 44px clamp(28px, 4vw, 58px); }
.hero-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 15px; color: #aaa7cf; font-size: .65rem; letter-spacing: .14em; font-weight: 850; }
.hero-kicker span { width: 7px; height: 7px; border-radius: 50%; background: #44e1bc; box-shadow: 0 0 0 5px rgba(68,225,188,.11), 0 0 16px rgba(68,225,188,.55); }
.hero-copy h2 { max-width: 720px; margin: 0; font-size: clamp(2.3rem, 4vw, 4.5rem); line-height: .98; letter-spacing: -.06em; }
.hero-copy h2 em { color: #9b88ff; font-style: normal; }
.hero-copy > .hero-content > p:not(.hero-kicker) { max-width: 680px; margin: 19px 0 25px; color: #b5b8d2; font-size: .95rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button--glow { color: #17122c; background: linear-gradient(105deg, #b8a9ff, #61d7f0); box-shadow: 0 13px 28px rgba(100,108,238,.25); }
.button--glow:hover { box-shadow: 0 17px 35px rgba(100,108,238,.38); }
.button--glass { color: #e8e8f6; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.07); backdrop-filter: blur(9px); }
.button--glass:hover { background: rgba(255,255,255,.12); }
.hero-mini-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 29px; color: #898fab; font-size: .68rem; }
.hero-mini-stats b { margin-right: 3px; color: #fff; font-size: .76rem; }
.hero-mini-stats i { width: 3px; height: 3px; border-radius: 50%; background: #626c89; }
.quality-card { display: flex; flex-direction: column; min-height: 350px; padding: 23px; border: 1px solid rgba(229,232,241,.85); border-radius: 26px; background: rgba(255,255,255,.86); box-shadow: 0 20px 50px rgba(48,50,86,.09); backdrop-filter: blur(14px); }
.quality-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.quality-card header > div { display: grid; }
.quality-kicker { color: #9ca3b6; font-size: .59rem; letter-spacing: .13em; font-weight: 850; }
.quality-card header strong { margin-top: 3px; font-size: .9rem; }
.signal-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 8px; color: #168062; background: #eaf9f4; font-size: .61rem; font-weight: 800; }
.signal-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: pulse-ring 1.8s infinite; }
.quality-body { display: grid; grid-template-columns: 134px 1fr; gap: 18px; align-items: center; margin: 25px 0 18px; }
.score-ring { position: relative; width: 128px; height: 128px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#7c5cff 0 var(--score), #edf0f6 var(--score) 360deg); box-shadow: 0 14px 30px rgba(82,61,174,.14); }
.score-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.score-ring div { position: relative; z-index: 1; display: grid; text-align: center; }
.score-ring strong { font-size: 1.75rem; letter-spacing: -.06em; }
.score-ring span { color: var(--ink-soft); font-size: .61rem; }
.quality-copy { display: grid; gap: 5px; }
.quality-copy strong { font-size: .82rem; }
.quality-copy span { color: var(--ink-soft); font-size: .68rem; }
.run-pulse { min-height: 25px; display: flex; align-items: flex-end; gap: 5px; margin: auto 0 19px; }
.run-pulse i { flex: 1 1 0; min-width: 4px; height: 13px; border-radius: 5px; background: #dfe3ed; transition: height .2s; }
.run-pulse i:nth-child(3n) { height: 20px; }
.run-pulse i:hover { height: 24px; }
.run-pulse .pulse-passed { background: linear-gradient(#36d8aa, #16a87b); }
.run-pulse .pulse-failed, .run-pulse .pulse-setup_failed { background: linear-gradient(#ff8093, #ec4b65); }
.run-pulse .pulse-running, .run-pulse .pulse-preparing { background: linear-gradient(#8c74ff, #5c42d8); }
.run-pulse .pulse-paused, .run-pulse .pulse-queued { background: linear-gradient(#ffc46b, #ec8b2f); }
.run-pulse span { color: var(--ink-soft); font-size: .68rem; }
.quality-card footer { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; color: var(--ink-soft); font-size: .64rem; }
.quality-card footer b { color: var(--ink); }
.availability-track { height: 5px; overflow: hidden; border-radius: 8px; background: #e9ecf3; }
.availability-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #18bad3, #19c896); }

/* Components */
.stats-grid { gap: 16px; }
.stat-card { min-height: 150px; padding: 21px; overflow: hidden; border-color: rgba(226,229,239,.95); border-radius: 19px; box-shadow: 0 9px 30px rgba(43,49,84,.055); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.stat-card:hover { transform: translateY(-4px); border-color: rgba(124,92,255,.2); box-shadow: var(--shadow-lift); }
.stat-card::after { right: -38px; bottom: -49px; width: 135px; height: 135px; border: 22px solid rgba(124,92,255,.05); }
.stat-card--cyan::after { border-color: rgba(24,186,211,.06); }
.stat-card--orange::after { border-color: rgba(255,159,67,.07); }
.stat-card--green::after { border-color: rgba(25,200,150,.07); }
.stat-label { font-size: .74rem; }
.stat-value { margin: 18px 0 7px; font-family: inherit; font-size: 2.5rem; font-weight: 760; letter-spacing: -.065em; }
.stat-accent { width: 39px; height: 39px; border-radius: 12px; color: #7256e8; background: #f0edff; }
.stat-card--cyan .stat-accent { color: #1096aa; background: #e8f9fb; }
.stat-card--orange .stat-accent { color: #c87425; background: #fff3e6; }
.stat-card--green .stat-accent { color: #16805f; background: #e9f9f4; }
.stat-spark { position: absolute; right: 18px; bottom: 17px; display: flex; gap: 3px; align-items: end; height: 24px; opacity: .55; }
.stat-spark i { width: 3px; border-radius: 4px; background: #7c5cff; }
.stat-spark i:nth-child(1) { height: 7px; }.stat-spark i:nth-child(2) { height: 15px; }.stat-spark i:nth-child(3) { height: 10px; }.stat-spark i:nth-child(4) { height: 22px; }.stat-spark i:nth-child(5) { height: 17px; }
.stat-card--cyan .stat-spark i { background: var(--cyan); }.stat-card--orange .stat-spark i { background: var(--orange); }.stat-card--green .stat-spark i { background: var(--mint); }
.panel { overflow: hidden; border-color: rgba(226,229,239,.95); border-radius: 19px; box-shadow: 0 10px 35px rgba(43,49,84,.05); }
.panel-head { min-height: 66px; padding-inline: 21px; }
.panel-head h2, .panel-head h3 { font-size: .96rem; }
.live-card { border-radius: 14px; background: var(--surface-soft); transition: transform .2s, border-color .2s, box-shadow .2s; }
.live-card:hover { transform: translateY(-2px); border-color: rgba(124,92,255,.25); box-shadow: 0 12px 25px rgba(58,52,101,.08); }
.device-glyph { border-color: #7d6be1; color: #725bdd; background: linear-gradient(160deg, #f1efff, #e8f7fb); box-shadow: 0 8px 20px rgba(83,70,155,.12); }
.progress-line { height: 6px; background: #eceef5; }
.progress-line span { position: relative; overflow: hidden; background: linear-gradient(90deg, #7c5cff, #4776f5, #18bad3); }
.progress-line span::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: progress-shine 2s linear infinite; }
.scenario-card, .device-card { position: relative; overflow: hidden; padding: 20px; border-color: rgba(226,229,239,.95); border-radius: 18px; box-shadow: 0 8px 27px rgba(43,49,84,.045); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.scenario-card::before, .device-card::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; transform: scaleX(.25); transform-origin: left; background: linear-gradient(90deg, #7c5cff, #18bad3); transition: transform .3s var(--ease); }
.scenario-card:hover, .device-card:hover { transform: translateY(-5px); border-color: rgba(124,92,255,.2); box-shadow: var(--shadow-lift); }
.scenario-card:hover::before, .device-card:hover::before { transform: scaleX(1); }
.filterbar { padding: 9px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.7); box-shadow: 0 8px 25px rgba(43,49,84,.035); backdrop-filter: blur(10px); }
.filterbar input, .filterbar select { border-color: transparent; background: transparent; }
input, select, textarea { border-radius: 11px; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(124,92,255,.1); }
.button { border-radius: 11px; transition: transform .18s var(--ease), box-shadow .18s, background .18s; }
.button--primary { color: #fff; background: linear-gradient(105deg, #7c5cff, #5677f5); box-shadow: 0 10px 24px rgba(91,74,226,.24); }
.button--primary:hover { background: linear-gradient(105deg, #896dff, #6382ff); box-shadow: 0 14px 29px rgba(91,74,226,.33); }
.button--secondary { background: var(--surface); }
.button--danger { background: linear-gradient(105deg, #f25770, #dc3e59); }
.button.is-loading > span:last-child { animation: arrow-wait .8s ease-in-out infinite alternate; }
.link-button { color: #6550ce; }
.link-button:hover { color: #39258f; }
table { border-collapse: separate; border-spacing: 0; }
th { padding-block: 13px; color: #858da2; background: #f8f9fc; }
td { padding-block: 15px; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: #faf9ff; }
.status-badge { padding: 5px 10px; border: 0; }
.status-badge--passed, .status-badge--published, .status-badge--online { color: #117658; background: #eaf9f4; }
.status-badge--running { color: #5941c4; background: #eeebff; }
.status-badge--queued, .status-badge--paused, .status-badge--draft { color: #a45d19; background: #fff3e6; }
.status-badge--failed, .status-badge--setup_failed, .status-badge--offline { color: #af3e52; background: #fff0f3; }
.empty-state-icon { border-color: #c8c2ec; color: #7b65dc; background: #f4f1ff; }

/* Modals, palette and feedback */
.modal-backdrop { background: rgba(7,9,22,.68); backdrop-filter: blur(10px) saturate(120%); }
.modal { border: 1px solid rgba(255,255,255,.35); border-radius: 22px; box-shadow: 0 40px 120px rgba(5,8,23,.42); animation: modal-in .25s var(--ease); }
.modal-head { padding: 22px 24px; }
.modal-head h2 { font-size: 1.3rem; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f5f6fa; }
.command-palette { gap: 12px; }
.command-search { position: relative; display: flex; align-items: center; }
.command-search > span { position: absolute; z-index: 1; left: 15px; color: var(--purple); font-size: 1.15rem; }
.command-search input { min-height: 52px; padding-left: 44px; background: #f8f8fc; }
.command-list { display: grid; gap: 6px; max-height: 390px; overflow: auto; }
.command-list button { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; border: 1px solid transparent; border-radius: 13px; padding: 10px; color: var(--ink); background: transparent; text-align: left; }
.command-list button:hover { border-color: #ddd7fc; background: #f7f5ff; }
.command-list button > span:nth-child(2) { display: grid; }
.command-list strong { font-size: .82rem; }
.command-list small { color: var(--ink-soft); font-size: .68rem; }
.command-glyph { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: #6851d3; background: #eeebff; }
.command-glyph--hot { color: #fff; background: linear-gradient(135deg, #7c5cff, #4776f5); box-shadow: 0 8px 18px rgba(91,74,226,.25); }
.profile-panel { grid-template-columns: 70px 1fr; align-items: center; }
.profile-avatar { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 21px; color: #fff; background: linear-gradient(135deg, #7c5cff, #4776f5); box-shadow: 0 14px 28px rgba(91,74,226,.25); font-size: 1.1rem; font-weight: 850; }
.profile-panel h3 { margin: 0; font-size: 1.2rem; }
.profile-panel p { margin: 3px 0 0; color: var(--ink-soft); font-size: .78rem; }
.permission-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.permission-grid span { padding: 10px; border-radius: 11px; color: var(--ink-soft); background: var(--surface-soft); font-size: .72rem; }
.permission-grid i { margin-right: 6px; color: var(--mint); font-style: normal; }
.toast-root { right: 26px; bottom: 26px; }
.toast { min-width: 300px; border: 1px solid rgba(255,255,255,.09); border-left: 0; border-radius: 13px; padding: 15px 17px 15px 45px; background: rgba(12,16,32,.96); box-shadow: 0 20px 55px rgba(6,8,22,.3); backdrop-filter: blur(14px); }
.toast::before { content: "i"; position: absolute; margin-left: -30px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: var(--blue); font-size: .68rem; font-weight: 900; }
.toast--success::before { content: "✓"; background: var(--mint); }
.toast--error::before { content: "!"; background: var(--red); }
.loading-dashboard { display: grid; gap: 16px; }
.loading-hero { height: 270px; border-radius: 24px; }
.loading-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.loading-cards i { height: 135px; border-radius: 18px; }
.shimmer { position: relative; overflow: hidden; background: #e9ecf4; }
.shimmer::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent); animation: shimmer 1.3s infinite; }
.loading-dashboard p { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--ink-soft); font-size: .75rem; }
.loading-dashboard p span { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); animation: pulse-ring 1.2s infinite; }
.screen-stage { border-radius: 18px; background: radial-gradient(circle at 50% 35%, #252252, #0b0e1b 70%); }
.screen-frame { border-color: #3c3a68; box-shadow: 0 25px 65px rgba(0,0,0,.4), 0 0 0 1px rgba(157,138,255,.15); }

/* Midnight theme */
[data-theme="midnight"] {
  color-scheme: dark;
  --ink: #eef0fb;
  --ink-soft: #8d97b4;
  --paper: #080b14;
  --surface: #111625;
  --surface-soft: #151b2c;
  --line: #252c41;
  --line-strong: #333b53;
  --shadow: 0 18px 60px rgba(0,0,0,.28);
  --shadow-lift: 0 28px 75px rgba(0,0,0,.4);
}
[data-theme="midnight"] body { background: radial-gradient(circle at 78% -10%, rgba(124,92,255,.12), transparent 30%), radial-gradient(circle at 15% 85%, rgba(24,186,211,.07), transparent 30%), var(--paper); }
[data-theme="midnight"] .main-shell { background: transparent; }
[data-theme="midnight"] .topbar { border-bottom-color: rgba(58,65,88,.65); background: rgba(11,15,27,.75); }
[data-theme="midnight"] .icon-button, [data-theme="midnight"] .command-button { color: #aeb6cc; background: rgba(21,27,44,.82); }
[data-theme="midnight"] kbd { color: #8e98b2; border-color: #333b52; background: #181e30; }
[data-theme="midnight"] .quality-card, [data-theme="midnight"] .stat-card, [data-theme="midnight"] .panel, [data-theme="midnight"] .scenario-card, [data-theme="midnight"] .device-card { border-color: rgba(48,56,79,.85); background: rgba(17,22,37,.88); box-shadow: 0 18px 45px rgba(0,0,0,.18); }
[data-theme="midnight"] .score-ring { background: conic-gradient(#8d73ff 0 var(--score), #252c41 var(--score) 360deg); }
[data-theme="midnight"] .score-ring::before { background: #111625; }
[data-theme="midnight"] .availability-track, [data-theme="midnight"] .progress-line { background: #252c41; }
[data-theme="midnight"] .stat-accent { color: #b0a0ff; background: rgba(124,92,255,.15); }
[data-theme="midnight"] .stat-card--cyan .stat-accent { color: #6ee5f4; background: rgba(24,186,211,.13); }
[data-theme="midnight"] .stat-card--orange .stat-accent { color: #ffc17e; background: rgba(255,159,67,.13); }
[data-theme="midnight"] .stat-card--green .stat-accent { color: #5ce0ba; background: rgba(25,200,150,.13); }
[data-theme="midnight"] .live-card, [data-theme="midnight"] .filterbar, [data-theme="midnight"] .step-row, [data-theme="midnight"] .manual-bar { background: #151b2c; }
[data-theme="midnight"] input, [data-theme="midnight"] select, [data-theme="midnight"] textarea { color: var(--ink); background: #111625; }
[data-theme="midnight"] label { color: #abb3c8; }
[data-theme="midnight"] th { color: #7f89a4; background: #151b2c; }
[data-theme="midnight"] td { border-bottom-color: #242b40; }
[data-theme="midnight"] tbody tr:hover { background: #171d30; }
[data-theme="midnight"] .button--secondary { color: var(--ink); border-color: #343c54; background: #171d2f; }
[data-theme="midnight"] .modal, [data-theme="midnight"] .modal-head { background: #111625; }
[data-theme="midnight"] .modal-head, [data-theme="midnight"] .modal-foot { border-color: #282f44; }
[data-theme="midnight"] .modal-foot { background: #0e1321; }
[data-theme="midnight"] .modal-close { color: #aab2c8; background: #1b2235; }
[data-theme="midnight"] .command-search input { background: #0e1321; }
[data-theme="midnight"] .command-list button:hover { border-color: #3b3564; background: #19182e; }
[data-theme="midnight"] .permission-grid span { background: #151b2c; }
[data-theme="midnight"] .shimmer { background: #171d2e; }
[data-theme="midnight"] .shimmer::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.045), transparent); }
[data-theme="midnight"] .empty-state-icon { border-color: #474166; color: #a998ff; background: #1a1830; }
[data-theme="midnight"] .login-panel { background: #0b0f1b; }
[data-theme="midnight"] .login-card { border-color: #252c41; background: rgba(17,22,37,.9); }
[data-theme="midnight"] .login-card input { color: #eef0fb; background: #0e1321; }
[data-theme="midnight"] .login-card label { color: #abb3c8; }
[data-theme="midnight"] .login-card p:not(.eyebrow):not(.form-error) { color: #858fab; }
[data-theme="midnight"] .pairing-code { color: #dcd8ff; border-color: #4c456d; background: #18172c; }

/* Motion */
@keyframes aurora-drift { to { transform: translate(28px, -22px) scale(1.12); } }
@keyframes showcase-float { 0%,100% { transform: perspective(1200px) rotateY(-6deg) rotateX(2deg) translateY(0); } 50% { transform: perspective(1200px) rotateY(-4deg) rotateX(1deg) translateY(-10px); } }
@keyframes page-rise { from { opacity: .15; transform: translateY(9px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progress-shine { to { transform: translateX(100%); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes arrow-wait { to { transform: translateX(5px); opacity: .5; } }
@keyframes pulse-ring { 0%,100% { box-shadow: 0 0 0 3px rgba(25,200,150,.09); } 50% { box-shadow: 0 0 0 7px rgba(25,200,150,.02); } }

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

@media (max-width: 1280px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .overview-hero { grid-template-columns: minmax(0, 1.25fr) minmax(315px, .75fr); }
  .command-button { width: 41px; overflow: hidden; padding: 0; justify-content: center; font-size: 0; }
  .command-button kbd { display: none; }
}

@media (max-width: 1050px) {
  .overview-hero { grid-template-columns: 1fr; }
  .quality-card { min-height: 280px; }
  .quality-body { margin-block: 18px; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 274px; height: 100vh; padding-inline: 18px; transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: 24px 0 70px rgba(0,0,0,.35); }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .sidebar .brand-lockup span:last-child, .nav-item, .user-chip { font-size: inherit; }
  .nav-item { justify-content: flex-start; padding-inline: 13px; }
  .nav-icon { font-size: 1.05rem; }
  .nav-item.is-active::before { left: -18px; }
  .nav-section { display: block; }
  .cloud-health { display: flex; }
  .user-chip { display: grid; }
  .user-chip span:nth-child(2), .user-chip span:last-child { display: grid; }
  .text-button { display: block; }
  .sidebar-scrim { position: fixed; z-index: 25; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(4,6,15,.58); backdrop-filter: blur(3px); }
  .app-shell.nav-open .sidebar-scrim { display: block; }
  .mobile-menu-button { display: grid; place-items: center; flex: 0 0 auto; }
  .topbar { padding-inline: 18px; }
  .topbar > div:nth-of-type(1) { flex: 1; }
  .page-content { padding-inline: 18px; }
  .live-sync-chip { display: none; }
}

@media (max-width: 700px) {
  .login-shell { display: block; background: #090c19; }
  .login-brand { min-height: 360px; padding: 27px 24px 45px; }
  .login-stage { margin-block: auto; }
  .login-statement h1 { font-size: clamp(3.4rem, 15vw, 5rem); }
  .login-copy { display: block; margin-top: 20px; font-size: .88rem; }
  .system-line { display: none; }
  .login-panel { min-height: calc(100vh - 360px); padding: 0 17px 30px; background: #090c19; }
  .login-card { margin-top: -18px; padding: 27px 22px; border-radius: 22px; }
  .login-card-head { grid-template-columns: 42px 1fr; }
  .login-icon { width: 42px; height: 42px; border-radius: 13px; }
  .login-card h2 { font-size: 1.7rem; }
  .trust-line { flex-wrap: wrap; }
  .topbar { min-height: 80px; }
  .topbar h1 { font-size: 1.18rem; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-button { display: grid; }
  .topbar-actions #theme-button, .topbar-actions #refresh-button { display: none; }
  .command-button { display: none; }
  .button#new-run-button { width: 40px; min-width: 40px; padding: 0; overflow: hidden; font-size: 0; }
  .button#new-run-button::before { content: "+"; font-size: 1.2rem; }
  .overview-hero { margin-top: -2px; }
  .hero-copy { min-height: 390px; border-radius: 22px; }
  .hero-content { padding: 32px 25px; }
  .hero-copy h2 { font-size: 2.7rem; }
  .hero-mini-stats { align-items: flex-start; flex-direction: column; gap: 5px; }
  .hero-mini-stats i { display: none; }
  .quality-card { border-radius: 22px; }
  .quality-body { grid-template-columns: 120px 1fr; }
  .score-ring { width: 112px; height: 112px; }
  .stats-grid, .loading-cards { grid-template-columns: 1fr; }
  .grid-2, .card-grid, .form-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .filterbar { align-items: stretch; flex-direction: column; }
  .filterbar input, .filterbar select { width: 100%; max-width: none; }
  .permission-grid { grid-template-columns: 1fr; }
  .toast-root { inset: auto 13px 13px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}

/* Learn Mode, contextual helper and operating guide */
.helper-button { border-color: rgba(124,92,255,.25); color: #7254ef; background: #f2efff; font-weight: 900; }
.learn-hero, .guide-hero { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; min-height: 390px; margin-bottom: 20px; overflow: hidden; border-radius: 28px; color: #fff; background: radial-gradient(circle at 88% 15%, rgba(84,226,205,.25), transparent 28%), radial-gradient(circle at 30% 90%, rgba(160,112,255,.28), transparent 34%), linear-gradient(125deg, #151333, #3b2678 58%, #155f73); box-shadow: 0 24px 60px rgba(38,31,98,.24); }
.learn-hero::after, .guide-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.2) 1px, transparent 1px); background-size: 25px 25px; mask-image: linear-gradient(to right, transparent, #000); }
.learn-hero-copy, .guide-hero > div { z-index: 1; align-self: center; padding: 48px 52px; }
.learn-hero h2, .guide-hero h2 { max-width: 700px; margin: 9px 0 16px; font-size: clamp(2.4rem, 4.5vw, 4.5rem); line-height: .98; letter-spacing: -.055em; }
.learn-hero p:not(.hero-kicker), .guide-hero > div > p:not(.hero-kicker) { max-width: 660px; color: rgba(255,255,255,.75); font-size: 1rem; line-height: 1.7; }
.learn-visual { z-index: 1; display: grid; align-content: center; justify-items: center; padding: 36px; }
.learn-phone { width: 190px; height: 310px; padding: 12px; border: 2px solid rgba(255,255,255,.4); border-radius: 31px; background: #080a14; box-shadow: 0 25px 55px rgba(3,4,15,.48); transform: rotate(5deg); }
.learn-phone > div { position: relative; display: flex; align-items: center; flex-direction: column; height: 100%; padding: 52px 18px 20px; overflow: hidden; border-radius: 21px; color: #1d2440; background: linear-gradient(#f9fbff, #d8e8ef); }
.learn-phone b { margin-bottom: 25px; color: #5d6784; font-size: .7rem; letter-spacing: .14em; }
.learn-phone i { width: 88%; height: 9px; margin: 7px; border-radius: 9px; background: #c7d2df; }
.learn-phone i:nth-of-type(2) { width: 65%; }
.learn-phone button { width: 90%; height: 45px; margin-top: auto; border: 0; border-radius: 13px; color: white; background: linear-gradient(120deg, #7859ff, #26bba0); font-weight: 900; }
.learn-tap-ring { position: absolute; z-index: 2; right: 29px; bottom: 42px; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; background: rgba(124,92,255,.45); animation: learn-tap 1.7s ease-out infinite; }
.learn-trail { display: flex; align-items: center; gap: 7px; margin-top: 25px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.learn-trail span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; background: rgba(255,255,255,.08); }
.learn-trail span.is-captured { border-color: rgba(76,223,178,.5); color: #82f0ce; }
.learn-trail i { width: 16px; height: 1px; background: rgba(255,255,255,.3); }
.readiness-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.readiness-card { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 13px; min-height: 135px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: var(--shadow-sm); }
.readiness-card > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #7558ef; background: #f0edff; font-size: .74rem; font-weight: 900; }
.readiness-card strong { display: block; margin: 2px 0 5px; }
.readiness-card p { color: var(--muted); font-size: .76rem; line-height: 1.45; }
.readiness-card > small { position: absolute; right: 15px; bottom: 12px; color: #9a91bb; font-size: .57rem; font-weight: 900; letter-spacing: .11em; }
.readiness-card.is-ready { border-color: rgba(25,200,150,.28); background: linear-gradient(145deg, var(--panel), rgba(25,200,150,.06)); }
.readiness-card.is-ready > span { color: #087c5c; background: #dcf8ef; }
.readiness-card.is-ready > small { color: #12936e; }
.readiness-card.is-blocked > span { color: #a34a20; background: #fff0e5; }
.learn-explainer { margin-bottom: 10px; }
.learn-feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.learn-feature-grid > div { min-height: 185px; padding: 27px; background: var(--panel); }
.learn-feature-grid > div > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 24px; border-radius: 13px; color: #7356ed; background: #f0edff; font-size: 1.1rem; }
.learn-feature-grid strong { display: block; margin-bottom: 8px; }
.learn-feature-grid p { color: var(--muted); font-size: .79rem; line-height: 1.6; }

.wizard-body { padding-top: 19px; }
.wizard-progress { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0 0 26px; }
.wizard-progress span { position: relative; display: grid; justify-items: center; gap: 6px; color: #9aa0b4; }
.wizard-progress span:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 14px; left: 62%; width: 76%; height: 2px; background: #e5e7ef; }
.wizard-progress i { z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid #e0e2eb; border-radius: 50%; background: var(--panel); font-size: .68rem; font-style: normal; font-weight: 900; }
.wizard-progress small { font-size: .62rem; font-weight: 800; }
.wizard-progress .is-active { color: #7153ee; }
.wizard-progress .is-active i { border-color: #7658f4; color: white; background: linear-gradient(135deg, #7658f4, #9a69ef); box-shadow: 0 0 0 5px rgba(118,88,244,.1); }
.wizard-progress .is-done { color: #15936f; }
.wizard-progress .is-done i { border-color: #19b889; color: white; background: #19b889; }
.wizard-progress .is-done::after { background: #79d8bd !important; }
.wizard-stage { min-height: 355px; }
.wizard-stage h3 { margin: 8px 0 12px; font-size: 1.45rem; line-height: 1.3; }
.wizard-stage > p { color: var(--muted); line-height: 1.65; }
.wizard-welcome { display: grid; justify-items: center; align-content: center; padding-inline: 8%; text-align: center; }
.wizard-illustration { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 17px; border: 1px solid #d9d2ff; border-radius: 24px; color: #7255ee; background: linear-gradient(145deg, #f3f0ff, #e7fbf6); box-shadow: 0 15px 35px rgba(90,69,181,.16); font-size: 2rem; }
.wizard-callout, .wizard-tip { display: flex; gap: 14px; margin-top: 24px; padding: 16px 18px; border: 1px solid #d9d3fb; border-radius: 15px; color: #4f4770; background: #f7f5ff; text-align: left; }
.wizard-callout strong { flex: 0 0 auto; color: #5d43d2; }
.wizard-callout span, .wizard-tip p { color: #716b87; font-size: .78rem; line-height: 1.5; }
.connection-map { display: grid; grid-template-columns: 1fr 35px 1fr 35px 1fr; align-items: center; gap: 6px; margin: 45px 0 32px; }
.connection-map > div { display: grid; justify-items: center; min-height: 145px; padding: 20px 10px; border: 1px solid var(--line); border-radius: 18px; text-align: center; background: var(--panel-2); }
.connection-map > div > span { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 13px; color: #7357e9; background: #edeaff; font-size: 1.25rem; }
.connection-map small { margin-top: 6px; color: var(--muted); font-size: .68rem; }
.connection-map > i { color: #a9adc0; font-style: normal; text-align: center; }
.connection-map .is-ready { border-color: rgba(25,200,150,.3); background: rgba(25,200,150,.05); }
.connection-map .is-ready > span { color: #0b8562; background: #daf6ed; }
.connection-map .is-blocked { border-color: #ffd6c4; background: #fff8f4; }
.wizard-alert { padding: 18px; border: 1px solid #ffd3bd; border-radius: 16px; background: #fff8f3; }
.wizard-alert p { margin: 5px 0 13px; color: #895f4d; font-size: .8rem; }
.wizard-success { padding: 15px; border: 1px solid #bdebdc; border-radius: 14px; color: #0a7959; background: #ebfbf6; font-weight: 800; text-align: center; }
.wizard-stage label { margin-bottom: 14px; }
.wizard-stage textarea { resize: vertical; }
.wizard-tip { align-items: flex-start; border-color: #cee9f0; background: #f0fbfd; }
.wizard-tip span { padding: 4px 7px; border-radius: 6px; color: #0a7184; background: #d5f3f7; font-size: .6rem; font-weight: 900; }
.safety-list { display: grid; gap: 9px; }
.safety-list label { display: flex; align-items: flex-start; gap: 13px; margin: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); cursor: pointer; }
.safety-list input { width: 18px; height: 18px; margin-top: 2px; accent-color: #7557ef; }
.safety-list span { display: grid; gap: 3px; }
.safety-list small { color: var(--muted); font-size: .7rem; line-height: 1.4; }
.recording-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 15px; padding: 15px 17px; border-radius: 14px; color: white; background: linear-gradient(115deg, #342a73, #155e71); }
.recording-summary > span { font-size: .59rem; font-weight: 900; letter-spacing: .11em; }
.recording-summary small { color: rgba(255,255,255,.65); }
.recording-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 15px; border: 1px solid rgba(236,77,93,.25); border-radius: 14px; background: rgba(236,77,93,.06); }
.recording-banner > div { display: grid; }
.recording-banner small { color: var(--muted); }
.recording-dot { width: 12px; height: 12px; border-radius: 50%; background: #ec4d5d; box-shadow: 0 0 0 0 rgba(236,77,93,.4); animation: rec-pulse 1.4s infinite; }
.recorder-grid { display: grid; grid-template-columns: minmax(250px, .82fr) 1.18fr; gap: 17px; }
.learn-screen-stage { display: grid; place-items: center; min-height: 335px; overflow: hidden; border: 7px solid #181b28; border-radius: 24px; background: #080a11; }
.learn-screen-stage img { width: 100%; height: 100%; max-height: 440px; object-fit: contain; }
#learn-screen-empty { display: grid; justify-items: center; gap: 6px; padding: 30px; color: #aab1c9; text-align: center; }
#learn-screen-empty[hidden] { display: none; }
#learn-screen-empty span { color: #8c77f4; font-size: 2rem; }
#learn-screen-empty small { color: #687087; }
.learn-event-list { display: grid; align-content: start; gap: 8px; max-height: 335px; padding-right: 4px; overflow-y: auto; }
.learn-event-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); }
.learn-event-row > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #0b7f60; background: #daf6ed; font-weight: 900; }
.learn-event-row div { display: grid; gap: 3px; min-width: 0; }
.learn-event-row strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.learn-event-row small { color: var(--muted); font-size: .66rem; }
.learn-event-empty { display: grid; justify-items: center; gap: 10px; padding: 50px 20px; color: var(--muted); text-align: center; }
.learn-event-empty span { display: grid; place-items: center; width: 35px; height: 35px; border: 1px dashed #aaa0df; border-radius: 50%; color: #7256eb; }
.wizard-complete { display: grid; justify-items: center; align-content: center; text-align: center; }
.complete-mark { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 14px; border-radius: 23px; color: white; background: linear-gradient(135deg, #20c798, #4ed0a0); box-shadow: 0 16px 38px rgba(25,200,150,.3); font-size: 2rem; }
.completion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 24px; text-align: left; }
.completion-grid > div { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2); }
.completion-grid span { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 16px; border-radius: 9px; color: #7357eb; background: #ece9ff; font-size: .7rem; font-weight: 900; }
.completion-grid strong { display: block; margin-bottom: 6px; }
.completion-grid small { color: var(--muted); line-height: 1.45; }

.guide-hero { grid-template-columns: 1fr 240px; min-height: 340px; }
.guide-hero > aside { z-index: 1; display: grid; place-content: center; padding: 30px; border-left: 1px solid rgba(255,255,255,.15); text-align: center; }
.guide-hero > aside span { font-size: 6rem; font-weight: 900; line-height: .9; letter-spacing: -.08em; }
.guide-hero > aside strong { margin: 11px 0 6px; font-size: 1.1rem; }
.guide-hero > aside small { color: rgba(255,255,255,.55); line-height: 1.5; }
.guide-section { margin: 20px 0; padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow-sm); scroll-margin-top: 20px; }
.guide-section-head { display: grid; grid-template-columns: 52px 1fr; gap: 18px; max-width: 850px; margin-bottom: 28px; }
.guide-section-head > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #7659ee; background: #eeeaff; font-weight: 900; }
.guide-section-head h2 { margin: 4px 0 7px; font-size: 1.75rem; letter-spacing: -.03em; }
.guide-section-head p:last-child { color: var(--muted); line-height: 1.55; }
.architecture-map { display: grid; grid-template-columns: 1fr 105px 1fr 105px 1fr; align-items: center; }
.architecture-node { display: grid; justify-items: center; min-height: 205px; padding: 28px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-2); text-align: center; }
.architecture-node > span { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 21px; border-radius: 18px; color: #7256ea; background: #ece9ff; font-size: 1.65rem; }
.architecture-node small { max-width: 230px; margin-top: 8px; color: var(--muted); line-height: 1.45; }
.architecture-node.is-cloud { border-color: #d7cdfd; background: linear-gradient(150deg, #f7f4ff, #f1fbfd); }
.architecture-node.is-pos { border-color: #bde8dc; background: linear-gradient(150deg, #f2fcf9, #f5fbff); }
.architecture-map > i { display: grid; gap: 4px; color: #8173bd; font-style: normal; text-align: center; }
.architecture-map > i b { color: var(--muted); font-size: .58rem; letter-spacing: .07em; }
.guide-note { display: flex; gap: 15px; margin-top: 22px; padding: 17px 20px; border: 1px solid #d7d0f4; border-radius: 15px; color: #534779; background: #f8f6ff; }
.guide-note span { color: #776e91; font-size: .8rem; line-height: 1.5; }
.guide-note--warning { border-color: #f7d6aa; color: #8d5525; background: #fff9ef; }
.guide-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.guide-steps article { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.guide-steps article > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #795af2, #4a88d8); font-size: .74rem; font-weight: 900; }
.guide-steps small { color: #7255e2; font-size: .58rem; font-weight: 900; letter-spacing: .09em; }
.guide-steps h3 { margin: 4px 0 6px; font-size: .95rem; }
.guide-steps p { color: var(--muted); font-size: .76rem; line-height: 1.5; }
.guide-section code { padding: 2px 5px; border-radius: 5px; color: #5b43bd; background: #ece9fa; }
.command-card { margin-top: 14px; padding: 17px 20px; border: 1px solid #242a3b; border-radius: 16px; color: #d9def0; background: #111522; }
.command-card > div { display: flex; justify-content: space-between; margin-bottom: 11px; color: #8c96b3; font-size: .6rem; font-weight: 900; letter-spacing: .1em; }
.command-card button { border: 0; color: #a995ff; background: transparent; cursor: pointer; }
.command-card code { padding: 0; color: #78e3c1; background: none; font-size: .9rem; }
.command-card p { margin-top: 10px; color: #8c96b3; font-size: .72rem; }
.lifecycle-line, .guide-flow { display: grid; grid-template-columns: 1fr 25px 1fr 25px 1fr 25px 1fr; align-items: center; }
.lifecycle-line > div, .guide-flow > div { min-height: 150px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.lifecycle-line span { display: grid; place-items: center; width: 31px; height: 31px; margin-bottom: 19px; border-radius: 10px; color: #7254ea; background: #ece9ff; font-size: .7rem; font-weight: 900; }
.lifecycle-line strong, .guide-flow strong { display: block; margin-bottom: 6px; }
.lifecycle-line small, .guide-flow small { color: var(--muted); line-height: 1.45; }
.lifecycle-line > i, .guide-flow > i { color: #aaaec0; font-style: normal; text-align: center; }
.guide-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 18px; }
.guide-columns article { padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel-2); }
.guide-columns h3 { margin-bottom: 15px; }
.guide-columns ul { display: grid; gap: 10px; padding-left: 20px; color: var(--muted); font-size: .79rem; line-height: 1.5; }
.guide-flow > div { border-top: 3px solid #8064ef; }
.guide-flow b { display: block; margin-bottom: 18px; color: #795ce7; font-size: .58rem; letter-spacing: .1em; }
.guide-paragraph { margin-top: 20px; padding: 20px; border-radius: 15px; color: var(--muted); background: var(--panel-2); line-height: 1.65; }
.validation-layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.validation-layers article { display: grid; grid-template-columns: 37px 1fr; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.validation-layers span { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; color: white; background: linear-gradient(135deg, #785af1, #23b997); font-size: .7rem; font-weight: 900; }
.validation-layers p { margin-top: 7px; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.security-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.security-grid > div { min-height: 205px; padding: 23px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel-2); }
.security-grid span { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 24px; border-radius: 13px; color: #7256e9; background: #ece9ff; }
.security-grid strong { display: block; margin-bottom: 8px; }
.security-grid p { color: var(--muted); font-size: .76rem; line-height: 1.55; }
.role-table td:not(:first-child), .role-table th:not(:first-child) { text-align: center; }
.role-table td:not(:first-child) { color: #168a68; font-weight: 900; }
.final-checklist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.final-checklist label { display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); cursor: pointer; }
.final-checklist input { width: 17px; height: 17px; accent-color: #7659ee; }
.final-checklist span { font-size: .76rem; font-weight: 700; }
.guide-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 25px 28px; border-radius: 18px; color: white; background: linear-gradient(115deg, #30236e, #146678); }
.guide-cta h3 { margin-top: 4px; font-size: 1.25rem; }
.guide-faq > article { border-bottom: 1px solid var(--line); }
.guide-faq > article button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 18px 4px; border: 0; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.guide-faq > article button span { color: #7457eb; font-size: 1.15rem; transition: transform .2s; }
.guide-faq > article > p { display: none; max-width: 850px; padding: 0 4px 20px; color: var(--muted); line-height: 1.65; }
.guide-faq > article.is-open > p { display: block; }
.guide-faq > article.is-open button span { transform: rotate(45deg); }

.helper-panel { padding-top: 20px; }
.helper-next { display: grid; grid-template-columns: 70px 1fr; gap: 18px; padding: 24px; border-radius: 19px; color: white; background: radial-gradient(circle at 10% 10%, rgba(76,219,189,.24), transparent 35%), linear-gradient(120deg, #28205e, #195c72); }
.helper-next > span { display: grid; place-items: center; width: 65px; height: 65px; border: 1px solid rgba(255,255,255,.22); border-radius: 20px; background: rgba(255,255,255,.1); font-size: 1.8rem; }
.helper-next h3 { margin: 5px 0 7px; font-size: 1.35rem; }
.helper-next p:not(.eyebrow) { margin-bottom: 15px; color: rgba(255,255,255,.68); line-height: 1.5; }
.helper-context { margin: 14px 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2); }
.helper-context p { margin-top: 5px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.helper-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.helper-links button { padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--panel); font-weight: 800; cursor: pointer; }
.helper-links button:hover { border-color: #b9afea; color: #6f52e3; background: #f7f5ff; }
.status-badge--learning, .status-badge--learned { color: #6c4fd8; background: #eeeaff; }
.status-dot--learning, .status-dot--learned { background: #8061ed; }

[data-theme="midnight"] .readiness-card, [data-theme="midnight"] .learn-feature-grid > div, [data-theme="midnight"] .guide-section { background: #111625; }
[data-theme="midnight"] .readiness-card > span, [data-theme="midnight"] .learn-feature-grid > div > span, [data-theme="midnight"] .wizard-illustration, [data-theme="midnight"] .guide-section-head > span, [data-theme="midnight"] .architecture-node > span, [data-theme="midnight"] .lifecycle-line span, [data-theme="midnight"] .completion-grid span, [data-theme="midnight"] .security-grid span { color: #b5a5ff; background: #24203f; }
[data-theme="midnight"] .readiness-card.is-ready > span, [data-theme="midnight"] .connection-map .is-ready > span, [data-theme="midnight"] .learn-event-row > span { color: #6ee4c1; background: #153a34; }
[data-theme="midnight"] .learn-feature-grid, [data-theme="midnight"] .readiness-card, [data-theme="midnight"] .connection-map > div, [data-theme="midnight"] .safety-list label, [data-theme="midnight"] .learn-event-row, [data-theme="midnight"] .completion-grid > div, [data-theme="midnight"] .architecture-node, [data-theme="midnight"] .guide-steps article, [data-theme="midnight"] .lifecycle-line > div, [data-theme="midnight"] .guide-flow > div, [data-theme="midnight"] .guide-columns article, [data-theme="midnight"] .validation-layers article, [data-theme="midnight"] .security-grid > div, [data-theme="midnight"] .final-checklist label, [data-theme="midnight"] .helper-context { background: #151b2c; }
[data-theme="midnight"] .architecture-node.is-cloud, [data-theme="midnight"] .architecture-node.is-pos { background: #151b2c; }
[data-theme="midnight"] .wizard-callout, [data-theme="midnight"] .guide-note { border-color: #393354; color: #c0b4ed; background: #1b1930; }
[data-theme="midnight"] .wizard-callout span, [data-theme="midnight"] .guide-note span { color: #9790ae; }
[data-theme="midnight"] .wizard-alert, [data-theme="midnight"] .connection-map .is-blocked { border-color: #5b3d35; background: #2a1c1c; }
[data-theme="midnight"] .wizard-success { border-color: #28554b; color: #6ee4c1; background: #14332d; }
[data-theme="midnight"] .wizard-tip { border-color: #2b4951; background: #142b32; }
[data-theme="midnight"] .guide-section code { color: #b5a5ff; background: #25203f; }
[data-theme="midnight"] .helper-links button { color: var(--ink); background: #151b2c; }
[data-theme="midnight"] .status-badge--learning, [data-theme="midnight"] .status-badge--learned { color: #b8a8ff; background: #282145; }

@keyframes learn-tap { 0% { transform: scale(.55); opacity: 0; } 35% { opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes rec-pulse { 70% { box-shadow: 0 0 0 9px rgba(236,77,93,0); } 100% { box-shadow: 0 0 0 0 rgba(236,77,93,0); } }

@media (max-width: 1150px) {
  .readiness-grid, .learn-feature-grid, .validation-layers, .security-grid { grid-template-columns: repeat(2, 1fr); }
  .architecture-map { grid-template-columns: 1fr 60px 1fr 60px 1fr; }
  .lifecycle-line, .guide-flow { grid-template-columns: 1fr 18px 1fr 18px 1fr 18px 1fr; }
}

@media (max-width: 780px) {
  .learn-hero, .guide-hero { grid-template-columns: 1fr; }
  .learn-hero-copy, .guide-hero > div { padding: 36px 26px; }
  .learn-visual, .guide-hero > aside { display: none; }
  .readiness-grid, .learn-feature-grid, .guide-steps, .guide-columns, .validation-layers, .security-grid, .final-checklist { grid-template-columns: 1fr; }
  .wizard-progress small { display: none; }
  .wizard-progress span:not(:last-child)::after { left: 60%; width: 80%; }
  .connection-map, .architecture-map { grid-template-columns: 1fr; gap: 8px; }
  .connection-map > i, .architecture-map > i { transform: rotate(90deg); }
  .recorder-grid { grid-template-columns: 1fr; }
  .learn-screen-stage { min-height: 280px; }
  .completion-grid { grid-template-columns: 1fr; }
  .guide-section { padding: 24px 18px; border-radius: 20px; }
  .guide-section-head { grid-template-columns: 42px 1fr; gap: 12px; }
  .guide-section-head > span { width: 40px; height: 40px; }
  .lifecycle-line, .guide-flow { grid-template-columns: 1fr; gap: 7px; }
  .lifecycle-line > i, .guide-flow > i { transform: rotate(90deg); }
  .guide-note { align-items: flex-start; flex-direction: column; }
  .guide-cta { align-items: flex-start; flex-direction: column; }
  .helper-next { grid-template-columns: 1fr; }
  .helper-links { grid-template-columns: 1fr; }
}
