:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #66736e;
  --line: #dbe5df;
  --panel: #ffffff;
  --soft: #f5f8f3;
  --mist: #e8f4ef;
  --teal: #0f766e;
  --green: #15803d;
  --gold: #d97706;
  --red: #b42318;
  --shadow: 0 24px 60px rgba(21, 58, 47, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 34rem),
    linear-gradient(135deg, #f7fbf8 0%, #f4f1e8 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.official-link,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.checker-panel,
.side-panel {
  border: 1px solid rgba(219, 229, 223, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.checker-panel {
  overflow: hidden;
}

.checker-head {
  padding: clamp(24px, 4vw, 38px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(217, 119, 6, 0.1)),
    var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checker-head h1,
.side-panel h2 {
  margin: 8px 0 0;
}

.checker-head h1 {
  max-width: 680px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.checker-head p {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.bill-checker {
  padding: clamp(18px, 3vw, 30px);
}

.bill-checker--embed {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
}

.embed-body {
  min-height: auto;
  padding: 12px;
  background: transparent;
}

.checker-form {
  display: grid;
  gap: 18px;
}

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

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

.field label,
.form-label {
  color: #26332f;
  font-size: 0.9rem;
  font-weight: 800;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  content: "";
  pointer-events: none;
  transform: translateY(-68%) rotate(45deg);
}

select,
input[type="text"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

select {
  appearance: none;
  padding: 0 44px 0 14px;
}

input[type="text"] {
  padding: 0 14px;
  letter-spacing: 0;
}

select:focus,
input[type="text"]:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.mode-tab[aria-pressed="true"] {
  background: #fff;
  color: var(--teal);
  box-shadow: 0 8px 22px rgba(21, 58, 47, 0.1);
}

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

.ru-field[hidden] {
  display: none;
}

.hint {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-pick {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 800;
}

.quick-pick.is-active {
  border-color: transparent;
  background: var(--teal);
  color: #fff;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
  text-decoration: none;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--teal), var(--green));
  color: #fff;
  box-shadow: 0 16px 28px rgba(15, 118, 110, 0.2);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
}

.status.is-error {
  color: var(--red);
}

.status.is-good {
  color: var(--green);
}

.result-panel {
  display: none;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.result-panel.is-visible {
  display: block;
}

.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-title {
  margin: 0;
  font-size: 1rem;
}

.result-frame {
  width: 100%;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.side-panel {
  padding: 24px;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.company-tile {
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--soft));
}

.company-tile strong,
.company-tile small {
  display: block;
}

.company-tile strong {
  font-size: 0.98rem;
}

.company-tile small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 0.76rem;
}

.trust-strip {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.trust-strip span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.trust-strip span::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--gold);
  content: "";
}

.fallback-box {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #f2c98f;
  border-radius: 8px;
  background: #fff8ed;
  color: #7a4600;
}

.fallback-box.is-visible {
  display: block;
}

@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 14px;
  }

  .topbar,
  .form-actions,
  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .official-link,
  .primary-button,
  .secondary-button,
  .link-button {
    width: 100%;
  }

  .field-grid,
  .input-row,
  .company-grid {
    grid-template-columns: 1fr;
  }

  .checker-head {
    padding: 22px;
  }

  .bill-checker {
    padding: 18px;
  }

  .result-frame {
    min-height: 540px;
  }
}
