/* ================================================================
   1099 vs W-2 Take-Home Calculator — Windows 95/98 Retro Design
   Officina Systems Micro-Tool Family
   ================================================================ */

/* ─── PALETTE ──────────────────────────────────────────────────── */
:root {
  --face:      #c0c0c0;
  --desktop:   #008080;
  --black:     #000000;
  --white:     #ffffff;
  --dgray:     #808080;
  --lgray:     #dfdfdf;
  --nav:       #000080;
  --nav-end:   #1084d0;
  --nav-txt:   #ffffff;
  --text:      #000000;
  --text2:     #333333;
  --text3:     #666666;
  --green-win: #007000;
  --yellow-win:#a05800;
  --red-win:   #800000;
  --blue-win:  #000080;
  --inset-bg:  #ffffff;
  --info-bg:   #ffffcc;
  --w2-accent: #000060;
  --c99-accent:#600000;
}

/* ─── RESET ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--desktop);
  color: var(--text);
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--blue-win); }
a:hover { text-decoration: underline; }

/* ─── DESKTOP + PAGE WINDOW ────────────────────────────────────── */
.win-desktop {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
}
.page-window {
  background: var(--face);
  width: 100%;
  max-width: 940px;
  min-height: calc(100vh - 12px);
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 1px  1px 0 var(--white),
    inset -1px -1px 0 var(--black),
    inset 2px  2px 0 var(--lgray),
    inset -2px -2px 0 var(--dgray);
}

