:root {
  color-scheme: dark;
  --obsidian: #080b12;
  --raised: #101827;
  --panel: #151f31;
  --signal: #4c7dff;
  --signal-strong: #6992ff;
  --cyan: #55d6c2;
  --cloud: #f4f7ff;
  --muted: #8492aa;
  --danger: #ff5d73;
  --line: #27344a;
  --line-strong: #3b4b65;
  --success-surface: #102925;
  --danger-surface: #2a151e;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--cloud);
  background: var(--obsidian);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 300px; background: var(--obsidian); }
body { min-width: 300px; min-height: 100vh; margin: 0; background: var(--obsidian); }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: wait; }
a { color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--obsidian); background: var(--cyan); }
:focus-visible { outline: 3px solid var(--signal-strong); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--cloud); font-weight: 700; }
h1 { font-size: clamp(2.35rem, 5vw, 4.25rem); line-height: .98; letter-spacing: -.055em; }
h2 { font-size: 1.22rem; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1rem; line-height: 1.35; }
p { line-height: 1.6; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 11px 16px;
  border: 2px solid var(--signal);
  background: var(--cloud);
  color: var(--obsidian);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.page-shell {
  display: flex;
  flex-direction: column;
  width: min(1280px, calc(100% - 80px));
  min-height: 100svh;
  margin: 0 auto;
}

.masthead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}
.masthead::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 72px;
  height: 2px;
  background: var(--signal);
  content: "";
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--cloud);
  text-decoration: none;
}
.signal-mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  width: 35px;
  height: 35px;
  padding: 6px;
  border: 1px solid #365173;
  background: var(--raised);
}
.signal-mark span { display: block; min-height: 7px; background: var(--signal); }
.signal-mark span:nth-child(1) { height: 45%; background: var(--cyan); }
.signal-mark span:nth-child(2) { height: 100%; }
.signal-mark span:nth-child(3) { height: 70%; background: var(--cloud); }
.wordmark-type {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.38rem;
  font-weight: 750;
  letter-spacing: -.065em;
}
.wordmark-number { margin-right: 3px; color: var(--signal-strong); }
.console-name {
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.logout-button { margin-left: auto; }
main { flex: 1; outline: none; }
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 56px;
  padding: 24px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
}
.page-footer > :first-child { color: var(--cloud); font-weight: 650; }

