@font-face {
    font-family: "IBM Plex Sans";
    src: url("../../fonts/IBMPlexSans-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../../fonts/IBMPlexSans-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("../../fonts/IBMPlexMono-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    --ink: #0a0a0a;
    --paper: #f2f2ee;
    --white: #fff;
    --soft: #e5e5df;
    --muted: #656561;
    --line-width: 2px;
    --line: var(--line-width) solid var(--ink);
    --content-width: 1600px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

html.is-route-scroll-resetting,
html.is-route-scroll-resetting body {
    overflow-anchor: none;
    scroll-behavior: auto !important;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "IBM Plex Sans", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    border-radius: 0;
}

button,
select,
input[type="checkbox"] {
    cursor: pointer;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

::selection {
    color: var(--white);
    background: var(--ink);
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 8px 12px;
    color: var(--white);
    background: var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

.masthead {
    display: flex;
    min-height: 72px;
    align-items: stretch;
    justify-content: space-between;
    border-bottom: var(--line);
    background: var(--white);
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px 0 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
}

.wordmark-mark {
    display: grid;
    width: 72px;
    align-self: stretch;
    place-items: center;
    color: var(--white);
    background: var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 17px;
}

.masthead-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    border-left: var(--line);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: .06em;
}

.pwa-action {
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    color: var(--ink);
    background: var(--white);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
}

.pwa-action:disabled {
    cursor: wait;
    opacity: .55;
}

.pwa-header-action {
    position: relative;
    display: inline-flex;
    min-width: 104px;
    min-height: 40px;
    overflow: visible;
    padding: 8px 14px;
}

.pwa-header-action[data-pwa-mode="install"] {
    margin-right: 52px;
    margin-left: 52px;
}

.pwa-header-action[data-pwa-mode="install"]::before,
.pwa-header-action[data-pwa-mode="install"]::after {
    position: absolute;
    top: 50%;
    width: 30px;
    color: var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 20px;
    line-height: 1;
    pointer-events: none;
}

.pwa-header-action[data-pwa-mode="install"]::before {
    right: calc(100% + 14px);
    content: "→";
    animation: pwa-arrow-from-left 1.1s ease-in-out infinite;
}

.pwa-header-action[data-pwa-mode="install"]::after {
    left: calc(100% + 14px);
    content: "←";
    animation: pwa-arrow-from-right 1.1s ease-in-out infinite;
}

@keyframes pwa-arrow-from-left {
    0%,
    100% {
        opacity: .4;
        transform: translate(-5px, -50%);
    }

    50% {
        opacity: 1;
        transform: translate(4px, -50%);
    }
}

@keyframes pwa-arrow-from-right {
    0%,
    100% {
        opacity: .4;
        transform: translate(5px, -50%);
    }

    50% {
        opacity: 1;
        transform: translate(-4px, -50%);
    }
}

.button.pwa-overview-action {
    display: none;
}

.install-tip,
.mobile-info-hint,
.mobile-info-rail {
    display: none;
}

/* Keep the fixed hint outside transformed panels, and hide it while changing tools. */
body:has(.main-content.is-swiping) .mobile-info-hint,
body:has(.main-content.is-swipe-settling) .mobile-info-hint {
    opacity: 0;
    pointer-events: none;
}

.meta-divider {
    color: var(--muted);
}

.app-shell {
    display: grid;
    width: min(100%, var(--content-width));
    min-height: calc(100vh - 72px - 54px);
    margin: 0 auto;
    grid-template-columns: 252px minmax(0, 1fr);
    border-right: var(--line);
    border-left: var(--line);
}

.sidebar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    border-right: var(--line);
    background: var(--white);
}

.sidebar-heading,
.panel-label {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .08em;
}

.tool-nav {
    display: flex;
    flex-direction: column;
}

.tool-nav-link {
    display: grid;
    min-height: 76px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ink);
    grid-template-columns: 26px minmax(0, 1fr) auto;
    text-decoration: none;
}

.mobile-home-link {
    display: none;
}

.tool-nav-link[aria-current="page"] {
    color: var(--white);
    background: var(--ink);
}

.tool-number {
    align-self: start;
    padding-top: 2px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
}

.tool-nav-link strong,
.tool-nav-link small {
    display: block;
}

.tool-nav-link strong {
    font-size: 15px;
    letter-spacing: .02em;
}

.tool-nav-link small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 12px;
}

.tool-nav-link[aria-current="page"] small {
    color: #c7c7c2;
}

.sidebar-note {
    margin-top: auto;
    padding: 20px 16px;
    border-top: 1px solid var(--ink);
}

.sidebar-note p {
    margin: 10px 0 0;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 1.75;
}

.eyebrow {
    margin: 0 0 18px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: .08em;
}

.main-content {
    min-width: 0;
}

.tool-panel {
    min-height: 100%;
    padding: clamp(28px, 5vw, 72px);
}

.overview-panel {
    background-image:
        linear-gradient(rgba(10, 10, 10, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 10, 10, .045) 1px, transparent 1px);
    background-size: 32px 32px;
}

.hero-grid {
    display: grid;
    align-items: end;
    gap: 48px;
    margin-bottom: clamp(48px, 7vw, 92px);
    grid-template-columns: minmax(0, 1.8fr) minmax(250px, .8fr);
}

.hero-grid h1,
.tool-header h1 {
    margin: 0;
    font-size: clamp(48px, 6.3vw, 102px);
    font-weight: 700;
    letter-spacing: -.065em;
    line-height: .91;
}

.hero-copy {
    padding-bottom: 4px;
}

.hero-copy > p {
    max-width: 430px;
    margin: 0;
    font-size: clamp(17px, 1.5vw, 22px);
    line-height: 1.45;
}

