/* Page layout only. The shared studio tokens own every color and page width. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("./fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

html { background: var(--bg); }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; transition: background .15s, border-color .15s; }
button:disabled { cursor: default; opacity: .45; }
button:not(:disabled):active { transform: translateY(1px); }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 8px; left: 20px; z-index: 1; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 28px; padding-block: 25px; border-bottom: 1px solid var(--border); }
.studio-brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; min-height: 44px; font-size: 15px; font-weight: 600; letter-spacing: -.035em; text-decoration: none; }
.studio-brand img { display: block; width: 36px; height: 36px; flex-shrink: 0; }
.studio-name { line-height: 1.45; }
.tool-name { display: block; margin-top: 3px; font-size: 11px; font-weight: 450; color: var(--fg-dim); }
.home-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 13px; font-weight: 550; text-decoration: none; white-space: nowrap; }
.privacy { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--fg-dim); }
.privacy svg { width: 15px; height: 15px; flex-shrink: 0; }
.text-tool main { padding-bottom: 28px; }
.text-tool .intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-block: 48px 38px; }
.mobile-break { display: none; }
.steps { display: flex; gap: 20px; list-style: none; margin: 0 0 4px; padding: 0; font-size: 12px; color: var(--fg-dim); white-space: nowrap; }
.steps li { display: flex; align-items: center; gap: 7px; }
.steps b { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--border); border-radius: 50%; color: var(--fg-mute); font-size: 10px; font-weight: 500; }

.workspace { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; background: var(--bg-elev); border-bottom: 1px solid var(--border); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { float: left; margin: 12px 18px 0 0; font-size: 13px; font-weight: 550; }
.segmented { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px; gap: 3px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: block; padding: 8px 14px; border-radius: 5px; font-size: 13px; color: var(--fg-dim); white-space: nowrap; }
.segmented input:checked + span { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.mode-help { max-width: 270px; font-size: 12px; color: var(--fg-dim); line-height: 1.6; margin: 0; text-align: right; }
.editors { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.editor { min-width: 0; padding: 24px 26px 18px; display: flex; flex-direction: column; }
.source-editor { border-right: 1px solid var(--border); }
.result-editor { background: var(--bg-elev); }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; margin-bottom: 15px; }
.text-tool #main-content .editor h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.025em; }
.dot { display: block; width: 6px; height: 6px; background: var(--fg-mute); border-radius: 50%; }
.dot.accent { background: var(--accent); }
.text-button { border: 0; background: transparent; padding: 5px 0; min-height: 32px; color: var(--accent); font-size: 12px; line-height: 1.5; }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
.text-button.muted { color: var(--fg-dim); }
.result-state { font-size: 11px; line-height: 1.6; color: var(--accent); background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 6px; padding: 3px 9px; }
.result-state.stale { color: var(--fg-dim); background: var(--bg-elev2); border-color: var(--border); }
textarea { display: block; background: transparent; border: 0; width: 100%; height: 264px; min-height: 180px; resize: vertical; padding: 5px 0 16px; font-size: 16px; line-height: 1.9; letter-spacing: -.025em; color: var(--fg); border-radius: 0; outline: none; caret-color: var(--accent); }
textarea::placeholder { color: var(--fg-mute); opacity: 1; }
textarea:focus-visible { box-shadow: inset 0 -2px var(--accent); }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; font-size: 12px; color: var(--fg-dim); margin-top: 12px; font-variant-numeric: tabular-nums; }
.editor-footer span { line-height: 1.5; }
#difference { color: var(--fg-dim); text-align: right; }
.options { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding: 15px 25px; border-block: 1px solid var(--border); }
.options label { display: flex; gap: 8px; align-items: center; min-height: 28px; font-size: 12px; color: var(--fg-dim); cursor: pointer; line-height: 1.5; }
.options input { appearance: none; width: 17px; height: 17px; border: 1px solid var(--line-strong); border-radius: 4px; display: grid; place-content: center; margin: 0; flex-shrink: 0; background: var(--bg); }
.options input:checked { background: var(--cta-bg); border-color: var(--cta-bg); }
.options input:checked::before { content: ""; width: 7px; height: 4px; border-left: 2px solid var(--cta-fg); border-bottom: 2px solid var(--cta-fg); transform: translateY(-1px) rotate(-45deg); }
.action-bar { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 20px 25px; }
.action-notes { font-size: 12px; color: var(--fg-dim); line-height: 1.8; display: flex; flex-direction: column; align-items: flex-start; }
.actions { display: flex; gap: 9px; flex-shrink: 0; }
.button { border: 1px solid transparent; min-height: 46px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 550; padding: 0 20px; }
.button.primary { background: var(--cta-bg); color: var(--cta-fg); border-color: var(--cta-bg); }
.button.primary:not(:disabled):hover { filter: brightness(.95); }
.button.secondary { color: var(--fg); background: var(--bg); border-color: var(--border); }
.button.secondary:not(:disabled):hover { background: var(--bg-elev); border-color: var(--line-strong); }
.button svg { width: 16px; height: 16px; }
kbd { display: inline-block; font-family: inherit; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; color: var(--fg-dim); line-height: 1.5; padding: 0 4px; margin: 0 2px; }
.below-editor { display: flex; justify-content: space-between; gap: 15px; color: var(--fg-mute); font-size: 12px; }
.below-editor p { margin: 15px 0; line-height: 1.65; }
#status { min-height: 21px; font-size: 13px; color: var(--accent); text-align: center; margin: 1px 0 15px; line-height: 1.7; }
.no-script { color: var(--danger); }
footer { border-top: 1px solid var(--border); padding-top: 20px; font-size: 12px; color: var(--fg-mute); display: flex; justify-content: space-between; gap: 15px; }
footer a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; margin-top: -12px; }
footer a:hover { text-decoration: underline; }

@media (min-width: 1500px) {
  textarea { height: 310px; }
}
@media (max-width: 1100px) {
  .steps { display: none; }
  .mode-help { max-width: 240px; }
  .controls { gap: 14px; }
  legend { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .options { gap: 18px; }
  .action-notes { max-width: 260px; }
}
@media (max-width: 700px) {
  .site-header { grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; padding-block: 17px; }
  .studio-brand { gap: 8px; font-size: 13px; }
  .studio-brand img { width: 31px; height: 31px; }
  .home-link { font-size: 12px; gap: 6px; }
  .privacy { grid-column: 1 / -1; font-size: 11px; gap: 5px; }
  .privacy svg { width: 13px; }
  .text-tool .intro { padding-block: 38px 30px; }
  .mobile-break { display: initial; }
  .controls { align-items: stretch; flex-direction: column; gap: 10px; padding: 16px; }
  .modes { width: 100%; }
  .segmented label { flex: 1; text-align: center; }
  .segmented span { padding: 9px 5px; font-size: 12px; }
  .mode-help { text-align: left; max-width: none; padding-left: 2px; }
  .editors { grid-template-columns: minmax(0,1fr); }
  .editor { padding: 18px 20px 13px; }
  .source-editor { border-right: 0; border-bottom: 1px solid var(--border); }
  .editor-heading { margin-bottom: 10px; }
  textarea { height: 184px; min-height: 140px; line-height: 1.8; }
  .editor-footer { margin-top: 3px; font-size: 11px; }
  .options { padding: 14px 19px; column-gap: 20px; row-gap: 8px; }
  .options label { min-height: 32px; }
  .action-bar { flex-direction: column-reverse; align-items: stretch; gap: 14px; padding: 17px 19px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .button { padding: 0 10px; min-height: 47px; }
  .action-notes { font-size: 11px; max-width: none; align-items: center; }
  .below-editor { flex-direction: column; gap: 0; padding-block: 10px; }
  .below-editor p { margin: 3px 0; font-size: 11px; }
  #status { margin: 2px 0 15px; font-size: 12px; }
  footer { padding-top: 17px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
