/* brutalist. black on white, monospace, hard borders, no rounding, no shadows. */
:root {
    --ink: #000;
    --paper: #fff;
    --dim: #666;
    --hot: #c00;
}

* {
    box-sizing: border-box;
}

/* without pyscript's core.css these tags render their contents */
py-config, py-script {
    display: none;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.35;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.2rem;
    gap: 1rem;
}

header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 0.25rem 0;
    border-bottom: 3px solid var(--ink);
    padding-bottom: 0.4rem;
}

header p {
    margin: 0.4rem 0 0 0;
    color: var(--dim);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

select, input, textarea, button {
    font-family: inherit;
    font-size: inherit;
    color: var(--ink);
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 0;
    padding: 0.35rem 0.5rem;
    outline: none;
}

select:focus, input:focus, textarea:focus {
    box-shadow: inset 0 0 0 2px var(--ink);
}

#tool {
    font-weight: 700;
    text-transform: uppercase;
}

#filter {
    flex: 1 1 22rem;
    min-width: 12rem;
}

#rawwrap {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 2px solid var(--ink);
    padding: 0.3rem 0.5rem;
    user-select: none;
}

#rawwrap input { border: 0; padding: 0; }

#offset {
    width: 9rem;
}

#dl {
    cursor: pointer;
    text-transform: uppercase;
}

#dl:active {
    background: var(--ink);
    color: var(--paper);
}

.status {
    color: var(--hot);
    margin-left: auto;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.panes {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    min-height: 0;
}

.inpane {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

textarea {
    flex: 1 1 0;
    width: 100%;
    resize: none;
    min-height: 0;
    white-space: pre;
    overflow: auto;
}

.inpane.dragging {
    outline: 4px dashed var(--ink);
    outline-offset: -4px;
}

.outpane {
    margin: 0;
    border: 2px solid var(--ink);
    background: var(--paper);
    padding: 0.6rem;
    overflow: auto;
    white-space: pre;
    min-height: 0;
}

.outpane.err {
    color: var(--hot);
}

footer {
    color: var(--dim);
    font-size: 0.8rem;
    border-top: 2px solid var(--ink);
    padding-top: 0.5rem;
}

.hidden {
    display: none !important;
}

/* wait cursor while pyodide boots */
body.booting, body.booting * {
    cursor: progress;
}
