:root {
  color-scheme: dark;
  --canvas: #0d0e12;
  --sidebar: #111217;
  --surface: #15161c;
  --elevated: #1c1d25;
  --hover: #22232d;
  --border: #2c2d38;
  --ink: #eeeef3;
  --muted: #a0a1b2;
  --accent: #b4a5ff;
  --primary: #7256cc;
  --primary-hover: #7c60d6;
  --accent-surface: #252035;
  --danger: #ffabae;
  --success: #95d8b3;
  --warning: #e9c586;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  font-feature-settings: "cv01", "ss03";
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, input, select, textarea { border-radius: 7px; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea { min-height: 42px; width: 100%; padding: 10px 12px; background: var(--canvas); color: var(--ink); border: 1px solid #626373; }
input::placeholder { color: var(--muted); opacity: 1; }
input:disabled { color: var(--muted); background: var(--surface); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.7px; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; }
.eyebrow { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 1px solid var(--border); padding: 8px 14px; font-weight: 500; color: var(--ink); background: var(--elevated); white-space: nowrap; transition: background .12s; }
.button:hover:not(:disabled) { background: var(--hover); border-color: #454654; }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.ghost { background: transparent; border-color: transparent; }
.button.danger { color: var(--danger); background: #302023; border-color: #593438; }
.button.compact { min-height: 34px; font-size: 12px; padding: 6px 10px; }
.full-width { width: 100%; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; background: var(--elevated); padding: 12px; }
.skip-link:focus { top: 12px; }
.boot { display: grid; min-height: 90vh; place-content: center; color: var(--muted); }
.login-view { min-height: 100dvh; display: grid; place-content: center; padding: 48px 24px; }
.login-card { width: min(390px, calc(100vw - 48px)); }
.brand { display: flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.brand-mark { display: grid; place-content: center; width: 33px; height: 33px; border-radius: 8px; background: var(--accent-surface); color: var(--accent); font-size: 27px; font-style: italic; line-height: 1; font-weight: 600; }
.brand-caption { display: block; font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.login-heading { margin: 44px 0 26px; }
.login-heading h1 { margin-bottom: 10px; }
.field { display: grid; gap: 7px; margin-bottom: 18px; min-width: 0; }
.field label { color: #d5d5df; font-size: 13px; font-weight: 500; }
.form-message { color: var(--muted); margin: 12px 0 18px; font-size: 13px; overflow-wrap: anywhere; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }
.login-form .button { margin-top: 4px; }
.login-footer { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.app { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 27px 16px 20px; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar .brand { padding: 0 9px; }
.nav-caption { color: var(--muted); font-size: 11px; margin: 40px 12px 12px; }
.navigation { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 12px; background: transparent; color: var(--muted); border: 1px solid transparent; text-align: left; }
.nav-item:hover { background: var(--elevated); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--accent-surface); color: #d1c7ff; }
.nav-symbol { width: 19px; font-size: 20px; line-height: 1; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 20px 12px 0; display: grid; gap: 3px; }
.workspace { min-width: 0; }
.topbar { min-height: 72px; padding: 12px 32px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.account { display: flex; gap: 4px; align-items: center; min-width: 0; }
#account-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.account-avatar { background: var(--elevated); border: 1px solid var(--border); width: 25px; height: 25px; display: grid; place-content: center; border-radius: 50%; font-size: 11px; }
.main { max-width: 1600px; padding: 35px 32px 56px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin-bottom: 9px; }
.page-heading p.muted { font-size: 13px; }
.notice { padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--elevated); margin-bottom: 22px; overflow-wrap: anywhere; }
.notice.error { color: var(--danger); border-color: #593438; }
.notice.success { color: var(--success); }
@media (max-width: 1100px) {
  .app { grid-template-columns: 184px minmax(0, 1fr); }
  .main, .topbar { padding-left: 24px; padding-right: 24px; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { position: static; width: auto; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { padding: 0; }
  .sidebar .brand-caption { display: none; }
  .nav-caption, .sidebar-footer { display: none; }
  .navigation { display: flex; overflow-x: auto; gap: 4px; margin-top: 16px; padding-bottom: 3px; }
  .nav-item { flex-shrink: 0; min-height: 44px; padding: 8px 12px; font-size: 13px; }
  .nav-symbol { display: none; }
  .topbar { padding: 10px 16px; min-height: 64px; }
  .breadcrumb { display: none; }
  .account { width: 100%; justify-content: space-between; }
  .main { padding: 24px 16px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 24px; }
  h1 { font-size: 25px; }
  .button, .button.compact, .filters button { min-width: 44px; min-height: 44px; }
  input, select { min-height: 44px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 9px; margin: 0; padding: 0; background: var(--surface); }
.stats > div { padding: 18px 20px; border-right: 1px solid var(--border); }
.stats > div:last-child { border-right: 0; }
.stats dt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stats dd { font-size: 26px; font-weight: 500; margin: 7px 0 0; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.5px; }
.data-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 10px 0 20px; }
.panel { border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; }
.count { color: var(--muted); background: var(--elevated); border: 1px solid var(--border); border-radius: 5px; font-size: 11px; padding: 2px 6px; vertical-align: middle; margin-left: 5px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 22px 18px; }
.filters { display: flex; gap: 3px; flex-wrap: wrap; }
.filters button { background: transparent; border: 1px solid transparent; color: var(--muted); min-height: 36px; padding: 7px 10px; font-size: 12px; }
.filters button[aria-pressed="true"] { background: var(--elevated); color: var(--ink); border-color: #424350; }
.filters button:hover { color: var(--ink); background: var(--elevated); }
.search-field { flex: 0 1 280px; }
.search-field input { min-height: 36px; padding: 8px 11px; font-size: 12px; }
.table-scroll { position: relative; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
.license-table { min-width: 770px; }
th { color: var(--muted); font-size: 11px; font-weight: 500; padding: 11px 22px; background: #181920; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 16px 22px; border-bottom: 1px solid var(--border); font-size: 12px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #191a22; }
.key-cell { display: flex; gap: 8px; align-items: center; }
.key-cell .mono { max-width: 300px; color: #d1c7ff; }
.device-meta { margin-top: 5px; color: var(--muted); font-size: 11px; max-width: 340px; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; line-height: 1.5; color: #d5d5df; padding: 3px 8px; border-radius: 5px; background: var(--elevated); border: 1px solid var(--border); white-space: nowrap; }
.badge.success { color: var(--success); background: #182820; border-color: #2b4837; }
.badge.danger { color: var(--danger); background: #302023; border-color: #593438; }
.badge.warning { color: var(--warning); background: #2c261c; border-color: #504330; }
.empty-state { text-align: center; color: var(--muted); padding: 44px 20px; }
.empty-state.error { color: var(--danger); }
.panel-footer { padding: 13px 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
dialog { color: var(--ink); background: var(--surface); border: 1px solid #424350; border-radius: 12px; padding: 26px; width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: 0 24px 100px #0008; }
dialog::backdrop { background: #000b; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-header .button { font-size: 22px; padding: 3px 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.generated-section { margin-top: 24px; border-top: 1px solid var(--border); }
.generated-section .panel-header { padding: 18px 0; }
.generated-keys { display: grid; gap: 8px; max-height: 280px; overflow-y: auto; }
.generated-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--canvas); border: 1px solid var(--border); border-radius: 6px; }
.detail-list { margin: 0; display: grid; gap: 16px; }
.detail-list dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.license-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.confirm-description { margin-top: 16px; color: #c4c4d0; overflow-wrap: anywhere; white-space: pre-line; }
#session-rows td { overflow-wrap: anywhere; min-width: 170px; }
@media (max-width: 1250px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-right: 0; }
  .stats > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .stats > div { padding: 14px; }
  .stats dt { font-size: 11px; white-space: normal; }
  .stats dd { font-size: 23px; }
  .data-status { align-items: flex-start; }
  .toolbar { flex-direction: column-reverse; align-items: stretch; padding: 0 16px 16px; gap: 12px; }
  .search-field { flex-basis: auto; }
  .search-field input, .filters button { min-height: 44px; }
  .panel-header { padding: 16px; }
  .panel-header > p { display: none; }
  .panel-footer { padding: 13px 16px; }
  th, td { padding-left: 16px; padding-right: 16px; }
  .form-grid { gap: 12px; }
  dialog { padding: 20px; }
  .generated-row { flex-wrap: wrap; }
}
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 28px; }
.upload-panel { min-width: 0; }
.upload-description { margin: 0 22px 18px; overflow-wrap: anywhere; }
.upload-form { padding: 0 22px 22px; }
.current-build { display: grid; gap: 3px; margin: 0 22px 22px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 7px; background: var(--canvas); min-height: 88px; align-content: center; overflow-wrap: anywhere; }
.current-version { font-size: 17px; font-weight: 500; }
.dropzone { padding: 15px; background: var(--canvas); border: 1px dashed #555563; border-radius: 8px; }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-surface); }
input[type="file"] { font-size: 12px; padding: 0; border: 0; min-height: 36px; color: var(--muted); border-radius: 0; }
input::file-selector-button { background: var(--elevated); color: var(--ink); border: 1px solid #494a58; border-radius: 5px; min-height: 36px; padding: 6px 11px; margin-right: 10px; cursor: pointer; }
.upload-progress { padding: 0 22px 12px; display: flex; align-items: center; gap: 8px; }
progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--border); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.upload-message { padding: 0 22px 20px; margin: 0; color: var(--muted); }
.upload-message.error { color: var(--danger); }
.upload-message.success { color: var(--success); }
.build-histories { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.build-table { min-width: 790px; }
.build-version { font-weight: 500; overflow-wrap: anywhere; max-width: 300px; }
.row-actions { display: flex; gap: 6px; }
.danger-text { color: var(--danger); }
.product-explanation { margin: 0 0 22px; max-width: 660px; font-size: 13px; }
.product-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 270px) auto; gap: 12px 28px; align-items: center; padding: 26px; border-bottom: 1px solid var(--border); }
.product-row:last-child { border-bottom: 0; }
.product-identity { display: grid; gap: 9px; justify-items: start; }
.product-row .field { margin: 0; }
.product-row > button { align-self: end; min-height: 44px; }
.product-message { grid-column: 1 / -1; margin: 0; }
@media (max-width: 1000px) { .upload-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .upload-form { padding: 0 16px 16px; }
  .upload-description { margin-left: 16px; margin-right: 16px; }
  .current-build { margin: 0 16px 16px; }
  .upload-progress, .upload-message { padding-left: 16px; padding-right: 16px; }
  .product-row { grid-template-columns: minmax(0, 1fr) auto; padding: 20px 16px; gap: 18px 12px; }
  .product-identity { grid-column: 1 / -1; }
  input::file-selector-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
