:root {
  color-scheme: light dark;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-strong: #f7f7f4;
  --text: #20241f;
  --muted: #6b716a;
  --line: #daddd3;
  --accent: #7b506f;
  --accent-strong: #63405a;
  --accent-soft: #f1eaf0;
  --overview: #232024;
  --overview-muted: #c0b8be;
  --success: #18794e;
  --success-soft: #e8f5ee;
  --warning: #925f18;
  --warning-soft: #f6eedf;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 24px 70px rgb(64 54 62 / 0.13);
  --radius: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

.ui-icon { display: block; width: 20px; height: 20px; background: currentColor; mask-position: center; mask-repeat: no-repeat; mask-size: contain; -webkit-mask-position: center; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain; }
.icon-key { mask-image: url("./icons/key.svg"); -webkit-mask-image: url("./icons/key.svg"); }
.icon-arrow-right { mask-image: url("./icons/arrow-right.svg"); -webkit-mask-image: url("./icons/arrow-right.svg"); }
.icon-history { mask-image: url("./icons/history.svg"); -webkit-mask-image: url("./icons/history.svg"); }
.icon-computer { mask-image: url("./icons/computer.svg"); -webkit-mask-image: url("./icons/computer.svg"); }
.icon-unlink { mask-image: url("./icons/unlink.svg"); -webkit-mask-image: url("./icons/unlink.svg"); }
.icon-device { mask-image: url("./icons/device.svg"); -webkit-mask-image: url("./icons/device.svg"); }
.icon-brightness { mask-image: url("./icons/brightness.svg"); -webkit-mask-image: url("./icons/brightness.svg"); }
.icon-loading { mask-image: url("./icons/loading.svg"); -webkit-mask-image: url("./icons/loading.svg"); }
.icon-check { mask-image: url("./icons/check.svg"); -webkit-mask-image: url("./icons/check.svg"); }
.icon-paste { mask-image: url("./icons/paste.svg"); -webkit-mask-image: url("./icons/paste.svg"); }

html { min-width: 320px; background: var(--page); }

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.36;
  background-image: linear-gradient(rgb(71 65 69 / 0.035) 1px, transparent 1px), linear-gradient(90deg, rgb(71 65 69 / 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #242521, transparent 78%);
}

::selection { color: #faf9f5; background: var(--accent); }

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  height: 72px;
  border-bottom: 1px solid rgb(218 221 211 / 0.82);
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { display: block; object-fit: contain; transition: transform 520ms var(--ease-out); }
.brand:hover img { transform: rotate(-5deg) scale(1.04); }
.header-context { margin-right: auto; border-left: 1px solid var(--line); padding-left: 18px; color: var(--muted); font-size: 13px; font-weight: 680; white-space: nowrap; }
.header-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.header-license { max-width: 210px; overflow: hidden; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.back-link { color: var(--muted); font-size: 14px; font-weight: 650; white-space: nowrap; transition: color 220ms ease, transform 420ms var(--ease-out); }
.back-link:hover { color: var(--accent); transform: translateX(-2px); }
.header-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 220ms ease, background-color 220ms ease, transform 420ms var(--ease-out);
}
.header-button:hover { border-color: #aaa49f; background: var(--surface-strong); transform: translateY(-1px); }
.theme-toggle { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); cursor: pointer; transition: border-color 220ms ease, background-color 220ms ease, transform 420ms var(--ease-out); }
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle .ui-icon { width: 18px; height: 18px; transition: transform 520ms var(--ease-out); }
.theme-toggle:hover .ui-icon { transform: rotate(18deg); }
.theme-toggle.is-switching { animation: theme-button-switch 580ms var(--ease-out); }
.theme-toggle.is-switching .ui-icon { animation: theme-icon-switch 580ms var(--ease-out); }

main { min-height: calc(100dvh - 128px); }

.query-view {
  min-height: calc(100dvh - 128px);
  display: grid;
  place-items: center;
  padding: 36px 20px 56px;
}

.access-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.access-brand-panel {
  position: relative;
  min-height: 560px;
  padding: clamp(38px, 6vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #f4f3ef;
  background:
    radial-gradient(circle at 15% 8%, rgb(123 80 111 / 0.3), transparent 24rem),
    radial-gradient(circle at 92% 88%, rgb(155 104 30 / 0.16), transparent 20rem),
    var(--overview);
}

.access-brand-panel::before, .access-brand-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
}
.access-brand-panel::before { width: 280px; height: 280px; top: -120px; right: -110px; border: 1px solid rgb(255 255 255 / 0.08); }
.access-brand-panel::after { width: 160px; height: 160px; right: -70px; bottom: -65px; border: 1px solid rgb(155 104 30 / 0.28); }
.access-eyebrow { position: absolute; top: 30px; left: clamp(38px, 6vw, 68px); display: inline-flex; align-items: center; gap: 8px; color: var(--overview-muted); font-size: 11px; font-weight: 750; letter-spacing: 0.12em; }
.access-eyebrow i, .overview-copy > p i { width: 6px; height: 6px; border-radius: 50%; background: #58d09a; box-shadow: 0 0 0 5px rgb(88 208 154 / 0.1); animation: status-pulse 2.6s ease-in-out infinite; }

.access-logo { position: relative; display: block; margin-bottom: 42px; object-fit: contain; filter: drop-shadow(0 14px 24px rgb(0 0 0 / 0.18)); transition: transform 650ms var(--ease-out); }
.access-brand-panel:hover .access-logo { transform: translateY(-3px) rotate(-2deg); }
.access-brand-panel h1 { max-width: 440px; margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: 1.04; letter-spacing: -0.052em; }
.access-brand-panel > p { max-width: 390px; margin: 22px 0 0; color: var(--overview-muted); font-size: 17px; line-height: 1.75; }
.access-capabilities { max-width: 390px; margin-top: 38px; }
.access-capabilities span { display: block; border-top: 1px solid rgb(255 255 255 / 0.12); padding: 12px 0; color: #d1d5cf; font-size: 13px; font-weight: 650; transition: color 220ms ease, transform 500ms var(--ease-out); }
.access-capabilities span:hover { color: #faf9f5; transform: translateX(5px); }

.access-form-panel { min-width: 0; min-height: 560px; padding: clamp(38px, 6vw, 68px); display: flex; flex-direction: column; justify-content: center; }

.journey { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 720; }
.journey span { white-space: nowrap; transition: color 320ms ease, transform 500ms var(--ease-out); }
.journey span.is-current { color: var(--accent); }
.journey i { width: 42px; height: 1px; overflow: hidden; background: var(--line); }
.journey i::after { content: ""; display: block; width: 100%; height: 100%; background: var(--accent); transform: translateX(-105%); }
.journey-complete i::after { transform: translateX(0); transition: transform 700ms 150ms var(--ease-smooth); }
.journey-complete { margin-bottom: 22px; }

.form-heading { margin: 42px 0 30px; }
.section-eyebrow { display: block; margin-bottom: 13px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; }
.form-heading h2 { margin: 0; outline: none; font-size: clamp(32px, 4vw, 44px); line-height: 1.08; letter-spacing: -0.045em; }
.form-heading p { max-width: 430px; margin: 14px 0 0; color: var(--muted); line-height: 1.7; }

#license-form label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 720; }
#license-form input { width: 100%; min-height: 52px; border-radius: 12px; }
.license-input-shell { position: relative; }
.license-input-shell > span { position: absolute; top: 50%; left: 12px; z-index: 1; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); transform: translateY(-50%); transition: border-color 220ms ease, color 220ms ease, transform 420ms var(--ease-out); }
.license-input-shell > span .ui-icon { width: 17px; height: 17px; }
.license-input-shell:focus-within > span { border-color: rgb(123 80 111 / 0.45); color: var(--accent); }
#license-form input {
  border: 1px solid #c8c9c0;
  padding: 0 102px 0 62px;
  color: var(--text);
  background: var(--surface-strong);
  outline: none;
  transition: border-color 220ms ease, box-shadow 280ms ease, transform 420ms var(--ease-out);
}
#license-form input::placeholder { color: #7c7e76; opacity: 1; }
#license-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(123 80 111 / 0.16); }
.license-paste { position: absolute; top: 50%; right: 7px; z-index: 2; min-width: 78px; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgb(255 255 255 / 0.64); border-radius: 9px; padding: 0 10px; color: var(--accent-strong); background: rgb(251 252 248 / 0.58); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.74), 0 4px 12px rgb(64 54 62 / 0.07); cursor: pointer; transform: translateY(-50%); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); transition: color 220ms ease, border-color 220ms ease, background-color 260ms ease, box-shadow 320ms ease, transform 420ms var(--ease-out); }
.license-paste .ui-icon { width: 16px; height: 16px; }
.license-paste span { font-size: 12px; font-weight: 750; }
.license-paste:hover { border-color: rgb(123 80 111 / 0.34); background: rgb(251 252 248 / 0.82); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.82), 0 8px 18px rgb(64 54 62 / 0.1); transform: translateY(calc(-50% - 1px)); }
.license-paste:active { transform: translateY(-50%) scale(0.97); }
.license-paste.is-pasted { color: var(--success); border-color: rgb(24 121 78 / 0.32); background: rgb(232 245 238 / 0.82); }
.license-slider {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 56px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #c8c9c0;
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: border-color 240ms ease, background-color 320ms ease, box-shadow 320ms ease, opacity 240ms ease;
}
.license-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(100deg, transparent 18%, rgb(123 80 111 / 0.12) 48%, transparent 78%);
  transform: translateX(-110%);
}
.slider-fill {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--accent-soft);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}
.slider-label {
  position: absolute;
  inset: 0 48px;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
  letter-spacing: 0.01em;
  pointer-events: none;
  transition: color 260ms ease, opacity 260ms ease, transform 420ms var(--ease-out);
}
.slider-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: 10px;
  color: #faf8f9;
  background: var(--accent);
  box-shadow: 0 8px 18px rgb(123 80 111 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.25);
  will-change: transform;
}
.slider-thumb::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 0.11);
  pointer-events: none;
}
.slider-thumb .ui-icon { width: 18px; height: 18px; }
.slider-gesture { width: 28px; height: 28px; object-fit: contain; filter: brightness(0) invert(1); pointer-events: none; user-select: none; }
.slider-check { position: absolute; opacity: 0; transform: scale(0.45) rotate(-22deg); }
.license-slider.is-ready { border-color: rgb(123 80 111 / 0.48); }
.license-slider.is-ready:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(123 80 111 / 0.1); }
.license-slider.is-ready .slider-label { color: var(--text); }
.license-slider.is-locked { cursor: not-allowed; opacity: 0.72; }
.license-slider.is-locked .slider-thumb { color: #898c85; background: var(--line); box-shadow: none; }
.license-slider.is-preparing { cursor: wait; }
.license-slider.is-preparing::after { opacity: 1; animation: slider-prepare 1.25s ease-in-out infinite; }
.license-slider.is-preparing .slider-thumb { background: #826b7d; box-shadow: none; }
.license-slider.is-dragging { border-color: var(--accent); cursor: grabbing; box-shadow: 0 0 0 3px rgb(123 80 111 / 0.12); }
.license-slider.is-dragging .slider-label { opacity: 0.86; transform: translateX(5px); }
.license-slider.is-snapping .slider-thumb, .license-slider.is-snapping .slider-fill { transition: transform 620ms var(--ease-out); }
.license-slider.is-verifying { border-color: var(--accent); cursor: wait; }
.license-slider.is-verifying .slider-gesture { opacity: 0.72; }
.license-slider.is-success { border-color: rgb(24 121 78 / 0.55); cursor: default; background: var(--success-soft); }
.license-slider.is-success .slider-fill { background: var(--success-soft); }
.license-slider.is-success .slider-thumb { background: var(--success); box-shadow: 0 8px 18px rgb(24 121 78 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.25); }
.license-slider.is-success .slider-gesture { opacity: 0; transform: scale(0.45) rotate(22deg); }
.license-slider.is-success .slider-check { opacity: 1; transform: scale(1) rotate(0); transition: opacity 240ms ease, transform 520ms var(--ease-out); }
.license-slider.is-success .slider-label { color: var(--success); }
.license-slider.is-error { border-color: rgb(180 35 24 / 0.5); cursor: default; background: var(--danger-soft); }
.license-slider.is-error .slider-label { color: var(--danger); }
.license-slider.is-error .slider-thumb { background: var(--danger); box-shadow: none; }
.header-button:active, .device-unbind:active, .dialog-actions button:active { transform: translateY(1px); }
.form-help, .form-error { margin: 11px 0 0; font-size: 13px; line-height: 1.55; }
.form-help { color: var(--muted); }
.form-error { color: var(--danger); font-weight: 650; }
#license-form > .form-error {
  min-height: 42px;
  overflow-wrap: anywhere;
}
#license-form > .form-error[hidden] {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}
.form-error:not([hidden]), .unbind-message:not([hidden]) { animation: notice-in 460ms var(--ease-out) both; }

.query-loading { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-strong); }
.query-loading:not([hidden]) { animation: loading-card-in 520ms var(--ease-out) both; }
.query-loading strong, .query-loading span { display: block; }
.query-loading strong { font-size: 14px; }
.query-loading span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.loading-lines { margin-top: 14px; display: grid; gap: 7px; }
.loading-lines i { position: relative; display: block; width: 100%; height: 6px; overflow: hidden; border-radius: 6px; background: var(--line); }
.loading-lines i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(123 80 111 / 0.38), transparent); transform: translateX(-110%); animation: loading-sweep 1.35s ease-in-out infinite; }
.loading-lines i:nth-child(2)::after { animation-delay: 100ms; }
.loading-lines i:nth-child(3)::after { animation-delay: 200ms; }
.loading-lines i:nth-child(2) { width: 76%; }
.loading-lines i:nth-child(3) { width: 52%; }