/* ─── TITLE BAR ────────────────────────────────────────────────── */
.win-titlebar {
  background: linear-gradient(90deg, var(--nav) 0%, var(--nav-end) 100%);
  color: var(--nav-txt);
  padding: 3px 4px 3px 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  flex-shrink: 0;
}
.win-title-icon { font-size: 13px; line-height: 1; flex-shrink: 0; }
.win-title-text {
  font-size: 11px;
  font-weight: bold;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.win-title-btns { display: flex; gap: 2px; flex-shrink: 0; }
.win-tbtn {
  width: 16px; height: 14px;
  background: var(--face);
  color: var(--black);
  border: none;
  font-size: 8px;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-weight: bold;
  line-height: 1;
  cursor: default;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  box-shadow:
    inset 1px  1px 0 var(--white),
    inset -1px -1px 0 var(--black),
    inset 2px  2px 0 var(--lgray),
    inset -2px -2px 0 var(--dgray);
}
.win-window-body { flex: 1; display: flex; flex-direction: column; }

/* ─── APP HEADER ────────────────────────────────────────────────── */
.app-header {
  padding: 12px 16px 10px;
  border-bottom: 2px solid;
  border-color: var(--dgray) var(--white) var(--white) var(--dgray);
  text-align: center;
  background: var(--face);
}
.brand-name {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: -0.3px;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
}
.brand-name em { color: var(--blue-win); font-style: normal; }
.brand-tag {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── CALC HERO ─────────────────────────────────────────────────── */
.calc-hero {
  text-align: center;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--dgray);
}
.calc-hero h1 {
  font-size: clamp(14px, 3.5vw, 20px);
  font-weight: bold;
  line-height: 1.3;
  color: var(--black);
  margin-bottom: 6px;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
}
.hero-sub {
  color: var(--text2);
  font-size: 11px;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ─── DUAL PANEL ─────────────────────────────────────────────────── */
.dual-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 12px;
  gap: 10px;
}
@media (min-width: 680px) {
  .dual-panel { grid-template-columns: 1fr 1fr; }
}

/* ─── CALC PANEL ────────────────────────────────────────────────── */
.calc-panel {
  background: var(--face);
  border: 2px solid;
  border-color: var(--dgray) var(--white) var(--white) var(--dgray);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Panel headers */
.panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  margin-bottom: 2px;
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.w2-header {
  background: var(--w2-accent);
  color: var(--white);
  box-shadow:
    inset 1px  1px 0 #4444aa,
    inset -1px -1px 0 #000040;
}
.c99-header {
  background: var(--c99-accent);
  color: var(--white);
  box-shadow:
    inset 1px  1px 0 #aa4444,
    inset -1px -1px 0 #400000;
}
.panel-icon { font-size: 14px; }
.section-sub {
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-win);
  border-top: 1px solid var(--dgray);
  padding-top: 8px;
  margin-top: 2px;
}

/* ─── INPUT ROWS ─────────────────────────────────────────────────── */
.input-row { display: flex; flex-direction: column; gap: 3px; }
.input-row label { font-size: 11px; font-weight: bold; color: var(--text); }

.input-row input,
.input-row select {
  background: var(--inset-bg);
  color: var(--text);
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 12px;
  padding: 3px 8px;
  width: 100%;
  height: 22px;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow:
    inset 1px  1px 0 var(--dgray),
    inset -1px -1px 0 var(--lgray),
    inset 2px  2px 0 var(--black),
    inset -2px -2px 0 var(--white);
}
.input-row input:focus,
.input-row select:focus {
  outline: 1px dotted var(--black);
  outline-offset: -3px;
}
.hint { font-size: 10px; color: var(--text3); line-height: 1.4; }

.prefix-wrap { position: relative; }
.prefix-wrap .prefix {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 12px; pointer-events: none; z-index: 1;
}
.prefix-wrap input { padding-left: 18px; }

.suffix-wrap { position: relative; }
.suffix-wrap .suffix {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 12px; pointer-events: none;
}
.suffix-wrap input { padding-right: 22px; }

/* ─── ADVANCED TOGGLE ───────────────────────────────────────────── */
.advanced-toggle {
  background: var(--face);
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 11px;
  padding: 4px 12px;
  text-align: left;
  box-shadow:
    inset 1px  1px 0 var(--white),
    inset -1px -1px 0 var(--black),
    inset 2px  2px 0 var(--lgray),
    inset -2px -2px 0 var(--dgray);
  margin-top: 4px;
}
.advanced-toggle:hover { background: var(--nav); color: var(--white); }
.advanced-toggle:active {
  box-shadow:
    inset 1px  1px 0 var(--black),
    inset -1px -1px 0 var(--white),
    inset 2px  2px 0 var(--dgray),
    inset -2px -2px 0 var(--lgray);
}
.advanced-section { display: none; }
.advanced-section.open { display: block; }

/* ─── STATE NOTICE ──────────────────────────────────────────────── */
.state-notice {
  display: none;
  background: var(--info-bg);
  border: 1px solid var(--dgray);
  color: var(--text2);
  font-size: 11px;
  margin-top: 4px;
  padding: 6px 10px;
  line-height: 1.5;
}
.state-notice.visible { display: block; }

/* ─── RESULTS PANEL ─────────────────────────────────────────────── */
.results-panel {
  display: none;
  margin: 0 12px 12px;
}
.results-panel.visible { display: block; }

/* ─── BIG METRICS ROW ────────────────────────────────────────────── */
.big-metrics-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
@media (min-width: 560px) {
  .big-metrics-row { grid-template-columns: repeat(3, 1fr); }
}

.big-metric-card {
  padding: 12px 12px 10px;
  text-align: center;
  box-shadow:
    inset 1px  1px 0 var(--dgray),
    inset -1px -1px 0 var(--lgray),
    inset 2px  2px 0 var(--black),
    inset -2px -2px 0 var(--white);
  background: var(--inset-bg);
}
.w2-card  { border-top: 3px solid var(--w2-accent); }
.comp-card { border-top: 3px solid var(--green-win); }
.c99-card { border-top: 3px solid var(--c99-accent); }
.c99-card { display: none; }
.c99-card.visible { display: block; }

.big-metric-label {
  font-size: 9px;
  font-weight: bold;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.big-metric {
  font-size: clamp(18px, 5vw, 28px);
  font-weight: bold;
  letter-spacing: -0.5px;
  margin: 2px 0;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
}
.big-metric.positive { color: var(--green-win); }
.big-metric.negative { color: var(--red-win); }
.big-metric-sub { font-size: 10px; color: var(--text3); margin-top: 2px; }

.diff-badge {
  display: none;
  font-size: 11px;
  font-weight: bold;
  margin-top: 4px;
  padding: 2px 6px;
}
.diff-badge.positive { color: var(--green-win); display: block; }
.diff-badge.negative { color: var(--red-win); display: block; }

/* ─── BREAKEVEN BANNER ──────────────────────────────────────────── */
.breakeven-banner {
  background: var(--face);
  padding: 12px 14px;
  margin: 0 0 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow:
    inset 1px  1px 0 var(--white),
    inset -1px -1px 0 var(--black),
    inset 2px  2px 0 var(--lgray),
    inset -2px -2px 0 var(--dgray);
}
.breakeven-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.breakeven-text h3 { font-size: 12px; font-weight: bold; margin-bottom: 3px; color: var(--black); }
.breakeven-text p { font-size: 11px; color: var(--text2); line-height: 1.5; margin-bottom: 6px; }
.breakeven-text p:last-child { margin-bottom: 0; }

/* ─── COMPARISON TABLE ──────────────────────────────────────────── */
.comparison-wrap {
  overflow-x: auto;
  box-shadow:
    inset 1px  1px 0 var(--dgray),
    inset -1px -1px 0 var(--lgray),
    inset 2px  2px 0 var(--black),
    inset -2px -2px 0 var(--white);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--inset-bg);
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
}
.comparison-table th {
  background: var(--face);
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 5px 10px;
  text-align: right;
  border-bottom: 2px solid var(--dgray);
  border-right: 1px solid var(--dgray);
}
.comparison-table th:first-child { text-align: left; }
.comparison-table th:last-child { border-right: none; }
.comparison-table th.w2-col  { color: var(--w2-accent);  }
.comparison-table th.c99-col { color: var(--c99-accent); }

.comparison-table td {
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text2);
  border-bottom: 1px solid var(--dgray);
  border-right: 1px solid #d0d0d0;
  text-align: right;
}
.comparison-table td:first-child {
  text-align: left;
  color: var(--text3);
  font-size: 10px;
}
.comparison-table td:last-child { border-right: none; }
.comparison-table tr:last-child td { border-bottom: none; }

