:root {
  color-scheme: light;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 16px;
  --stc-orange: #ee7520;
  --stc-black: #040606;
  --desktop-teal: #087d78;
  --win-grey: #c7c7c7;
  --win-light: #ffffff;
  --win-mid: #868686;
  --win-dark: #2b2b2b;
  --paper: #f4f2ed;
  --danger: #b51f16;
  --success: #087b35;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--stc-black);
  background: var(--desktop-teal);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.desktop-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.system-bar {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 10px;
  color: var(--win-light);
  background: var(--stc-black);
  border: 2px solid var(--win-light);
  border-right-color: var(--win-dark);
  border-bottom-color: var(--win-dark);
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.system-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-led,
.result-led {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid var(--win-light);
  background: #23d95d;
}

.ticker {
  height: 29px;
  margin: 8px 0;
  overflow: hidden;
  color: var(--stc-black);
  background: #ffd900;
  border: 2px inset var(--win-grey);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 25px;
  white-space: nowrap;
  contain: inline-size;
}

.ticker-track {
  width: max-content;
  padding-left: 100%;
  animation: ticker-scroll 24s linear infinite;
}

@keyframes ticker-scroll {
  to { transform: translateX(-100%); }
}

.window {
  background: var(--win-grey);
  border: 3px solid var(--win-light);
  border-right-color: var(--win-dark);
  border-bottom-color: var(--win-dark);
  box-shadow: 8px 8px 0 rgba(4, 6, 6, 0.38);
}

.window-titlebar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 5px 4px 10px;
  color: var(--win-light);
  background: var(--stc-orange);
  font-weight: 700;
}

.window-controls {
  display: flex;
  gap: 3px;
}

.window-controls span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--stc-black);
  background: var(--win-grey);
  border: 2px solid var(--win-light);
  border-right-color: var(--win-dark);
  border-bottom-color: var(--win-dark);
  font-size: 0.8rem;
  line-height: 1;
}

.window-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 22px;
  padding: 24px;
  background: var(--paper);
  border: 2px inset var(--win-grey);
}

.brand-panel {
  min-width: 0;
  padding: 8px 14px 8px 6px;
}

.brand-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin-bottom: 18px;
}

.edition-label {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 7px;
  color: var(--win-light);
  background: var(--stc-black);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 650px;
  margin-bottom: 12px;
  font-size: 2rem;
  line-height: 1.12;
}

.intro-copy {
  max-width: 660px;
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.55;
}

code {
  padding: 1px 4px;
  color: var(--stc-orange);
  background: var(--stc-black);
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.notice-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: center;
  max-width: 680px;
  margin-bottom: 20px;
  padding: 11px 12px;
  background: #fff3e9;
  border: 2px solid var(--stc-orange);
}

.notice-box strong {
  color: var(--stc-orange);
  font-family: "Courier New", monospace;
}

.notice-box span {
  line-height: 1.35;
}

.machine-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 2px inset var(--win-grey);
}

.machine-stats div {
  min-width: 0;
  padding: 8px;
  background: var(--stc-black);
  border-right: 1px solid #5a5a5a;
}

.machine-stats div:last-child {
  border-right: 0;
}

.machine-stats dt {
  margin-bottom: 4px;
  color: #aaa;
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.machine-stats dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #72ff73;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
}

.login-panel {
  align-self: start;
  min-width: 0;
  padding: 14px;
  background: var(--win-grey);
  border: 3px solid var(--win-light);
  border-right-color: var(--win-dark);
  border-bottom-color: var(--win-dark);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px groove var(--win-grey);
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.pixel-key {
  display: grid;
  width: 38px;
  height: 28px;
  place-items: center;
  color: var(--stc-black);
  background: #ffd900;
  border: 2px solid var(--win-dark);
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  font-weight: 700;
}

form {
  display: grid;
  gap: 7px;
}

label {
  margin-top: 4px;
  font-size: 0.84rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 38px;
  padding: 7px 8px;
  color: var(--stc-black);
  background: var(--win-light);
  border: 3px solid var(--win-dark);
  border-right-color: var(--win-light);
  border-bottom-color: var(--win-light);
  border-radius: 0;
  outline: 0;
}

input:focus {
  box-shadow: 0 0 0 2px var(--stc-orange);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

button {
  min-height: 40px;
  padding: 7px 12px;
  color: var(--stc-black);
  background: var(--win-grey);
  border: 3px solid var(--win-light);
  border-right-color: var(--win-dark);
  border-bottom-color: var(--win-dark);
  border-radius: 0;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: #dedede;
  outline: 2px dotted var(--stc-black);
  outline-offset: -6px;
}

button:active {
  border-color: var(--win-dark) var(--win-light) var(--win-light) var(--win-dark);
}

button:disabled {
  color: var(--win-mid);
  cursor: wait;
}

#login-button {
  color: var(--win-light);
  background: var(--stc-orange);
}

.result-panel {
  margin-top: 16px;
  padding: 10px;
  background: var(--win-light);
  border: 3px inset var(--win-grey);
}

.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.result-led {
  background: var(--danger);
  border-color: var(--win-dark);
}

.result-panel.success .result-led {
  background: var(--success);
}

.result-panel p {
  margin-bottom: 0;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}

#profile-data {
  margin: 10px 0 0;
  border-top: 1px dotted var(--win-dark);
}

#profile-data div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  padding-top: 7px;
}

#profile-data dt {
  font-size: 0.72rem;
  font-weight: 700;
}

#profile-data dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
}

.support-line {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px dotted var(--win-mid);
  color: #515151;
  font-size: 0.72rem;
  text-align: center;
}

.window-statusbar {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 9px;
  border-top: 2px solid var(--win-light);
  font-size: 0.7rem;
}

@media (max-width: 760px) {
  .desktop-shell {
    padding: 8px;
  }

  .system-bar,
  .window-statusbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .window-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 15px;
  }

  .brand-panel {
    padding-right: 0;
  }

  .machine-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .machine-stats div {
    border-right: 0;
    border-bottom: 1px solid #5a5a5a;
  }

  .machine-stats div:last-child {
    border-bottom: 0;
  }

  .notice-box {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    padding-left: 8px;
    animation: none;
  }
}
