/*
 * DeltaV Mods - toolbox.
 *
 * Styles for the tools hub and the four editors. The editors are adapted
 * from Stormworks-Tools-Online (MIT, lganic); the look follows the dark
 * DeltaV theme instead of the light original.
 */

/* Keep account actions at the right when tool pages hide project search. */
.tool-page .header-actions,
.tools-hub-page .header-actions {
    margin-left: auto;
}

/* ------------------------------------------------------------- tools hub */

.tools-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
    gap: 32px;
    align-items: center;
    padding: 46px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(620px 320px at 8% 0%, rgba(47, 159, 224, 0.16), transparent 62%),
        radial-gradient(480px 280px at 100% 100%, rgba(217, 128, 90, 0.12), transparent 60%),
        linear-gradient(145deg, var(--surface-2), var(--surface));
    overflow: hidden;
}

.tools-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(91, 180, 227, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 180, 227, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%);
    pointer-events: none;
}

.tools-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.tools-hero h1 {
    margin: 14px 0 14px;
    font-family: var(--display);
    font-size: clamp(1.7rem, 3.4vw, 2.8rem);
    line-height: 1.12;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.tools-hero p {
    max-width: 560px;
    margin: 0;
    color: var(--text-2);
    font-size: 15px;
}

.tools-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.tools-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 26px;
    color: var(--text-3);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tools-hero-stats strong {
    display: block;
    color: var(--green-bright);
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0;
}

.tools-hero-art {
    position: relative;
    z-index: 1;
    justify-self: center;
    width: min(100%, 320px);
}

.tools-hero-art svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
}

.tool-hub-section {
    margin-top: 46px;
}

.tool-hub-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 28px;
    margin-bottom: 20px;
}

.tool-hub-head h2 {
    margin-top: 6px;
    font-family: var(--display);
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    text-transform: uppercase;
}

.tool-hub-head p {
    max-width: 460px;
    margin: 0;
    color: var(--text-3);
    font-size: 13.5px;
}

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

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px 26px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    color: var(--text);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    color: var(--text);
}

.tool-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(47, 159, 224, 0.34);
    border-radius: 16px;
    background: var(--green-soft);
    color: var(--green-bright);
}

.tool-card h3 {
    font-size: 1.05rem;
}

.tool-card p {
    flex: 1;
    margin: 0;
    color: var(--text-3);
    font-size: 13.5px;
    line-height: 1.6;
}

.tool-card .tag-row {
    margin: 2px 0 4px;
}

.tool-card-go {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--green);
    font-size: 13px;
    font-weight: 600;
}

.tool-hub-note {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 26px;
}

.tool-hub-note > div {
    padding: 24px 26px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: rgba(19, 32, 27, 0.55);
}

.tool-hub-note h2 {
    margin: 8px 0 8px;
    font-size: 1.02rem;
}

.tool-hub-note p {
    margin: 0;
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.65;
}

.tool-hub-note code,
.tools-credit code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--surface-3);
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 0.92em;
}

.tools-credit {
    margin: 28px 0 0;
    color: var(--text-3);
    font-size: 12.5px;
    text-align: center;
}

.tools-credit .icon {
    vertical-align: -2px;
}

/* ------------------------------------------------------------ tool shell */

.tool-page .site-main {
    padding-top: 20px;
}

.tool-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: calc(100dvh - 210px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}

.tool-shell-single {
    grid-template-columns: minmax(0, 1fr);
}

.tool-aside {
    display: flex;
    flex-direction: column;
    align-self: start;
    min-width: 0;
    max-height: calc(100dvh - 96px);
    padding: 24px 22px;
    border-right: 1px solid var(--border);
    background:
        radial-gradient(360px 220px at 0 0, rgba(47, 159, 224, 0.07), transparent 70%),
        var(--surface-2);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}

.tool-aside::-webkit-scrollbar {
    width: 10px;
}

