:root {
    --ink: #151515;
    --paper: #f7f4ee;
    --card: #ffffff;
    --line: #dcd6ca;
    --muted: #6d675d;
    --red: #e63b2e;
    --blue: #1f4fd8;
    --yellow: #f5b700;
    --ok-bg: #e7f3e4;
    --err-bg: #fbe5e2;
    --font: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #f1ede5;
        --paper: #141413;
        --card: #1d1c1a;
        --line: #36332e;
        --muted: #a39d92;
        --blue: #6f93ff;
        --ok-bg: #1d3320;
        --err-bg: #3d1f1b;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--font); }
a { color: var(--blue); }
code { font-family: var(--mono); font-size: .88em; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 2rem; margin: 0 0 .6rem; }

/* Top bar and brand mark */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
          padding: 14px 24px; border-bottom: 3px solid var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 1.2rem; }
.topbar nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.35rem;
         color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.mark { display: inline-flex; align-items: flex-end; gap: 3px; }
.mark i, .hero-art i { display: block; }
.mark .c { width: 14px; height: 14px; border-radius: 50%; background: var(--red); }
.mark .s { width: 12px; height: 18px; background: var(--blue); }
.mark .t { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
           border-bottom: 14px solid var(--yellow); }

.page { max-width: 64rem; margin: 0 auto; padding: 32px 24px 64px; }
.narrow { max-width: 26rem; }
.muted { color: var(--muted); }

/* Buttons and forms */
.btn { display: inline-block; background: var(--ink); color: var(--paper); border: 2px solid var(--ink);
       padding: 9px 18px; font: 500 1rem var(--font); text-decoration: none; cursor: pointer; border-radius: 0; }
.btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; font-weight: 500; }
button.link.danger { color: var(--red); }
form.inline { display: inline; }
input[type=text], input:not([type]), input[type=email], input[type=password] {
    width: 100%; padding: 9px 11px; font: 1rem var(--font); background: var(--card); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 0; }
input:focus, textarea:focus, .btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
.stack { display: grid; gap: 1rem; margin: 1.2rem 0; }
.stack label { display: grid; gap: 4px; font-weight: 500; }
.stack small { color: var(--muted); font-weight: 400; }
.row { display: flex; gap: 8px; align-items: center; }
.suffix-input { display: flex; align-items: stretch; }
.suffix-input input { flex: 1; min-width: 0; }
.suffix-input span { padding: 9px 11px; border: 2px solid var(--ink); border-left: 0; background: var(--ink);
                     color: var(--paper); white-space: nowrap; font-weight: 400; }
.errors ul { margin: 0; padding: 10px 14px 10px 30px; background: var(--err-bg); border-left: 5px solid var(--red); }
.errors:empty, .validation-summary-valid { display: none; }
.flash { padding: 10px 14px; background: var(--ok-bg); border-left: 5px solid var(--blue); margin: 0 0 1.5rem;
         overflow-wrap: anywhere; }
.flash.error { background: var(--err-bg); border-left-color: var(--red); }

/* Landing */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; padding: 3rem 0 4rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 320px; width: 100%; justify-self: center; }
.hero-art .c { position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%; background: var(--red); left: 0; top: 0; }
.hero-art .s { position: absolute; width: 46%; height: 62%; background: var(--blue); right: 0; top: 14%; mix-blend-mode: multiply; }
.hero-art .t { position: absolute; left: 10%; bottom: 0; width: 0; height: 0;
               border-left: 120px solid transparent; border-right: 120px solid transparent; border-bottom: 140px solid var(--yellow); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 3px solid var(--ink); }
