:root {
  color-scheme: dark;
  --accent: #c42cff;
  --accent-soft: rgba(196, 44, 255, .16);
  --paper: #f8f3fa;
  --muted: #9e96a4;
  --panel: rgba(20, 17, 24, .94);
  --line: #514a58;
  --success: #5cffbc;
  --danger: #ff4e83;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  margin: 0;
  color: var(--paper);
  background: #070609;
  font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  font-weight: 400;
}

body { min-width: 320px; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 14% 22%, rgba(196,44,255,.22), transparent 28%),
    radial-gradient(circle at 84% 72%, rgba(88,20,115,.18), transparent 27%),
    linear-gradient(145deg, #08070a, #110d15 48%, #070609);
}

.background::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .15;
  background-image: radial-gradient(circle, rgba(255,255,255,.48) 0 1px, transparent 1.25px);
  background-size: 10px 10px;
  mask-image: linear-gradient(115deg, transparent 10%, #000 50%, transparent 92%);
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(28,24,32,.97), rgba(11,9,13,.97));
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .18;
  background:
    radial-gradient(circle at 92% 8%, rgba(196,44,255,.35), transparent 26%),
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.018) 8px 9px);
}

.panel > * { position: relative; z-index: 1; }
.kicker { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 1.7px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(28px, 4.8vw, 54px); font-weight: 500; line-height: .95; letter-spacing: .6px; }
h2 { margin: 5px 0 0; font-size: 21px; font-weight: 550; letter-spacing: .5px; }