.tool-aside::-webkit-scrollbar-thumb {
    border: 3px solid var(--surface-2);
    border-radius: 999px;
    background: var(--surface-3);
}

.tool-head {
    margin-bottom: 20px;
}

.tool-head h1 {
    margin: 8px 0 8px;
    font-family: var(--display);
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    text-transform: uppercase;
}

.tool-head p {
    margin: 0;
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.6;
}

.tool-head-wide {
    max-width: 720px;
}

.tool-switch {
    display: flex;
    gap: 4px;
    margin: 0 0 22px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-deep);
}

.tool-switch a {
    flex: 1;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.tool-switch a:hover {
    color: var(--text);
}

.tool-switch a.active {
    background: var(--green);
    color: #04121d;
}

.tool-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.tool-section:last-of-type {
    border-bottom: 0;
}

.tool-aside .eyebrow {
    margin-top: 18px;
    font-size: 11px;
}

.tool-aside .eyebrow:first-child {
    margin-top: 0;
}

.tool-aside label,
.tool-dialog label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
}

.tool-aside p,
.tool-dialog p {
    margin: 10px 0 0;
    color: var(--text-3);
    font-size: 12.5px;
    line-height: 1.6;
}

.tool-aside .eyebrow + section,
.tool-aside .eyebrow + .tool-section {
    margin-top: 8px;
}

.tool-aside input[type="number"],
.tool-dialog input[type="number"],
.tool-aside input[type="text"],
.tool-dialog input[type="text"],
.tool-aside select,
.tool-dialog select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
}

.tool-aside input[type="number"]:focus,
.tool-dialog input[type="number"]:focus,
.tool-aside select:focus,
.tool-dialog select:focus {
    border-color: var(--green);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(47, 159, 224, 0.14);
}

.tool-aside input[type="range"],
.tool-dialog input[type="range"] {
    width: 100%;
    margin: 12px 0 6px;
    accent-color: var(--green);
    cursor: pointer;
}

.tool-aside input[type="file"],
.tool-dialog input[type="file"] {
    width: 100%;
    color: var(--text-3);
    font-size: 12px;
}

.tool-aside input[type="file"]::file-selector-button,
.tool-dialog input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.tool-aside input[type="checkbox"],
.tool-dialog input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--green);
}

.tool-aside output,
.tool-dialog output {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-bright);
    font-family: var(--mono);
    font-size: 12px;
}

.number-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 12px;
}

.number-row input[type="number"] {
    max-width: 96px;
}

.number-row span {
    color: var(--text-3);
    font-size: 12px;
}

.number-row-tight {
    gap: 8px;
    margin: 0;
}

.number-row-tight input[type="number"] {
    max-width: 72px;
}

.number-row-tight input[type="range"] {
    margin: 0;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-3);
    font-size: 11px;
}

.tool-aside .tool-views {
    display: grid;
    gap: 9px;
}

.tool-aside .tool-views label {
    justify-content: flex-start;
    font-weight: 500;
}

.tool-aside .tool-views .eyebrow {
    margin: 0 0 2px;
}

.tool-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 18px 0 6px;
    padding: 9px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.tool-reset:hover {
    border-color: var(--green);
    color: var(--text);
}

.tool-aside-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.tool-aside-foot a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-3);
}

.tool-aside-foot a:hover {
    color: var(--green-bright);
}

.tool-workspace {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
    background:
        radial-gradient(700px 380px at 70% 0%, rgba(47, 159, 224, 0.07), transparent 65%),
        var(--bg-deep);
}

#plot {
    position: relative;
    flex: 1;
    min-height: 440px;
    height: calc(100dvh - 250px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(rgba(36, 54, 48, 0.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 54, 48, 0.55) 1px, transparent 1px),
        #0b1410;
    background-size: 32px 32px;
    overflow: hidden;
    touch-action: none;
    cursor: crosshair;
    outline: 0;
}

#plot:focus-visible {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(47, 159, 224, 0.18);
}

#plot canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

