:root {
    color-scheme: light;
    --ink: #111312;
    --muted: #69706d;
    --line: #c7cfca;
    --soft: #f4f7f5;
    --paper: #ffffff;
    --accent: #0b7a4b;
    --accent-strong: #075f3a;
    --danger: #b52525;
    --shadow: 0 18px 60px rgba(14, 26, 20, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: linear-gradient(180deg, #f9fbfa 0%, #edf2ef 100%);
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
input,
textarea {
    font: inherit;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.shell.narrow {
    width: min(760px, calc(100% - 32px));
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0 22px;
    border-bottom: 2px solid var(--ink);
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: clamp(32px, 5vw, 56px);
    line-height: 0.95;
    font-weight: 800;
    letter-spacing: 0;
}

h2 {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0;
}

h3 {
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.dot {
    width: 10px;
    height: 10px;
    border: 2px solid var(--ink);
    background: var(--paper);
}

.dot.live {
    background: #24d07a;
}

.dot.empty {
    background: #d6ddda;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 2px solid var(--ink);
    border-radius: 4px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.button.primary {
    background: var(--accent);
    color: #ffffff;
}

.button.primary:hover {
    background: var(--accent-strong);
}

.button.secondary {
    background: var(--paper);
}

.button.secondary:hover {
    background: var(--soft);
}

.notice {
    margin: 18px 0 0;
    padding: 12px 14px;
    border: 2px solid var(--accent);
    background: #e5f7ee;
    color: var(--accent-strong);
    font-weight: 800;
}

.notice.error {
    border-color: var(--danger);
    background: #fff1f1;
    color: var(--danger);
}

.compose {
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
}

.text-windows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 14px;
}

.editor-window,
.paste-window {
    min-width: 0;
    border: 2px solid var(--ink);
    border-radius: 4px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.editor-window {
    display: block;
}

.window-bar,
.window-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 9px 12px;
    border-bottom: 2px solid var(--ink);
    background: var(--soft);
}

.window-bar {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

textarea {
    display: block;
    width: 100%;
    min-height: 260px;
    resize: vertical;
    padding: 14px;
    border: 0;
    outline: none;
    background: #ffffff;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
}

textarea:focus {
    box-shadow: inset 0 0 0 3px rgba(11, 122, 75, 0.22);
}

.form-row {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.file-picker {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    min-height: 42px;
    border: 2px dashed var(--ink);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--muted);
    overflow: hidden;
}

.file-picker span {
    padding: 0 12px;
    font-weight: 800;
    color: var(--ink);
}

.file-picker input {
    min-width: 0;
    width: 100%;
    padding: 8px;
}

.current {
    padding: 28px 0 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.section-head p {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.paste-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 14px;
}

.window-title {
    align-items: flex-start;
}

.window-title > div {
    min-width: 0;
}

.window-title p {
    margin-top: 2px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.window-title a {
    flex: 0 0 auto;
    color: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
}

.window-title a:hover {
    text-decoration: underline;
}

.window-body {
    min-height: 220px;
    max-height: 520px;
    overflow: auto;
    background: #ffffff;
}

.window-body pre {
    margin: 0;
    padding: 14px;
    min-width: 100%;
    color: #151817;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.window-body img {
    display: block;
    width: 100%;
    height: auto;
}

.binary,
.empty-state {
    display: grid;
    min-height: 220px;
    place-items: center;
    background:
        linear-gradient(90deg, rgba(17, 19, 18, 0.06) 1px, transparent 1px),
        linear-gradient(rgba(17, 19, 18, 0.06) 1px, transparent 1px),
        #ffffff;
    background-size: 18px 18px;
}

.binary span,
.empty-state h2 {
    padding: 8px 12px;
    border: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-weight: 800;
    text-transform: uppercase;
}

.truncated {
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 20px, 1180px);
        padding-top: 14px;
    }

    .topbar,
    .section-head,
    .form-row {
        align-items: stretch;
        flex-direction: column;
    }

    .actions,
    .form-row .button {
        width: 100%;
    }

    .button,
    .file-picker {
        width: 100%;
    }

    textarea {
        min-height: 220px;
    }
}