.mark {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 2px solid var(--accent);
  border-radius: 23px;
  color: white;
  background: linear-gradient(145deg, #5f087f, #17101c);
  box-shadow: 0 0 30px rgba(196,44,255,.28);
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -3px;
  transform: rotate(-4deg);
}

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(470px, 100%); padding: 42px; text-align: center; }
.login-card h1 { margin: 8px 0 13px; font-size: 36px; }
.login-card p { margin-bottom: 28px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-card form { display: grid; gap: 10px; text-align: left; }

label { color: #c9c1cc; font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.size-badge { margin-left: 5px; color: var(--accent); font-size: 9px; white-space: nowrap; }
.field-hint { color: var(--muted); font-size: 9px; line-height: 1.35; }
input, textarea {
  width: 100%;
  border: 1px solid #514a58;
  border-radius: 11px;
  outline: 0;
  padding: 12px 13px;
  color: white;
  background: #0a080c;
  font-size: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { resize: vertical; line-height: 1.45; }
input[type="file"] { padding: 9px; color: var(--muted); }
input::file-selector-button {
  margin-right: 10px;
  border: 1px solid #62596a;
  border-radius: 8px;
  padding: 7px 10px;
  color: white;
  background: #24182a;
  font-size: 10px;
  cursor: pointer;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,44,255,.1); }

.primary-button, .ghost-button, .danger-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  padding: 0 15px;
  color: white;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .8px;
  text-decoration: none;
  cursor: pointer;
}
.primary-button { border: 1px solid #d060ff; background: linear-gradient(135deg, #9a18d2, #560875); }
.primary-button:hover { filter: brightness(1.12); }
.primary-button:disabled, .ghost-button:disabled { cursor: wait; opacity: .45; }
.ghost-button { border: 1px solid #5b5361; color: #d6ced9; background: rgba(255,255,255,.025); }
.ghost-button:hover { border-color: var(--accent); color: white; }
.danger-button { border: 1px solid rgba(255,78,131,.62); color: #ffd7e4; background: rgba(255,78,131,.09); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #332e37;
  padding: 0 max(22px, calc((100vw - 1240px) / 2));
  background: rgba(7,6,9,.9);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand > div:last-child { display: grid; gap: 4px; }
.brand strong { font-size: 13px; font-weight: 600; letter-spacing: .9px; }
.small-mark { width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: 14px; }
.topbar-actions { display: flex; gap: 8px; }

.workspace { width: min(1240px, calc(100% - 34px)); margin: 0 auto; padding: 28px 0 54px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px 30px; }
.hero h1 { max-width: 780px; margin-top: 7px; font-size: clamp(30px, 5vw, 58px); }
.hero p { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.hero-status { min-width: 220px; display: grid; grid-template-columns: 12px 1fr; gap: 4px 9px; align-items: center; }
.hero-status i { width: 10px; height: 10px; grid-row: span 2; border-radius: 50%; background: var(--success); box-shadow: 0 0 17px var(--success); }
.hero-status span { color: #d8d1db; font-size: 10px; font-weight: 650; letter-spacing: .8px; }
.hero-status strong { color: var(--muted); font-size: 10px; font-weight: 400; }

.message { margin-top: 14px; border-radius: 12px; padding: 12px 14px; font-size: 12px; }
.error-message { border: 1px solid rgba(255,78,131,.6); color: #ffd7e4; background: rgba(255,78,131,.1); }
.success-message { border: 1px solid rgba(92,255,188,.38); color: #c9ffe8; background: rgba(92,255,188,.07); }

.grid { display: grid; gap: 14px; margin-top: 14px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.card { padding: 24px; scroll-margin-top:90px; }
.card-heading { position: relative; min-height: 63px; border-bottom: 1px solid #3b3540; margin-bottom: 19px; padding-bottom: 15px; }
.number { position: absolute; top: -18px; right: 0; color: rgba(255,255,255,.045); font-size: 68px; font-weight: 700; line-height: 1; }
.stack-form { display: grid; gap: 8px; }
.stack-form .primary-button { margin-top: 8px; }
.current-update { margin-bottom: 15px; }
.empty-state { border: 1px dashed #4a434f; border-radius: 11px; padding: 13px; color: var(--muted); font-size: 11px; }
.update-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border: 1px solid rgba(92,255,188,.28); border-radius: 12px; padding: 13px; background: rgba(92,255,188,.045); }
.update-summary > span { display: grid; gap: 4px; min-width: 0; }
.update-summary strong { color: var(--success); font-size: 15px; }
.update-summary small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.update-summary button { min-height: 34px; }

.progress { position: relative; height: 34px; overflow: hidden; border: 1px solid #5c5362; border-radius: 10px; background: #0a080c; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #6e0b96, var(--accent)); transition: width .18s ease; }
.progress span { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; font-size: 10px; font-weight: 650; }

.banners-card { margin-top: 14px; }
.horizontal-heading { display: flex; justify-content: space-between; gap: 20px; }
.banner-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.banner-heading-actions .ghost-button { white-space: nowrap; }
.counter { align-self: flex-start; border: 1px solid #5f5766; border-radius: 10px; padding: 9px 12px; color: #d8d0db; font-size: 11px; }
.banner-form { display: grid; grid-template-columns: 1.2fr .9fr .9fr 1.2fr auto; align-items: start; gap: 9px; }
.banner-form > div { display: grid; gap: 7px; min-width: 0; }
.banner-form .primary-button { align-self: end; }
.banner-list { display: grid; gap: 10px; margin-top: 18px; }
.banner-empty { border: 1px dashed #4a434f; border-radius: 13px; padding: 24px; color: var(--muted); font-size: 11px; text-align: center; }
.banner-item { display: grid; grid-template-columns: 220px minmax(0,1fr) auto; gap: 15px; align-items: center; border: 1px solid #443e49; border-radius: 13px; padding: 9px; background: rgba(0,0,0,.2); }
.banner-item img { width: 100%; max-width: 220px; height: auto; aspect-ratio: 15 / 1; border-radius: 4px; object-fit: contain; object-position: center; background: #050406; }
.banner-copy { min-width: 0; display: grid; gap: 5px; }
.banner-copy strong, .banner-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner-copy strong { font-size: 12px; font-weight: 600; }
.banner-copy span { color: var(--muted); font-size: 10px; }
.banner-actions { display: flex; gap: 6px; }
.icon-button { width: 34px; height: 34px; border: 1px solid #554d5b; border-radius: 9px; color: white; background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--accent); }
.icon-button.delete:hover { border-color: var(--danger); color: #ff9cba; }

.manifest-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-top: 14px; padding: 24px; }
.manifest-card p { margin: 8px 0 0; color: var(--muted); font-family: Consolas, monospace; font-size: 10px; word-break: break-all; }
.manifest-card pre { grid-column: 1 / -1; max-height: 320px; overflow: auto; margin: 0; border: 1px solid #413a46; border-radius: 12px; padding: 15px; color: #d8c9de; background: #08060a; font: 10px/1.55 Consolas, monospace; }

@media (max-width: 1040px) {
  .two-columns { grid-template-columns: 1fr; }
  .banner-form { grid-template-columns: 1fr 1fr; }
  .banner-form .primary-button { min-height: 44px; }
}

@media (max-width: 720px) {
  .topbar { height: auto; align-items: flex-start; padding: 13px 16px; }
  .brand strong, .brand .kicker { display: none; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .topbar-actions .ghost-button { min-height: 38px; padding: 0 10px; font-size: 9px; }
  .workspace { width: min(100% - 20px, 1240px); padding-top: 10px; }
  .hero { display: grid; padding: 22px; }
  .hero-status { min-width: 0; }
  .card { padding: 18px; }
  .banner-form { grid-template-columns: 1fr; }
  .banner-item { grid-template-columns: 1fr; }
  .banner-item img { width: 100%; max-width: none; height: auto; }
  .banner-actions { justify-content: flex-end; }
  .manifest-card { grid-template-columns: 1fr; align-items: stretch; padding: 18px; }
  .manifest-card pre { grid-column: auto; }
  .login-card { padding: 29px 22px; }
}
:root { --stats-accent: #c5a2ff; }
.client-statistics { margin: 18px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.stats-grid > div { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid #45334f; border-radius: 12px; background: #201628; }
.stats-grid strong { font-size: 30px; color: var(--stats-accent); font-weight: 500; }
.stats-grid span { font-size: 12px; color: #b3a7bb; }
.client-versions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.version-badge { padding: 6px 10px; border-radius: 8px; background: #2c2136; color: #d5c3e4; font-size: 12px; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Text is rendered as textContent, never as HTML from a submitted ticket. */
.feedback-list { display: grid; gap: 12px; margin-top: 16px; }
.feedback-ticket { display: grid; gap: 9px; padding: 16px; border: 1px solid #403448; border-radius: 12px; }
.feedback-ticket small { color: #a99cb3; overflow-wrap: anywhere; }
.feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.feedback-diagnostic { white-space: pre-wrap; font-size: 11px; }
.feedback-ticket select { width: 180px; }
.feedback-logs summary { padding:8px 0;color:#cba8f8;cursor:pointer; }
.feedback-log-text { max-height:360px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.5 Consolas,monospace;color:#d1c4df;background:#100d16;border-radius:9px;padding:12px; }
select {font:inherit;color:var(--paper);background:#0a080c;border:1px solid var(--line);border-radius:9px;padding:10px;max-width:100%;}
.management-actions {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:14px 0;}
.management-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:end;}
.management-grid>div,.management-grid>label {display:grid;gap:6px;min-width:0;}
.check-label {display:flex;align-items:center;gap:9px;font-size:12px;letter-spacing:0;}
.check-label input {width:16px;height:16px;accent-color:var(--accent);}
#announcementsCard,#securityCard {margin-top:14px;}
.field-hint {font-size:11px;line-height:1.55;}
.banner-form {grid-template-columns:repeat(3,minmax(0,1fr));}
.banner-schedule,.banner-preview {grid-column:1/-1;}
.banner-schedule small {grid-column:1/-1;}
.banner-preview {border-top:1px solid var(--line);padding-top:10px;}
.banner-preview summary {cursor:pointer;font-size:12px;}
.preview-normal,.preview-compact {margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:12px;background:#090916;}
.preview-normal img {max-width:none;display:block;margin-top:10px;}
.preview-compact {max-width:300px;min-height:100px;}
.management-table {max-height:380px;overflow:auto;}
.management-table table {border-collapse:collapse;width:100%;font-size:12px;}
.management-table th,.management-table td {text-align:left;border-bottom:1px solid #38303f;padding:10px;overflow-wrap:anywhere;}
.management-table th {color:var(--muted);}
.management-row {display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid var(--line);padding:12px;border-radius:10px;font-size:12px;}
.management-row a {font-size:10px;}
.factor-setup {display:grid;gap:12px;margin:18px 0;padding:18px;border:1px solid var(--line);border-radius:12px;max-width:440px;}
.factor-setup code {overflow-wrap:anywhere;font-size:14px;user-select:all;}
#recoveryCodes {white-space:pre-wrap;user-select:all;line-height:1.7;}
.danger {color:var(--danger);border-color:var(--danger);}
#securityCard h3 {margin:28px 0 12px;font-size:14px;}
button:focus-visible,select:focus-visible,a:focus-visible {outline:2px solid var(--accent);outline-offset:3px;}
@media(max-width:720px){.management-grid,.banner-form{grid-template-columns:1fr;}.management-row{align-items:flex-start;flex-direction:column;}}
