:root {
  color-scheme: light;
  --blue-950: #08152c;
  --blue-900: #102448;
  --blue-800: #1a5faf;
  --blue-700: #2472d0;
  --blue-50: #eef6ff;
  --green-600: #198754;
  --orange-600: #d97706;
  --red-600: #c73636;
  --ink: #101828;
  --muted: #64748b;
  --line: #dbe4f0;
  --soft: #f7f7f7;
  --white: #ffffff;
  --shadow: 0 18px 55px rgba(36, 114, 208, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 8%, rgba(36, 114, 208, 0.1), transparent 27rem),
    linear-gradient(180deg, #f6fbff 0%, #ffffff 52%);
  font-size: 16px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--blue-950);
  letter-spacing: 0;
  line-height: 1.08;
}

.app-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 62px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 34px;
}

.tool-icon {
  display: grid;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: linear-gradient(135deg, #0957ff, var(--blue-700));
  box-shadow: 0 15px 30px rgba(36, 114, 208, 0.24);
}

.tool-icon span {
  font-size: 28px;
  font-weight: 800;
}

.brand {
  margin-bottom: 2px;
  color: var(--blue-700);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  font-size: clamp(32px, 5vw, 48px);
}

.lead {
  max-width: 780px;
  margin-top: 5px;
  color: #5f6b82;
  font-size: 17px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(350px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(8, 21, 44, 0.06);
}

.input-panel,
.result-panel {
  padding: 20px;
}

.panel-title,
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 800;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green-600);
  content: "";
}

h2 {
  margin-top: 2px;
  font-size: 21px;
}

form {
  display: grid;
  gap: 14px;
}

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field span {
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.field strong {
  color: var(--red-600);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--blue-950);
  background: var(--white);
  box-shadow: inset 0 1px 0 rgba(8, 21, 44, 0.02), 0 2px 8px rgba(8, 21, 44, 0.03);
}

input,
select {
  min-height: 48px;
  padding: 0 16px;
}

textarea {
  min-height: 84px;
  resize: vertical;
  padding: 13px 16px;
}

input::placeholder,
textarea::placeholder {
  color: #7a8494;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(36, 114, 208, 0.78);
  box-shadow: 0 0 0 4px rgba(36, 114, 208, 0.12);
}

.method-note {
  display: none;
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  color: #8a4f05;
  background: rgba(217, 119, 6, 0.08);
  font-size: 14px;
}

.method-note.is-visible {
  display: block;
}

.primary-button,
.secondary-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
  letter-spacing: 0;
}

.primary-button {
  width: 100%;
  margin-top: 2px;
  padding: 12px 18px;
  color: var(--white);
  background: #0957ff;
  box-shadow: 0 14px 22px rgba(9, 87, 255, 0.18);
}

.primary-button:hover {
  background: var(--blue-700);
}

.secondary-button {
  width: 100%;
  padding: 12px 18px;
  color: var(--blue-700);
  background: var(--blue-50);
}

.secondary-button:hover {
  background: #e4f1ff;
}

.copy-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 10px;
  color: #5f6b82;
  background: transparent;
  font-size: 13px;
}

.copy-button:hover {
  color: var(--blue-700);
  background: var(--blue-50);
}

.empty-state {
  border: 1px dashed rgba(100, 116, 139, 0.32);
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
  background: rgba(247, 247, 247, 0.56);
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--blue-950);
}

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

.result-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 13px;
  background: var(--white);
}

.result-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 15px;
}

.result-label {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 36px;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--white);
  background: var(--blue-700);
  font-size: 12px;
  font-weight: 800;
}

.result-card p {
  color: #39465b;
}

.null-line {
  margin-top: 10px;
  border-left: 3px solid rgba(36, 114, 208, 0.38);
  padding: 8px 0 8px 11px;
  color: #5c6678;
  background: linear-gradient(90deg, rgba(36, 114, 208, 0.06), transparent);
  font-size: 14px;
}

.null-line strong {
  color: var(--blue-950);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  color: #4f5d73;
  background: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.quality-box {
  margin-top: 13px;
  border: 1px solid rgba(25, 135, 84, 0.2);
  border-radius: 14px;
  padding: 13px 14px;
  color: #175a3a;
  background: rgba(25, 135, 84, 0.07);
}

.quality-title {
  margin-bottom: 3px;
  font-weight: 800;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(340px, calc(100vw - 36px));
  transform: translateY(20px);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--white);
  background: var(--blue-950);
  box-shadow: 0 12px 28px rgba(8, 21, 44, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

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

  .input-panel,
  .result-panel {
    padding: 18px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 24px, 1100px);
    padding-top: 24px;
  }

  .hero {
    align-items: flex-start;
  }

  .tool-icon {
    width: 54px;
    height: 54px;
  }

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

  .result-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-button {
    justify-content: flex-start;
    width: fit-content;
  }
}

@media (max-width: 420px) {
  .app-shell {
    width: min(100% - 18px, 1100px);
  }

  .hero {
    gap: 12px;
  }

  .lead {
    font-size: 16px;
  }

  .input-panel,
  .result-panel {
    padding: 14px;
  }

  input,
  select {
    min-height: 46px;
    padding: 0 12px;
  }

  textarea {
    padding: 12px;
  }
}

@media (min-width: 980px) and (min-height: 680px) {
  .workspace {
    gap: 20px;
  }

  .input-panel {
    max-height: calc(100vh - 112px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 18px;
  }

  form {
    gap: 11px;
  }

  .field-grid {
    gap: 10px;
  }

  input,
  select {
    min-height: 42px;
    padding-inline: 12px;
  }

  textarea {
    height: 68px;
    min-height: 68px;
    padding: 10px 12px;
  }
}
