/* Pockethernet brand: navy #0e1929 and gold #ad8104 from the wordmark, with the app's own
   palette (PEN/SW/APP/PENG/src/theme/palette.ts) for everything interactive, so this page and
   the Pockethernet 2 update page read as one family. Both palettes are contrast-checked there. */
:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e0e6ed;
  --text: #1a1a1a;
  --heading: #0e1929;
  --muted: #4a5568;
  --faint: #6b7280;
  --primary: #246fc5;
  --primary-strong: #1d5fa9;
  --primary-tint: #edf3fa;
  --primary-container: #d9e7f8;
  --on-primary: #ffffff;
  --ok: #27794b;
  --bad: #c53030;
  --bad-tint: #fbebea;
  --gold: #ad8104;
  --track: #e6ebf3;
  --shadow: 0 1px 2px rgba(14, 25, 41, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121212;
    --card: #171d23;
    --line: #2f3338;
    --text: #e5e7eb;
    --heading: #e5e7eb;
    --muted: #9ca3af;
    --faint: #8a94a3;
    --primary: #4a9ae8;
    --primary-strong: #7fb8f0;
    --primary-tint: #1b2834;
    --primary-container: #203448;
    /* The app's dark onPrimary: white on this blue would miss AA. */
    --on-primary: #0b1220;
    --ok: #3da06a;
    --bad: #e45c5c;
    --bad-tint: #2a1a1b;
    --gold: #c99a1f;
    --track: #2a2f36;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.shell {
  width: min(720px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

/* Header: the wordmark, then the gold hairline that carries the brand through the page. */
.hero {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--gold);
}

.brand img {
  display: block;
  width: 100%;
  max-width: 232px;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--heading);
  font-weight: 650;
}

h1 {
  margin-top: 18px;
  font-size: clamp(1.5rem, 3.6vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-sub {
  margin: 6px 0 0;
  color: var(--muted);
}

.hero-sub strong {
  color: var(--text);
}

h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

h3 {
  font-size: 1.05rem;
}

h4 {
  margin: 16px 0 4px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.panel {
  margin-top: 16px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.steps {
  margin: 0 0 18px;
  padding-left: 22px;
}

.steps li {
  margin: 5px 0;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.status-label,
.muted,
.note {
  color: var(--muted);
}

.note {
  font-size: 0.9rem;
  margin: 14px 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.actions-main,
.actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button,
input[type="file"] {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 22px;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.button-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--primary);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-tint);
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.action-hint {
  margin: 0 0 16px;
  min-height: 1.4em;
  font-weight: 600;
  color: var(--text);
}

.support-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  line-height: 1.45;
  font-size: 0.95rem;
}

.support-note:empty {
  display: none;
}

.note-info {
  background: var(--primary-tint);
  border-color: var(--primary-container);
  color: var(--muted);
}

.note-warning {
  background: var(--bad-tint);
  border-color: var(--bad);
  color: var(--bad);
  font-weight: 600;
}

.progress-block {
  display: grid;
  gap: 6px;
}

.progress-block label {
  font-size: 0.9rem;
  color: var(--muted);
}

progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--track);
}

progress::-webkit-progress-bar {
  background: var(--track);
}

progress::-webkit-progress-value {
  background: var(--primary);
}

progress::-moz-progress-bar {
  background: var(--primary);
}

/* Changelog */
.changelog .release {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.changelog .release:first-of-type {
  margin-top: 14px;
}

.release-date {
  margin-left: 8px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0;
}

.release-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.release ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.release li {
  margin: 5px 0;
}

.earlier dl {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 6px 12px;
  margin: 12px 0 0;
}

.earlier dt {
  font-weight: 650;
  color: var(--heading);
}

.earlier dd {
  margin: 0;
  color: var(--muted);
}

.file-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.file-picker {
  display: grid;
  gap: 8px;
}

.log {
  margin: 0;
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 10px;
  background: #0e1929;
  color: #e5e7eb;
  line-height: 1.45;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, monospace;
  font-size: 0.92em;
}

a {
  color: var(--primary);
}

.foot {
  margin-top: 24px;
  color: var(--faint);
  font-size: 0.88rem;
}

.foot p {
  margin: 0;
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 720px);
    padding-top: 22px;
  }

  .panel {
    padding: 16px;
  }

  .status-row {
    flex-direction: column;
    gap: 4px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-main,
  .actions-secondary {
    width: 100%;
  }

  .actions-main button,
  .actions-secondary button {
    flex: 1 1 auto;
  }

  .earlier dl {
    grid-template-columns: 2.8rem 1fr;
  }
}
