:root {
  --tool-bg: #0b1020;
  --tool-panel: #151b2f;
  --tool-panel-2: #1c2440;
  --tool-line: rgba(255, 255, 255, 0.12);
  --tool-text: #f4f6ff;
  --tool-muted: #aeb7d4;
  --tool-accent: #7482ff;
  --tool-good: #45d39a;
  --tool-bad: #ff6b7a;
  --tool-warn: #ffca66;
}
body {
  background:
    radial-gradient(
      circle at 80% 0,
      rgba(116, 130, 255, 0.18),
      transparent 32rem
    ),
    var(--tool-bg);
  color: var(--tool-text);
}
.tool-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 100px;
}
.tool-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 34px;
}
.tool-hero h1 {
  font-size: clamp(2.3rem, 7vw, 4.8rem);
  margin: 4px 0 12px;
}
.tool-hero p {
  max-width: 680px;
  color: var(--tool-muted);
  margin: 0;
}
.tool-kicker {
  color: #aeb7ff !important;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}
.tool-panel {
  grid-column: span 12;
  padding: 24px;
  border: 1px solid var(--tool-line);
  border-radius: 20px;
  background: rgba(21, 27, 47, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}
.tool-panel.half {
  grid-column: span 6;
}
.tool-panel.third {
  grid-column: span 4;
}
.tool-panel h2 {
  font-size: 1.25rem;
  margin: 0 0 18px;
}
.tool-panel h3 {
  font-size: 1rem;
  margin: 0 0 10px;
}
.tool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tool-stack {
  display: grid;
  gap: 14px;
}
.tool-field {
  display: grid;
  gap: 7px;
  flex: 1;
  min-width: 140px;
}
.tool-field span {
  color: var(--tool-muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.tool-input,
.tool-select {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--tool-line);
  border-radius: 11px;
  color: var(--tool-text);
  background: #0f1529;
  font: inherit;
}
.tool-input:focus,
.tool-select:focus {
  outline: 2px solid var(--tool-accent);
  outline-offset: 2px;
}
.tool-button {
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--tool-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.tool-button:hover {
  filter: brightness(1.08);
}
.tool-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tool-button.secondary {
  border: 1px solid var(--tool-line);
  background: transparent;
}
.tool-button.good {
  background: #167a5a;
}
.tool-button.bad {
  background: #a9364b;
}
.tool-button.warn {
  color: #211700;
  background: var(--tool-warn);
}
.tool-note {
  color: var(--tool-muted);
  font-size: 0.88rem;
}
.tool-error {
  padding: 12px 14px;
  border: 1px solid rgba(255, 107, 122, 0.35);
  border-radius: 10px;
  color: #ffc1c8;
  background: rgba(255, 107, 122, 0.08);
}
.tool-badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  color: #cdd2ff;
  background: rgba(116, 130, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 800;
}
.tool-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tool-empty {
  padding: 28px;
  text-align: center;
  color: var(--tool-muted);
  border: 1px dashed var(--tool-line);
  border-radius: 14px;
}
.tool-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--tool-line);
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .tool-page {
    padding-top: 38px;
  }
  .tool-hero {
    align-items: start;
    flex-direction: column;
  }
  .tool-panel.half,
  .tool-panel.third {
    grid-column: span 12;
  }
  .tool-panel {
    padding: 18px;
  }
  .tool-row > .tool-button {
    flex: 1;
  }
  .tool-input,
  .tool-select,
  .tool-button {
    min-height: 52px;
  }
}

/* Theme-aware tool surfaces */
body[data-theme="light"] {
  --tool-bg: #f4f6fc;
  --tool-panel: #fff;
  --tool-panel-2: #edf1fb;
  --tool-line: rgba(34, 43, 89, 0.16);
  --tool-text: #1c2140;
  --tool-muted: #606985;
  --tool-accent: #5865f2;
  --tool-good: #16845e;
  --tool-bad: #c13f55;
  --tool-warn: #e4a932;
  background:
    radial-gradient(
      circle at 80% 0,
      rgba(88, 101, 242, 0.12),
      transparent 32rem
    ),
    var(--tool-bg);
}
body[data-theme="light"] .tool-panel {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(48, 59, 110, 0.09);
}
body[data-theme="light"] .tool-input,
body[data-theme="light"] .tool-select {
  color: var(--tool-text);
  background: #fff;
}
body[data-theme="light"] .tool-button.secondary {
  color: var(--tool-text);
  background: #f4f6fc;
}
body[data-theme="light"] .tool-badge {
  color: #4552c8;
  background: rgba(88, 101, 242, 0.11);
}
body[data-theme="light"] .tool-error {
  color: #9f263d;
  background: rgba(193, 63, 85, 0.08);
}
body[data-theme="light"] .tool-empty {
  background: rgba(237, 241, 251, 0.5);
}
body[data-theme="sunset"] {
  --tool-bg: #17132f;
  --tool-panel: rgba(39, 29, 62, 0.92);
  --tool-panel-2: rgba(68, 42, 76, 0.9);
  --tool-line: rgba(255, 220, 205, 0.18);
  --tool-text: #fff7f1;
  --tool-muted: #dec8d3;
  --tool-accent: #f47b70;
  --tool-good: #45d39a;
  --tool-bad: #ff7181;
  --tool-warn: #ffc078;
  background:
    radial-gradient(
      circle at 76% 72%,
      rgba(255, 160, 108, 0.28),
      transparent 28rem
    ),
    linear-gradient(165deg, #182447 0%, #3a285b 42%, #884568 72%, #d77969 100%);
  background-attachment: fixed;
}
body[data-theme="sunset"] .tool-panel {
  background: var(--tool-panel);
}
body[data-theme="sunset"] .tool-input,
body[data-theme="sunset"] .tool-select {
  background: rgba(23, 19, 47, 0.8);
}
