:root {
  color-scheme: dark;
  --bg: #07080a;
  --frame: #0d0f14;
  --panel: #101217;
  --panel-soft: #14171f;
  --panel-lift: #181b24;
  --text: #f7f8f8;
  --muted: #8a8f98;
  --faint: #62666d;
  --border: rgba(255, 255, 255, 0.075);
  --border-soft: rgba(255, 255, 255, 0.05);
  --blue: #55b3ff;
  --blue-soft: rgba(85, 179, 255, 0.12);
  --green: #5fc992;
  --green-soft: rgba(95, 201, 146, 0.12);
  --red: #ff6363;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "cv01", "ss03";
}

button,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.app-frame {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--frame);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.45),
    0 30px 80px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #0d0f14;
}

.brand,
.toolbar,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.035em;
  white-space: nowrap;
  text-decoration: none;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #11141b;
}

.logo-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #e7eaee;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-word {
  font-size: 1.02rem;
}

.brand .logo-lockup + div {
  min-width: 0;
  padding-left: 2px;
}

.brand p {
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  justify-content: flex-end;
  gap: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.brand p,
.status,
.select-label,
.pane-header span,
.chip {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.select-label {
  color: var(--faint);
}

select,
button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  padding: 0 16px;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

select {
  min-width: 150px;
  appearance: none;
  color-scheme: dark;
  background-color: var(--panel-lift);
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 5.25 7 8.75l3.5-3.5' fill='none' stroke='%238a8f98' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  padding-right: 42px;
}

select option {
  background: var(--panel-lift);
  color: var(--text);
}

button {
  cursor: pointer;
  font-weight: 510;
}

button:hover,
select:hover {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.055);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  border-color: rgba(95, 201, 146, 0.42);
  background: var(--green-soft);
  color: #c9f8dc;
}

button.primary:hover {
  border-color: rgba(95, 201, 146, 0.68);
  background: rgba(95, 201, 146, 0.17);
}

button.secondary {
  border-color: rgba(85, 179, 255, 0.40);
  background: var(--blue-soft);
  color: #d4ecff;
}

button.secondary:hover {
  border-color: rgba(85, 179, 255, 0.68);
  background: rgba(85, 179, 255, 0.17);
}

button.quiet {
  color: var(--muted);
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  padding: 0 14px;
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}

.home-link:hover {
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
}

.chip {
  border: 1px solid rgba(85, 179, 255, 0.22);
  border-radius: 999px;
  background: rgba(85, 179, 255, 0.08);
  color: #bfe5ff;
  padding: 4px 8px;
}

.hidden {
  display: none;
}

.panes {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--panel);
}

.output-pane {
  background: #0e1118;
}

.pane + .pane {
  border-left: 1px solid var(--border);
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.018);
}

.pane-header h2 {
  color: #d0d6e0;
  font-size: 0.9rem;
  font-weight: 510;
}

textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  overflow: auto;
  border: 0;
  outline: none;
  background: transparent;
  color: #dfe5ee;
  padding: 24px 26px 34px;
  line-height: 1.62;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

textarea::placeholder {
  color: #525866;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #151923;
  color: var(--text);
  padding: 10px 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
  font-size: 0.88rem;
}

.toast.success {
  border-color: rgba(95, 201, 146, 0.55);
  background: #0f2118;
  color: #c9f8dc;
}

.toast.info {
  border-color: rgba(85, 179, 255, 0.55);
  background: #0d1a2a;
  color: #d4ecff;
}

.toast.error {
  border-color: rgba(255, 99, 99, 0.55);
  background: #271111;
  color: #ffd1d1;
}

.seo-content {
  border-top: 1px solid var(--border);
  background: #090b10;
  padding: 72px 22px 84px;
}

.seo-wrap {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.seo-content h2 {
  max-width: 760px;
  margin-top: 12px;
  color: var(--text);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.seo-content > .seo-wrap > p:not(.eyebrow) {
  max-width: 820px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.seo-grid article,
.faq details {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.seo-grid article {
  padding: 20px;
}

.seo-grid h3 {
  margin: 0;
  color: #dce7f4;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.seo-grid p,
.faq p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.faq {
  margin-top: 46px;
}

.faq h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.faq details {
  margin-top: 12px;
  padding: 16px 18px;
}

.faq summary {
  cursor: pointer;
  color: #dce7f4;
  font-weight: 600;
}

.seo-detail {
  margin-top: 46px;
}

.seo-detail h2,
.trust-content h1 {
  color: var(--text);
}

.seo-columns,
.trust-sections {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.seo-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seo-columns article,
.trust-sections article {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  padding: 20px;
}

.seo-columns h3,
.trust-sections h2 {
  color: #dce7f4;
  font-size: 1rem;
}

.seo-columns p,
.trust-content p,
.trust-sections p {
  color: var(--muted);
  line-height: 1.7;
}

.internal-links {
  margin-top: 46px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
  padding: 20px;
}

.internal-links h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.internal-links nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.internal-links a,
.home-note a {
  color: #dce7f4;
  text-decoration: none;
}

.internal-links nav a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.035);
  font-size: 0.9rem;
}

.internal-links a:hover,
.home-note a:hover {
  color: var(--blue);
}

.internal-links p,
.home-note {
  margin-top: 16px;
  color: var(--muted);
}

.trust-shell {
  width: 100%;
  min-height: 100vh;
  overflow: auto;
  background: var(--bg);
}

.trust-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.trust-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.trust-nav a:hover {
  color: var(--text);
}

.trust-content {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 72px 28px 96px;
}

.trust-content h1 {
  margin-top: 12px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.trust-content > p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 18px;
  font-size: 1.06rem;
}

.trust-updated {
  font-size: 0.9rem !important;
}

.home-shell {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--frame);
}

.home-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.home-hero {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 64px 28px 42px;
  overflow: hidden;
}

.home-hero h1 {
  max-width: 760px;
  margin-top: 14px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.home-hero > p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.formatter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.formatter-card {
  display: grid;
  gap: 10px;
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #101217;
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.formatter-card:hover {
  border-color: rgba(255,255,255,0.22);
  background: #141720;
  transform: translateY(-1px);
}

.formatter-card span {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.formatter-card small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 940px) {
  .app-shell {
    width: 100%;
    padding: 0;
  }

  .app-frame {
    height: 100vh;
    border-radius: 0;
  }

  .titlebar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .toolbar,
  .actions {
    justify-content: flex-start;
  }

  .panes,
  .seo-grid,
  .seo-columns,
  .formatter-grid {
    grid-template-columns: 1fr;
  }

  .home-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-hero {
    padding: 36px 20px 28px;
  }

  .formatter-card {
    min-height: auto;
  }

  .pane + .pane {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .pane {
    min-height: 42vh;
  }
}
