/* Workspace layout: keep the editor prominent and group related actions. */
.size-control{margin-left:auto;font-size:13px;color:#64748b}.size-control select{padding:8px;border:1px solid #e2e8f0;border-radius:6px;background:#fff}
.workspace-actions{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}.workspace-actions>div{display:flex;gap:6px;flex-wrap:wrap}.editor-switch{display:none}#workspace-status{font-size:13px;color:#2563eb;margin-bottom:8px}.workspace-focus .toolbar,.workspace-focus .footer{display:none}.workspace-focus .main{padding-bottom:12px}
body{background:#f8fafc;color:#0f172a}
.header{box-shadow:none;border-bottom:1px solid #e2e8f0}
.header-inner{max-width:1600px;height:64px;padding:0 32px}
.logo{color:#2563eb;font-size:19px}
.main{width:100%;max-width:1600px;margin:0 auto;padding:28px 32px 40px}
.tool-intro{margin-bottom:22px}
h1{font-size:clamp(22px,2.3vw,30px);letter-spacing:-.6px}
.tool-intro p{font-size:14px;color:#64748b;line-height:1.8}
.tool-intro a{color:#2563eb;text-underline-offset:4px}
.toolbar{gap:12px;padding:14px 16px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;margin-bottom:20px}
.toolbar-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.toolbar-group+.toolbar-group{padding-left:12px;border-left:1px solid #e2e8f0}
.toolbar-group:last-child{margin-left:auto}
.btn{min-height:36px;border-radius:7px;font-weight:500}
.btn-primary,.btn.active{background:#2563eb;border-color:#2563eb}
.btn-primary:hover{background:#1d4ed8}
.btn-secondary{border-color:#e2e8f0}
.editor-wrap{gap:20px;height:clamp(400px,57vh,720px);min-height:400px}
.editor-col{background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden;box-shadow:0 4px 16px #0f172a04}
/* Give formatted results more room than the raw input. */
.editor-col.input-col{flex:1.2 1 0}
.editor-col.output-col{flex:1.8 1 0}
.editor-label{margin:0;padding:14px 16px;border-bottom:1px solid #e2e8f0;min-height:48px;background:#f8fafc;color:#334155;font-size:13px;letter-spacing:0;text-transform:none}
.editor-format{font-size:11px;color:#64748b;margin-left:8px;font-weight:400}
#input{border:0;border-radius:0;padding:18px;min-height:0;font-size:14px}
#input:focus{box-shadow:inset 0 0 0 2px #2563eb55}
.output-panel{border:0;border-radius:0}
.json-output{padding:18px;min-width:0}
.j-str{color:#237139}.j-num{color:#146c91}.j-bool{color:#b42336}.j-null{color:#9a5100}.editor-label .char-count{color:#64748b}.j-fold:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.line-numbers{padding-top:18px;background:#f8fafc;color:#94a3b8}
.guide{max-width:none;display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:32px}
.guide section{margin:0;border-color:#e2e8f0;padding:24px;min-width:0}
.guide h2{font-size:18px}
.guide pre{max-width:100%}

button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #2563eb;outline-offset:3px}
.guide-disclosure{margin-top:24px}
.guide-disclosure>summary{cursor:pointer;padding:16px 20px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;color:#334155;font-weight:600}
.guide-disclosure .guide{margin-top:16px}
.editor-wrap{height:var(--editor-height,65vh)}
@media(max-width:900px){.toolbar-group:last-child{margin-left:0}.main{padding:24px 20px}.header-inner{padding:0 20px}}
@media(max-width:768px){.header-inner{height:56px}.main{padding:20px 14px}.toolbar{gap:10px;padding:12px}.toolbar-group+.toolbar-group{padding-left:0;border-left:0}.toolbar-group{width:100%}.btn{min-height:40px;padding:7px 12px}.editor-wrap{height:auto;min-height:0;gap:16px}.editor-col{flex:none!important;min-height:300px;height:340px}.guide{grid-template-columns:1fr}.guide section{padding:20px}.tool-intro{margin-bottom:16px}.back-link{font-size:12px}}
@media(max-width:768px){.editor-col{height:var(--editor-height,340px)}.toolbar-group{width:auto}.toolbar-group:last-child{margin-left:0}}
@media(max-width:768px){.editor-switch{display:flex;gap:8px;margin-bottom:10px}.editor-switch button{flex:1;padding:10px;border:1px solid #e2e8f0;border-radius:7px;background:#fff;color:#334155}.editor-switch [aria-pressed=true]{background:#2563eb;color:white}.editor-wrap[data-view=input] .output-col,.editor-wrap[data-view=output] .input-col{display:none}.toolbar{gap:8px}.toolbar-menu summary{padding:10px}.size-control{margin-left:0}.toolbar-menu>div{left:auto;right:0}.workspace-actions .btn{font-size:12px;padding:8px 10px}.tool-intro h1{font-size:22px}}
/* Compact workspace: slim toolbar, per-panel actions, row based output, inline guide. */
.header-inner{height:60px}
.header .logo{font-size:26px;letter-spacing:-.4px}
.header .site-nav a{font-size:15px}
.main{padding-top:20px}
.tool-intro{margin-bottom:12px}
.tool-intro h1{font-size:clamp(24px,2.6vw,32px);line-height:1.3}
.toolbar{padding:0;background:none;border:0;border-radius:0;margin-bottom:12px;gap:8px}
.toolbar-group+.toolbar-group{padding-left:0;border-left:0}
#workspace-status{margin:0 0 0 auto;font-size:13px;color:#2563eb}
.editor-label{padding:8px 12px;gap:8px;flex-wrap:wrap}
.panel-tools{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.btn-sm{min-height:30px;padding:4px 10px;font-size:12px}
.editor-label .char-count{margin-left:6px;white-space:nowrap}
.json-output{padding:10px 0;white-space:normal;word-break:normal}
.j-row{display:flex;align-items:flex-start}
.j-row:hover{background:#eff6ff}
.j-ln{flex:none;align-self:stretch;width:calc(var(--digits,2)*1ch + 22px);padding:0 10px 0 8px;text-align:right;color:#94a3b8;background:#f8fafc;border-right:1px solid #e2e8f0;user-select:none;font-variant-numeric:tabular-nums}
.no-ln .j-ln{display:none}
.j-fd{flex:none;width:24px;height:1.7em;display:flex;align-items:center;justify-content:center;user-select:none}
.j-fold{margin:0}
.j-code{flex:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;padding-right:14px}
.j-err{color:#cf1322}
.guide-bar{margin-bottom:16px}
#guide-content h1{margin-bottom:16px}
#guide-view .guide{margin:16px 0 0;max-width:none}
@media(max-width:768px){#workspace-status{margin-left:0;width:100%}.panel-tools{width:100%;justify-content:flex-start}}
/* v5: flat display tools in output header, arrow between panels, centred controls, focus ring on the panel */
.btn{justify-content:center;line-height:1.2}
.panel-tools label{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#64748b;white-space:nowrap}
.j-fold{position:relative;width:18px;height:18px;padding:0;font-size:0;line-height:0;display:block}
.j-fold::before{content:"";position:absolute;left:50%;top:50%;width:0;height:0;transform:translate(-50%,-50%);border-style:solid;border-width:5px 4px 0 4px;border-color:currentColor transparent transparent transparent}
.j-fold[aria-expanded=false]::before{border-width:4px 0 4px 5px;border-color:transparent transparent transparent currentColor}
#input:focus,#input:focus-visible{box-shadow:none;outline:none}
.editor-col:focus-within{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb33}
.display-tools{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:6px 12px;border-bottom:1px solid #e2e8f0;background:#fff}
.display-tools label,.panel-tools label{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#64748b;white-space:nowrap}
/* v7: segmented controls, flat toolbar, arrow between panels, red error highlight, bigger notices */
.editor-wrap{gap:10px}
.reuse-arrow{flex:none;align-self:center;width:38px;height:38px;padding:0;display:flex;align-items:center;justify-content:center;border:1px solid #e2e8f0;border-radius:10px;background:#fff;color:#2563eb;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.reuse-arrow:hover{background:#2563eb;color:#fff;border-color:#2563eb}
.reuse-arrow svg{width:20px;height:20px}
.reuse-label{display:none}
.seg{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#64748b;white-space:nowrap}
.seg-btns{display:inline-flex;border:1px solid #e2e8f0;border-radius:7px;overflow:hidden}
.seg-btns button{min-height:28px;padding:0 10px;border:0;background:#fff;color:#64748b;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.seg-btns button+button{border-left:1px solid #e2e8f0}
.seg-btns button[aria-pressed=true]{background:#2563eb;color:#fff}
.input-wrap{position:relative;flex:1;min-height:0;background:#fff}
.input-backdrop,#input{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:18px;border:0;border-radius:0;font:14px/1.7 Menlo,Consolas,"Courier New",monospace;letter-spacing:normal;tab-size:4;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;overflow:auto}
.input-backdrop{z-index:0;color:transparent;pointer-events:none}
.input-backdrop mark{color:transparent;background:rgba(255,59,59,.32);border-radius:3px;box-shadow:0 2px 0 #ff3b3b}
#input{z-index:1;background:transparent;resize:none}
.toast{top:80px;padding:14px 34px;border-radius:12px;font-size:18px;font-weight:600;background:#2563eb;box-shadow:0 8px 28px #0f172a44}
.error-bar{padding:12px 16px;border-radius:10px;font-size:15px;line-height:1.5}
@media(max-width:768px){.reuse-arrow{width:auto;height:40px;padding:0 16px;gap:8px;align-self:stretch}.reuse-label{display:inline;font-size:13px}.editor-wrap[data-view=input] .reuse-arrow{display:none}}
/* v8: title lives in the sticky header */
.header-inner{height:auto;min-height:64px;padding-top:10px;padding-bottom:10px}
.header .logo{font-size:30px;letter-spacing:-.4px}
.header-copy h1{color:#0f172a;font-size:clamp(16px,1.6vw,20px)}
@media(max-width:760px){.header .logo{font-size:22px}}
.main{padding-top:16px}
.tool-intro{display:none}
.seo-article{margin:32px 0 8px;padding:24px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;line-height:1.8;color:#444}
.seo-article h2{font-size:18px;color:#1a1a2e;margin:18px 0 8px}
.seo-article h2:first-child{margin-top:0}
.seo-article a{color:#2563eb}
