/* ledigt.org – direction "A · Specifikation". IBM Plex, near-white paper, dark green accent. */
/* IBM Plex, served from this site (SIL Open Font License 1.1, see fonts/LICENSE-IBM-Plex.txt). */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/IBMPlexSans-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/IBMPlexSans-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/IBMPlexMono-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Serif'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/IBMPlexSerif-Medium.woff2') format('woff2'); }

:root {
    --bg: #FBFBF9;
    --surface: #FFFFFF;
    --band: #F3F4F0;
    --text: #1B1D1C;
    --body: #3E423F;
    --muted: #5C605D;
    --accent: #0B5D4B;
    --accent-hover: #073F33;
    --accent-soft: #E6EFEC;
    --border: #DCDDD8;
    --border-row: #ECEDE9;
    --border-input: #8C908B;
    --badge-border: #C9CBC5;
    --code-bg: #EFF0EC;
    --error: #8A1F11;
    --error-bg: #FBEDEA;
    --error-border: #E3B5AE;
    --warning: #6B4E00;
    --warning-bg: #FBF5E4;
    --warning-border: #E2CF9B;
    --warning-row: #EFE6CC;
    --problem: #8A5A00;
    --problem-icon: #B7791F;
    --serif: 'IBM Plex Serif', Georgia, serif;
    --sans: 'IBM Plex Sans', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --radius: 4px;
    --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
    outline: 3px solid var(--accent); outline-offset: 2px;
}
code, pre, kbd { font-family: var(--mono); }
code { font-size: 0.92em; }
h1, h2, h3 { line-height: 1.2; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.wide { max-width: 1180px; }
main.page { padding-top: 64px; padding-bottom: 96px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-name { font-family: var(--mono); font-weight: 500; font-size: 20px; }
.badge { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--badge-border); padding: 1px 6px; border-radius: 3px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; }
.site-nav a { color: var(--text); text-decoration: none; padding: 4px 0; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; font-weight: 500; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); }

