:root {
  color-scheme: light;
  --ink: #1d252c;
  --muted: #5f6f7a;
  --line: #d7e0e6;
  --panel: #ffffff;
  --soft: #f3f7f8;
  --accent: #0f8b8d;
  --accent-dark: #0a6569;
  --warm: #f4a340;
  --danger: #cf3f32;
  --good: #27865d;
  --shadow: 0 16px 36px rgba(26, 45, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #e9f0ef;
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

.tool-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: end;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.12), transparent 55%),
    var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: 0;
  line-height: 1.12;
}

.lead {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-meter {
  display: grid;
  gap: 8px;
  align-content: center;
  min-height: 140px;
  padding: 20px;
  border: 1px solid rgba(15, 139, 141, 0.28);
  border-radius: 8px;
  background: #f8fbfb;
}

.hero-meter span {
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-meter strong {
  color: var(--accent-dark);
  font-size: 2.8rem;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.input-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.input-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.paste-guide {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(15, 139, 141, 0.24);
  border-radius: 8px;
  background: #eef8f7;
}

.paste-guide strong {
  color: var(--accent-dark);
}

.paste-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.guide-tags span {
  padding: 5px 9px;
  border: 1px solid #c8dddc;
  border-radius: 999px;
  background: #fff;
  color: #33434c;
  font-size: 0.8rem;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 7px;
}

label,
legend {
  color: #24313a;
  font-size: 0.91rem;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid #c9d5dc;
  border-radius: 6px;
  background: #fbfdfd;
  color: var(--ink);
  outline: 0;
}

textarea {
  min-height: 220px;
  padding: 12px;
  line-height: 1.65;
  resize: vertical;
}

input,
select {
  height: 42px;
  padding: 0 11px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.16);
}

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

.checks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid #dce5ea;
  border-radius: 8px;
  background: var(--soft);
}

.checks label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.5;
}

.checks input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.advanced-options {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
}

.advanced-options summary {
  min-height: 48px;
  padding: 13px 14px;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
}

.advanced-options[open] {
  padding-bottom: 14px;
}

.advanced-options[open] summary {
  border-bottom: 1px solid var(--line);
}

.advanced-options .grid,
.advanced-options .checks {
  margin: 14px 14px 0;
}

.primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.result-panel {
  min-height: 620px;
  padding: 22px;
}

.empty-state {
  display: grid;
  min-height: 560px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #c4d2d9;
  border-radius: 8px;
  background: #f8fbfb;
}

.hidden {
  display: none !important;
}

.results {
  display: grid;
  gap: 18px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.score-card {
  display: grid;
  gap: 8px;
  min-height: 100px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.score-card span,
.money-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.score-card strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.summary-box {
  padding: 16px;
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  background: #eef8f7;
  line-height: 1.75;
  font-weight: 700;
}

.money-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.money-box div {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 14px;
  background: #fff;
}

.money-box strong {
  font-size: 1.25rem;
}

.detected-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.tab {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 3px 10px rgba(20, 43, 56, 0.1);
}

.tab-panel {
  display: grid;
  gap: 10px;
}

.notice {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.65;
}

.notice strong {
  display: block;
  margin-bottom: 3px;
}

.notice.good {
  border-color: rgba(39, 134, 93, 0.3);
  background: #f2faf6;
}

.notice.warn {
  border-color: rgba(244, 163, 64, 0.42);
  background: #fff8ee;
}

.notice.danger {
  border-color: rgba(207, 63, 50, 0.34);
  background: #fff2f0;
}

.disclaimer {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .tool-shell {
    padding: 14px;
  }

  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 22px;
  }

  .hero-meter {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .grid,
  .score-row,
  .money-box {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }

  textarea {
    min-height: 180px;
  }
}
