:root {
  color-scheme: dark;
  --bg: #0c1210;
  --panel: #111a15;
  --line: #2b3a30;
  --ink: #edf3ee;
  --muted: #a0aea4;
  --soft: #77867b;
  --green: #a8ce69;
  --green-dark: #7fa846;
  --red: #e38d80;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 85% 0%, #16251c 0, transparent 36%), var(--bg);
}
a { color: inherit; text-decoration: none; }
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: #0c1210ee;
}
.brand { display: flex; align-items: center; }
.brand-logo { display: block; width: auto; max-width: 180px; height: 48px; object-fit: contain; }
.account { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; }
.account a:hover, .account button:hover { color: var(--green); }
.account form { margin: 0; }
.account button, .text-button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.shell { max-width: 1180px; min-height: calc(100vh - 70px); margin: 0 auto; padding: 46px 24px 24px; display: flex; flex-direction: column; }
footer { margin-top: auto; padding-top: 45px; color: #728075; font-size: 11px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font: 10px/1.2 ui-monospace, SFMono-Regular, monospace; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: 34px; line-height: 1.13; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 19px; letter-spacing: -.02em; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 9px; padding: 10px 15px; border: 1px solid transparent; border-radius: 5px; font: 650 12px system-ui, sans-serif; cursor: pointer; transition: .15s ease; }
.button.primary { background: var(--green); color: #11180e; }
.button.primary:hover { transform: translateY(-1px); background: #b8dc7e; }
.button.secondary { border-color: #34483a; background: #17221b; color: #dbe5dc; }
.button.secondary:hover { border-color: #6f9250; color: white; }
.button.full { width: 100%; }
.button.small { min-height: 31px; padding: 6px 10px; font-size: 10px; }
.notice { margin-bottom: 25px; padding: 12px 15px; border: 1px solid #435a36; background: #1b2719; color: #c8d9b3; font-size: 12px; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.installer-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.device-card, .card, .assignment-card { border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(150deg, #141e18, #101713); }
.device-card { padding: 18px; }
.device-top { display: flex; align-items: center; justify-content: space-between; }
.device-symbol { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #34483a; border-radius: 5px; color: var(--green); font-size: 18px; }
.platform { padding: 4px 7px; border: 1px solid #344238; border-radius: 3px; color: #a9b8ab; font-size: 9px; }
.device-card h2 { margin: 15px 0 1px; }
.customer { margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.device-id { padding-top: 12px; border-top: 1px solid var(--line); color: var(--soft); font-size: 10px; }
.device-id code, .assignment-heading code { color: #dce6de; font: 11px ui-monospace, SFMono-Regular, monospace; }
.notes { min-height: 18px; color: #aab5ac; font-size: 11px; }
.device-card > .button { margin-top: 10px; }
.device-card > .button span { font-size: 16px; }
.fineprint { margin-top: 21px; color: #7f8d82; font-size: 10px; }
.empty-state { display: grid; justify-items: center; padding: 64px 20px; border: 1px dashed #34443a; border-radius: 6px; color: var(--muted); text-align: center; }
.empty-state h2, .empty-state h1 { margin: 10px 0 5px; color: var(--ink); }
.empty-state p { font-size: 12px; }
.empty-icon { color: var(--green); font-size: 30px; }
.empty-state.compact { padding: 22px; font-size: 12px; }
.login-layout { display: grid; width: 100%; max-width: 900px; flex: 1; grid-template-columns: 1.1fr .8fr; align-items: center; gap: 70px; margin: 0 auto; }
.login-intro h1 { font-size: 48px; }
.login-intro > p:not(.eyebrow) { max-width: 390px; color: var(--muted); font-size: 14px; }
.login-line { display: flex; align-items: center; gap: 9px; margin-top: 40px; color: #aab7ac; font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dark); box-shadow: 0 0 10px #86b44b; }
.login-card { padding: 28px; }
.login-card h2 { margin: 0 0 20px; font-size: 23px; }
.card label, .stack-form > label, .form-card > label { display: grid; gap: 6px; margin-bottom: 14px; color: #c4cec6; font-size: 11px; }
.card input, .stack-form input, .form-card input, .inline-form input { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #34443a; border-radius: 4px; outline: none; background: #0d1410; color: var(--ink); font: 12px system-ui, sans-serif; }
.card input:focus, .stack-form input:focus, .form-card input:focus, .inline-form input:focus { border-color: #88ad55; box-shadow: 0 0 0 2px #88ad5520; }
.helper, .form-card small { color: #819086; font-size: 10px; }
.login-card .button { margin-top: 4px; }
.narrow { width: 100%; max-width: 520px; margin: 0 auto; }
.narrow h1 { margin-bottom: 20px; }
.form-card { padding: 22px; }
.messages { margin-bottom: 15px; }
.flash { padding: 10px 13px; border: 1px solid #40573c; background: #1b291a; color: #cde1b8; font-size: 12px; }
.flash.error { border-color: #683d37; background: #2b1b19; color: #f0b0a6; }
.flash + .flash { margin-top: 7px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.section-title h2 { margin: 0; }
.count { color: var(--soft); font-size: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack-form fieldset { margin: 3px 0 15px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
.stack-form legend { padding: 0 5px; color: var(--muted); font-size: 10px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.check { display: flex !important; align-items: center; gap: 7px !important; margin: 0 !important; color: #c5cec7 !important; font-size: 10px !important; }
.check input { width: auto !important; accent-color: var(--green); }
.section-block { margin-top: 33px; }
.table-card { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
table { width: 100%; min-width: 700px; border-collapse: collapse; text-align: left; }
th { background: #162019; color: #849187; font: 9px ui-monospace, SFMono-Regular, monospace; letter-spacing: .08em; }
th, td { padding: 11px 13px; border-bottom: 1px solid #28362d; }
tbody tr:last-child td { border-bottom: 0; }
td { color: #b5c0b7; font-size: 11px; }
td strong { color: #e3ebe5; }
.inline-form { display: flex; min-width: 260px; gap: 6px; }
.inline-form input { padding: 7px; font-size: 10px; }
.muted { color: var(--soft); }
.assignment-list { display: grid; gap: 9px; }
.assignment-card { padding: 14px 16px; }
.assignment-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.assignment-heading > div { display: grid; gap: 4px; }
.assignment-heading strong { font-size: 12px; }
.assignment-heading span { color: var(--soft); font-size: 10px; }
.assignment-form { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.password-row { display: grid; grid-template-columns: minmax(145px, .7fr) minmax(250px, 1fr) minmax(190px, auto); align-items: center; gap: 12px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.password-row > div:first-child { display: grid; gap: 3px; }
.password-row strong { color: #dbe5dc; font-size: 10px; }
.password-status { color: var(--soft); font-size: 9px; }
.save-secret-form, .secret-controls { display: flex; align-items: center; gap: 6px; }
.save-secret-form input { width: 100%; min-width: 100px; padding: 7px 8px; border: 1px solid #34443a; border-radius: 4px; background: #0d1410; color: var(--ink); font: 10px system-ui, sans-serif; }
.secret-controls { justify-content: end; }
.secret-value { max-width: 240px; overflow-wrap: anywhere; color: #f1dc9e; font: 10px ui-monospace, SFMono-Regular, monospace; }
.danger { color: var(--red); font-size: 10px; }
.text-button:hover { text-decoration: underline; }
.import-divider { height: 1px; margin: 24px 0 20px; background: var(--line); }
.import-help { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.import-help code { color: #dce6de; font: 10px ui-monospace, SFMono-Regular, monospace; }
.template-link { display: inline-block; margin-bottom: 13px; color: var(--green); font-size: 10px; }
.template-link:hover { text-decoration: underline; }
.import-form { display: grid; gap: 9px; margin-bottom: 8px; }
.import-form label { display: grid; gap: 6px; color: #c4cec6; font-size: 11px; }
.import-form input[type="file"] { font-size: 10px; }
.installer-manager { margin-bottom: 18px; padding: 20px; }
.installer-url { margin: -3px 0 14px; color: var(--muted); font-size: 10px; }
.installer-url code { color: #dce6de; }
.installer-warning { margin: 8px 0 14px; overflow-wrap: anywhere; }
.installer-link-form { display: grid; grid-template-columns: minmax(190px, 1.5fr) minmax(130px, .7fr) minmax(130px, .7fr) auto; align-items: end; gap: 10px; margin-bottom: 14px; }
.installer-link-form label { display: grid; gap: 6px; color: #c4cec6; font-size: 10px; }
.installer-link-form input, .installer-link-form select { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #34443a; border-radius: 4px; outline: none; background: #0d1410; color: var(--ink); font: 12px system-ui, sans-serif; }
.installer-link-form button:disabled { cursor: not-allowed; opacity: .45; }
.installer-table table { min-width: 720px; }
.installer-result { align-self: center; margin-top: 8vh; padding: 26px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.installer-result > p:not(.eyebrow) { color: var(--muted); font-size: 12px; }
.installer-result .result-summary { color: var(--ink) !important; }
.share-link { display: flex; gap: 7px; margin: 17px 0; }
.share-link input { flex: 1; min-width: 0; padding: 10px; border: 1px solid #34443a; border-radius: 4px; background: #0d1410; color: var(--ink); font: 11px ui-monospace, SFMono-Regular, monospace; }
.result-actions { display: flex; margin-top: 20px; }
.download-confirm { margin: 20px 0; }

@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 16px; }
  .brand-logo { height: 42px; max-width: 155px; }
  .account { gap: 10px; font-size: 10px; }
  .account > span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell { padding: 30px 16px 18px; }
  .page-heading { align-items: start; }
  .page-heading h1 { font-size: 28px; }
  .login-layout { grid-template-columns: 1fr; align-content: center; gap: 22px; max-width: 440px; }
  .login-intro h1 { font-size: 38px; }
  .login-line { margin-top: 20px; }
  .admin-grid, .form-row, .password-row { grid-template-columns: 1fr; }
  .installer-link-form { grid-template-columns: 1fr; }
  .assignment-form, .secret-controls { align-items: flex-start; flex-wrap: wrap; }
  .save-secret-form { flex-wrap: wrap; }
  .login-card { padding: 22px; }
  h1 { font-size: 29px; }
}
