/* ── reset & base ────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Courier New', 'Courier', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #ddd;
  background: #0d0618;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
  min-height: 100vh;
}

a {
  color: #87ceeb;
  text-decoration: none;
}
a:hover {
  color: #e891cf;
}

/* ── Win95 Chrome ────────────────────────────────── */
.win-chrome {
  max-width: 860px;
  width: 100%;
  background: #c0c0c0;
  border: 2px outset #dfdfdf;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #808080;
}

/* title bar */
.title-bar {
  background: linear-gradient(90deg, #1a0a2e, #5b2c8e);
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.title-bar-text {
  color: #e891cf;
  font-size: 12px;
  font-weight: bold;
}
.title-bar-controls {
  display: flex;
  gap: 2px;
}
.title-bar-controls span {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: 1px outset #dfdfdf;
  text-align: center;
  line-height: 12px;
  font-size: 10px;
  color: #333;
  cursor: default;
}

/* menu bar */
.menu-bar {
  background: #c0c0c0;
  padding: 2px 6px;
  border-bottom: 1px solid #808080;
  font-size: 11px;
  display: flex;
  gap: 10px;
}
.menu-bar a {
  color: #333;
  text-decoration: none;
}
.menu-bar a.active {
  color: #5b2c8e;
  font-weight: bold;
}
.menu-bar a:hover {
  color: #5b2c8e;
}

/* viewport (the inset area inside the window) */
.win-viewport {
  background: #1a0a2e;
  border: 2px inset #808080;
  margin: 2px;
  min-height: 400px;
}

/* status bar */
.status-bar {
  background: #c0c0c0;
  border-top: 1px solid #fff;
  padding: 3px 6px;
  font-size: 10px;
  color: #555;
  display: flex;
  justify-content: space-between;
}
.status-right {
  color: #e891cf;
}

/* mobile nav (hidden on desktop) */
.mobile-nav {
  display: none;
}

/* ── Page Content ────────────────────────────────── */
.page-content {
  padding: 16px 20px;
}

.page-header {
  border-bottom: 1px solid #5b2c8e;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.page-header h1 {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: normal;
  color: #e891cf;
  margin-bottom: 2px;
}
.page-header .subtitle {
  font-size: 11px;
  color: #87ceeb;
}

/* breadcrumbs */
.breadcrumb {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

/* ── Quick Links Table ───────────────────────────── */
.link-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid #5b2c8e;
  margin-bottom: 16px;
}
.link-table thead td {
  background: #2a1a3e;
  color: #e891cf;
  padding: 6px 10px;
  border-bottom: 1px solid #5b2c8e;
}
.link-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #2a1a3e;
}
.link-table .desc {
  color: #888;
}

/* ── Info Boxes ──────────────────────────────────── */
.info-box {
  background: #2a1a3e;
  border-left: 3px solid #e891cf;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.info-box.warning {
  border-left-color: #ffd700;
}
.info-box .info-title {
  font-size: 12px;
  color: #e891cf;
  margin-bottom: 4px;
}
.info-box.warning .info-title {
  color: #ffd700;
}
.info-box p {
  font-size: 12px;
  color: #bbb;
}

/* ── Forms (calculator inputs) ───────────────────── */
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 12px;
  color: #87ceeb;
  margin-bottom: 4px;
}
.form-input,
.form-select {
  width: 100%;
  background: #1a0a2e;
  border: 2px inset #5b2c8e;
  color: #ddd;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  padding: 6px 8px;
}
.form-select {
  appearance: none;
  cursor: pointer;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

/* win95 button */
.btn-win {
  display: inline-block;
  background: #c0c0c0;
  border: 2px outset #dfdfdf;
  padding: 4px 20px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  font-family: 'Courier New', monospace;
}
.btn-win:active {
  border-style: inset;
}

/* ── Calculator Panel ────────────────────────────── */
.calc-panel {
  background: #2a1a3e;
  border: 1px solid #5b2c8e;
  padding: 14px;
  margin-bottom: 16px;
}

/* result area (HTMX target) */
.calc-result {
  border-top: 1px dashed #5b2c8e;
  padding-top: 12px;
  margin-top: 12px;
}
.calc-result .result-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

/* result stats table */
.result-stats {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.result-stats td {
  padding: 3px 0;
}
.result-stats .stat-label {
  color: #888;
}
.result-stats .stat-value {
  text-align: right;
  color: #e891cf;
}
.result-stats .stat-value.alt {
  color: #87ceeb;
}

/* SVG chart container */
.chart-container {
  background: #1a0a2e;
  border: 1px solid #5b2c8e;
  padding: 8px;
}
.chart-container svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Footer ──────────────────────────────────────── */
.page-footer {
  border-top: 1px dashed #5b2c8e;
  padding-top: 8px;
  font-size: 10px;
  color: #888;
  display: flex;
  justify-content: space-between;
}
.page-footer .heart {
  color: #e891cf;
}

/* ── Checkbox groups ──────────────────────────────── */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 4px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #ccc;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  accent-color: #e891cf;
  cursor: pointer;
}

/* ── HTMX loading indicator ──────────────────────── */
.htmx-indicator {
  display: none;
  color: #87ceeb;
  font-size: 12px;
}
.htmx-request .htmx-indicator {
  display: inline;
}

/* ── Responsive: mobile ──────────────────────────── */
@media (max-width: 640px) {
  body {
    padding: 0;
  }

  /* strip the chrome */
  .win-chrome {
    background: none;
    border: none;
    box-shadow: none;
    max-width: 100%;
  }
  .title-bar,
  .menu-bar,
  .status-bar {
    display: none;
  }
  .win-viewport {
    border: none;
    margin: 0;
  }

  /* show mobile nav */
  .mobile-nav {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #5b2c8e;
    font-size: 12px;
    flex-wrap: wrap;
  }
  .mobile-nav a {
    color: #87ceeb;
    background: #2a1a3e;
    padding: 4px 8px;
    border: 1px solid #5b2c8e;
  }
  .mobile-nav a.active {
    color: #e891cf;
    border-color: #e891cf;
  }

  .page-content {
    padding: 14px 16px;
  }

  /* stack form rows on mobile */
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  /* quick links go single column */
  .link-table td {
    display: block;
    width: 100%;
  }
}