.text-button,
.primary-button,
.secondary-button,
.license-switch {
  border-radius: 5px;
  font-weight: 700;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.text-button {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--signal-strong);
  font-size: .84rem;
}
.text-button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--raised); color: var(--cloud); }
.text-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 24px;
  border: 1px solid var(--signal);
  background: var(--signal);
  color: var(--cloud);
  box-shadow: inset 0 -2px 0 #345bc8;
}
.primary-button:hover:not(:disabled) { border-color: var(--signal-strong); background: var(--signal-strong); }
.primary-button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #397f78;
  background: #11221f;
  color: var(--cyan);
  font-size: .84rem;
}
.secondary-button:hover:not(:disabled) { border-color: var(--cyan); background: #17302c; color: var(--cloud); }
button:disabled,
fieldset:disabled button {
  opacity: .46;
  box-shadow: none;
  transform: none;
}

label, legend { color: #dce5f7; font-size: .84rem; font-weight: 650; }
input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  margin-top: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #0c1320;
  color: var(--cloud);
  caret-color: var(--cyan);
  transition: border-color 120ms ease, background-color 120ms ease;
}
input[type="text"]:hover:not(:disabled),
input[type="password"]:hover:not(:disabled) { border-color: #526786; }
input[type="text"]:focus,
input[type="password"]:focus { border-color: var(--signal-strong); background: #0d1625; }
input::placeholder { color: #718098; opacity: 1; font-weight: 400; }
input:disabled { background: #0d1420; color: #68758a; }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cloud);
  box-shadow: 0 0 0 1000px #0c1320 inset;
  caret-color: var(--cyan);
}
.optional { margin-left: 5px; color: var(--muted); font-size: .75rem; font-weight: 400; }
.form-feedback,
.row-feedback {
  color: var(--danger);
  overflow-wrap: anywhere;
}
.form-feedback { margin-top: 14px; font-size: .82rem; }
.notice {
  padding: 13px 15px;
  border: 1px solid #65303d;
  border-left: 4px solid var(--danger);
  border-radius: 4px;
  background: var(--danger-surface);
  color: #ffabb7;
  font-size: .84rem;
  overflow-wrap: anywhere;
}
.notice-error { color: #ffabb7; }
.section-description { max-width: 60ch; margin-top: 11px; color: var(--muted); font-size: .86rem; }

.session-view {
  max-width: 590px;
  padding: clamp(80px, 12vh, 140px) 0;
}
.session-view h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.session-view p { margin: 19px 0; color: var(--muted); }
.loading-line {
  display: block;
  width: 68px;
  height: 3px;
  margin-bottom: 25px;
  background: var(--signal);
  animation: signal-pulse 1.4s steps(2, end) infinite;
}
.session-view[aria-busy="false"] .loading-line { background: var(--danger); animation: none; }

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 440px);
  align-items: center;
  gap: clamp(60px, 10vw, 150px);
  min-height: min(680px, calc(100svh - 145px));
  padding: 64px 0 42px;
}
.login-intro { position: relative; padding-left: clamp(24px, 4vw, 58px); }
.login-intro::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--line-strong);
  content: "";
}
.intro-line { position: relative; width: 74px; height: 4px; margin-bottom: 34px; background: var(--signal); }
.intro-line::after {
  position: absolute;
  top: 0;
  right: -30px;
  width: 20px;
  height: 4px;
  background: var(--cyan);
  content: "";
}
.login-intro h1 { max-width: 680px; }
.login-intro > p { max-width: 460px; margin-top: 25px; color: var(--muted); font-size: .97rem; }
.login-intro .intro-footnote { margin-top: 46px; color: var(--cyan); font-size: .78rem; font-weight: 650; }
.login-form-wrap {
  position: relative;
  padding: 35px 34px 32px;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--signal);
  border-radius: 5px;
  background: var(--raised);
  box-shadow: 10px 10px 0 #06080d;
}
.login-form-wrap::before {
  position: absolute;
  top: -3px;
  right: 0;
  width: 52px;
  height: 3px;
  background: var(--cyan);
  content: "";
}
.login-form-wrap form { margin-top: 27px; }
.login-form-wrap .primary-button { width: 100%; margin-top: 23px; }
.login-note { margin-top: 22px; color: var(--muted); font-size: .76rem; }