/* Type */
.eyebrow { margin: 0 0 20px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--accent); }
.display { margin: 0 0 24px; font-family: var(--serif); font-weight: 500; font-size: 52px; line-height: 1.1; letter-spacing: -0.01em; }
.page-title { margin: 0 0 12px; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.15; }
.lead { margin: 0 0 32px; font-size: 18px; line-height: 1.6; color: var(--body); max-width: 40em; }
.hero .lead { font-size: 19px; max-width: 34em; }
.section-title { margin: 0 0 40px; font-family: var(--serif); font-weight: 500; font-size: 32px; }
.card h2, .subhead { margin: 0 0 12px; font-family: var(--serif); font-weight: 500; font-size: 26px; }
.prose-sv { max-width: 44em; font-size: 17px; line-height: 1.7; }
.prose-sv h2 { margin: 48px 0 16px; font-family: var(--serif); font-weight: 500; font-size: 28px; }
.prose-sv h3 { margin: 32px 0 8px; font-size: 19px; font-weight: 600; }
.prose-sv p, .prose-sv ul, .prose-sv ol { margin: 0 0 16px; color: var(--body); }
.prose-sv li { margin-bottom: 6px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--radius); font-family: var(--sans); font-weight: 500; font-size: 16px; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-hover); color: #FFFFFF; }
.btn-secondary { border-color: var(--text); color: var(--text); background: transparent; }
.btn-secondary:hover { background: var(--band); color: var(--text); }
.btn[disabled] { background: #E7E8E3; border-color: #A9ADA7; color: var(--muted); cursor: not-allowed; }
.btn-small { min-height: 44px; padding: 0 16px; font-family: var(--mono); font-size: 14px; font-weight: 400; }

/* Home */
.hero { padding-top: 96px; padding-bottom: 72px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 56px; align-items: start; }
.code-figure { margin: 0; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); min-width: 0; }
.code-figure figcaption { padding: 10px 16px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }
.code-figure pre { margin: 0; padding: 20px 16px; font-size: 14px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--band); }
.stats .wrap { padding-top: 28px; padding-bottom: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.stat-value { font-family: var(--mono); font-size: 28px; }
.stat-label { font-size: 14px; color: var(--muted); }
.steps-section { padding-top: 88px; padding-bottom: 88px; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 40px; }
.steps li { border-top: 2px solid var(--text); padding-top: 20px; }
.step-no { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.steps h3 { margin: 0 0 10px; font-size: 19px; font-weight: 600; }
.steps p { margin: 0; line-height: 1.6; color: var(--body); }
.cards { padding-bottom: 88px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px 32px; }
.card { border: 1px solid var(--border); background: var(--surface); padding: 32px; border-radius: var(--radius); }
.card p { margin: 0 0 20px; line-height: 1.6; color: var(--body); }
.card p:last-child { margin-bottom: 0; }
.card-link { font-weight: 500; }

/* Forms */
.check-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.field { flex: 1 1 360px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label, .filter label { font-weight: 500; font-size: 15px; }
.input, .select { min-height: 48px; padding: 0 14px; border: 1px solid var(--border-input); border-radius: var(--radius); font-size: 16px; color: var(--text); background: var(--surface); width: 100%; }
.input-mono { font-family: var(--mono); }
.select { font-family: var(--sans); }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 20px; }
.filter { display: flex; flex-direction: column; gap: 6px; }
.filter-grow { flex: 1 1 280px; }

/* Messages */
.notice { margin: 0 0 24px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--band); line-height: 1.55; }
.notice-success { border-color: #9CC5B8; background: var(--accent-soft); color: var(--accent-hover); }
.notice-error { border-color: var(--error-border); background: var(--error-bg); color: var(--error); }

/* Check results */
.results { margin-top: 48px; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.results-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 28px; }
.meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 0 0 32px; }
.facts div { background: var(--surface); padding: 18px 20px; min-width: 0; }
.facts dt { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.issue-groups { display: flex; flex-direction: column; gap: 24px; }
.issues { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); }
.issues h3 { margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--band); font-size: 16px; font-weight: 600; }
.issues ul { margin: 0; padding: 0; list-style: none; }
.issues li { padding: 16px 20px; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 16px; border-bottom: 1px solid var(--border-row); }
.issues li:last-child { border-bottom: 0; }
.issues .where { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; color: var(--body); }
.issues .what { line-height: 1.55; overflow-wrap: anywhere; }
.issues-error { border-color: var(--error-border); }
.issues-error h3 { background: var(--error-bg); border-color: var(--error-border); color: var(--error); }
.issues-error .where { color: var(--error); }
.issues-warning { border-color: var(--warning-border); }
.issues-warning h3 { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.issues-warning li { border-color: var(--warning-row); }
.issues-warning .where { color: var(--warning); }
.cta-panel { margin-top: 40px; padding: 24px; border: 1px solid var(--border); background: var(--band); border-radius: var(--radius); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta-panel p { margin: 0; line-height: 1.55; max-width: 40em; }
.cta-panel form { margin: 0; }
.checklist { margin: 32px 0 0; padding-left: 20px; color: var(--body); line-height: 1.7; max-width: 44em; }

/* Register */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.page-head .lead { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 24px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th { text-align: left; padding: 12px 16px; font-weight: 600; font-size: 13px; color: var(--body); background: var(--band); border-bottom: 1px solid var(--border); }
.table-wrap td { padding: 14px 16px; border-bottom: 1px solid var(--border-row); vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: 0; }
.registry-table { min-width: 760px; }
.num { text-align: right; font-family: var(--mono); }
.table-wrap th.num { font-family: var(--sans); }
.mono { font-family: var(--mono); font-size: 14px; }
.muted { color: var(--muted); }
.strong { font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.status::before { content: ""; width: 10px; height: 10px; flex: none; }
.status-ok { color: var(--accent); }
.status-ok::before { border-radius: 50%; background: var(--accent); }
.status-problem { color: var(--problem); }
.status-problem::before { background: var(--problem-icon); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.empty { padding: 32px; text-align: center; color: var(--body); }
.side-cards { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.side-cards .card { padding: 24px; }
.side-cards h2 { font-size: 22px; margin-bottom: 8px; }

/* Docs */
.docs { padding-top: 48px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.toc { flex: 1 1 220px; max-width: 260px; font-size: 14px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.toc-label { display: block; font-size: 12px; font-family: var(--mono); color: var(--muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 7px 10px; color: var(--body); text-decoration: none; border-radius: 3px; }
.toc a:hover { background: var(--accent-soft); color: var(--accent); }
.docs article { flex: 999 1 560px; min-width: 0; max-width: 760px; }
.doc-meta { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.prose { font-size: 17px; line-height: 1.7; }
.prose h1 { margin: 0 0 28px; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.15; }
.prose h2 { margin: 56px 0 16px; font-family: var(--serif); font-weight: 500; font-size: 28px; scroll-margin-top: 16px; }
.prose h3 { margin: 36px 0 12px; font-family: var(--serif); font-weight: 500; font-size: 22px; scroll-margin-top: 16px; }
.prose h4 { margin: 28px 0 8px; font-size: 17px; font-weight: 600; }
.prose p, .prose ul, .prose ol { margin: 0 0 20px; }
.prose li { margin-bottom: 6px; }
.prose code { background: var(--code-bg); padding: 1px 5px; border-radius: 3px; font-size: 15px; }
.prose pre { margin: 0 0 24px; padding: 18px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; font-size: 14px; line-height: 1.65; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose .table-wrap table { font-size: 15px; min-width: 560px; }
.prose .table-wrap td { padding: 10px 14px; line-height: 1.5; }
.prose .table-wrap th { padding: 10px 14px; }
.prose thead:not(:has(th:not(:empty))) { display: none; }
.prose .anchor { margin-left: 8px; color: var(--badge-border); text-decoration: none; font-family: var(--mono); font-size: 0.7em; }
.prose h2:hover .anchor, .prose h3:hover .anchor { color: var(--accent); }
.example-file { margin-bottom: 40px; }

/* Small screens: 16px gutters, smaller headings */
@media (max-width: 640px) {
    :root { --gutter: 16px; }
    .display { font-size: 36px; }
    .page-title, .prose h1 { font-size: 30px; }
    .section-title { font-size: 26px; }
    .hero { padding-top: 48px; padding-bottom: 48px; gap: 32px; }
    main.page { padding-top: 40px; padding-bottom: 64px; }
    .steps-section { padding-top: 56px; padding-bottom: 56px; }
    .card { padding: 24px; }
    .issues li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .toc { position: static; max-width: none; max-height: none; }
    .docs { gap: 32px; padding-top: 32px; }
}

/* Landlord pages: three entrances, status card, mail texts, page sections */
.cards-3 { padding-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cards-3 .subhead { font-size: 22px; }
.status-card h2 { font-size: 22px; }
.status-card p { margin-bottom: 14px; font-size: 15px; }
.section-tight { padding-top: 0; }
.page-section { padding-bottom: 96px; }
.page-section .code-figure, .prose-sv .code-figure { margin: 0 0 24px; max-width: 44em; }
.prose-sv .table-wrap { max-width: 44em; }
.prose-sv .table-wrap td { line-height: 1.5; }
.faq h3 { scroll-margin-top: 16px; }
.code-figure pre.mail { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--sans); font-size: 15px; line-height: 1.6; user-select: all; }
.path-list { margin: 0 0 32px; }
.lead-note { margin: -16px 0 32px; max-width: 46em; }
.dev-note { margin-top: 32px; }
.notice p { margin: 0 0 12px; }
.notice p:last-child { margin-bottom: 0; }
.cta-panel .actions { flex: none; }

/* /skapa: the form that creates the file */
.panel { margin: 0 0 40px; padding: 24px; border: 1px solid var(--border); background: var(--band); border-radius: var(--radius); display: grid; gap: 16px; justify-items: start; max-width: 46em; }
.panel p, .panel .notice { margin: 0; }
.panel .field, .panel details { width: 100%; }
.panel details .field { margin-top: 12px; }
.panel-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 22px; }
.form-group { margin: 0 0 32px; padding: 24px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); min-width: 0; display: grid; gap: 20px; scroll-margin-top: 16px; }
.form-group legend { padding: 0 8px; font-family: var(--serif); font-weight: 500; font-size: 22px; }
.form-group p { margin: 0; max-width: 46em; line-height: 1.55; }
.form-heading { margin: 48px 0 12px; font-family: var(--serif); font-weight: 500; font-size: 30px; scroll-margin-top: 16px; }
.form-intro { margin: 0 0 24px; max-width: 46em; color: var(--body); line-height: 1.6; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px 24px; align-items: start; }
.field-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.optional { font-weight: 400; color: var(--muted); }
.field-error { margin: 0; font-size: 15px; font-weight: 500; color: var(--error); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.textarea { min-height: 96px; padding: 12px 14px; font-family: var(--mono); font-size: 14px; }
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice { display: flex; gap: 12px; align-items: flex-start; line-height: 1.55; color: var(--body); max-width: 46em; }
.choice input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--accent); }
.choice-small { margin-top: 12px; font-size: 14px; }
.form-actions { margin: 0 0 32px; }
.form-group .form-actions { margin: 0; }
.btn-plain { min-height: 44px; padding: 0 16px; font-size: 15px; border-color: var(--border-input); }
.error-list { margin: 0; padding-left: 20px; }
.error-list a { color: inherit; font-weight: 500; }
.code-figure pre.copy-all { user-select: all; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
