:root {
  --bg: #05100a;
  --panel: #0a1c12;
  --line: #1d4d33;
  --text: #baf7cf;
  --dim: #31b0d8;
  --green: #39ff8f;
  --amber: #ffcb47;
  --magenta: #ff6ec7;
  --warn: #ff4d5e;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  padding: 40px 16px;
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

/* ---- index.html ---- */
.landing {
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.landing h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--green);
  text-shadow: 0 0 8px rgba(57, 255, 143, 0.45);
  letter-spacing: 0.02em;
}
.landing .sub {
  color: var(--dim);
  font-size: 0.9rem;
  margin-bottom: 32px;
}
.landing .sub::before {
  content: '> ';
  color: var(--green);
}
.landing a.status-link:not(:last-child) {
  margin-bottom: 20px;
}
.landing a.status-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  background: var(--panel);
  transition: border-color 0.15s ease;
}
.landing a.status-link:hover {
  border-color: var(--green);
}
.landing a.status-link::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- shared "windowed" page shell: status.html / details.html / document.html ---- */
.page {
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.titlebar {
  display: flex;
  align-items: center;
  padding: 6px 6px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: #071409;
  position: relative;
}
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 1;
}
.back-link:hover {
  color: var(--green);
  background: rgba(57, 255, 143, 0.08);
}
.titlebar h1 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dim);
  margin: 0;
  letter-spacing: 0.05em;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  background: var(--panel);
  align-items: start;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #081a10;
  min-width: 0;
  height: 120px;
  container-type: inline-size;
}

.label {
  font-size: 0.85rem;
  color: var(--dim);
}

.value {
  font-size: clamp(0.85rem, 4.5cqi, 1.4rem);
  font-weight: 600;
  color: var(--text);
  white-space: normal;
  overflow-wrap: break-word;
}

.bar-wrap {
  background: #04140a;
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.bar.warn { background: var(--warn); }

.card.no-bar .value { font-size: 1.2rem; }

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing a.status-link::before {
    animation: none;
  }
}

/* ---- document.html: lock screen ---- */
.lock-page {
  display: none;
  max-width: 420px;
  width: 100%;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.lock-page.show { display: flex; }
.lock-panel {
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  background: var(--panel);
}
.lock-panel .sub {
  color: var(--dim);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.lock-form {
  display: flex;
  gap: 8px;
  width: 100%;
}
.lock-form input[type="password"] {
  flex: 1;
  padding: 12px 14px;
  background: #04140a;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.lock-form input[type="password"]:focus {
  outline: none;
  border-color: var(--green);
}
.lock-form button {
  padding: 12px 20px;
  background: #081a10;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--green);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.lock-form button:hover {
  border-color: var(--green);
}
.lock-error {
  color: var(--warn);
  font-size: 0.85rem;
  margin-top: 14px;
  min-height: 1.2em;
}
.lock-error:empty {
  margin-top: 0;
  min-height: 0;
}

/* ---- document.html: unlocked content ---- */
.doc-page {
  display: none;
  max-width: 640px;
  width: 100%;
}
.doc-page.show { display: flex; }
.doc-content {
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  background: var(--panel);
  padding: 28px 30px;
  line-height: 1.6;
  font-size: 0.95rem;
}
.doc-content h2 {
  color: var(--green);
  font-size: 1.1rem;
  margin-top: 0;
}
.doc-content p {
  margin: 0 0 14px;
}