.console-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 0 34px;
}
.console-heading-row h1 { font-size: clamp(2.45rem, 4.4vw, 4rem); }
.console-heading-row p { margin-top: 12px; color: var(--muted); font-size: .92rem; }
.admin-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  color: #bdc9dc;
  font-size: .78rem;
  font-weight: 650;
}
.admin-label-dot { width: 8px; height: 8px; background: var(--cyan); box-shadow: 0 0 0 3px #193531; }
#console-feedback { margin-bottom: 22px; }
.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(34px, 5vw, 70px);
}
.creation-panel {
  padding: 28px 28px 30px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--signal);
  border-radius: 6px;
  background: var(--raised);
}
.section-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.section-stroke { width: 4px; height: 21px; background: var(--signal); flex: 0 0 auto; }
.section-stroke.teal { background: var(--cyan); }
.creation-panel form { margin-top: 27px; }
.creation-fields,
.duration-fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.duration-fieldset { margin-top: 27px; }
.duration-fieldset legend { margin-bottom: 11px; }
.duration-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.duration-chip { position: relative; display: block; cursor: pointer; font-weight: 400; }
.duration-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.duration-chip > span {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  min-height: 49px;
  padding: 12px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #0d1522;
  color: var(--muted);
  font-size: .72rem;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.duration-chip strong { color: #dce5f4; font-size: 1.06rem; font-weight: 700; }
.duration-chip-lifetime { grid-column: 1 / -1; }
.duration-chip-lifetime > span { gap: 8px; }
.duration-chip-lifetime small { font-size: .7rem; }
.duration-chip input:checked + span { padding: 11px 3px; border: 2px solid var(--signal); background: #18294a; color: #b9cbff; }
.duration-chip input:checked + span strong { color: var(--cloud); }
.duration-chip input:focus-visible + span { outline: 3px solid var(--signal-strong); outline-offset: 2px; }
.duration-chip:hover input:not(:disabled) + span { border-color: var(--signal-strong); color: #b9c5d8; }
.duration-chip input:disabled + span { cursor: wait; opacity: .45; }
.generate-button { width: 100%; margin-top: 25px; }
.field-note { margin-top: 10px; color: var(--muted); font-size: .73rem; text-align: center; }

.key-result {
  margin-top: 25px;
  padding: 22px;
  border: 1px solid #2d665f;
  border-left: 4px solid var(--cyan);
  border-radius: 4px;
  background: var(--success-surface);
}
.key-result h3 { color: #9ce9dc; }
.key-result > p { margin-top: 8px; color: #9db6b3; font-size: .79rem; }
.key-result input {
  border-color: #397f78;
  background: #0a1716;
  color: var(--cloud);
  font-size: clamp(.88rem, 2vw, 1.02rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
}
.key-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.key-actions .text-button { color: #9ce9dc; font-size: .78rem; }
.key-feedback { margin-top: 11px; color: #9ce9dc; font-size: .78rem; }

.license-panel { min-width: 0; padding-top: 10px; }
.list-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.license-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  padding: 2px 6px;
  margin-left: 6px;
  border: 1px solid #397f78;
  border-radius: 3px;
  background: #112724;
  color: var(--cyan);
  font-size: .74rem;
  letter-spacing: 0;
  vertical-align: middle;
}
.list-description { max-width: 500px; margin-top: 11px; color: var(--muted); font-size: .8rem; }
#list-feedback { margin-top: 22px; }
.list-state { margin-top: 24px; padding: 52px 20px 46px; border: 1px solid var(--line); text-align: center; }
.list-state p { max-width: 340px; margin: 9px auto 0; color: var(--muted); font-size: .84rem; }
.list-state .loading-line { margin: 0 auto 19px; }
.empty-mark {
  position: relative;
  display: block;
  width: 49px;
  height: 36px;
  margin: 0 auto 22px;
  border: 1px solid #4a607d;
  background: var(--raised);
}
.empty-mark::before,
.empty-mark::after { position: absolute; left: 8px; height: 2px; background: var(--line-strong); content: ""; }
.empty-mark::before { top: 10px; width: 30px; }
.empty-mark::after { top: 20px; width: 20px; background: var(--cyan); }
.license-list { display: grid; gap: 10px; padding: 0; margin: 24px 0 0; list-style: none; }
.license-row {
  position: relative;
  padding: 19px 20px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 4px;
  background: var(--raised);
}
.license-row[aria-busy="true"] { border-left-color: var(--signal); }
.license-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.license-identity { min-width: 0; }
.license-title { color: var(--cloud); font-size: .98rem; overflow-wrap: anywhere; }
.license-reference { margin-top: 4px; color: var(--muted); font-size: .68rem; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.license-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 78px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #397f78;
  background: #112724;
  color: var(--cyan);
  font-size: .77rem;
  flex: 0 0 auto;
}
.license-switch::before { width: 9px; height: 9px; background: currentColor; content: ""; }
.license-switch[aria-checked="false"] { border-color: var(--line-strong); background: #121b29; color: #8c9ab0; }
.license-switch:hover:not(:disabled) { border-color: currentColor; background: #17302c; }
.license-switch[aria-checked="false"]:hover:not(:disabled) { background: #182334; }
.license-details { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr); gap: 16px; margin-top: 15px; }
.license-detail { min-width: 0; padding-top: 11px; border-top: 1px solid var(--line); }
.detail-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: .68rem; }
.detail-value { display: block; color: #d6dfef; font-size: .79rem; line-height: 1.48; overflow-wrap: anywhere; }
.license-statusline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; margin-top: 13px; }
.status-badge { display: inline-block; padding: 4px 7px; border: 1px solid #3a475c; border-radius: 3px; background: #1a2332; color: #a6b1c3; font-size: .67rem; font-weight: 700; }
.status-active { border-color: #326a63; background: #102925; color: #8be2d4; }
.status-unused { border-color: #38517d; background: #15223c; color: #a9c0ff; }
.status-expired { border-color: #65303d; background: var(--danger-surface); color: #ff9aaa; }
.status-disabled { border-color: #3c485a; background: #171e29; color: #8f9caf; }
.license-device { color: var(--muted); font-size: .69rem; }
.row-feedback { margin-top: 12px; padding-left: 10px; border-left: 2px solid var(--danger); font-size: .78rem; line-height: 1.5; }
.list-updated { margin-top: 17px; color: var(--muted); font-size: .7rem; }
.list-updated::before { display: inline-block; width: 6px; height: 6px; margin-right: 7px; background: var(--cyan); content: ""; vertical-align: 1px; }

@keyframes signal-pulse {
  50% { opacity: .28; transform: scaleX(.62); transform-origin: left; }
}

@media (max-width: 1060px) {
  .page-shell { width: calc(100% - 52px); }
  .workspace { grid-template-columns: minmax(310px, 370px) minmax(0, 1fr); gap: 28px; }
  .creation-panel { padding: 25px 23px 27px; }
  .login-layout { gap: 54px; }
}

@media (max-width: 840px) {
  .page-shell { width: calc(100% - 40px); }
  .login-layout { grid-template-columns: 1fr; gap: 35px; min-height: auto; padding-top: 42px; }
  .login-intro { padding-left: 28px; }
  .login-intro h1 { font-size: clamp(2.7rem, 10vw, 4rem); }
  .login-intro .intro-footnote { display: none; }
  .login-form-wrap { width: min(100%, 520px); box-shadow: 7px 7px 0 #06080d; }
  .workspace { grid-template-columns: 1fr; gap: 36px; }
  .creation-panel { width: min(100%, 560px); }
  .license-panel { padding-top: 0; }
}

@media (max-width: 580px) {
  .page-shell { width: calc(100% - 28px); }
  .masthead { min-height: 76px; gap: 12px; }
  .signal-mark { width: 32px; height: 32px; }
  .wordmark-type { font-size: 1.22rem; }
  .console-name { padding-left: 12px; font-size: .75rem; }
  .logout-button { min-height: 38px; padding-inline: 8px; }
  .session-view { padding: 70px 0; }
  .login-layout { padding: 32px 0 25px; }
  .login-intro { padding-left: 20px; }
  .intro-line { width: 55px; margin-bottom: 25px; }
  .login-intro > p { margin-top: 19px; font-size: .9rem; }
  .login-form-wrap { padding: 27px 22px 25px; }
  .console-heading-row { align-items: flex-start; padding: 35px 0 28px; }
  .admin-label { display: none; }
  .console-heading-row h1 { font-size: clamp(2.35rem, 12vw, 3rem); }
  .creation-panel { padding: 24px 20px 25px; }
  .duration-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .key-result { padding: 19px 15px; }
  .key-result input { letter-spacing: .045em; }
  .license-row { padding: 17px 15px; }
  .license-details { gap: 11px; }
  .page-footer { margin-top: 40px; padding-bottom: 22px; font-size: .68rem; }
}

@media (max-width: 390px) {
  .page-shell { width: calc(100% - 22px); }
  .console-name { display: none; }
  .logout-button { font-size: .78rem; }
  .duration-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duration-chip-lifetime { grid-column: 1 / -1; }
  .list-heading-row { align-items: flex-start; gap: 6px; }
  .refresh-button { padding: 7px 6px; }
  .license-topline { gap: 10px; }
  .license-switch { min-width: 68px; min-height: 40px; padding-inline: 8px; }
  .license-details { grid-template-columns: 1fr; }
  .page-footer { flex-direction: column; gap: 6px; }
}

@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 (forced-colors: active) {
  .signal-mark span,
  .admin-label-dot,
  .section-stroke,
  .empty-mark::before,
  .empty-mark::after,
  .license-switch::before,
  .list-updated::before { background: CanvasText; }
  .primary-button { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