.query-view, .license-view { view-transition-name: license-stage; }
.license-view { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 64px; }

.license-overview {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  border-radius: var(--radius);
  padding: clamp(34px, 5vw, 56px);
  color: #f4f3ef;
  background:
    radial-gradient(circle at 88% 10%, rgb(123 80 111 / 0.28), transparent 24rem),
    radial-gradient(circle at 8% 100%, rgb(155 104 30 / 0.13), transparent 22rem),
    var(--overview);
  box-shadow: var(--shadow);
  transition: transform 650ms var(--ease-out), box-shadow 650ms var(--ease-out);
}
.license-overview::before { content: ""; position: absolute; width: 420px; height: 420px; top: -250px; right: -80px; border: 1px solid rgb(255 255 255 / 0.07); border-radius: 50%; pointer-events: none; }
.license-overview::after { content: ""; position: absolute; width: 250px; height: 250px; right: 80px; bottom: -210px; border: 1px solid rgb(155 104 30 / 0.24); border-radius: 50%; pointer-events: none; }
.license-overview:hover { transform: translateY(-2px); box-shadow: 0 30px 80px rgb(64 54 62 / 0.17); }
.overview-copy { position: relative; z-index: 1; min-width: 0; }
.overview-copy > p { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: #b4abb1; font-size: 12px; font-weight: 680; letter-spacing: 0.04em; }
.overview-copy h1 { max-width: 820px; margin: 0; outline: none; font-size: clamp(30px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.045em; overflow-wrap: anywhere; }
.license-code { display: block; margin-top: 15px; color: #cbc0c8; font-family: "Cascadia Code", Consolas, monospace; font-size: 13px; }
.status-badge { position: relative; z-index: 1; flex: 0 0 auto; border: 1px solid rgb(255 255 255 / 0.08); border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 750; backdrop-filter: blur(12px); transition: transform 420ms var(--ease-out); }
.status-badge:hover { transform: translateY(-1px) scale(1.025); }
.status-badge.is-active { color: #aee9ca; background: rgb(32 139 92 / 0.2); }
.status-badge.is-inactive { color: #ffb4ad; background: rgb(180 35 24 / 0.2); }

.metric-grid { margin-top: 18px; display: grid; grid-template-columns: 1.24fr 1fr 1fr; gap: 14px; }
.metric { --metric-progress: 0%; --metric-color: var(--accent); --metric-soft: var(--accent-soft); --metric-border: #d8c3d2; position: relative; min-height: 176px; overflow: hidden; border: 1px solid var(--metric-border); border-radius: var(--radius); padding: 22px 24px; background: color-mix(in srgb, var(--metric-soft) 58%, var(--surface)); transition: border-color 260ms ease, box-shadow 520ms var(--ease-out), transform 520ms var(--ease-out); }
.metric:nth-child(2) { --metric-color: #35735f; --metric-soft: #e7f1ec; --metric-border: #bdd7ca; }
.metric:nth-child(3) { --metric-color: #925f18; --metric-soft: #f6eedf; --metric-border: #e2cfaa; }
.metric::after { content: ""; position: absolute; width: 110px; height: 110px; right: -62px; bottom: -68px; border: 1px solid color-mix(in srgb, var(--metric-color) 22%, transparent); border-radius: 50%; }
.metric:hover { border-color: var(--metric-color); box-shadow: 0 18px 42px rgb(64 54 62 / 0.09); transform: translateY(-4px); }
.primary-metric { background: color-mix(in srgb, var(--metric-soft) 76%, var(--surface)); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric .metric-label, .metric small { display: block; color: var(--muted); }
.metric .metric-label { font-size: 13px; font-weight: 680; }
.metric-icon { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--metric-border); border-radius: 10px; color: var(--metric-color); background: color-mix(in srgb, var(--surface) 72%, var(--metric-soft)); transition: transform 500ms var(--ease-out); }
.metric-icon .ui-icon { width: 17px; height: 17px; }
.metric:hover .metric-icon { transform: rotate(-4deg) scale(1.06); }
.metric strong { position: relative; display: block; margin: 11px 0 12px; font-variant-numeric: tabular-nums; font-size: clamp(38px, 5vw, 54px); line-height: 0.95; letter-spacing: -0.052em; }
.metric-track { height: 3px; margin-bottom: 10px; overflow: hidden; border-radius: 999px; background: var(--line); }
.metric-track i { display: block; width: var(--metric-progress); height: 100%; border-radius: inherit; background: var(--metric-color); transform-origin: left; transition: width 850ms var(--ease-smooth); }
.metric small { font-size: 13px; line-height: 1.5; }

.license-content-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(330px, 0.66fr); gap: 18px; align-items: start; }
.devices-panel, .details-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 30px); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 1px 0 rgb(255 255 255 / 0.45) inset; transition: border-color 260ms ease, box-shadow 550ms var(--ease-out), transform 550ms var(--ease-out); }
.details-panel { position: relative; overflow: hidden; }
.details-panel::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--warning); }
.details-panel::after { content: ""; position: absolute; right: -54px; bottom: -62px; width: 128px; height: 128px; border-radius: 50%; background: var(--warning-soft); pointer-events: none; }
.details-panel > * { position: relative; z-index: 1; }
.devices-panel:hover, .details-panel:hover { border-color: #c7c1bf; box-shadow: 0 18px 46px rgb(64 54 62 / 0.08); transform: translateY(-2px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 0; font-size: 22px; letter-spacing: -0.025em; }
.panel-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.panel-count { flex: 0 0 auto; color: var(--accent); font-size: 13px; font-weight: 750; }
.unbind-message { margin: 18px 0 0; border: 1px solid #b9dec9; border-radius: 12px; padding: 11px 13px; color: var(--success); background: var(--success-soft); font-size: 13px; }

.device-list { max-height: 520px; margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.device-item { position: relative; min-width: 0; min-height: 188px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color 220ms ease, background-color 220ms ease, box-shadow 420ms var(--ease-out), transform 480ms var(--ease-out); }
.device-item::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--accent); }
.device-item::after { content: ""; position: absolute; right: -46px; bottom: -54px; width: 112px; height: 112px; border-radius: 50%; background: var(--accent-soft); pointer-events: none; transition: transform 520ms var(--ease-out); }
.device-item:hover { border-color: #c7c1bf; background: var(--surface-strong); transform: translateY(-2px); }
.device-item:hover::after { transform: translate(-4px, -4px) scale(1.06); }
.device-item.is-current-device { border-color: #b9d5c8; background: var(--surface); box-shadow: 0 12px 28px rgb(24 121 78 / 0.09); }
.device-title-row { min-height: 42px; display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding: 0 50px 0 0; text-align: left; }
.device-item h3 { margin: 0; color: var(--text); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.current-device-badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #b9d5c8; border-radius: 999px; padding: 3px 7px; color: var(--success); background: var(--success-soft); font-size: 11px; font-weight: 750; line-height: 1.35; }
.current-device-badge .ui-icon { width: 14px; height: 14px; }
.device-status { border-radius: 999px; padding: 3px 7px; color: var(--muted); background: var(--surface-strong); font-size: 11px; font-weight: 700; line-height: 1.35; }
.device-status.is-online { color: var(--success); background: var(--success-soft); }
.device-status.is-recently_offline { color: var(--warning); background: var(--warning-soft); }
.device-status.is-unavailable { color: var(--danger); background: var(--danger-soft); }
.device-meta { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); margin: 14px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.device-fact { min-width: 0; display: grid; grid-template-columns: 28px auto; align-items: center; justify-content: center; gap: 8px; padding-right: 12px; }
.device-fact + .device-fact { border-left: 1px solid var(--line); padding-right: 0; padding-left: 13px; }
.device-fact-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: var(--muted); background: var(--surface-strong); }
.device-fact-icon .ui-icon { width: 15px; height: 15px; }
.device-fact > div { min-width: 0; }
.device-fact dt { color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.25; }
.device-fact dd { margin: 4px 0 0; color: var(--text); font-size: 11px; font-weight: 720; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; }
.device-fact.is-last-seen { position: relative; }
.device-fact.is-last-seen::before { content: ""; position: absolute; right: 0; bottom: -13px; left: 13px; height: 2px; border-radius: 2px 2px 0 0; background: var(--warning); }
.device-fact.is-last-seen .device-fact-icon { color: var(--warning); background: var(--warning-soft); }
.device-fact.is-last-seen dt { color: var(--warning); font-weight: 780; }
.device-fact.is-last-seen dd { color: var(--warning); font-weight: 780; }
.device-main { position: relative; z-index: 1; min-width: 0; }
.device-main > .device-avatar { position: absolute; top: 0; right: 0; }
.device-main > div { min-width: 0; }
.device-avatar { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border: 1px solid #d8c3d2; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.device-avatar .ui-icon { width: 21px; height: 21px; }
.device-unbind {
  position: relative;
  z-index: 1;
  align-self: stretch;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid #e0b8b3;
  border-radius: 11px;
  padding: 0 11px;
  color: var(--danger);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: border-color 220ms ease, background-color 220ms ease, transform 420ms var(--ease-out), opacity 220ms ease;
}
.device-unbind .ui-icon { width: 17px; height: 17px; }
.device-unbind:hover:not(:disabled) { background: var(--danger-soft); transform: translateY(-2px); }
.device-unbind:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.device-unbind:disabled { cursor: not-allowed; opacity: 0.5; }
.device-list-empty { margin: 20px 0 0; border: 1px dashed var(--line); border-radius: 12px; padding: 26px 18px; color: var(--muted); text-align: center; font-size: 13px; }

.detail-list { margin: 18px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface-strong); }
.detail-list div { min-height: 50px; display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); border-radius: 9px; transition: background-color 220ms ease, box-shadow 260ms ease; }
.detail-list div:hover { background: color-mix(in srgb, var(--accent-soft) 48%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.45; text-align: right; overflow-wrap: anywhere; }
.detail-list div:first-child dd { color: var(--warning); font-weight: 780; }
.unbind-breakdown { margin-top: 14px; overflow: hidden; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); }
.quota-heading { grid-column: 1 / -1; margin: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; color: var(--text); font-size: 12px; font-weight: 720; }
.unbind-breakdown div { min-width: 0; padding: 11px 8px 12px; border-right: 1px solid var(--line); text-align: center; transition: background-color 220ms ease; }
.unbind-breakdown div:last-child { border-right: 0; }
.unbind-breakdown div:hover { background: var(--warning-soft); }
.unbind-breakdown span, .unbind-breakdown strong { display: block; }
.unbind-breakdown span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.unbind-breakdown strong { margin-top: 6px; color: var(--text); font-size: 18px; line-height: 1; }
.unbind-breakdown div:last-child strong { color: var(--warning); }
.unbind-dialog { width: calc(100vw - 32px); max-width: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; color: var(--text); background: var(--surface); box-shadow: 0 32px 90px rgb(24 19 22 / 0.28); }
.unbind-dialog[open] { animation: dialog-in 560ms var(--ease-out) both; }
.unbind-dialog[open]::backdrop { background: rgb(24 19 22 / 0.62); backdrop-filter: blur(5px); animation: backdrop-in 420ms ease both; }
.unbind-dialog.is-closing { animation: dialog-out 260ms ease both; }
.unbind-dialog.is-closing::backdrop { animation: backdrop-out 260ms ease both; }
.unbind-dialog form { position: relative; min-height: 340px; padding: 32px; }
.unbind-dialog form::before { content: ""; position: absolute; width: 190px; height: 190px; top: -130px; right: -80px; border: 1px solid rgb(123 80 111 / 0.12); border-radius: 50%; pointer-events: none; }
.dialog-icon { position: relative; display: grid; width: 48px; height: 48px; margin-bottom: 20px; place-items: center; border: 1px solid #f1b6b0; border-radius: 14px; color: var(--danger); background: var(--danger-soft); transition: color 360ms ease, border-color 360ms ease, background-color 360ms ease, transform 520ms var(--ease-out); }
.dialog-icon .state-icon { position: absolute; width: 21px; height: 21px; transition: opacity 260ms ease, transform 440ms var(--ease-out); }
.dialog-icon .state-working, .dialog-icon .state-success { opacity: 0; transform: scale(0.58); }
.unbind-dialog.is-working .dialog-icon { color: var(--accent); border-color: #d8c3d2; background: var(--accent-soft); transform: scale(1.04); }
.unbind-dialog.is-working .state-confirm, .unbind-dialog.is-success .state-confirm { opacity: 0; transform: scale(0.58) rotate(18deg); }
.unbind-dialog.is-working .state-working { opacity: 1; transform: scale(1); animation: icon-spin 1.1s linear infinite; }
.unbind-dialog.is-success .dialog-icon { color: var(--success); border-color: #b9dec9; background: var(--success-soft); transform: scale(1.06); }
.unbind-dialog.is-success .state-success { opacity: 1; transform: scale(1); }
.unbind-dialog h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.unbind-dialog p { margin: 14px 0 0; color: var(--muted); line-height: 1.65; }
.dialog-device { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-strong); }
.dialog-device span { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.dialog-device strong { min-width: 0; overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.dialog-impact { display: grid; grid-template-columns: 136px minmax(0, 1fr); margin-top: 12px; overflow: hidden; border: 1px solid #efc0bb; border-radius: 14px; background: var(--surface); transition: border-color 360ms ease, transform 520ms var(--ease-out); }
.impact-charge { display: flex; flex-direction: column; justify-content: center; min-height: 116px; padding: 18px; border-right: 1px solid #efc0bb; background: var(--danger-soft); }
.impact-charge > span { color: var(--danger); font-size: 12px; font-weight: 700; }
.impact-charge strong { display: flex; align-items: baseline; gap: 5px; margin-top: 5px; color: var(--danger); line-height: 1; }
.impact-charge strong b { font-size: 38px; letter-spacing: -0.05em; }
.impact-charge strong small { font-size: 15px; }
.impact-charge em { margin-top: 7px; color: var(--muted); font-size: 11px; font-style: normal; }
.impact-balance { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; gap: 8px; padding: 18px; }
.impact-balance > div { min-width: 0; }
.impact-balance span, .impact-balance strong { display: block; }
.impact-balance span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.impact-balance strong { margin-top: 8px; color: var(--text); font-size: 20px; line-height: 1; white-space: nowrap; }
.impact-balance > .ui-icon { width: 16px; height: 16px; color: #9b9e98; }
.impact-balance .impact-after strong { color: var(--danger); }
.unbind-dialog .impact-note { grid-column: 1 / -1; margin: 0; border-top: 1px solid #efc0bb; padding: 10px 14px; color: #8f2b23; background: var(--danger-soft); font-size: 12px; font-weight: 600; line-height: 1.5; text-align: center; }
.unbind-dialog.is-working .dialog-impact { border-color: #d8c3d2; transform: translateY(-1px); }
.unbind-dialog.is-working .impact-charge { border-color: #d8c3d2; background: var(--accent-soft); }
.unbind-dialog.is-working .impact-charge > span, .unbind-dialog.is-working .impact-charge strong, .unbind-dialog.is-working .impact-balance .impact-after strong { color: var(--accent); }
.unbind-dialog.is-working .impact-note { border-color: #d8c3d2; color: var(--accent-strong); background: var(--accent-soft); }
.unbind-dialog.is-success .dialog-impact { border-color: #b9dec9; transform: translateY(-1px); }
.unbind-dialog.is-success .impact-charge { border-color: #b9dec9; background: var(--success-soft); }
.unbind-dialog.is-success .impact-charge > span, .unbind-dialog.is-success .impact-charge strong, .unbind-dialog.is-success .impact-balance .impact-after strong { color: var(--success); }
.unbind-dialog.is-success .impact-note { border-color: #b9dec9; color: var(--success); background: var(--success-soft); }
.unbind-dialog .dialog-note { font-size: 13px; }
.unbind-dialog .form-error { color: var(--danger); }
.unbind-dialog.is-working h2, .unbind-dialog.is-working #unbind-dialog-copy, .unbind-dialog.is-working .dialog-note, .unbind-dialog.is-success h2, .unbind-dialog.is-success #unbind-dialog-copy, .unbind-dialog.is-success .dialog-note { animation: dialog-copy-change 460ms var(--ease-out) both; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dialog-actions button { min-height: 44px; border-radius: 11px; padding: 0 18px; font-weight: 700; cursor: pointer; transition: background-color 220ms ease, transform 420ms var(--ease-out), opacity 220ms ease; }
.dialog-actions button:hover { transform: translateY(-2px); }
.secondary-button { border: 1px solid var(--line); color: var(--text); background: var(--surface-strong); }
.secondary-button:hover { background: var(--page); }
.danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; color: #fff8f7; background: var(--danger); }
.danger-button:hover { background: #912018; }
.danger-button .button-loading { display: none; width: 15px; height: 15px; }
.unbind-dialog.is-working .danger-button .button-loading { display: block; animation: icon-spin 1.1s linear infinite; }
.unbind-dialog.is-working .dialog-actions { pointer-events: none; }
.unbind-dialog.is-success .dialog-actions { visibility: hidden; opacity: 0; transform: translateY(6px); transition: opacity 220ms ease, transform 320ms var(--ease-out), visibility 220ms; }

#license-form input:focus-visible, .license-slider:focus-visible, .header-button:focus-visible, .theme-toggle:focus-visible, .back-link:focus-visible, .device-unbind:focus-visible, .dialog-actions button:focus-visible { outline: 3px solid rgb(123 80 111 / 0.3); outline-offset: 2px; }

footer { height: 56px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

body.is-ready .site-header { animation: header-in 720ms var(--ease-out) both; }
body.is-ready .access-shell { animation: shell-in 820ms var(--ease-smooth) both; }
body.is-ready .access-brand-panel > * { animation: content-in 720ms var(--ease-out) both; }
body.is-ready .access-brand-panel > *:nth-child(2) { animation-delay: 80ms; }
body.is-ready .access-brand-panel > *:nth-child(3) { animation-delay: 140ms; }
body.is-ready .access-brand-panel > *:nth-child(4) { animation-delay: 200ms; }
body.is-ready .access-form-panel > * { animation: content-in 720ms var(--ease-out) both; }
body.is-ready .access-form-panel > *:nth-child(2) { animation-delay: 100ms; }
body.is-ready .access-form-panel > *:nth-child(3) { animation-delay: 180ms; }

.license-view.is-revealing > .journey { animation: reveal-up 620ms 60ms var(--ease-out) both; }
.license-view.is-revealing .license-overview { animation: reveal-up 760ms 100ms var(--ease-smooth) both; }
.license-view.is-revealing .metric { animation: reveal-up 700ms var(--reveal-delay, 180ms) var(--ease-out) both; }
.license-view.is-revealing .metric:nth-child(1) { --reveal-delay: 180ms; }
.license-view.is-revealing .metric:nth-child(2) { --reveal-delay: 240ms; }
.license-view.is-revealing .metric:nth-child(3) { --reveal-delay: 300ms; }
.license-view.is-revealing .devices-panel { animation: reveal-up 760ms 350ms var(--ease-out) both; }
.license-view.is-revealing .details-panel { animation: reveal-up 760ms 420ms var(--ease-out) both; }
.license-view.is-revealing .device-item { animation: device-in 620ms calc(430ms + var(--item-index, 0) * 55ms) var(--ease-out) both; }
.license-view.is-revealing .device-list-empty { animation: reveal-up 620ms 430ms var(--ease-out) both; }

html[data-view-direction="forward"]::view-transition-old(license-stage) { animation: stage-out-forward 360ms cubic-bezier(0.4, 0, 1, 1) both; }
html[data-view-direction="forward"]::view-transition-new(license-stage) { animation: stage-in-forward 720ms var(--ease-smooth) both; }
html[data-view-direction="back"]::view-transition-old(license-stage) { animation: stage-out-back 320ms cubic-bezier(0.4, 0, 1, 1) both; }
html[data-view-direction="back"]::view-transition-new(license-stage) { animation: stage-in-back 650ms var(--ease-smooth) both; }
::view-transition-group(license-stage) { animation-duration: 720ms; }

@keyframes header-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shell-in { from { opacity: 0; transform: translateY(22px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes content-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reveal-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes device-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loading-card-in { from { opacity: 0; transform: translateY(-8px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes loading-sweep { 0% { transform: translateX(-110%); } 60%, 100% { transform: translateX(110%); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes dialog-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(10px) scale(0.975); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes status-pulse { 0%, 100% { opacity: 0.72; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1); } }
@keyframes icon-spin { to { transform: rotate(360deg); } }
@keyframes slider-prepare { from { transform: translateX(-110%); } to { transform: translateX(110%); } }
@keyframes dialog-copy-change { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes theme-button-switch { 45% { box-shadow: 0 0 0 8px rgb(123 80 111 / 0.12); } }
@keyframes theme-icon-switch { from { opacity: 0; transform: rotate(-150deg) scale(0.35); } 60% { opacity: 1; transform: rotate(16deg) scale(1.18); } to { opacity: 1; transform: rotate(0) scale(1); } }
@keyframes stage-out-forward { to { opacity: 0; transform: translateY(-16px) scale(0.985); } }
@keyframes stage-in-forward { from { opacity: 0; transform: translateY(28px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes stage-out-back { to { opacity: 0; transform: translateY(18px) scale(0.99); } }
@keyframes stage-in-back { from { opacity: 0; transform: translateY(-18px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

html[data-theme="dark"] { color-scheme: dark; --page: #121412; --surface: #191b18; --surface-strong: #1f231f; --text: #f2f4ee; --muted: #adb4ac; --line: #363a35; --accent: #c38aae; --accent-strong: #d4a6c1; --accent-soft: #30232d; --overview: #211c20; --overview-muted: #c9bcc5; --warning: #d2a45e; --warning-soft: #30281c; --success-soft: #173b30; --danger-soft: #442625; --shadow: 0 24px 70px rgb(0 0 0 / 0.34); }
html[data-theme="dark"] body { background: radial-gradient(circle at 14% 4%, rgb(123 80 111 / 0.16), transparent 31rem), radial-gradient(circle at 88% 92%, rgb(155 104 30 / 0.08), transparent 28rem), var(--page); }
html[data-theme="dark"] .site-header { border-color: #343733; background: rgb(18 20 18 / 0.88); box-shadow: 0 8px 28px rgb(0 0 0 / 0.18); }
html[data-theme="dark"] #license-form input { border-color: #5c5d57; }
html[data-theme="dark"] #license-form input::placeholder { color: #b0b3ab; }
html[data-theme="dark"] .license-slider { border-color: #5c5d57; background: #1f231f; }
html[data-theme="dark"] .license-slider.is-ready { border-color: #885f7b; }
html[data-theme="dark"] .license-slider.is-locked .slider-thumb { color: #aeb0a8; background: #3d403a; }
html[data-theme="dark"] .license-slider.is-success { border-color: #2f6550; background: #173b30; }
html[data-theme="dark"] .license-slider.is-success .slider-label { color: #b9efd2; }
html[data-theme="dark"] .license-slider.is-error { border-color: #6c3b38; background: #442625; }
html[data-theme="dark"] .license-slider.is-error .slider-label { color: #ffb7b0; }
html[data-theme="dark"] .metric { --metric-border: #704b64; }
html[data-theme="dark"] .metric:nth-child(2) { --metric-color: #73b599; --metric-soft: #1b3028; --metric-border: #376853; }
html[data-theme="dark"] .metric:nth-child(3) { --metric-color: #d2a45e; --metric-soft: #30281c; --metric-border: #6e5836; }
html[data-theme="dark"] .devices-panel, html[data-theme="dark"] .details-panel { box-shadow: 0 1px 0 rgb(255 255 255 / 0.025) inset; }
html[data-theme="dark"] .current-device-badge { border-color: #376853; }
html[data-theme="dark"] .device-meta code { color: #c8c0c5; }
html[data-theme="dark"] .device-unbind { border-color: #76423e; color: #f0b5af; }
html[data-theme="dark"] .unbind-message { border-color: #2f6550; color: #b9efd2; }
html[data-theme="dark"] .dialog-impact, html[data-theme="dark"] .impact-charge, html[data-theme="dark"] .unbind-dialog .impact-note { border-color: #6c3b38; }
html[data-theme="dark"] .unbind-dialog .impact-note { color: #ffb7b0; }
html[data-theme="dark"] .unbind-dialog.is-working .dialog-impact, html[data-theme="dark"] .unbind-dialog.is-working .impact-charge, html[data-theme="dark"] .unbind-dialog.is-working .impact-note { border-color: #704b64; }
html[data-theme="dark"] .unbind-dialog.is-success .dialog-impact, html[data-theme="dark"] .unbind-dialog.is-success .impact-charge, html[data-theme="dark"] .unbind-dialog.is-success .impact-note { border-color: #2f6550; }

/* Web liquid glass material layer inspired by iOS 26. */
:root {
  --glass-fill: rgb(251 252 248 / 0.58);
  --glass-fill-strong: rgb(252 253 249 / 0.76);
  --glass-fill-soft: rgb(246 248 243 / 0.46);
  --glass-edge: rgb(255 255 255 / 0.66);
  --glass-edge-soft: rgb(255 255 255 / 0.42);
  --glass-highlight: inset 0 1px 0 rgb(255 255 255 / 0.78), inset 0 -1px 0 rgb(255 255 255 / 0.2);
  --glass-shadow: 0 20px 58px rgb(64 54 62 / 0.12), 0 4px 14px rgb(64 54 62 / 0.05);
  --glass-shadow-lifted: 0 30px 90px rgb(64 54 62 / 0.17), 0 8px 22px rgb(64 54 62 / 0.07);
}

html[data-theme="dark"] {
  --glass-fill: rgb(29 33 29 / 0.58);
  --glass-fill-strong: rgb(33 38 33 / 0.76);
  --glass-fill-soft: rgb(38 43 38 / 0.42);
  --glass-edge: rgb(255 255 255 / 0.15);
  --glass-edge-soft: rgb(255 255 255 / 0.09);
  --glass-highlight: inset 0 1px 0 rgb(255 255 255 / 0.16), inset 0 -1px 0 rgb(255 255 255 / 0.04);
  --glass-shadow: 0 20px 58px rgb(0 0 0 / 0.3), 0 4px 14px rgb(0 0 0 / 0.16);
  --glass-shadow-lifted: 0 30px 90px rgb(0 0 0 / 0.42), 0 8px 22px rgb(0 0 0 / 0.2);
}

body {
  background: var(--page);
  background-attachment: fixed;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 4%, rgb(123 80 111 / 0.2), transparent 30rem),
    radial-gradient(circle at 88% 16%, rgb(84 122 99 / 0.1), transparent 28rem),
    radial-gradient(circle at 54% 94%, rgb(180 124 56 / 0.07), transparent 32rem),
    var(--page);
}

.site-header {
  border-color: var(--glass-edge-soft);
  background: var(--glass-fill);
  box-shadow: var(--glass-highlight), 0 8px 28px rgb(64 54 62 / 0.07);
  backdrop-filter: blur(28px) saturate(160%) contrast(1.04);
  -webkit-backdrop-filter: blur(28px) saturate(160%) contrast(1.04);
}

.access-shell,
.license-overview,
.metric,
.devices-panel,
.details-panel,
.device-item,
.detail-list,
.unbind-breakdown,
.query-loading,
.unbind-dialog {
  border-color: var(--glass-edge);
  background-color: var(--glass-fill);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(155%) contrast(1.03);
  -webkit-backdrop-filter: blur(24px) saturate(155%) contrast(1.03);
}

.access-shell {
  background: var(--glass-fill-soft);
}

.access-form-panel {
  background: var(--glass-fill);
  backdrop-filter: blur(24px) saturate(155%);
  -webkit-backdrop-filter: blur(24px) saturate(155%);
}

.access-brand-panel {
  background:
    radial-gradient(circle at 12% 8%, rgb(123 80 111 / 0.34), transparent 22rem),
    radial-gradient(circle at 90% 88%, rgb(180 124 56 / 0.16), transparent 19rem),
    rgb(35 32 36 / 0.92);
  box-shadow: inset -1px 0 0 rgb(255 255 255 / 0.08), inset 0 1px 0 rgb(255 255 255 / 0.1);
}

.license-overview {
  background:
    radial-gradient(circle at 88% 10%, rgb(123 80 111 / 0.3), transparent 24rem),
    radial-gradient(circle at 8% 100%, rgb(180 124 56 / 0.14), transparent 22rem),
    rgb(35 32 36 / 0.88);
}

.metric {
  background: color-mix(in srgb, var(--metric-soft) 42%, var(--glass-fill));
}

.devices-panel,
.details-panel {
  background: var(--glass-fill-soft);
}

.device-item {
  background: var(--glass-fill);
}

.device-item:hover,
.devices-panel:hover,
.details-panel:hover,
.metric:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--glass-edge));
  box-shadow: var(--glass-highlight), var(--glass-shadow-lifted);
}

.device-avatar,
.device-fact-icon,
.metric-icon,
.license-input-shell > span,
.dialog-icon {
  box-shadow: var(--glass-highlight);
  backdrop-filter: blur(15px) saturate(145%);
  -webkit-backdrop-filter: blur(15px) saturate(145%);
}

#license-form input,
.license-slider,
.secondary-button,
.dialog-device,
.impact-balance,
.header-button,
.theme-toggle {
  border-color: var(--glass-edge);
  background: var(--glass-fill-soft);
  box-shadow: var(--glass-highlight);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.license-slider.is-ready:hover,
#license-form input:focus,
.license-input-shell:focus-within > span {
  border-color: rgb(123 80 111 / 0.42);
}

.slider-thumb {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.2), transparent 48%),
    rgb(123 80 111 / 0.9);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.34), 0 10px 24px rgb(123 80 111 / 0.2);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.license-slider.is-success .slider-thumb {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.18), transparent 48%),
    rgb(24 121 78 / 0.9);
}

.unbind-dialog {
  border-radius: 16px;
  background: var(--glass-fill-strong);
  box-shadow: var(--glass-highlight), var(--glass-shadow-lifted);
}

.unbind-dialog[open]::backdrop {
  background: rgb(24 19 22 / 0.52);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
}

html[data-theme="dark"] .license-paste {
  color: var(--accent-strong);
  border-color: var(--glass-edge);
  background: var(--glass-fill-soft);
  box-shadow: var(--glass-highlight), 0 5px 14px rgb(0 0 0 / 0.18);
}

html[data-theme="dark"] .license-paste:hover {
  background: var(--glass-fill-strong);
}

html[data-theme="dark"] .license-paste.is-pasted {
  color: #8fd4b3;
  border-color: rgb(72 155 113 / 0.34);
  background: rgb(23 59 48 / 0.78);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header,
  .access-shell,
  .access-form-panel,
  .metric,
  .devices-panel,
  .details-panel,
  .device-item,
  .query-loading,
  .unbind-dialog {
    background: #f8f9f5;
  }
  html[data-theme="dark"] .site-header,
  html[data-theme="dark"] .access-shell,
  html[data-theme="dark"] .access-form-panel,
  html[data-theme="dark"] .metric,
  html[data-theme="dark"] .devices-panel,
  html[data-theme="dark"] .details-panel,
  html[data-theme="dark"] .device-item,
  html[data-theme="dark"] .query-loading,
  html[data-theme="dark"] .unbind-dialog {
    background: #1d211d;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .access-shell,
  .access-form-panel,
  .metric,
  .devices-panel,
  .details-panel,
  .device-item,
  .query-loading,
  .unbind-dialog {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 900px) {
  .access-shell { grid-template-columns: 1fr; }
  .access-brand-panel, .access-form-panel { min-height: auto; }
  .access-brand-panel { padding: 42px 34px; }
  .access-eyebrow { left: 34px; }
  .access-logo { width: 56px; height: 56px; margin-bottom: 28px; }
  .access-brand-panel h1 { max-width: 560px; font-size: clamp(36px, 8vw, 50px); }
  .access-capabilities { display: none; }
  .access-form-panel { padding: 42px 34px 48px; }
  .form-heading { margin-top: 32px; }
  .license-content-grid { grid-template-columns: 1fr; }
  .detail-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
  .detail-list div { min-height: 82px; display: block; border-right: 1px solid var(--line); border-bottom: 0; padding: 14px 16px; }
  .detail-list div:last-child { border-right: 0; }
  .detail-list dd { margin-top: 8px; text-align: left; }
}

@media (max-width: 720px) {
  .device-list { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .header-inner { width: min(100% - 32px, 1180px); }
  .header-context { display: none; }
  .header-license { display: none; }
  .back-link { display: none; }
  .query-view { display: block; padding: 18px 16px 40px; }
  .access-brand-panel { padding: 34px 26px; }
  .access-eyebrow { position: static; margin-bottom: 28px; }
  .access-logo { margin-bottom: 24px; }
  .access-brand-panel > p { font-size: 15px; }
  .access-form-panel { padding: 34px 26px 40px; }
  .license-view { width: min(100% - 32px, 1180px); padding: 20px 0 48px; }
  .license-overview { min-height: 190px; padding: 30px 26px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 138px; }
  .license-content-grid { gap: 14px; }
  .devices-panel, .details-panel { padding: 24px 20px; }
  .detail-list { grid-template-columns: 1fr; padding: 0 14px; }
  .detail-list div { min-height: 50px; display: grid; grid-template-columns: 82px minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--line); padding: 11px 0; }
  .detail-list div:last-child { border-bottom: 0; }
  .detail-list dd { margin-top: 0; text-align: right; }
  .device-unbind { width: 100%; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .brand span { font-size: 15px; }
  .header-button { padding: 0 10px; }
  .theme-toggle { width: 36px; height: 36px; }
  .journey i { width: 26px; }
  .license-overview { display: block; }
  .status-badge { display: inline-block; margin-top: 20px; }
  .panel-heading { display: block; }
  .panel-count { display: block; margin-top: 8px; }
  .unbind-dialog form { padding: 24px 20px; }
  .dialog-impact { grid-template-columns: 112px minmax(0, 1fr); }
  .impact-charge { min-height: 110px; padding: 14px; }
  .impact-charge strong b { font-size: 34px; }
  .impact-balance { gap: 5px; padding: 14px 12px; }
  .impact-balance strong { font-size: 17px; }
  .dialog-actions { grid-template-columns: 0.8fr 1.2fr; }
  .dialog-actions button { padding: 0 12px; font-size: 13px; }
}

body.is-client-launch { overflow: hidden; }
body.is-client-launch .site-header { opacity: 0.72; pointer-events: none; }
body.is-client-launch .license-view { display: block; filter: blur(7px); opacity: 0.72; pointer-events: none; transform: scale(0.992); user-select: none; }
body.is-client-launch .query-view {
  position: fixed;
  inset: 0;
  z-index: 120;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(22 20 23 / 0.38);
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
}
body.is-client-launch .access-shell { width: min(500px, 100%); display: block; border-radius: 16px; box-shadow: 0 30px 90px rgb(24 19 22 / 0.26), inset 0 1px 0 rgb(255 255 255 / 0.52); }
body.is-client-launch .access-brand-panel, body.is-client-launch .journey, body.is-client-launch #license-form > label, body.is-client-launch .license-input-shell { display: none; }
body.is-client-launch .access-form-panel { min-height: 0; padding: 34px; }
body.is-client-launch .form-heading { margin: 0 0 25px; }
body.is-client-launch .form-heading h2 { font-size: clamp(27px, 5vw, 34px); }
body.is-client-launch .form-heading p { margin-top: 12px; line-height: 1.65; }
body.is-client-launch .license-slider { margin-top: 0; }
body.is-client-launch .form-help { margin-top: 13px; text-align: center; }

@media (max-width: 560px) {
  body.is-client-launch .query-view { padding: 18px; }
  body.is-client-launch .access-form-panel { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .query-view, .license-view { view-transition-name: none; }
}

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }
