:root {
  --tool-ok: #166534;
  --tool-deny: #991b1b;
  --tool-warn: #92400e;
  --tool-panel: #faf9f7;
  --tool-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --yt-accent: #1f4b7a;
  --yt-border: #e5e2dc;
  --yt-muted: #5c5c5c;
  --yt-bg: #f7f6f3;
}

.tool-page {
  background: var(--yt-bg);
  color: #1a1a1a;
  font-family: Inter, sans-serif;
  overflow-x: clip;
}

.tool-page .tool-layout,
.tool-page .tool-card,
.tool-page .tool-aside,
.tool-page .tool-source-card,
.tool-page .tool-result,
.tool-page .yacht-step,
.tool-page .marina-grid {
  min-width: 0;
}

.tool-page .page-hero {
  padding-top: 32px;
  padding-bottom: 24px;
}

@media (min-width: 768px) {
  .tool-page .page-hero {
    padding-top: var(--space-7);
    padding-bottom: var(--space-5);
  }
}

.tool-lede {
  max-width: 64ch;
  margin: 0;
  color: var(--yt-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.tool-layout {
  display: grid;
  gap: 24px;
}

@media (min-width: 880px) {
  .tool-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
    gap: 32px;
    align-items: start;
  }
}

.tool-card,
.tool-aside,
.tool-source-card {
  background: #fff;
  border: 1px solid var(--yt-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.06);
}

@media (min-width: 700px) {
  .tool-card,
  .tool-aside,
  .tool-source-card {
    padding: 32px;
  }
}

.tool-card h2,
.tool-aside h2,
.tool-source-card h3 {
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tool-card > p,
.tool-aside > p,
.tool-source-card p {
  margin: 0 0 16px;
  color: var(--yt-muted);
  line-height: 1.6;
}

.demo-note {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--yt-border);
  background: var(--tool-panel);
  color: var(--yt-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.yacht-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: yacht-step;
}

@media (max-width: 899px) {
  .yacht-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 549px) {
  .yacht-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.yacht-steps li {
  counter-increment: yacht-step;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--yt-border);
  background: var(--tool-panel);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--yt-muted);
  text-align: center;
}

.yacht-steps li::before {
  content: counter(yacht-step) ". ";
  color: var(--yt-accent);
}

.yacht-steps li.is-active {
  border-color: var(--yt-accent);
  background: #fff;
  color: #1a1a1a;
}

.yacht-steps li.is-done {
  border-color: #86efac;
  color: var(--tool-ok);
}

.yacht-step[hidden] {
  display: none !important;
}

.yacht-form {
  display: grid;
  gap: 14px;
}

.yacht-form label {
  font-weight: 500;
  font-size: 0.875rem;
}

.yacht-form input,
.yacht-form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--yt-border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: inherit;
}

.yacht-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%231F4B7A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.yacht-form input:focus,
.yacht-form select:focus {
  outline: 2px solid rgba(31, 75, 122, 0.4);
  outline-offset: 1px;
  border-color: var(--yt-accent);
}

.marina-grid {
  display: grid;
  gap: 10px;
}

.marina-option {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 1.5px solid var(--yt-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.marina-option strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.marina-option span {
  display: block;
  color: var(--yt-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.marina-option[aria-pressed="true"] {
  border-color: var(--yt-accent);
  background: #f2f6fa;
}

.marina-option:focus-visible {
  outline: 2px solid rgba(31, 75, 122, 0.4);
  outline-offset: 2px;
}

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

.bank-option {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 1.5px solid var(--yt-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.bank-option strong {
  display: block;
  font-weight: 600;
}

.bank-option span {
  display: block;
  margin-top: 4px;
  color: var(--yt-muted);
  font-size: 0.8125rem;
}

.bank-option[aria-pressed="true"] {
  border-color: var(--yt-accent);
  background: #f2f6fa;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--yt-accent);
}

.check-row label {
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--yt-muted);
  line-height: 1.5;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.step-actions .btn {
  min-width: 140px;
  justify-content: center;
}

@media (max-width: 479px) {
  .step-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .step-actions .btn {
    width: 100%;
  }
}

.ob-progress {
  margin: 8px 0 0;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--yt-border);
  background: var(--tool-panel);
  color: var(--yt-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.ob-progress[hidden] {
  display: none !important;
}

.tool-result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--yt-border);
  background: var(--tool-panel);
}

.tool-result.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.tool-result.is-deny {
  border-color: #fecaca;
  background: #fef2f2;
}

.tool-result h3 {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
}

.tool-result > p {
  margin: 0 0 14px;
  color: var(--yt-muted);
  line-height: 1.55;
}

.decision-banner {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
}

.decision-banner.is-drive {
  background: #166534;
  color: #fff;
}

.decision-banner.is-stop {
  background: #991b1b;
  color: #fff;
}

.status-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

@media (min-width: 620px) {
  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.status-panel {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--yt-border);
  background: #fff;
  overflow-wrap: anywhere;
}

.status-panel span {
  display: block;
  font-size: 0.8125rem;
  color: var(--yt-muted);
}

.status-panel strong {
  display: block;
  margin-top: 4px;
  font-weight: 600;
}

.status-panel.is-ok {
  border-color: #86efac;
}

.status-panel.is-deny {
  border-color: #fca5a5;
}

.evidence-wrap {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--yt-border);
  background: #fff;
}

.evidence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

@media (max-width: 479px) {
  .evidence-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .evidence-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.evidence-details summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--yt-accent);
  padding: 8px 0;
}

.evidence-pre {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #1a1a1a;
  color: #f7f6f3;
  font-size: 0.7rem;
  line-height: 1.45;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.proof-line {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--yt-border);
  font-size: 0.8125rem;
  color: var(--yt-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tool-aside ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--yt-muted);
  line-height: 1.6;
}

.tool-aside li + li {
  margin-top: 8px;
}

.source-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 700px) {
  .source-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.blocker-list {
  margin: 0 0 14px;
  padding-left: 1.15rem;
  color: var(--yt-muted);
  line-height: 1.55;
}

.blocker-list li + li {
  margin-top: 6px;
}