.features > div { padding: 1.4rem 1.4rem 1.4rem 0; }
.features > div + div { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.features h3 { margin: 0 0 .4rem; }

/* Site list */
.site-list { list-style: none; padding: 0; margin: 0 0 2.5rem; border-top: 2px solid var(--ink); }
.site-list li { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.site-name { font-size: 1.25rem; font-weight: 700; color: var(--ink); }

/* File browser */
.site-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.site-head a { overflow-wrap: anywhere; }
.usage { min-width: 200px; font-size: .85rem; color: var(--muted); }
.bar { height: 8px; background: var(--line); margin-top: 4px; }
.bar div { height: 100%; background: var(--blue); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 1rem; font-weight: 500; }
.crumbs a { color: var(--ink); }
.crumbs span { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.2rem; align-items: flex-start; }
.toolbar form { margin: 0; }
details.pop { position: relative; }
details.pop summary { list-style: none; cursor: pointer; }
details.pop summary::-webkit-details-marker { display: none; }
details.pop > form { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; background: var(--card);
                     border: 2px solid var(--ink); padding: 10px; width: 300px; box-shadow: 6px 6px 0 var(--ink); }
details.pop.right > form { left: auto; right: 0; }
.files { width: 100%; border-collapse: collapse; background: var(--card); border: 2px solid var(--ink); }
.files th { text-align: left; font-weight: 500; font-size: .85rem; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid var(--ink); }
.files td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.files tr:last-child td { border-bottom: 0; }
.files .num { text-align: right; white-space: nowrap; }
.files .name { overflow-wrap: break-word; word-break: break-word; }
.files .name a { color: var(--ink); font-weight: 500; text-decoration: none; }
.files .name a:hover { text-decoration: underline; }
.files .actions { text-align: right; white-space: nowrap; }
.files .actions > * { margin-left: 12px; }
.files .actions a, .files .actions summary { color: var(--ink); font-weight: 500; font-size: .92rem; }
.files .actions details { display: inline-block; text-align: left; }
.icon { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; }
.icon.dir { background: var(--yellow); }
.icon.file { background: var(--blue); }
.icon.bin { background: var(--red); border-radius: 50%; }
.empty { padding: 2.5rem; text-align: center; border: 2px dashed var(--line); color: var(--muted); }
.dropzone { position: fixed; inset: 16px; z-index: 20; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700;
            background: color-mix(in srgb, var(--paper) 85%, transparent); border: 4px dashed var(--blue); pointer-events: none; }
.dropzone[hidden] { display: none; }

/* Editor */
.editor textarea { width: 100%; height: 65vh; padding: 14px; font: 14px/1.6 var(--mono); tab-size: 2;
                   background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; resize: vertical; }
.editor-bar { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

@media (max-width: 720px) {
    .topbar { padding: 12px 16px; }
    .page { padding: 24px 16px 48px; }
    .hero { grid-template-columns: 1fr; padding-top: 1rem; }
    .hero-art { display: none; }
    .features { grid-template-columns: 1fr; }
    .features > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
    .files th:nth-child(2), .files td:nth-child(2), .files th:nth-child(3), .files td:nth-child(3) { display: none; }
    .files td { padding: 8px; }
    .files .actions > * { margin-left: 8px; }
    .files .actions a:not(:first-child) { display: none; }
}

/* SFTP details */
.sftp { margin: 0 0 1.2rem; border: 2px solid var(--ink); background: var(--card); padding: 0 14px; }
.sftp summary { cursor: pointer; font-weight: 500; padding: 10px 0; }
.sftp[open] { padding-bottom: 6px; }
.sftp p { margin: 0 0 .8rem; }
.sftp dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0 0 .8rem; }
.sftp dt { color: var(--muted); }
.sftp dd { margin: 0; overflow-wrap: anywhere; }

/* Site tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ink); margin: 0 0 1.4rem; }
.tabs a { padding: 8px 16px; color: var(--ink); text-decoration: none; font-weight: 500; border: 2px solid transparent; border-bottom: 0; margin-bottom: -2px; }
.tabs a[aria-current=page] { border-color: var(--ink); background: var(--card); border-bottom: 2px solid var(--card); }

/* Forms */
.forms-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.forms-top p { margin: 0; }
.settings { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.settings label { display: flex; gap: 6px; align-items: center; }
.settings input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.howto { margin: 0 0 1.4rem; border: 2px solid var(--ink); background: var(--card); padding: 0 14px; }
.howto summary { cursor: pointer; font-weight: 500; padding: 10px 0; }
.howto pre { background: var(--paper); border: 1px solid var(--line); padding: 12px; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.howto ul { padding-left: 1.2rem; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; }
.filters a { color: var(--ink); }
.filters a[aria-current=page] { font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--yellow); }
.list-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.list-head a { color: var(--ink); font-weight: 500; }
.nowrap { white-space: nowrap; }
.submissions .summary { width: 100%; max-width: 0; }
.submissions .summary button { display: block; width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.submissions .summary button:hover { text-decoration: underline; }
dialog.submission { width: min(40rem, calc(100vw - 32px)); max-height: min(80vh, 44rem); padding: 0; border: 2px solid var(--ink);
                    background: var(--card); color: var(--ink); box-shadow: 8px 8px 0 var(--ink); }
dialog.submission[open] { display: flex; flex-direction: column; }
dialog.submission::backdrop { background: rgb(0 0 0 / .35); }
dialog.submission header { display: flex; gap: 12px; align-items: baseline; padding: 12px 16px; border-bottom: 2px solid var(--ink); }
dialog.submission header form { margin-left: auto; }
dialog.submission .body { overflow-y: auto; padding: 16px; }
dialog.submission dl { margin: 0; }
dialog.submission dt { font-size: .85rem; color: var(--muted); margin-top: 12px; }
dialog.submission dt:first-child { margin-top: 0; }
dialog.submission dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog.submission .meta { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; margin: 16px 0 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 1.2rem; justify-content: center; margin-top: 1rem; }
.pager a { color: var(--ink); font-weight: 500; }

@media (max-width: 720px) {
    .submissions th:nth-child(2), .submissions td:nth-child(2) { display: none; }
}

/* SFTP logins */
.sftp-hint { margin: 0 0 1.2rem; font-size: .92rem; }
.sftp-hint a { color: var(--ink); font-weight: 500; }
.connect { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0 0 1.2rem; }
.connect dt { color: var(--muted); }
.connect dd { margin: 0 0 0 -16px; }
.logins tr.disabled td { opacity: .55; }
.logins tr.disabled td.actions { opacity: 1; }
.tag { display: inline-block; font-size: .72rem; font-weight: 500; padding: 0 6px; margin-left: 6px; border: 1.5px solid var(--ink); vertical-align: 1px; }
.tag.off { border-color: var(--red); color: var(--red); }
.logins .actions button.link { font-size: .92rem; margin-left: 12px; }
.secret { border: 2px solid var(--ink); border-left: 8px solid var(--yellow); background: var(--card); padding: 12px 14px; margin: 0 0 1.4rem; }
.secret p { margin: 0 0 8px; }
.secret input { font-family: var(--mono); max-width: 22rem; }
.add-login { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.add-login label { display: grid; gap: 4px; font-weight: 500; }
.add-login label.check, .stack label.check { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.prefix-input { display: flex; }
.prefix-input span { padding: 9px 4px 9px 11px; border: 2px solid var(--ink); border-right: 0; background: var(--ink); color: var(--paper); font-weight: 400; }
.prefix-input input { width: 12rem; }
select { padding: 9px 11px; font: 1rem var(--font); background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; max-width: 100%; }
.stack textarea { width: 100%; padding: 9px 11px; font: 13px/1.5 var(--mono); background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; }
.fingerprints { margin: -8px 0 0; padding-left: 1.2rem; font-size: .8rem; overflow-wrap: anywhere; }

@media (max-width: 720px) {
    .logins th:nth-child(3), .logins td:nth-child(3), .logins th:nth-child(4), .logins td:nth-child(4) { display: none; }
    .logins .actions { white-space: normal; }
    .logins .actions button.link, .logins .actions form { margin-left: 8px; }
}

/* Domains */
.small { font-size: .85rem; }
.domain { border: 2px solid var(--ink); background: var(--card); padding: 14px 16px; margin: 0 0 1.2rem; border-left-width: 8px; }
.domain.pending { border-left-color: var(--yellow); }
.domain.verified { border-left-color: var(--blue); }
.domain.live { border-left-color: #2f9e44; }
.domain header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.domain h2 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.domain .status { font-size: .8rem; font-weight: 500; padding: 1px 8px; border: 1.5px solid var(--ink); }
.domain-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.domain-actions a { color: var(--ink); font-weight: 500; }
.domain p { margin: .6rem 0; }
.domain p span { margin-left: 4px; }
.dns { border-collapse: collapse; width: 100%; font-size: .92rem; margin: .4rem 0; }
.dns th { text-align: left; font-weight: 500; color: var(--muted); font-size: .8rem; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--line); }
.dns td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dns td:first-child { width: 5rem; font-weight: 500; white-space: nowrap; }
.add-domain input { max-width: 22rem; }

/* Account */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem 2rem; margin: 1.4rem 0 2.4rem; }
.meter-head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 500; margin-bottom: 4px; }
.meter .bar { height: 10px; }
.meter.high .bar div { background: var(--yellow); }
.meter.full .bar div { background: var(--red); }
.meter small { display: block; margin-top: 4px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.plan { border: 2px solid var(--ink); background: var(--card); padding: 16px; }
.plan.current { box-shadow: 6px 6px 0 var(--blue); }
.plan h3 { margin: 0; }
.plan .price { font-size: 1.8rem; font-weight: 700; margin: .3rem 0; }
.plan .price span { font-size: .9rem; font-weight: 400; color: var(--muted); }
.plan ul { padding-left: 1.1rem; margin: .6rem 0 1rem; }
.usage a { color: var(--muted); }

/* Abuse reports and admin */
.site-footer { max-width: 64rem; margin: 0 auto; padding: 0 24px 32px; font-size: .85rem; }
.site-footer a { color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.stack select, .stack textarea { width: 100%; }
.admin-suspend { flex-wrap: wrap; margin: 0 0 1.6rem; }
.admin-suspend input { width: auto; flex: 1 1 12rem; }
.count { font-size: .9rem; font-weight: 500; padding: 0 8px; border: 1.5px solid var(--ink); vertical-align: 4px; }
.admin-table .summary { width: 100%; max-width: 0; }
.admin-table .summary button { display: block; width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.verify-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-left-color: var(--yellow); }
.verify-banner span { flex: 1 1 20rem; }