.comparison-table .row-section-header td {
  background: var(--face);
  font-weight: bold;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text3);
  border-top: 2px solid var(--dgray);
  text-align: left;
  padding: 3px 10px;
  border-bottom: 1px solid var(--dgray);
}
.comparison-table .row-total td {
  font-weight: bold;
  color: var(--text);
  background: #e8e8e8;
  border-top: 2px solid var(--dgray);
}
.comparison-table .row-takehome td {
  font-weight: bold;
  font-size: 12px;
  background: #f0f0f0;
}

/* JS value classes */
.val-green  { color: var(--green-win)  !important; }
.val-red    { color: var(--red-win)    !important; }
.val-yellow { color: var(--yellow-win) !important; }
.text-muted { color: var(--text3)      !important; }

/* ─── BELOW FOLD ────────────────────────────────────────────────── */
.below-fold { padding: 0 14px 40px; }
.section-divider {
  border: none;
  border-top: 2px solid;
  border-color: var(--dgray) transparent transparent var(--dgray);
  box-shadow: 0 1px 0 var(--lgray);
  margin: 20px 0;
}

/* ─── EXPLAINER BLOCK ───────────────────────────────────────────── */
.explainer-block {
  background: var(--face);
  border: 2px solid;
  border-color: var(--dgray) var(--white) var(--white) var(--dgray);
  margin-bottom: 16px;
  overflow: hidden;
}
.explainer-block summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  padding: 8px 14px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  background: var(--face);
  user-select: none;
}
.explainer-block summary::-webkit-details-marker { display: none; }
.explainer-block summary:hover { background: var(--nav); color: var(--white); }
.explainer-block summary::after { content: "▼"; font-size: 9px; color: var(--dgray); }
.explainer-block summary:hover::after { color: var(--white); }
.explainer-block[open] summary::after { content: "▲"; }
.explainer-body {
  padding: 10px 14px 14px;
  color: var(--text2);
  font-size: 11px;
  line-height: 1.7;
  background: var(--inset-bg);
  border-top: 1px solid var(--dgray);
}
.explainer-body h3 {
  font-size: 11px;
  font-weight: bold;
  color: var(--text);
  margin: 10px 0 4px;
}
.explainer-body ul { padding-left: 16px; margin-top: 3px; }
.explainer-body ul li { margin-bottom: 3px; }

/* ─── SECTION TITLE ─────────────────────────────────────────────── */
.section-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ─── BREAKEVEN SECTION ─────────────────────────────────────────── */
.breakeven-section { margin-bottom: 20px; }
.breakeven-card {
  background: var(--face);
  padding: 14px 16px;
  box-shadow:
    inset 1px  1px 0 var(--white),
    inset -1px -1px 0 var(--black),
    inset 2px  2px 0 var(--lgray),
    inset -2px -2px 0 var(--dgray);
}
.breakeven-card h3 { font-size: 12px; font-weight: bold; margin-bottom: 8px; color: var(--black); }
.breakeven-card p { color: var(--text2); font-size: 11px; line-height: 1.6; margin-bottom: 8px; }
.breakeven-card ul { color: var(--text2); font-size: 11px; line-height: 1.7; padding-left: 16px; margin-bottom: 10px; }

