/* B64Nex workspace: Input ⇄ Output, options bar, previews, JWT / hash panels */
.ws { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--elev); box-shadow: var(--shadow-card); overflow: hidden; min-height: 560px; }
.ws-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ws-title { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; }
.ws-name { flex: 0 1 260px; min-width: 90px; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; font: 600 14px var(--font-ui); color: var(--text); }
.ws-name:hover, .ws-name:focus { border-color: var(--line-2); background: var(--elev); outline: none; }
.ws-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ws-tools { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.ws-tools button { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--text-2); font: 600 13px var(--font-ui); cursor: pointer; }
.ws-tools button:hover { background: var(--surface-2); }
.ws-tools button.on { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }
.ws-glyph { font: 700 11px var(--font-mono); min-width: 18px; height: 18px; padding: 0 3px; border-radius: 5px; display: inline-grid; place-items: center; background: var(--surface-2); color: inherit; }
.ws-tools button.on .ws-glyph { background: var(--primary); color: #fff; }
.ws-opts { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ws-mode button { min-width: 96px; }
.ws-mode button.on { background: var(--grad); color: #fff; border-color: transparent; }
.ws-o { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.ws-o select { border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; background: var(--elev); color: var(--text); font: 13px var(--font-ui); max-width: 190px; }
.ws-chk { cursor: pointer; user-select: none; }
.ws-chk input { accent-color: var(--primary); width: 15px; height: 15px; }
.ws-live { padding: 4px 10px; border-radius: 999px; background: var(--amber-50); color: var(--text); }
.ws-detect { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 12px; min-height: 0; }
.ws-detect:not(:empty) { padding-top: 8px; }
.ws-badge .badge { display: inline-flex; align-items: center; gap: 5px; }
.badge.badge-v { background: var(--primary-50); color: var(--primary); }
.badge.badge-ok { background: var(--success-bg); color: var(--success); }
.badge.badge-err { background: var(--danger-bg); color: var(--danger); }
.ws-hint, .ws-err { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font: 600 12.5px var(--font-ui); cursor: pointer; border: 1px solid; }
.ws-hint { background: var(--amber-50); border-color: var(--amber); color: var(--text); }
.ws-err { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); text-align: left; }
.ws-panes { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: 0; padding: 10px 12px 6px; min-height: 380px; }
.ws-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; position: relative; }
.ws-phead { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; flex-wrap: wrap; }
.ws-phead b { font-weight: 700; color: var(--text); }
.ws-mini { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--elev); color: var(--text-2); border-radius: 7px; padding: 3px 8px; font: 500 12px var(--font-ui); cursor: pointer; }
.ws-mini:hover { border-color: var(--primary); color: var(--primary); }
.ws-oview button { padding: 3px 9px; font-size: 12px; }
.ws-ta { flex: 1; width: 100%; min-height: 320px; resize: none; border: 0; outline: none; padding: 12px 14px; background: transparent; color: var(--text); font: 13px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-all; tab-size: 4; }
.ws-ta-out { background: var(--code-bg); }
.ws-ta.ws-bad { box-shadow: inset 3px 0 0 var(--danger); }
.ws-ta::selection { background: var(--amber); color: #111; }
.ws-mid { display: grid; place-items: center; }
.ws-swap { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--elev); color: var(--primary); font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-card); transition: transform .2s var(--ease); }
.ws-swap:hover:not(:disabled) { transform: rotate(180deg); border-color: var(--primary); }
.ws-swap:disabled { opacity: .35; cursor: default; }
.ws-file { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow: auto; }
.ws-fdrop { flex: 1; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--line-2); border-radius: 12px; cursor: pointer; text-align: center; padding: 18px; color: var(--text-2); background: var(--grad-soft); }
.ws-fdrop:hover { border-color: var(--primary); }
.ws-fdrop .ico { width: 34px; height: 34px; color: var(--primary); }
.ws-finfo { display: flex; flex-direction: column; gap: 10px; }
.ws-finfo-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--elev); }
.ws-progress { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 26px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; box-shadow: var(--shadow-pop); }
.ws-progress[hidden] { display: none; }
.ws-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--grad); transition: width .15s; }
.ws-progress span { position: relative; font: 600 12px var(--font-ui); color: var(--text); mix-blend-mode: normal; }
.ws-preview, .ws-rich { flex: 1; overflow: auto; padding: 14px; min-height: 320px; }
.ws-pv-media { display: grid; place-items: center; min-height: 200px; border-radius: 10px; background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px; padding: 10px; }
.ws-pv-img { max-width: 100%; max-height: 380px; image-rendering: auto; border-radius: 6px; }
.ws-pv-pdf { width: 100%; height: 440px; border: 0; border-radius: 8px; background: #fff; }
.ws-pv-media video, .ws-pv-media audio, .ws-finfo video, .ws-finfo audio { max-width: 100%; }
.ws-finfo .ws-pv-img { max-height: 240px; align-self: center; }
.ws-finfo .ws-pv-pdf { height: 300px; }
.ws-pv-text { margin: 0; width: 100%; white-space: pre-wrap; word-break: break-word; font: 13px/1.6 var(--font-mono); background: var(--elev); padding: 12px; border-radius: 8px; max-height: 420px; overflow: auto; }
.ws-pv-bin { text-align: center; color: var(--text-2); } .ws-pv-bin .ico { width: 40px; height: 40px; color: var(--primary); } .ws-pv-bin pre { text-align: left; font: 12px/1.5 var(--font-mono); }
.ws-pv-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.ws-note { margin: 0 10px 10px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.ws-note-warn { background: var(--amber-50); color: var(--text); border: 1px solid var(--amber); }
.ws-note-err { background: var(--danger-bg); color: var(--danger); }
.ws-code { margin: 0 0 12px; padding: 12px; border-radius: 10px; background: var(--code-bg); font: 13px/1.55 var(--font-mono); white-space: pre-wrap; word-break: break-all; }
.ws-jwt h4 { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.jwt-h { color: #DB2777; } .jwt-p { color: var(--primary); } .jwt-s { color: #0891B2; }
.jwt-a { border-left: 3px solid #DB2777; } .jwt-b { border-left: 3px solid var(--primary); } .jwt-c { border-left: 3px solid #0891B2; }
.ws-claims { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.ws-claims th { text-align: left; width: 56px; padding: 6px 8px; font: 600 12px var(--font-mono); color: var(--primary); vertical-align: top; }
.ws-claims td { padding: 6px 8px; border-bottom: 1px solid var(--line); word-break: break-all; }
.ws-hash { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ws-hash code { font: 12.5px/1.5 var(--font-mono); word-break: break-all; background: var(--code-bg); padding: 6px 8px; border-radius: 6px; }
.ws-foot { padding: 6px 14px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-dropmask { position: absolute; inset: 0; z-index: 30; display: none; place-items: center; align-content: center; gap: 10px; background: rgba(124,58,237,.12); border: 3px dashed var(--primary); border-radius: 16px; color: var(--primary); font-size: 18px; backdrop-filter: blur(2px); }
.ws-dropmask .ico { width: 40px; height: 40px; }
.ws.ws-dragging .ws-dropmask { display: grid; }
.ws.ws-full { position: fixed; inset: 0; z-index: 900; border-radius: 0; height: 100vh; }
.ws.ws-full .ws-ta { min-height: 0; }
body.ed-noscroll { overflow: hidden; }
[hidden] { display: none !important; }
@media (max-width: 899px) {
  .ws-panes { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 0; padding: 8px; }
  .ws-mid { padding: 6px 0; } .ws-swap { transform: rotate(90deg); } .ws-swap:hover:not(:disabled) { transform: rotate(270deg); }
  .ws-ta { min-height: 200px; }
  .ws-actions .btn span:not(.badge) { display: none; }
  .ws-actions .btn[data-act="save"] span { display: inline; }
  .ws-title { flex-basis: 100%; }
  .ws-opts { gap: 8px; }
  .ws-mode { width: 100%; } .ws-mode button { flex: 1; }
  .ws-o select { max-width: 150px; }
  .ws-hash { grid-template-columns: 1fr auto auto; } .ws-hash code { grid-column: 1 / -1; grid-row: 2; }
  .ws-foot { white-space: normal; }
}
@media print { .ws-bar, .ws-tools, .ws-opts, .ws-in, .ws-mid { display: none !important; } .ws-panes { display: block; } }

/* landing hero: encode mock */
.bm { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 0; padding: 16px; min-height: 300px; align-items: stretch; }
.bm-pane { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
.bm-pane h5 { margin: 0; padding: 7px 10px; font-size: 12px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; justify-content: space-between; }
.bm-pane pre { margin: 0; padding: 12px; font: 12.5px/1.65 var(--font-mono); white-space: pre-wrap; word-break: break-all; color: var(--text-2); flex: 1; }
.bm-pane pre b { color: var(--primary); font-weight: 600; } .bm-pane pre i { color: var(--accent); font-style: normal; background: var(--amber-50); }
.bm-mid { display: grid; place-items: center; font-size: 20px; color: var(--primary); font-weight: 700; }
.bm-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
@media (max-width: 1080px) { .bm { grid-template-columns: 1fr; } .bm-mid { transform: rotate(90deg); padding: 4px 0; } }
.shared-dec { margin-top: 18px; }
.shared-pre { margin: 0; white-space: pre-wrap; word-break: break-all; font: 13px/1.6 var(--font-mono); }
.tool-cards .card .tc-glyph { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; font: 700 13px var(--font-mono); }
/* local documents list (guest, max 20) */
.ed-doclist { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.ed-doc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--elev); }
.ed-doc.on { border-color: var(--primary); background: var(--primary-50); }
.ed-doc b { display: block; cursor: pointer; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* public tool pages */
.tool-hero { padding: 36px 0 18px; }
.tool-hero h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.03em; margin: 0 0 10px; }
.tool-hero p { color: var(--muted); max-width: 760px; margin: 0; font-size: 16px; }
.tool-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
.tool-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-weight: 600; font-size: 14px; background: var(--elev); }
.tool-tabs a.on, .tool-tabs a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 40px 0; }
.tool-cards .card { padding: 22px; }
.tool-cards h3 { margin: 10px 0 6px; font-size: 17px; }
.tool-cards p { margin: 0; color: var(--muted); font-size: 14px; }
.tool-steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 0; list-style: none; }
.tool-steps li { counter-increment: s; padding: 18px 18px 18px 58px; position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--elev); }
.tool-steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; }
.tool-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.tool-faq summary { cursor: pointer; font-weight: 600; }
.tool-faq p { color: var(--text-2); margin: 10px 0 0; }

/* shared read-only page */
.shared-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--elev); box-shadow: var(--shadow-card); }
.shared-view { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); min-height: 420px; max-height: 76vh; overflow: auto; padding: 16px; position: relative; }
.shared-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding: 18px 20px; }

/* home: try-it section */
.home-editor .sec-head { text-align: center; max-width: 780px; margin: 0 auto 26px; }
.home-editor .sec-head h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.025em; margin: 0 0 10px; }
.home-editor .sec-head p { color: var(--muted); margin: 0; font-size: 16px; }
.home-editor .pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.home-editor .pills span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

@media (max-width: 899px) {
.wrap.wrap-wide { max-width: 1480px; }
.shell.shell-wide { grid-template-columns: 236px minmax(0, 1fr); }
.shell.shell-wide > main { padding-left: 20px; padding-right: 20px; }
@media (max-width: 1100px) { .shell.shell-wide { grid-template-columns: 210px minmax(0, 1fr); } }
@media (max-width: 767px) { .shell.shell-wide { grid-template-columns: minmax(0, 1fr); } .shell.shell-wide > main { padding-left: 12px; padding-right: 12px; } }
.hist-view { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.hist-path { font-family: var(--font-mono); font-size: 12px; background: var(--surface); padding: 1px 6px; border-radius: 6px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