.text-link {
    display: inline-flex;
    gap: 16px;
    align-items: center;
    padding-right: 4px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

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

.tool-card {
    display: flex;
    min-width: 0;
    min-height: 390px;
    flex-direction: column;
    padding: 20px;
    border: var(--line);
    background: var(--white);
    text-decoration: none;
}

.tool-card:not(:nth-child(3n + 1)) {
    margin-left: calc(0px - var(--line-width));
}

.tool-card:nth-child(n + 4) {
    margin-top: calc(0px - var(--line-width));
}

.tool-card.inverted {
    color: var(--white);
    background: var(--ink);
}

.card-index,
.card-action {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: .08em;
}

.card-symbol {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 28px 0 36px;
    place-items: center;
    border: 2px solid currentColor;
    font-family: "IBM Plex Mono", monospace;
    font-size: 20px;
}

.card-title {
    margin-bottom: 20px;
    font-size: clamp(21px, 1.55vw, 28px);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1;
}

.card-description {
    margin-bottom: 32px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.inverted .card-description {
    color: #bcbcb7;
}

.card-action {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid currentColor;
}

.tool-header {
    display: grid;
    align-items: end;
    gap: 48px;
    margin-bottom: clamp(40px, 6vw, 76px);
    grid-template-columns: minmax(0, 1.55fr) minmax(270px, .75fr);
}

.tool-header h1 {
    max-width: 830px;
    font-size: clamp(44px, 5.8vw, 88px);
}

.tool-header > p {
    max-width: 460px;
    margin: 0;
    font-size: 16px;
}

.workspace-grid,
.decoded-grid,
.jwt-details-grid {
    display: grid;
    align-items: stretch;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-panel,
.output-panel {
    min-width: 0;
    border: var(--line);
    background: var(--white);
}

.control-panel {
    padding: 0 20px 20px;
}

.control-panel > .panel-label {
    margin: 0 -20px 22px;
}

.output-panel {
    display: flex;
    flex-direction: column;
}

.field-grid {
    display: grid;
    gap: 18px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-wide {
    grid-column: 1 / -1;
}

.field > span,
.field > label,
.check-field > span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.field small {
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--ink);
    color: var(--ink);
    background: var(--white);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.code-input:focus,
.code-output:focus {
    outline: 3px solid var(--ink);
    outline-offset: -4px;
}

.check-field {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ink);
}

.check-field input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ink);
}

.check-field > span {
    margin: 0;
}

.check-field small {
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 400;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 2px 5px;
    border: 1px solid transparent;
    border-bottom: 2px solid currentColor;
    color: var(--ink);
    background: transparent;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.button.primary {
    padding: 10px 15px;
    border: 1px solid var(--ink);
    color: var(--ink);
    background: var(--white);
}

.button:disabled {
    cursor: not-allowed;
    opacity: .35;
}

.mini-button {
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--ink);
    color: var(--ink);
    background: var(--white);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
}

.reference-panel {
    margin-top: 20px;
    border: var(--line);
    background: var(--white);
}

.reference-content {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
}

.structure-map {
    display: grid;
    min-width: 0;
}

.emso-map {
    grid-template-columns: 1.6fr .65fr 1fr .55fr;
}

.vat-map {
    grid-template-columns: .55fr 1.45fr .55fr;
}

.structure-part {
    min-width: 0;
    padding: 20px 16px;
    border-right: 1px solid var(--ink);
}

.structure-part:last-child {
    border-right: 0;
}

.structure-part > span {
    display: block;
    margin-bottom: 18px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: .08em;
}

.structure-part strong {
    display: block;
    margin-bottom: 14px;
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(19px, 2.2vw, 32px);
    font-weight: 400;
    letter-spacing: -.06em;
    line-height: 1;
    overflow-wrap: anywhere;
}

.structure-part p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.reference-copy {
    padding: 24px;
    border-left: var(--line);
}

.reference-copy .eyebrow {
    margin-bottom: 12px;
}

.reference-copy h2 {
    margin: 0 0 12px;
    font-size: clamp(22px, 2.4vw, 34px);
    letter-spacing: -.04em;
    line-height: 1.05;
}

.reference-copy > p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.reference-links {
    margin: 22px 0 0;
    padding: 0;
    border-bottom: 1px solid var(--ink);
    list-style: none;
}

.reference-links li {
    border-top: 1px solid var(--ink);
}

.reference-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    text-decoration: none;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.file-drop {
    display: flex;
    min-height: 128px;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 20px;
    padding: 20px;
    border: 2px dashed var(--ink);
    background: var(--paper);
    cursor: pointer;
    text-align: left;
}

.file-drop.is-dragging,
.file-drop:focus-within {
    color: var(--white);
    background: var(--ink);
}

.file-drop-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border: 2px solid currentColor;
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
}

.file-drop strong,
.file-drop small {
    display: block;
}

.file-drop strong {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: .04em;
}

.file-drop small {
    max-width: 300px;
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-drop.is-dragging small,
.file-drop:focus-within small {
    color: #c7c7c2;
}

.qif-options {
    margin-top: 4px;
}

.qif-output {
    min-height: 655px;
    flex: 1;
    padding: 18px;
}

.pdf-import-panel,
.pdf-workspace,
.pdf-export-panel {
    border: var(--line);
    background: var(--white);
}

.field input:disabled {
    color: var(--muted);
    background: var(--soft);
    cursor: not-allowed;
}

.field-input-action {
    display: grid;
    align-items: stretch;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.field-input-action .button {
    min-height: 48px;
}

.pdf-title-word {
    white-space: nowrap;
}

.pdf-workspace,
.pdf-export-panel {
    margin-top: 20px;
}

.pdf-import-body {
    display: grid;
    min-height: 170px;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr);
}

.pdf-file-drop {
    min-height: 170px;
    margin: 0;
    border: 0;
    border-right: var(--line);
}

.pdf-import-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    flex-direction: column;
}