#plot.dragging {
    cursor: grabbing;
}

#plot.resizing {
    cursor: ew-resize;
}

#plot.resizing-vertical {
    cursor: ns-resize;
}

.zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(9, 16, 12, 0.82);
    backdrop-filter: blur(6px);
}

.zoom button {
    min-width: 34px;
    padding: 5px 9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.zoom button:hover {
    background: var(--surface-3);
    color: var(--text);
}

.plot-note {
    position: absolute;
    bottom: 12px;
    left: 50%;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(9, 16, 12, 0.82);
    color: var(--text-3);
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}

/* ------------------------------------------------------- editor controls */

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

.tools button,
.editor-actions button {
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.tools button:hover,
.editor-actions button:hover {
    border-color: var(--green);
    color: var(--text);
}

.tools button.active {
    border-color: var(--green);
    background: var(--green);
    color: #04121d;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.editor-actions button {
    flex: 1;
}

.editor-actions button:disabled {
    opacity: 0.4;
    cursor: default;
}

.palette {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 7px;
}

.palette .swatch {
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: none;
    cursor: pointer;
}

.palette .swatch.active {
    outline: 2px solid var(--green-bright);
    outline-offset: 2px;
}

.palette .swatch.transparent {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #c9ced4 25%, transparent 25%),
        linear-gradient(-45deg, #c9ced4 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #c9ced4 75%),
        linear-gradient(-45deg, transparent 75%, #c9ced4 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

.custom-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: var(--text-3);
    font-size: 12px;
}

.custom-color-row input[type="color"] {
    width: 38px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

.tool-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-button-row > .btn {
    flex: 1 1 120px;
    justify-content: center;
    min-height: 40px;
}

.tool-aside .tool-check {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: fit-content;
    min-height: 38px;
    margin: 12px 0 0;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.tool-aside .tool-check input[type="checkbox"] {
    flex: 0 0 17px;
}

.tool-status {
    margin: 12px 0 0;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.55;
}

.tool-status[data-state="ok"] {
    border-color: rgba(58, 155, 208, 0.45);
    color: var(--green-bright);
}

.tool-status[data-state="error"] {
    border-color: rgba(255, 107, 107, 0.45);
    color: #ff9b9b;
}

#export-area {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

#export-area:empty {
    display: none;
}

.export-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-deep);
    color: var(--text-2);
    font-size: 12px;
}

.export-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.export-item button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text-2);
    cursor: pointer;
}

.export-item button:hover {
    border-color: var(--green);
    color: var(--text);
}

/* -------------------------------------------------------------- dialogs */

.tool-dialog {
    width: min(850px, calc(100vw - 32px));
    max-height: 88vh;
    padding: 24px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    overflow: auto;
}

.tool-dialog::backdrop {
    background: rgba(4, 7, 10, 0.72);
    backdrop-filter: blur(3px);
}

.tool-dialog h2 {
    margin: 0 0 6px;
    font-family: var(--display);
    font-size: 1.1rem;
    text-transform: uppercase;
}

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

.resize-previews figure {
    margin: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    text-align: center;
}

.resize-previews img,
.resize-previews canvas {
    width: 100%;
    height: auto;
    min-height: 120px;
    max-height: 220px;
    object-fit: contain;
    image-rendering: pixelated;
}

.resize-previews figcaption {
    margin-top: 7px;
    color: var(--text-3);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tool-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin: 12px 0;
}

.tool-inline > label {
    flex: 0 0 auto;
    justify-content: flex-start;
}

.tool-inline select {
    width: auto;
    min-width: 190px;
}

.tool-inline-top {
    align-items: flex-start;
}

.tool-field {
    flex: 1 1 160px;
    display: grid;
    gap: 6px;
}

.tool-field label {
    justify-content: flex-start;
}

.tool-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

/* --------------------------------------------------------- flag dialog */

.flag-dialog {
    width: min(980px, calc(100vw - 32px));
}

.flag-category {
    margin-top: 20px;
}

.flag-category h3 {
    margin: 0 0 10px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.flag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 8px;
}

.flag-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text-3);
    font-size: 11px;
    text-align: center;
    cursor: pointer;
}

