
:root {
  --bg: #101827;
  --surface: #182438;
  --surface-light: #202f45;
  --text: #f4f7fb;
  --muted: #a5b1c2;
  --accent: #9bf27c;
  --accent-dark: #172b19;
  --border: #304057;
  --danger: #ff8585;
  --warning-bg: #382b1d;
  --warning-border: #87633b;
  --success-bg: #1c3527;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

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

.brand-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: var(--accent);
  color: #10200f;
  font-size: 25px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.version,
.step,
.history-count {
  color: var(--muted);
  font-size: 12px;
}

.container {
  width: min(100% - 32px, 620px);
  margin: 0 auto;
  padding: 25px 0 35px;
}

.intro {
  padding: 8px 0 22px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.intro h2 {
  margin: 8px 0;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.15;
}

.intro > p:last-child {
  max-width: 470px;
  color: var(--muted);
  font-size: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.tab {
  padding: 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.active {
  background: var(--accent);
  color: #10200f;
}

.panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.step {
  white-space: nowrap;
  padding-top: 6px;
}

.field {
  margin-bottom: 17px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

.required {
  color: var(--danger);
}

.optional {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-height: 49px;
  padding: 0 13px;
  background: #111d2e;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.input-wrap:focus-within {
  border-color: var(--accent);
}

.input-wrap span {
  margin-right: 9px;
  color: var(--accent);
  font-weight: 700;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  outline: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.input-wrap input::placeholder {
  color: #718096;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 49px;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #10200f;
}

.primary-button:active {
  transform: scale(0.99);
}

.secondary-button {
  margin-top: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.error-message {
  margin: 0 0 14px;
  color: var(--danger);
  font-size: 13px;
}

.unavailable {
  padding: 18px 0 5px;
  text-align: center;
}

.unavailable-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 15px;
  border-radius: 18px;
  background: var(--surface-light);
  color: var(--accent);
  font-size: 34px;
}

.unavailable h3 {
  margin: 10px 0 8px;
}

.unavailable p {
  margin: 0 auto 20px;
  max-width: 390px;
  color: var(--muted);
  font-size: 13px;
}

.coming-label {
  display: inline-block;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.result-status {
  display: inline-block;
  max-width: 145px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-light);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.result-status.high {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: #ffd08a;
}

.result-status.normal {
  border-color: #49633f;
  background: var(--success-bg);
  color: var(--accent);
}

.total-card {
  padding: 20px;
  margin-bottom: 15px;
  border: 1px solid #49633f;
  border-radius: 14px;
  background: var(--accent-dark);
}

.total-card p {
  margin: 0;
  color: #c5d8c0;
  font-size: 12px;
}

.total-card h2 {
  margin: 5px 0;
  color: var(--accent);
  font-size: clamp(30px, 8vw, 39px);
  overflow-wrap: anywhere;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-stat {
  padding: 14px;
  background: #111d2e;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.result-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.result-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.charge-insight,
.insight-detail {
  padding: 14px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-light);
}

.charge-insight.high {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.charge-insight.normal {
  border-color: #49633f;
  background: var(--success-bg);
}

.charge-insight strong {
  display: block;
  font-size: 13px;
}

.charge-insight p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.insight-detail h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.contribution-row {
  margin-top: 12px;
}

.contribution-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.contribution-label span:first-child {
  color: var(--muted);
}

.contribution-track {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #101827;
}

.contribution-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--accent);
}

.insight-footnote {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.breakdown-title {
  margin: 23px 0 10px;
  font-size: 15px;
}

.breakdown-list {
  border-top: 1px solid var(--border);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.breakdown-row span:first-child {
  color: var(--muted);
}

.breakdown-row strong {
  text-align: right;
}

.comparison-box {
  padding: 15px;
  margin-top: 17px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #111d2e;
}

.comparison-box.match {
  border-color: #49633f;
}

.comparison-box.mismatch {
  border-color: #8a5555;
}

.comparison-box h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.comparison-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-actions {
  margin-top: 20px;
}

.history-panel {
  margin-top: 16px;
}

.history-count {
  white-space: nowrap;
  padding-top: 5px;
}

.history-list {
  display: grid;
  gap: 9px;
}

.empty-history {
  margin: 0;
  padding: 16px 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #111d2e;
  color: var(--text);
  text-align: left;
}

.history-item:active {
  border-color: var(--accent);
}

.history-item-main {
  min-width: 0;
}

.history-item-main strong,
.history-item-main span {
  display: block;
}

.history-item-main strong {
  font-size: 14px;
}

.history-item-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.history-item-total {
  flex-shrink: 0;
  text-align: right;
}

.history-item-total strong {
  display: block;
  font-size: 14px;
}

.history-item-total span {
  color: var(--muted);
  font-size: 10px;
}

.clear-history-button {
  margin-top: 14px;
}

.history-message {
  min-height: 16px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.note {
  padding: 16px 2px;
  color: var(--muted);
  font-size: 12px;
}

.note strong {
  color: var(--text);
}

.note p {
  margin: 5px 0 0;
}

footer {
  padding: 20px 15px 30px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

footer p {
  margin: 3px;
}

@media (max-width: 390px) {
  .panel {
    padding: 15px;
  }

  .fields-grid {
    grid-template-columns: 1fr;
  }

  .result-stat {
    padding: 12px;
  }
}