.pdf-import-actions .inline-status {
    margin: 0;
}

.pdf-workspace {
    padding: 26px;
}

.pdf-workspace-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ink);
}

.pdf-workspace-header .eyebrow {
    margin-bottom: 8px;
}

.pdf-workspace-header h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 3.2vw, 48px);
    letter-spacing: -.05em;
    line-height: 1;
}

.pdf-workspace-header p:not(.eyebrow) {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.pdf-workspace-counts {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.pdf-workspace-counts span {
    display: grid;
    min-width: 104px;
    min-height: 70px;
    place-content: center;
    border: 1px solid var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: .05em;
    text-align: center;
}

.pdf-workspace-counts strong {
    display: block;
    font-size: 21px;
    font-weight: 400;
}

.pdf-empty-state {
    display: grid;
    min-height: 330px;
    place-content: center;
    padding: 42px 20px;
    text-align: center;
}

.pdf-empty-state > span {
    display: block;
    margin-bottom: 20px;
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(38px, 6vw, 76px);
    letter-spacing: -.08em;
}

.pdf-empty-state strong {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: .06em;
}

.pdf-empty-state p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.pdf-page-grid {
    display: grid;
    margin: 26px 0 0;
    padding: 0;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    list-style: none;
}

.pdf-page-grid.is-busy {
    pointer-events: none;
}

.pdf-page-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    border: 1px solid var(--ink);
    background: var(--white);
    cursor: grab;
    transition: transform 110ms ease, box-shadow 110ms ease, opacity 110ms ease;
}

.pdf-page-card:active {
    cursor: grabbing;
}

.pdf-page-card:focus-visible {
    z-index: 2;
}

.pdf-page-card.is-dragging {
    opacity: .35;
}

.pdf-page-card.is-drop-before::before,
.pdf-page-card.is-drop-after::after {
    position: absolute;
    z-index: 5;
    top: -5px;
    bottom: -5px;
    width: 5px;
    background: var(--ink);
    content: "";
}

.pdf-page-card.is-drop-before::before {
    left: -10px;
}

.pdf-page-card.is-drop-after::after {
    right: -10px;
}

.pdf-page-card-header {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 9px;
    color: var(--white);
    background: var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: .04em;
}

.pdf-page-position {
    font-size: 12px;
}

.pdf-drag-handle {
    opacity: .72;
}

.pdf-page-preview {
    display: grid;
    min-height: 312px;
    padding: 11px;
    place-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--ink);
    background-color: var(--soft);
    background-image: linear-gradient(45deg, rgba(10, 10, 10, .04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(10, 10, 10, .04) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(10, 10, 10, .04) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(10, 10, 10, .04) 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.pdf-page-preview canvas {
    display: block;
    max-width: 100%;
    max-height: 290px;
    border: 1px solid #c8c8c2;
    background: var(--white);
    box-shadow: 0 5px 14px rgba(10, 10, 10, .16);
}

.pdf-page-loading {
    max-width: 140px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    letter-spacing: .05em;
    line-height: 1.5;
    text-align: center;
}

.pdf-page-loading.is-error {
    font-weight: 700;
}

.pdf-page-information {
    min-height: 72px;
    padding: 12px;
}

.pdf-page-information strong,
.pdf-page-information span {
    display: block;
}

.pdf-page-source {
    overflow: hidden;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-page-rotation {
    margin-top: 6px;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 8px;
    letter-spacing: .04em;
}

.pdf-page-actions {
    display: grid;
    margin-top: auto;
    border-top: 1px solid var(--ink);
    grid-template-columns: repeat(5, 1fr);
}

.pdf-page-action {
    min-width: 0;
    min-height: 40px;
    padding: 5px;
    border: 0;
    border-right: 1px solid var(--ink);
    color: var(--ink);
    background: var(--white);
    font-family: "IBM Plex Mono", monospace;
    font-size: 16px;
}

.pdf-page-action:last-child {
    border-right: 0;
}

.pdf-page-action:hover:not(:disabled),
.pdf-page-action:focus-visible {
    color: var(--white);
    background: var(--ink);
}

.pdf-page-action:disabled {
    cursor: not-allowed;
    opacity: .24;
}

.pdf-export-body {
    display: grid;
    align-items: end;
    gap: 16px;
    padding: 22px;
    grid-template-columns: minmax(240px, 1fr) auto auto;
}

.pdf-name-field > span {
    margin-bottom: 7px;
}

.pdf-download-button,
.pdf-share-button {
    min-height: 48px;
}

.pdf-export-note {
    margin: 0;
    padding: 0 22px 22px;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
    line-height: 1.5;
}

.inline-status,
.panel-footnote {
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
}

.inline-status {
    min-height: 1.5em;
    margin: 16px 0 0;
}

.inline-status.is-error {
    color: var(--ink);
    font-weight: 700;
}

.inline-status.is-error::before {
    content: "NAPAKA / ";
}

.code-input,
.code-output,
.code-block {
    tab-size: 4;
    color: var(--ink);
    background: var(--white);
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.code-input,
.code-output {
    width: 100%;
    resize: vertical;
}

.code-output {
    border: 0;
}

.identifier-output {
    min-height: 345px;
    flex: 1;
    padding: 18px;
}

.panel-footnote {
    margin: auto 0 0;
    padding: 11px 16px;
    border-top: 1px solid var(--ink);
}

.compact-panel {
    padding-bottom: 16px;
}

.compact-panel > .panel-label {
    margin-bottom: 0;
}

.jwt-input {
    min-height: 130px;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid var(--ink);
}

.compact-panel > .jwt-input {
    width: calc(100% + 40px);
    margin-left: -20px;
}

.validation-strip {
    display: grid;
    margin-top: 20px;
    border-top: var(--line);
    border-left: var(--line);
    background: var(--white);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.validation-strip > div {
    display: flex;
    min-width: 0;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-right: var(--line);
    border-bottom: var(--line);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
}

.state {
    padding: 4px 7px;
    border: 1px solid currentColor;
    font-size: 9px;
    white-space: nowrap;
}

.state.valid {
    color: var(--white);
    background: var(--ink);
}

.state.invalid {
    border-style: dashed;
}

.state.neutral {
    color: var(--muted);
}

.prominent-status {
    min-height: 22px;
    margin: 12px 0 18px;
}

.decoded-grid,
.jwt-details-grid {
    margin-top: 20px;
}

.code-block {
    min-height: 260px;
    max-height: 460px;
    margin: 0;
    overflow: auto;
    padding: 18px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.claim-list {
    display: flex;
    flex-direction: column;
}

.claim-row {
    display: grid;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--soft);
    grid-template-columns: 88px minmax(0, 1fr);
    font-size: 12px;
}

.claim-row:last-child {
    border-bottom: 0;
}

.claim-row strong {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
}

.claim-row span {
    overflow-wrap: anywhere;
}

.key-input {
    min-height: 102px !important;
    resize: vertical;
    font-family: "IBM Plex Mono", monospace !important;
    font-size: 11px !important;
}

.compact-field {
    display: grid;
    align-items: center;
    gap: 12px;
    grid-template-columns: auto minmax(130px, 1fr);
}

.compact-field > span {
    margin: 0;
}

.compact-field select {
    min-height: 40px;
}

.json-toolbar {
    display: grid;
    align-items: end;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px;
    grid-template-columns: 210px auto minmax(280px, 1fr);
}

.json-toolbar .field > span {
    margin-bottom: 5px;
}

.toolbar-check {
    min-height: 48px;
}

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

.json-grid {
    margin-top: 0;
}

.json-editor {
    min-height: min(52vh, 620px);
    padding: 18px;
    border: 0;
    resize: vertical;
}

.toast {
    position: fixed;
    z-index: 20;
    right: 22px;
    bottom: 22px;
    max-width: min(360px, calc(100vw - 44px));
    padding: 13px 16px;
    border: var(--line);
    color: var(--ink);
    background: var(--white);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
}

.site-footer {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-top: var(--line);
    color: var(--white);
    background: var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: .06em;
}

.site-footer a {
    text-decoration: none;
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.mobile-info-rail a {
    color: inherit;
}

.policy-main {
    min-height: calc(100vh - 72px - 54px);
    padding: clamp(28px, 5vw, 72px);
    background-image:
        linear-gradient(rgba(10, 10, 10, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 10, 10, .045) 1px, transparent 1px);
    background-size: 32px 32px;
}

.policy-back-button {
    position: fixed;
    z-index: 50;
    top: 94px;
    right: max(22px, var(--safe-right));
    left: auto;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: var(--line);
    color: var(--white);
    background: var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 19px;
    line-height: 1;
    text-decoration: none;
}

.policy-shell {
    width: min(100%, 1080px);
    margin: 0 auto;
    border-top: var(--line);
    border-left: var(--line);
    background: var(--white);
}

.policy-hero {
    display: grid;
    gap: 40px;
    padding: clamp(28px, 5vw, 64px);
    border-right: var(--line);
    border-bottom: var(--line);
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
}

.policy-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 700;
    letter-spacing: -.06em;
    line-height: .92;
}

.policy-hero-copy {
    align-self: end;
}

.policy-hero-copy p {
    margin: 0 0 20px;
    font-size: 17px;
}

.policy-updated {
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: .06em;
}

.policy-section {
    display: grid;
    border-right: var(--line);
    border-bottom: var(--line);
    grid-template-columns: minmax(190px, .34fr) minmax(0, 1fr);
}

.policy-section > h2 {
    margin: 0;
    padding: 28px;
    border-right: 1px solid var(--ink);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: .08em;
    line-height: 1.45;
}

.policy-copy {
    min-width: 0;
    padding: 28px clamp(24px, 4vw, 48px);
}

.policy-copy > :first-child {
    margin-top: 0;
}

.policy-copy > :last-child {
    margin-bottom: 0;
}

.policy-copy p,
.policy-copy li {
    max-width: 760px;
}

.policy-copy ul {
    margin: 16px 0;
    padding-left: 20px;
}

.policy-copy li + li {
    margin-top: 8px;
}

.policy-copy code {
    padding: 2px 5px;
    border: 1px solid var(--ink);
    background: var(--paper);
    font-family: "IBM Plex Mono", monospace;
    font-size: .85em;
}

.policy-copy a {
    text-underline-offset: 3px;
}

.policy-note {
    padding: 16px;
    border: 1px dashed var(--ink);
    background: var(--paper);
}

@media (hover: hover) and (pointer: fine) {
    .policy-back-button:hover {
        color: var(--ink);
        background: var(--white);
        box-shadow: 3px 3px 0 var(--ink);
        transform: translate(-2px, -2px);
    }

    .tool-nav-link:hover {
        color: var(--white);
        background: var(--ink);
    }

    .tool-nav-link:hover small {
        color: #c7c7c2;
    }

    .tool-card,
    .text-link,
    .reference-links a,
    .button,
    .pwa-header-action,
    .mini-button,
    .file-drop,
    .text-link > span[aria-hidden="true"],
    .reference-links a > span[aria-hidden="true"] {
        transition: color 120ms ease, background-color 120ms ease,
            border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
    }

    .tool-card:hover {
        z-index: 1;
        transform: translate(-4px, -4px);
        box-shadow: 6px 6px 0 var(--ink);
    }

    .text-link:hover {
        transform: translate(-2px, -2px);
        box-shadow: 3px 3px 0 var(--ink);
    }

    .text-link:hover > span[aria-hidden="true"],
    .reference-links a:hover > span[aria-hidden="true"] {
        transform: translateX(4px);
    }

    .reference-links a:hover {
        z-index: 1;
        outline: 1px solid var(--ink);
        background: var(--white);
        box-shadow: 3px 3px 0 var(--ink);
        font-weight: 700;
        transform: translate(-2px, -2px);
    }

    .button:hover:not(:disabled) {
        border-color: var(--ink);
        box-shadow: 3px 3px 0 var(--ink);
        transform: translate(-2px, -2px);
    }

    .mini-button:hover:not(:disabled) {
        color: var(--white);
        background: var(--ink);
        box-shadow: 2px 2px 0 var(--ink);
        transform: translate(-1px, -1px);
    }

    .button:active:not(:disabled),
    .mini-button:active:not(:disabled) {
        box-shadow: none;
        transform: translate(0, 0);
    }

    .file-drop:hover {
        color: var(--white);
        background: var(--ink);
    }

    .file-drop:hover small {
        color: #c7c7c2;
    }
}
@media (max-width: 1180px) {
    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-grid .tool-card {
        min-height: 350px;
        margin-top: 0;
        margin-left: 0;
    }

    .overview-grid .tool-card:nth-child(even) {
        margin-left: calc(0px - var(--line-width));
    }

    .overview-grid .tool-card:nth-child(n + 3) {
        margin-top: calc(0px - var(--line-width));
    }

    .json-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar-actions {
        justify-content: flex-start;
        grid-column: 1 / -1;
    }

    .reference-content {
        grid-template-columns: 1fr;
    }

    .reference-copy {
        border-top: var(--line);
        border-left: 0;
    }

    .pdf-export-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pdf-name-field {
        grid-column: 1 / -1;
    }

}

@media (max-width: 860px) {
    body {
        /* Clip sideways swipes without creating an extra vertical scroll container. */
        overflow-x: clip;
    }

    .masthead-meta {
        padding: 0 16px;
    }

    .app-shell {
        display: block;
        border: 0;
    }

    .main-content {
        position: relative;
        touch-action: pan-y;
    }

    .main-content.is-swiping,
    .main-content.is-swipe-settling {
        overflow-anchor: none;
    }

    .tool-panel.is-swipe-active {
        position: relative;
        z-index: 2;
        background-color: var(--paper);
        will-change: transform;
    }

    .tool-panel.is-swipe-target {
        position: absolute;
        z-index: 1;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 100%;
        pointer-events: none;
        background-color: var(--paper);
        will-change: transform;
    }

    .main-content.is-swipe-settling .tool-panel.is-swipe-active,
    .main-content.is-swipe-settling .tool-panel.is-swipe-target {
        transition: transform 260ms cubic-bezier(.22, .72, .18, 1);
    }

    .sidebar {
        position: sticky;
        z-index: 45;
        top: 0;
        display: block;
        overflow-x: auto;
        scrollbar-width: none;
        border-top: 0;
        border-right: 0;
        border-bottom: var(--line);
    }

    .sidebar-heading,
    .sidebar-note {
        display: none;
    }

    .tool-nav {
        display: grid;
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(var(--tool-count, 6), calc(100% / 6));
    }

    .tool-nav-link {
        min-width: 0;
        min-height: 66px;
        padding: 8px 10px;
        border-right: 1px solid var(--ink);
        border-bottom: 0;
        grid-template-columns: 20px minmax(0, 1fr);
    }

    .tool-nav-link:last-child {
        border-right: 0;
    }

    .tool-nav-link > span:last-child {
        display: none;
    }

    .hero-grid,
    .tool-header {
        align-items: start;
        gap: 28px;
        grid-template-columns: 1fr;
    }

    .workspace-grid,
    .jwt-details-grid {
        grid-template-columns: 1fr;
    }

    .pdf-import-body {
        grid-template-columns: 1fr;
    }

    .pdf-file-drop {
        border-right: 0;
        border-bottom: var(--line);
    }

    .policy-hero {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    body {
        --mobile-info-width: calc(100vw / 7);
        --mobile-nav-height: calc((100vw / 7) + var(--line-width));
    }

    .masthead {
        display: none;
    }

    .app-shell {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .tool-nav {
        grid-template-columns: repeat(var(--tool-route-count, 7), calc(100vw / 7));
        grid-template-rows: calc(100vw / 7);
    }

    .tool-nav-link {
        display: flex;
        height: 100%;
        min-height: 0;
        align-items: center;
        justify-content: center;
        padding: 6px 4px;
        background: var(--white);
        text-align: center;
    }

    .mobile-home-link {
        display: flex;
        min-height: 0;
        aspect-ratio: auto;
        padding: 0;
        font-family: "IBM Plex Mono", monospace;
    }

    .tool-nav-link.mobile-home-link strong {
        font-size: 15px;
        letter-spacing: -.08em;
    }

    .tool-nav-link .tool-number,
    .tool-nav-link small {
        display: none;
    }

    .tool-nav-link strong {
        font-size: 10px;
    }

    .text-link,
    .reference-links a {
        min-height: 44px;
    }

    .tool-panel {
        padding: 34px 16px 46px;
    }

    .hero-grid h1,
    .tool-header h1 {
        font-size: clamp(40px, 12vw, 54px);
    }

    .hero-grid {
        margin-bottom: 46px;
    }

    .hero-grid:has(.install-tip:not([hidden])) {
        margin-bottom: 24px;
    }

    .install-tip {
        position: relative;
        display: block;
        max-width: 430px;
        margin-top: 16px;
        border: var(--line);
        background: var(--white);
    }

    .install-tip-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 9px;
        color: var(--white);
        background: var(--ink);
        font-family: "IBM Plex Mono", monospace;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: .06em;
    }

    .install-tip-heading span:last-child {
        font-size: 14px;
        line-height: 1;
    }

    .install-tip-body {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }

    .install-tip-copy {
        min-width: 0;
        flex: 1 1 auto;
        max-width: none;
        margin: 0;
        padding: 0;
        font-size: 13px;
        line-height: 1.3;
    }

    .install-tip-name {
        font-weight: 700;
    }

    .button.pwa-overview-action {
        display: inline-flex;
        width: auto;
        min-height: 40px;
        flex: 0 0 auto;
        margin: 0;
        padding: 8px 10px 5px;
    }

    .mobile-info-hint {
        position: fixed;
        z-index: 31;
        top: calc(var(--safe-top) + var(--mobile-nav-height) + 150px);
        left: var(--safe-left);
        display: grid;
        width: 16px;
        height: 34px;
        place-items: center;
        padding: 0;
        border: 0;
        color: var(--white);
        background: var(--ink);
        font-family: "IBM Plex Mono", monospace;
        font-size: 10px;
        line-height: 1;
        transition: opacity 160ms ease;
    }

    body.is-mobile-info-open .mobile-info-hint {
        opacity: 0;
        pointer-events: none;
    }

    .mobile-info-rail {
        position: fixed;
        z-index: 40;
        top: calc(var(--mobile-nav-height) + var(--safe-top));
        bottom: var(--safe-bottom);
        left: 0;
        display: block;
        width: calc(var(--mobile-info-width) + var(--safe-left));
        padding-left: var(--safe-left);
        border-right: var(--line);
        color: var(--white);
        background: var(--ink);
        transform: translate3d(-100%, 0, 0);
        transition: transform 240ms cubic-bezier(.22, .72, .18, 1);
        will-change: transform;
    }

    .mobile-info-rail::before {
        position: absolute;
        top: 0;
        right: 100%;
        width: 100vw;
        height: 100%;
        content: "";
        background: var(--ink);
    }

    body.is-mobile-info-open .mobile-info-rail {
        transform: translate3d(0, 0, 0);
    }

    body.is-mobile-info-open .overview-panel {
        transform: translate3d(var(--mobile-info-width), 0, 0);
    }

    body.is-mobile-info-settling .overview-panel {
        transition: transform 240ms cubic-bezier(.22, .72, .18, 1);
    }

    body.is-mobile-info-dragging .mobile-info-rail {
        transition: none;
    }

    body.is-mobile-info-dragging .overview-panel {
        will-change: transform;
    }

    .mobile-info-close {
        position: absolute;
        z-index: 1;
        top: 8px;
        right: 0;
        left: var(--safe-left);
        display: grid;
        width: auto;
        min-width: 0;
        height: 44px;
        place-items: center;
        padding: 0;
        border: 0;
        color: var(--white);
        background: transparent;
        appearance: none;
        font-family: "IBM Plex Mono", monospace;
        font-size: 18px;
        line-height: 1;
    }

    .mobile-info-rail-content {
        position: absolute;
        top: 62px;
        right: 0;
        bottom: 28px;
        left: var(--safe-left);
        display: flex;
        align-items: center;
        gap: 18px;
        flex-direction: column;
        padding: 12px 14px;
        font-family: "IBM Plex Mono", monospace;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .06em;
        line-height: 1;
        white-space: nowrap;
    }

    .mobile-info-rail-content > * {
        flex: 0 0 auto;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
    }

    .mobile-info-author {
        margin-top: auto;
    }

    .mobile-info-rail-content a {
        text-decoration-line: underline;
        text-underline-offset: 4px;
    }

    .landing-footer {
        display: none;
    }

    .overview-grid,
    .decoded-grid,
    .json-toolbar {
        grid-template-columns: 1fr;
    }

    .overview-grid .tool-card:nth-child(n) {
        min-height: 330px;
        margin-left: 0;
    }

    .overview-grid .tool-card:nth-child(n + 2) {
        margin-top: calc(0px - var(--line-width));
    }

    .validation-strip {
        grid-template-columns: 1fr;
    }

    .validation-strip > div {
        min-height: 52px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .json-toolbar {
        align-items: stretch;
    }

    .toolbar-actions {
        grid-column: auto;
    }

    .toolbar-actions .button,
    .form-actions .button {
        flex: 1 1 150px;
    }

    .json-editor {
        min-height: 330px;
    }

    .emso-map {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .structure-part {
        padding: 16px 12px;
    }

    .emso-map .structure-part:nth-child(2) {
        border-right: 0;
    }

    .emso-map .structure-part:nth-child(-n + 2) {
        border-bottom: 1px solid var(--ink);
    }

    .reference-copy {
        padding: 20px 16px;
    }

    .pdf-workspace {
        padding: 18px 14px;
    }

    .pdf-workspace-header {
        align-items: stretch;
        gap: 22px;
        flex-direction: column;
    }

    .pdf-workspace-counts span {
        min-width: 0;
        flex: 1;
    }

    .pdf-page-grid {
        grid-template-columns: 1fr;
    }

    .pdf-page-card.is-drop-before::before,
    .pdf-page-card.is-drop-after::after {
        right: -5px;
        left: -5px;
        width: auto;
        height: 5px;
    }

    .pdf-page-card.is-drop-before::before {
        top: -10px;
        bottom: auto;
    }

    .pdf-page-card.is-drop-after::after {
        top: auto;
        bottom: -10px;
    }

    .pdf-page-preview {
        min-height: 360px;
    }

    .pdf-export-body {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .pdf-name-field {
        grid-column: auto;
    }

    .pdf-download-button,
    .pdf-share-button {
        width: 100%;
    }

    .site-footer {
        min-height: 56px;
        gap: 8px;
        padding: 0 10px;
        flex-wrap: nowrap;
        font-size: clamp(7px, 2vw, 9px);
        letter-spacing: .04em;
        white-space: nowrap;
    }

    .site-footer-links {
        min-width: 0;
        justify-content: flex-end;
        gap: clamp(8px, 2vw, 12px);
    }

    .policy-main {
        min-height: calc(100vh - 68px);
        min-height: calc(100dvh - 68px);
        padding: 24px 16px 36px;
    }

    .policy-back-button {
        top: auto;
        right: max(16px, var(--safe-right));
        bottom: max(16px, var(--safe-bottom));
        left: auto;
    }

    .policy-hero {
        gap: 28px;
        padding: 28px 20px;
    }

    .policy-hero h1 {
        font-size: clamp(42px, 13vw, 62px);
    }

    .policy-section {
        grid-template-columns: 1fr;
    }

    .policy-section > h2 {
        padding: 16px 20px;
        border-right: 0;
        border-bottom: 1px solid var(--ink);
    }

    .policy-copy {
        padding: 22px 20px;
    }
}

@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    body {
        --mobile-info-width: calc(100dvh / 7);
        overflow-x: clip;
    }

    .masthead {
        display: none;
    }

    .policy-back-button {
        top: auto;
        right: max(16px, var(--safe-right));
        bottom: max(16px, var(--safe-bottom));
        left: auto;
    }

    .app-shell {
        display: grid;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        border: 0;
        grid-template-columns: calc((100vh / 7) + var(--line-width)) minmax(0, 1fr);
        grid-template-columns: calc((100dvh / 7) + var(--line-width)) minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        z-index: 20;
        top: 0;
        display: block;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        border-top: 0;
        border-right: var(--line);
        border-bottom: 0;
    }

    .sidebar-heading,
    .sidebar-note {
        display: none;
    }

    .tool-nav {
        display: grid;
        width: 100%;
        height: 100%;
        min-width: 0;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(var(--tool-route-count, 7), calc(100dvh / 7));
    }

    .tool-nav-link {
        display: flex;
        min-width: 0;
        min-height: 0;
        align-items: center;
        justify-content: center;
        padding: 3px 2px;
        border-right: 0;
        border-bottom: 1px solid var(--ink);
        background: var(--white);
        text-align: center;
    }

    .tool-nav-link:last-child {
        border-bottom: 0;
    }

    .mobile-home-link {
        display: flex;
        aspect-ratio: auto;
        padding: 0;
        font-family: "IBM Plex Mono", monospace;
    }

    .tool-nav-link .tool-number,
    .tool-nav-link small,
    .tool-nav-link > span:last-child {
        display: none;
    }

    .tool-nav-link strong {
        font-size: 8px;
        line-height: 1.1;
    }

    .tool-nav-link.mobile-home-link strong {
        font-size: 15px;
        letter-spacing: -.08em;
    }

    .main-content {
        position: relative;
        touch-action: pan-y;
    }

    .main-content.is-swiping,
    .main-content.is-swipe-settling {
        overflow-anchor: none;
    }

    .tool-panel.is-swipe-active {
        position: relative;
        z-index: 2;
        background-color: var(--paper);
        will-change: transform;
    }

    .tool-panel.is-swipe-target {
        position: absolute;
        z-index: 1;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 100%;
        pointer-events: none;
        background-color: var(--paper);
        will-change: transform;
    }

    .main-content.is-swipe-settling .tool-panel.is-swipe-active,
    .main-content.is-swipe-settling .tool-panel.is-swipe-target {
        transition: transform 260ms cubic-bezier(.22, .72, .18, 1);
    }

    .tool-panel {
        padding: clamp(24px, 4vw, 44px);
    }

    .hero-grid,
    .tool-header {
        gap: 32px;
    }

    .hero-grid h1,
    .tool-header h1 {
        font-size: clamp(44px, 6vw, 56px);
    }

    .button.pwa-overview-action {
        display: inline-flex;
        width: auto;
        min-height: 38px;
        flex: 0 0 auto;
        margin: 0;
        padding: 7px 9px 4px;
    }

    .mobile-info-hint {
        position: fixed;
        z-index: 31;
        top: calc(var(--safe-top) + 50%);
        left: calc((100dvh / 7) + var(--line-width));
        display: grid;
        width: 16px;
        height: 34px;
        place-items: center;
        padding: 0;
        border: 0;
        color: var(--white);
        background: var(--ink);
        font-family: "IBM Plex Mono", monospace;
        font-size: 10px;
        line-height: 1;
        transform: translateY(-50%);
        transition: opacity 160ms ease;
    }

    body.is-mobile-info-open .mobile-info-hint {
        opacity: 0;
        pointer-events: none;
    }

    .install-tip {
        display: block;
        max-width: 360px;
        margin-top: 10px;
        border: var(--line);
        background: var(--white);
    }

    .install-tip-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 5px 8px;
        color: var(--white);
        background: var(--ink);
        font-family: "IBM Plex Mono", monospace;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: .06em;
    }

    .install-tip-body {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 8px;
    }

    .install-tip-copy {
        min-width: 0;
        flex: 1 1 auto;
        margin: 0;
        padding: 0;
        font-size: 11px;
        line-height: 1.3;
    }

    .install-tip-name {
        font-weight: 700;
    }

    .mobile-info-rail {
        position: fixed;
        z-index: 40;
        top: var(--safe-top);
        right: auto;
        bottom: var(--safe-bottom);
        left: calc((100dvh / 7) + var(--line-width));
        display: block;
        width: var(--mobile-info-width);
        border-right: var(--line);
        color: var(--white);
        background: var(--ink);
        transform: translate3d(-100%, 0, 0);
        transition: transform 240ms cubic-bezier(.22, .72, .18, 1);
        will-change: transform;
    }

    .mobile-info-rail::before {
        position: absolute;
        top: 0;
        right: 100%;
        width: 100vw;
        height: 100%;
        content: "";
        background: var(--ink);
    }

    body.is-mobile-info-open .mobile-info-rail {
        transform: translate3d(0, 0, 0);
    }

    body.is-mobile-info-open .overview-panel {
        transform: translate3d(var(--mobile-info-width), 0, 0);
    }

    body.is-mobile-info-settling .overview-panel {
        transition: transform 240ms cubic-bezier(.22, .72, .18, 1);
    }

    body.is-mobile-info-dragging .mobile-info-rail {
        transition: none;
    }

    body.is-mobile-info-dragging .overview-panel {
        will-change: transform;
    }

    .mobile-info-close {
        position: absolute;
        z-index: 1;
        top: 8px;
        left: 11px;
        display: grid;
        width: 44px;
        height: 44px;
        place-items: center;
        padding: 0;
        border: 0;
        color: var(--white);
        background: var(--ink);
        font-family: "IBM Plex Mono", monospace;
        font-size: 18px;
    }

    .mobile-info-rail-content {
        position: absolute;
        top: 60px;
        right: 0;
        bottom: 20px;
        left: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-direction: column;
        padding: 6px 12px;
        font-family: "IBM Plex Mono", monospace;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: .05em;
        line-height: 1;
        white-space: nowrap;
    }

    .mobile-info-rail-content > * {
        flex: 0 0 auto;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
    }

    .mobile-info-author {
        margin-top: auto;
    }

    .mobile-info-rail-content a {
        text-decoration-line: underline;
        text-underline-offset: 4px;
    }

    .landing-footer {
        display: none;
    }
}
@media (display-mode: standalone) {
    body {
        min-height: 100vh;
        min-height: 100dvh;
        padding-right: var(--safe-right);
        padding-left: var(--safe-left);
    }

    .masthead {
        padding-top: var(--safe-top);
    }

    .site-footer {
        padding-right: max(24px, var(--safe-right));
        padding-bottom: var(--safe-bottom);
        padding-left: max(24px, var(--safe-left));
    }

    .toast {
        right: max(22px, var(--safe-right));
        bottom: max(22px, var(--safe-bottom));
    }
}
@media (display-mode: standalone) and (max-width: 640px) {
    .app-shell {
        padding-top: var(--safe-top);
    }

    .sidebar {
        top: var(--safe-top);
    }

    .policy-main {
        padding-top: max(24px, var(--safe-top));
    }

    .site-footer {
        padding-right: max(10px, var(--safe-right));
        padding-left: max(10px, var(--safe-left));
    }
}

@media (display-mode: standalone) and (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    .app-shell {
        padding-top: var(--safe-top);
    }

    .sidebar {
        top: var(--safe-top);
        height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
    }
}

@media (orientation: landscape) and (max-width: 640px),
       (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    .mobile-info-hint,
    .mobile-info-rail {
        display: none;
    }

    body.is-mobile-info-open .overview-panel {
        transform: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .tool-card,
    .text-link,
    .reference-links a,
    .button,
    .pwa-header-action,
    .mobile-info-hint,
    .mobile-info-rail,
    .mini-button,
    .file-drop,
    .text-link > span[aria-hidden="true"],
    .reference-links a > span[aria-hidden="true"] {
        transition: none;
    }

    .main-content.is-swipe-settling .tool-panel.is-swipe-active,
    .main-content.is-swipe-settling .tool-panel.is-swipe-target {
        transition-duration: 1ms;
    }

    .pwa-header-action[data-pwa-mode="install"]::before,
    .pwa-header-action[data-pwa-mode="install"]::after {
        opacity: 1;
        animation: none;
        transform: translate(0, -50%);
    }

    .mobile-info-hint,
    .mobile-info-rail {
        transition-duration: 1ms;
    }

    body.is-mobile-info-settling .overview-panel {
        transition-duration: 1ms;
    }
}

@media print {
    .masthead,
    .sidebar,
    .site-footer,
    .mobile-info-hint,
    .mobile-info-rail,
    .policy-back-button,
    .form-actions,
    .json-toolbar {
        display: none;
    }

    .app-shell {
        display: block;
        border: 0;
    }

    .tool-panel {
        padding: 0;
    }
}
/* New explanatory content only; original workspace rules remain unchanged. */
.tool-help .reference-copy { min-width: 0; overflow-wrap: anywhere; }
.tool-help .reference-copy:nth-child(odd) { border-left: 0; }
.tool-help h3 { font-size: 16px; margin: 0 0 12px; }
.tool-help p { margin: 0 0 18px; }
.agent-documentation pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-documentation { max-width: 1080px; margin: auto; padding: 36px 24px; }
.agent-documentation section { margin-block: 32px; }
.agent-documentation code { overflow-wrap: anywhere; }
.artifact-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.image-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin-top: 24px; }
.image-card { min-width: 0; padding: 20px; border: var(--line); background: var(--white); }
.image-card img { display: block; width: 100%; height: 160px; object-fit: contain; background: var(--paper); }
.image-card h2 { margin-top: 16px; font-size: 18px; overflow-wrap: anywhere; }
.image-card p, .image-card a { overflow-wrap: anywhere; }
.image-drop.is-dragging { outline: 3px dashed var(--ink); outline-offset: -8px; }
[data-panel="jwt-generator"] .control-panel,
[data-panel="image-resizer"] .control-panel { padding-top: 20px; }
[data-panel="image-resizer"] .image-drop { margin-bottom: 20px; }
[data-panel="jwt-generator"] .form-actions + .field { display: block; margin-top: 24px; }
[data-panel="jwt-generator"] .control-panel > .field-grid:not(:first-child),
[data-panel="jwt-generator"] .decoded-grid { margin-top: 24px; }
[data-panel="jwt-generator"] input[type="datetime-local"] { min-width: 0; max-width: 100%; }
[data-panel="image-resizer"] .field-grid { margin-bottom: 20px; }
.sidebar::-webkit-scrollbar { display: none; }
