/* Shared homepage styles for standalone tools. */

:root {
  color-scheme: light;
  --bg:#faf8f5;
  --surface:#fff;
  --soft:#f5f2ed;
  --text:#242b35;
  --muted:#586170;
  --line:#d7d9dd;
  --accent:#9b3c20;
  --accent-soft:#fff0e8;
  --focus:#175bc0;
  --good:#17623d;
  --good-bg:#e9f6ee;
  --bad:#a3292f;
  --bad-bg:#fff0f0;
  --added:#e7f5ed;
  --changed:#fff2cf;
  --shadow:0 8px 30px #30291e08;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.5 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
select,
input[type=url] {
  min-height: 44px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 9px 15px;
  font-weight: 600;
}
button:hover:not(:disabled) {
  background: var(--soft);
}
button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button,
input,
textarea,
select,
summary,
a {
  touch-action: manipulation;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 20;
  background: var(--surface);
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.header-inner {
  max-width: 1180px;
  margin: auto;
  padding: 14px 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  flex-shrink: 0;
}
.header-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}
.header-links a {
  color: var(--muted);
}
main {
  max-width: 1180px;
  padding: 0 24px 48px;
  margin: auto;
}
.hero {
  text-align: center;
  padding: 44px 0 26px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: .12em;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  font-size: clamp(28px, 4.5vw, 46px);
  line-height: 1.2;
  letter-spacing: -.045em;
  margin: 12px 0;
}
h1 span {
  color: var(--accent);
}
.hero p {
  color: var(--muted);
  margin: 10px 0;
}
.steps {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 4px auto 28px;
  max-width: 650px;
  gap: 12px;
}
.steps li {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}
.step-number {
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  background: var(--surface);
}
.steps [aria-current=step] {
  color: var(--accent);
}
.steps [aria-current=step] .step-number {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.steps li:not(:last-child):after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
  margin-left: 5px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
h2 {
  font-size: 19px;
  margin: 0;
  letter-spacing: -.02em;
}
.section-heading h2 span,
.result-title span {
  color: var(--accent);
  margin-right: 7px;
}
.workspace-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.link-button {
  border: 0;
  background: none;
  color: var(--accent);
  padding-left: 8px;
  padding-right: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.quiet-button {
  font-size: 14px;
  background: transparent;
}
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.input-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.input-card[data-state=error] {
  border-color: var(--bad);
  box-shadow: 0 0 0 1px var(--bad);
}
.card-heading {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-heading h3 {
  margin: 2px 0;
  font-size: 16px;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--soft);
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: left;
}
.badge[data-state=valid] {
  background: var(--good-bg);
  color: var(--good);
}
.badge[data-state=error] {
  background: var(--bad-bg);
  color: var(--bad);
}
.segments {
  display: flex;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
  gap: 3px;
}
.segments button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 7px 9px;
  font-size: 14px;
  font-weight: 600;
}
.segments [aria-selected=true] {
  background: var(--surface);
  box-shadow: 0 1px 4px #00000014;
  color: var(--accent);
}
.method-panel {
  min-height: 302px;
}
.editor {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
}
.editor-top {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 0 12px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.editor-label {
  font:
    12px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: var(--muted);
}
.icon-tools {
  display: flex;
  gap: 0;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  padding: 6px;
  background: transparent;
  font-size: 19px;
  font-weight: 500;
}
.icon-button[aria-pressed=true],
.icon-button[aria-expanded=true] {
  color: var(--accent);
  background: var(--accent-soft);
}
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.edit-body {
  display: flex;
  height: 250px;
  overflow: hidden;
  background: var(--surface);
}
.line-numbers {
  margin: 0;
  padding: 12px 8px;
  flex: none;
  width: 44px;
  overflow: hidden;
  text-align: right;
  color: var(--muted);
  background: var(--soft);
  border-right: 1px solid var(--line);
  font:
    13px/22px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  user-select: none;
}
.json-input {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  border-radius: 0;
  padding: 12px;
  font:
    13px/22px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: transparent;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.json-input:focus {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.json-input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.json-input.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.find-bar {
  padding: 8px;
  background: var(--soft);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.find-bar input {
  flex: 1;
  min-width: 90px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  background: var(--surface);
}
.find-status {
  font-size: 12px;
  color: var(--muted);
}
.help-popover {
  position: relative;
}
.help-popover summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-weight: 700;
  color: var(--muted);
}
.help-popover summary::-webkit-details-marker {
  display: none;
}
.help-popover p {
  position: absolute;
  right: 0;
  top: 35px;
  width: 245px;
  padding: 12px;
  z-index: 5;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.drop-zone {
  width: 100%;
  min-height: 230px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px;
  font-weight: 500;
  background: var(--soft);
}
.drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-icon {
  font-size: 30px;
  color: var(--accent);
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.file-info {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.file-description {
  flex: 1;
  min-width: 0;
}
.file-description strong {
  display: block;
}
.import-status {
  font-size: 14px;
  color: var(--muted);
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.import-status.error {
  color: var(--bad);
}
.url-label {
  display: block;
  font-size: 14px;
  font-weight: 650;
  margin: 8px 0;
}
.url-controls {
  display: flex;
  gap: 8px;
}
.url-controls input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}
.url-help {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0;
}
.merge-section {
  text-align: center;
  padding: 30px 0;
}
.merge-title {
  margin-bottom: 16px;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.primary:hover:not(:disabled) {
  background: #7c2e17;
}
.merge-button {
  min-width: 240px;
  min-height: 52px;
  font-size: 17px;
  border-radius: 11px;
}
.rule {
  font-size: 14px;
  color: var(--muted);
  margin: 12px 0 4px;
}
.shortcut {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 14px;
}
kbd {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
}
.advanced {
  max-width: 490px;
  margin: 18px auto 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.advanced summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  min-height: 44px;
}
.options {
  padding: 0 16px 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.check-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  font-size: 14px;
}
.check-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.array-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.array-option select {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 6px 9px;
}
.advanced-note {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 13px;
  color: var(--muted);
}
.result-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.result-heading {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.result-actions button {
  font-size: 14px;
}
.result-empty {
  text-align: center;
  padding: 45px 18px;
  color: var(--muted);
}
.result-output {
  max-height: 520px;
  overflow: auto;
  outline-offset: -3px;
}
.result-lines {
  margin: 0;
  padding: 12px 0;
  list-style: none;
  counter-reset: line;
  min-width: 100%;
  width: max-content;
  font:
    13px/23px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.result-lines li {
  counter-increment: line;
  display: flex;
  min-height: 23px;
  white-space: pre;
}
.result-lines li:before {
  content: counter(line);
  position: sticky;
  left: 0;
  display: inline-block;
  flex: none;
  width: 54px;
  padding: 0 12px 0 4px;
  text-align: right;
  color: var(--muted);
  border-right: 1px solid var(--line);
  margin-right: 12px;
  background: var(--soft);
  user-select: none;
}
.result-lines code {
  font: inherit;
  padding-right: 18px;
}
.result-lines .added {
  background: var(--added);
}
.result-lines .overridden {
  background: var(--changed);
}
.result-legend {
  padding: 12px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.conflict-panel,
.diff-panel {
  border-top: 1px solid var(--line);
  padding: 16px 18px;
}
.conflict-panel h3,
.diff-panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.conflict-list {
  display: grid;
  gap: 12px;
}
.conflict-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--soft);
}
.conflict-card legend {
  padding: 0 5px;
  font-weight: 700;
}
.conflict-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.conflict-option {
  display: grid;
  gap: 7px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
}
.conflict-option span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
}
.conflict-option pre,
.diff-value {
  margin: 0;
  overflow: auto;
  max-height: 155px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.array-id-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.array-id-option input {
  width: 88px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 6px 9px;
}
.diff-list {
  display: grid;
  gap: 8px;
}
.diff-row {
  display: grid;
  grid-template-columns: minmax(110px, .65fr) minmax(70px, .35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface);
  font-size: 13px;
}
.diff-path {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}
.diff-kind {
  font-weight: 750;
  color: var(--accent);
}
.legend-key {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.swatch {
  width: 12px;
  height: 12px;
  border: 1px solid #788373;
  border-radius: 3px;
  background: var(--added);
}
.swatch.changed {
  background: var(--changed);
  border-color: #a78b48;
}
.result-notice {
  font-size: 13px;
  margin: 0;
  padding: 12px 18px;
  color: var(--muted);
}
.global-status {
  min-height: 24px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}
.privacy-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 26px 0;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer nav {
  display: flex;
  gap: 16px;
}
@media (max-width: 700px) {
  .header-inner {
    padding: 12px 16px;
  }
  .header-links a:first-child {
    display: none;
  }
  main {
    padding: 0 16px 28px;
  }
  .hero {
    padding: 30px 0 20px;
  }
  .hero p {
    font-size: 14px;
  }
  .steps {
    gap: 8px;
  }
  .steps li {
    font-size: 12px;
    gap: 6px;
  }
  .step-number {
    width: 26px;
    height: 26px;
  }
  .steps li:not(:last-child):after {
    display: none;
  }
  .input-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .input-card {
    padding: 14px;
  }
  .section-heading {
    gap: 8px;
  }
  .workspace-actions {
    width: 100%;
    justify-content: space-between;
    gap: 2px;
  }
  .quiet-button {
    padding: 9px 10px;
  }
  .result-heading {
    padding: 14px;
  }
  .result-actions {
    width: 100%;
  }
  .result-actions button {
    flex: 1;
    padding: 9px;
  }
  .rule {
    max-width: 310px;
    margin: 12px auto;
  }
  .card-heading {
    flex-wrap: wrap;
  }
  .badge {
    max-width: 100%;
  }
  .options {
    gap: 5px 14px;
  }
  .merge-button {
    width: 100%;
  }
  .site-footer nav {
    flex-wrap: wrap;
  }
  .conflict-options,
  .diff-row {
    grid-template-columns: 1fr;
  }
}