/* ─── FAQ ───────────────────────────────────────────────────────── */
.faq-section { margin-bottom: 20px; }
.faq-item { border-bottom: 1px solid var(--dgray); }
.faq-question {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  text-align: left;
  width: 100%;
  gap: 10px;
  transition: background 0.05s;
}
.faq-question:hover { background: var(--nav); color: var(--white); padding-left: 8px; padding-right: 8px; }
.faq-question:hover .faq-arrow { color: var(--white); }
.faq-arrow { color: var(--dgray); flex-shrink: 0; font-size: 10px; transition: transform 0.18s; }
.faq-answer { overflow: hidden; max-height: 0; transition: max-height 0.25s ease-out; }
.faq-answer.open { max-height: 1200px; }
.faq-answer-inner {
  color: var(--text2); font-size: 11px; line-height: 1.7;
  padding: 8px 8px 12px;
  background: var(--inset-bg);
  border-top: 1px solid var(--dgray);
}
.faq-answer-inner strong { color: var(--text); }
.faq-answer-inner ul { padding-left: 16px; margin: 6px 0; }
.faq-answer-inner li { margin-bottom: 3px; }
.faq-answer-inner p { margin-bottom: 8px; }
.faq-answer-inner p:last-child { margin-bottom: 0; }

/* ─── CAVEAT BLOCK ──────────────────────────────────────────────── */
.caveat-block {
  background: #fff3cd;
  border: 1px solid var(--yellow-win);
  padding: 12px 14px;
  margin-bottom: 20px;
}
.caveat-block h3 { color: var(--yellow-win); font-size: 12px; font-weight: bold; margin-bottom: 8px; }
.caveat-block ul { padding-left: 16px; }
.caveat-block ul li { color: var(--text2); font-size: 11px; line-height: 1.6; margin-bottom: 4px; }

/* ─── SITE FOOTER ───────────────────────────────────────────────── */
.site-footer {
  border-top: 2px solid;
  border-color: var(--dgray) var(--white) var(--white) var(--dgray);
  color: var(--text3);
  font-size: 11px;
  margin-top: auto;
  padding: 10px 14px;
  text-align: center;
  background: var(--face);
}
.site-footer a { color: var(--text3); }
.site-footer a:hover { color: var(--blue-win); text-decoration: none; }

/* ─── AD SLOT ───────────────────────────────────────────────────── */
.ad-slot { min-height: 90px; text-align: center; padding: 6px 0; }

/* ─── COOKIE DIALOG ─────────────────────────────────────────────── */
.cookie-dialog {
  display: none;
  flex-direction: column;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, calc(100vw - 20px));
  background: var(--face);
  z-index: 999;
  box-shadow:
    inset 1px  1px 0 var(--white),
    inset -1px -1px 0 var(--black),
    inset 2px  2px 0 var(--lgray),
    inset -2px -2px 0 var(--dgray),
    4px 4px 8px rgba(0,0,0,0.5);
}
.cookie-dialog-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cookie-dialog-body p { font-size: 11px; color: var(--text); line-height: 1.5; }
.cookie-dialog-body p a { color: var(--blue-win); }
.cookie-dialog-btns { display: flex; justify-content: center; }
.win-button-ok {
  min-width: 75px; height: 23px; padding: 0 12px;
  background: var(--face); color: var(--text);
  font-size: 11px; font-weight: bold;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  border: none; cursor: pointer;
  box-shadow:
    inset 1px  1px 0 var(--white),
    inset -1px -1px 0 var(--black),
    inset 2px  2px 0 var(--lgray),
    inset -2px -2px 0 var(--dgray);
}
.win-button-ok:active {
  box-shadow:
    inset 1px  1px 0 var(--black),
    inset -1px -1px 0 var(--white),
    inset 2px  2px 0 var(--dgray),
    inset -2px -2px 0 var(--lgray);
  padding-top: 2px; padding-left: 14px;
}
.win-button-ok:focus { outline: 1px dotted var(--black); outline-offset: -4px; }

/* ─── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .win-title-text { font-size: 10px; }
  .calc-panel { padding: 10px; }
  .big-metric { font-size: 18px; }
  .comparison-table th,
  .comparison-table td { padding: 3px 6px; font-size: 10px; }
}
