:root {
  color-scheme: light;
  --ink: #141414;
  --muted: #62645f;
  --paper: #f7f4eb;
  --panel: #fffaf0;
  --line: #d8d0bd;
  --accent: #166156;
  --accent-2: #c6422d;
  --gold: #d59a24;
  --night: #202124;
  --good: #2f7c48;
  --warn: #b46a10;
  --bad: #af3025;
  --shadow: 0 22px 70px rgba(31, 28, 20, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(20, 20, 20, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 20, 20, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(214, 154, 36, 0.16), transparent 28%),
    var(--paper);
  background-size: 34px 34px, 34px 34px, auto, auto;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--gold);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: "Courier New", monospace;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.02;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: "Courier New", monospace;
}

.top-actions a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.76);
  text-decoration: none;
}

.account-menu {
  position: relative;
}

.account-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  padding: 7px 10px;
  font-family: "Courier New", monospace;
}

.account-button span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
}

.account-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 10;
  width: 245px;
  padding: 16px;
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--ink);
}

.account-popover[hidden] {
  display: none !important;
}

.account-popover strong,
.account-popover span {
  display: block;
  margin-bottom: 10px;
}

.hero-grid {
  min-height: 455px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 28px;
  align-items: stretch;
  padding: 38px 0 28px;
}

.hero-copy {
  padding: clamp(24px, 5vw, 56px);
  border: 2px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(22, 97, 86, 0.12), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy h2 {
  max-width: 860px;
  font-size: clamp(2.4rem, 7vw, 6rem);
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.button:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.secondary,
.button.ghost {
  background: var(--gold);
  color: var(--ink);
}

.button.danger {
  background: var(--accent-2);
  color: #fff;
}

.status-panel,
.panel,
.metric-card {
  border: 2px solid var(--ink);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.status-panel {
  display: grid;
  align-content: end;
  padding: 24px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(20, 20, 20, 0.12), rgba(20, 20, 20, 0.82)),
    repeating-linear-gradient(135deg, #166156 0 16px, #1d7569 16px 32px);
}

.status-panel strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.label,
.metric-card span,
label,
th {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meter {
  height: 16px;
  margin: 20px 0;
  border: 2px solid #fff;
  background: rgba(255, 255, 255, 0.18);
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 0.35s ease;
}

.control-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 28px;
  padding: 18px;
  border: 2px solid var(--ink);
  background: var(--night);
  color: #fff;
}

label {
  display: grid;
  gap: 8px;
}

input,
textarea {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fffdf7;
  color: var(--ink);
  padding: 12px;
  outline-offset: 3px;
}

textarea {
  resize: vertical;
  min-height: 130px;
}

.layout-two,
.dashboard-grid,
.metrics-grid {
  display: grid;
  gap: 18px;
  margin: 18px 0;
}

.layout-two,
.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.metric-card {
  padding: 22px;
}

.panel h2 {
  font-size: 1.75rem;
  line-height: 1.08;
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}

.drop-zone {
  min-height: 196px;
  place-items: center;
  text-align: center;
  border: 2px dashed var(--ink);
  background: rgba(214, 154, 36, 0.12);
  cursor: pointer;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.drop-zone small,
.muted,
.fine-print,
.metric-card small {
  color: var(--muted);
  line-height: 1.5;
}

.paste-box {
  margin-top: 16px;
}

.paste-box summary {
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-weight: 800;
}

.paste-box textarea {
  margin: 12px 0;
}

.import-log {
  margin-top: 14px;
  color: var(--muted);
  min-height: 24px;
}

.import-actions {
  margin-top: 14px;
}

.import-preview {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.cloud-auth-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.compact-heading {
  margin-bottom: 0;
}

.compact-heading h2 {
  font-size: 1.25rem;
}

.cloud-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, max-content);
  gap: 10px;
  align-items: stretch;
}

.cloud-vault-list {
  display: grid;
  gap: 10px;
}

.cloud-vault-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf7;
}

.cloud-vault-row strong,
.cloud-vault-row span {
  display: block;
}

.cloud-vault-row span {
  color: var(--muted);
  font-size: 0.92rem;
}

.danger-mini {
  background: rgba(198, 66, 45, 0.14);
}

.quality-card {
  padding: 14px;
  border: 2px solid var(--ink);
  background: #fffdf7;
}

.quality-card strong {
  display: block;
  margin: 6px 0;
  font-size: 1.7rem;
}

.quality-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.compact-table table {
  min-width: 480px;
}

.compact-table td,
.compact-table th {
  padding: 9px 8px;
  font-size: 0.92rem;
}

.metric-card {
  min-height: 142px;
  display: grid;
  align-content: space-between;
}

.metric-card strong {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.bars,
.recommendations,
.subscription-list,
.asset-list,
.leak-radar {
  display: grid;
  gap: 12px;
}

.bar-item {
  display: grid;
  gap: 7px;
}

.bar-head,
.asset-row,
.sub-row,
.leak-card,
.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar-track {
  height: 14px;
  border: 1px solid var(--ink);
  background: #fff;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.35s ease;
}

.recommendation,
.sub-row,
.asset-row,
.leak-card,
.assistant-card,
.result-box,
.forecast-box {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf7;
}

.recommendation strong,
.sub-row strong {
  display: block;
  margin-bottom: 4px;
}

.recommendation p,
.sub-row p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.attention-panel {
  background:
    linear-gradient(135deg, rgba(198, 66, 45, 0.12), transparent 42%),
    rgba(255, 250, 240, 0.94);
}

.leak-card {
  align-items: flex-start;
}

.leak-card p,
.assistant-card p,
.result-box p,
.forecast-box p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.rank {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--gold);
  font-family: "Courier New", monospace;
  font-weight: 900;
}

.pill,
.mini-button,
.plan-badge,
.lock-label {
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pill {
  padding: 6px 8px;
  white-space: nowrap;
}

.pill.good {
  background: rgba(47, 124, 72, 0.15);
}

.pill.warn {
  background: rgba(180, 106, 16, 0.18);
}

.pill.bad {
  background: rgba(175, 48, 37, 0.18);
}

.mini-button {
  min-height: 32px;
  padding: 6px 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.is-locked {
  position: relative;
}

.is-locked:not(.gated-action) {
  opacity: 0.82;
}

.lock-label,
.plan-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 7px;
  background: rgba(198, 66, 45, 0.12);
}

.plan-badge.plus {
  background: rgba(22, 97, 86, 0.14);
}

.split-meter {
  height: 24px;
  display: flex;
  border: 2px solid var(--ink);
  background: #fff;
}

.split-meter span {
  min-width: 2px;
}

.split-meter .fixed {
  background: var(--accent-2);
}

.split-meter .variable {
  background: var(--accent);
}

.split-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.split-legend div,
.trust-list li {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf7;
}

.split-legend strong,
.split-legend span {
  display: block;
}

.forecast-box strong {
  display: block;
  margin: 6px 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.forecast-box.good {
  border-color: var(--good);
}

.forecast-box.warn {
  border-color: var(--warn);
}

.forecast-box.bad {
  border-color: var(--bad);
}

.wish-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.45fr);
  gap: 10px;
  margin-bottom: 12px;
}

.setup-card,
.rule-row,
.roadmap-item,
.launch-item {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf7;
}

.setup-card strong,
.setup-card span,
.rule-row strong,
.rule-row span {
  display: block;
}

.setup-card p,
.roadmap-item p,
.launch-item p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.rule-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.45fr);
  gap: 10px;
}