.flag-option:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.flag-option[aria-pressed="true"] {
    border-color: var(--green);
    background: var(--green-soft);
    color: var(--text);
    box-shadow: 0 0 0 2px rgba(47, 159, 224, 0.16);
}

.flag-option img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    border-radius: 5px;
    image-rendering: pixelated;
}

.flag-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.flag-footer {
    position: sticky;
    bottom: -24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 24px -24px -24px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: rgba(19, 32, 27, 0.96);
    backdrop-filter: blur(6px);
}

.flag-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flag-preview[hidden] {
    display: none;
}

.flag-preview img {
    width: 192px;
    height: 96px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    image-rendering: pixelated;
}

.flag-preview strong {
    color: var(--text-2);
    font-size: 13px;
}

.flag-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ------------------------------------------------------ line transplant */

.tool-converter {
    gap: 28px;
    padding: 34px;
}

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

.converter-column {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-align: center;
}

.converter-column h2 {
    font-size: 1rem;
}

.converter-column p {
    margin: 8px 0 16px;
    color: var(--text-3);
    font-size: 12.5px;
    line-height: 1.6;
}

.converter-column canvas,
.converter-output canvas {
    display: block;
    width: 100%;
    max-width: 512px;
    height: auto;
    aspect-ratio: 1;
    margin: 16px auto 0;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-deep);
    image-rendering: auto;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    background: var(--bg-deep);
    color: var(--green-bright);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-btn:hover {
    border-color: var(--green);
    background: var(--green-soft);
}

.upload-btn:focus-within {
    outline: 3px solid rgba(47, 159, 224, 0.3);
    outline-offset: 2px;
}

.upload-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.converter-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-align: center;
}

.converter-output .tool-check {
    margin-top: 0;
}

.converter-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.converter-result[hidden] {
    display: none;
}

.converter-credit {
    margin: 0;
    color: var(--text-3);
    font-size: 12px;
    text-align: center;
}

/* --------------------------------------------------- auth verification */

.auth-card-wide {
    max-width: 560px;
}

.verify-facts {
    display: grid;
    gap: 8px;
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
}

.verify-facts > div {
    display: grid;
    grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
}

.verify-facts dt {
    color: var(--text-3);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.verify-facts dd {
    margin: 0;
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 12.5px;
    overflow-wrap: anywhere;
    min-width: 0;
    text-align: right;
}

@media (max-width: 480px) {
    .verify-facts > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }

    .verify-facts dd {
        text-align: left;
    }
}

.verify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.verify-debug {
    margin-top: 16px;
}

.verify-debug a {
    color: var(--green-bright);
    text-decoration: underline;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
    .tools-hero {
        grid-template-columns: minmax(0, 1fr);
        padding: 34px 28px;
    }

    .tools-hero-art {
        display: none;
    }

    .tool-shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .palette {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tool-cards,
    .tool-hub-note,
    .converter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-shell {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .tool-aside {
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .tool-aside-foot {
        margin-top: 12px;
    }

    #plot {
        height: 62vh;
        min-height: 380px;
    }

    .tool-workspace {
        padding: 14px;
    }
}

@media (max-width: 600px) {
    .tools-hero {
        padding: 26px 20px;
    }

    .tool-hub-head {
        align-items: flex-start;
    }

    .tool-card {
        padding: 20px;
    }

    .tool-dialog {
        padding: 18px;
    }

    .resize-previews {
        grid-template-columns: minmax(0, 1fr);
    }

    .flag-footer {
        margin: 20px -18px -18px;
        padding: 12px 18px;
    }

    .flag-preview img {
        width: 128px;
        height: 64px;
    }

    .number-row {
        flex-wrap: wrap;
    }

    .tool-converter {
        padding: 20px;
    }
}
