.ascii85-tool {
    --ascii85-panel: #ffffff;
    --ascii85-panel-soft: #fcfcfd;
    --ascii85-text: #101418;
    --ascii85-muted: #5a6872;
    --ascii85-border: #d8dee4;
    --ascii85-amber: #fff5e3;
    --ascii85-amber-border: #ecd8ab;
    --ascii85-green: #eef8ef;
    --ascii85-green-border: #cfe2d1;
    --ascii85-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: var(--ascii85-text);
    font-family: "Inter", var(--font-sans);
}

html[data-theme="dark"] .ascii85-tool {
    --ascii85-panel: #181b1f;
    --ascii85-panel-soft: #20242a;
    --ascii85-text: #f1f3f5;
    --ascii85-muted: #9aa2ab;
    --ascii85-border: #2a3037;
    --ascii85-amber: rgba(116, 88, 26, 0.2);
    --ascii85-amber-border: #6f5623;
    --ascii85-green: rgba(34, 84, 41, 0.22);
    --ascii85-green-border: #366441;
}

.ascii85-tool * {
    box-sizing: border-box;
}

.ascii85-topbar,
.ascii85-status,
.ascii85-pill-row,
.ascii85-textarea-header {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ascii85-topbar {
    justify-content: space-between;
}

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

.ascii85-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    height: 100%;
}

.ascii85-mini,
.ascii85-helper {
    margin: 0;
    color: var(--ascii85-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ascii85-mini strong,
.ascii85-pill strong,
.ascii85-note strong {
    color: var(--ascii85-text);
}

.ascii85-inline,
.ascii85-mini code,
.ascii85-note code {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid var(--ascii85-border);
    border-radius: 999px;
    background: var(--ascii85-panel);
    color: var(--ascii85-text);
    font-family: var(--ascii85-mono);
    font-size: 0.86em;
    white-space: nowrap;
}

.ascii85-helper-error {
    color: #79531b;
    background: var(--ascii85-amber);
    border: 1px solid var(--ascii85-amber-border);
    border-radius: 14px;
    padding: 10px 11px;
}

html[data-theme="dark"] .ascii85-helper-error {
    color: #f0d48c;
}

.ascii85-select-label {
    color: var(--ascii85-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.ascii85-select,
.ascii85-number {
    min-height: 42px;
    border: 1px solid var(--ascii85-border);
    border-radius: 12px;
    background: var(--ascii85-panel);
    color: var(--ascii85-text);
    padding: 8px 10px;
}

.ascii85-format-grid {
    display: grid;
    gap: 10px;
}

.ascii85-radio-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--ascii85-border);
    border-radius: 14px;
    background: var(--ascii85-panel);
    cursor: pointer;
}

.ascii85-radio-card input[type="radio"],
.ascii85-tool input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #3f7fd8;
}

.ascii85-radio-card strong {
    display: block;
    margin: 0 0 3px;
    color: var(--ascii85-text);
    font-size: 0.94rem;
    line-height: 1.2;
}

.ascii85-radio-card small {
    display: block;
    color: var(--ascii85-muted);
    font-size: 0.82rem;
    line-height: 1.38;
}

.ascii85-number {
    width: 76px;
    padding: 6px 8px;
}

.ascii85-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ascii85-textarea-header {
    justify-content: space-between;
}

.ascii85-textarea {
    width: 100%;
    min-width: 0;
    min-height: 220px;
    resize: vertical;
    border: 1px solid var(--ascii85-border);
    border-radius: 12px;
    background: var(--ascii85-panel);
    color: var(--ascii85-text);
    outline: none;
    padding: 10px 12px;
    font-family: var(--ascii85-mono);
    font-size: 14px;
    line-height: 1.45;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.ascii85-textarea[readonly] {
    background: var(--ascii85-panel-soft);
}

.ascii85-textarea.ascii85-output.has-error {
    border-color: var(--ascii85-amber-border);
    background: #fffaf0;
}

html[data-theme="dark"] .ascii85-textarea.ascii85-output.has-error {
    background: rgba(71, 54, 18, 0.25);
}

.ascii85-textarea:focus,
.ascii85-button:focus-visible,
.ascii85-select:focus,
.ascii85-number:focus,
.ascii85-radio-card:focus-within {
    border-color: rgba(11, 132, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(11, 132, 255, 0.1);
    outline: none;
}

.ascii85-copy-inline {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
}

.ascii85-copy-inline.done {
    color: #245e2d;
    border-color: var(--ascii85-green-border);
    background: var(--ascii85-green);
}

.ascii85-copy-inline.error {
    color: #7b5c1c;
    border-color: var(--ascii85-amber-border);
    background: var(--ascii85-amber);
}

.cipher-option-row.is-disabled {
    opacity: 0.56;
}

@media (max-width: 560px) {
    .ascii85-topbar {
        align-items: stretch;
    }

    .ascii85-actions {
        width: 100%;
    }

    .ascii85-textarea {
        min-height: 210px;
    }
}