.rule-form .button {
  grid-column: 1 / -1;
}

.rule-list,
.roadmap-list,
.launch-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.security-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 2px solid var(--ink);
  background: var(--night);
  color: #fff;
}

.security-score strong {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.security-score span,
.roadmap-item span {
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
}

.roadmap-item span {
  width: fit-content;
  height: fit-content;
  padding: 5px 7px;
  border: 1px solid var(--ink);
  background: rgba(22, 97, 86, 0.13);
}

.onboarding-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.assistant-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.55fr);
  gap: 16px;
}

.assistant-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.assistant-card dt {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.assistant-card dd {
  margin: 0;
  font-weight: 800;
}

.week-check {
  margin: 0;
  padding-left: 22px;
}

.week-check li {
  margin: 0 0 10px;
  line-height: 1.45;
}

.trust-list {
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.stack-plans {
  grid-template-columns: 1fr;
}

.pricing-plans div {
  position: relative;
  display: grid;
  gap: 6px;
}

.product-panel {
  background:
    linear-gradient(135deg, rgba(22, 97, 86, 0.13), transparent 44%),
    rgba(255, 250, 240, 0.94);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.feature-tile {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--ink);
  background: #fffdf7;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.feature-tile strong,
.feature-tile span {
  display: block;
}

.feature-tile span {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.waitlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

select {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fffdf7;
  color: var(--ink);
  padding: 12px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.report-preview article {
  padding: 18px;
  border: 2px solid var(--ink);
  background: #fffdf7;
}

.report-preview strong {
  display: block;
  margin: 8px 0;
  font-size: 1.3rem;
}

.report-preview ul {
  margin: 0;
  padding-left: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 20, 20, 0.45);
}

.modal-backdrop[hidden],
.modal-backdrop.is-hidden {
  display: none !important;
  pointer-events: none;
}

.upgrade-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--ink);
  padding: 26px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  background: var(--accent-2);
  color: #fff;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-weight: 900;
}

.upgrade-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.upgrade-list span {
  padding: 10px;
  border: 1px solid var(--line);
  background: #fffdf7;
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .hero-grid,
  .control-band,
  #upload,
  .button,
  .modal-backdrop {
    display: none !important;
  }

  .app-shell {
    width: 100%;
  }

  .panel,
  .metric-card {
    box-shadow: none;
    break-inside: avoid;
  }
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

td:last-child,
th:last-child {
  text-align: right;
}

.asset-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.45fr) 48px;
  gap: 10px;
  margin-bottom: 14px;
}

.asset-form .button {
  padding: 0;
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.plans div {
  padding: 16px;
  border: 2px solid var(--ink);
  background: #fffdf7;
}

.plans strong,
.plans span,
.plans small {
  display: block;
}

.plans span {
  margin: 6px 0;
  font-size: 1.35rem;
  font-weight: 800;
}

#cancelTemplate {
  min-height: 310px;
  font-family: "Courier New", monospace;
  line-height: 1.48;
}

@media (max-width: 900px) {
  .topbar,
  .hero-grid,
  .layout-two,
  .dashboard-grid,
  .control-band {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    padding: 18px 0;
  }

  .top-actions {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar,
  .top-actions,
  .account-menu,
  .hero-actions,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .account-popover {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .metrics-grid,
  .plans,
  .feature-grid,
  .cloud-grid,
  .rule-form,
  .roadmap-item,
  .split-legend,
  .assistant-card,
  .wish-form,
  .asset-form {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 22px;
  }
}
