/* Additions to the generated design.css: self-hosted fonts, page layout and the parts
   the design export styles inline. Colours and components come from design.css. */

@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Serif Display"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/dm-serif-display-latin-400-italic.woff2") format("woff2"); }

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.app main { padding: 22px 24px 48px; max-width: 1600px; margin: 0 auto; }
.app h1.display { margin: 4px 0 0; font-size: 36px; line-height: 1.05; }
.app p { margin: 0; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; margin-bottom: 16px; }
.pagehead > .lead { margin-right: auto; min-width: 0; }
.pagehead .muted { margin-top: 6px; }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tools .muted, .small { font-size: 13px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .main { flex: 999 1 720px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cols > .side { flex: 1 1 310px; max-width: 460px; min-width: 300px; position: sticky; top: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.rowflex { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tiny { font-size: 12px; line-height: 16px; }
.strong { font-weight: 600; }
.error-text { color: var(--error); }
.kv { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 4px 10px; font-size: 13px; }
.seg a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-left: 1px solid var(--line);
  font: 500 13px Inter, sans-serif; color: var(--text-body); text-decoration: none; }
.seg a:first-child { border-left: 0; }
.seg a[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
a.fchip, a.chip, a.mini { text-decoration: none; }
select.btn { appearance: auto; padding-right: 6px; max-width: 230px; }
.topbar form { margin: 0; }
.topbar { row-gap: 8px; }
/* Second level of the navigation: the screens of the group chosen in the top bar. */
.subnav { order: 10; flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -24px -8px; padding: 6px 24px;
  border-top: 1px solid hsl(var(--foreground) / .08); }
.subnav-link { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  color: var(--text-body); text-decoration: none; font: 500 13px Inter, sans-serif; }
.subnav-link:hover { background: var(--hover); color: var(--ink); }
.subnav-link.is-active { background: var(--accent-soft); color: var(--accent); }
.subnav-link.is-active .nav-count { color: var(--accent); }
.avatar-btn { border: 0; cursor: pointer; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 38px; min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 16px 40px rgba(20,36,26,.16); padding: 6px; z-index: 40; }
.menu-list a, .menu-list button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: transparent;
  border-radius: 8px; font: 500 13px Inter, sans-serif; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--hover); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: hsl(var(--background));
  padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; z-index: 60; box-shadow: 0 12px 32px rgba(20,36,26,.3); max-width: 90vw; }
.toast.is-error { background: var(--error); color: #fff; }
.messages { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: 10px; background: var(--success-tint); color: var(--success); font-size: 13px; font-weight: 500; }
.messages li.error { background: var(--error-tint); color: var(--error); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.banner-warn { background: hsl(33 60% 95%); }
.banner-ok { background: var(--success-tint); color: var(--success); }
.banner-bad { background: var(--error-tint); color: var(--error); }
.empty { padding: 28px 20px; text-align: center; color: var(--text-muted); }

/* Review list */
.pat-head { padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.pat-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.pat-head .meta { margin-top: 6px; font-size: 13px; line-height: 20px; max-width: 78ch; }
.pat-head .note { margin-top: 8px; color: var(--text-body); }
.pat-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.tbl { min-width: 0; }
.thead, .trow { grid-template-columns: 30px minmax(108px, 1.1fr) minmax(92px, .9fr) repeat(var(--facts, 4), minmax(64px, 1fr)) 92px 80px minmax(92px, .9fr) 46px 148px; }
.trow a.cell .cell-v, .trow .cell[data-cell="_date"] .cell-v, .trow .cell[data-cell="_amount"] .cell-v { white-space: normal; overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.acts { flex-wrap: wrap; row-gap: 2px; }
.acts .chip { height: 20px; padding: 0 7px; font-size: 11px; }
.thead > div { overflow: hidden; text-overflow: ellipsis; }
.trow > div { min-width: 0; display: flex; align-items: stretch; }
.trow > div > .cell { width: 100%; text-decoration: none; }
.trow .rownum { align-items: center; justify-content: center; font-size: 12px; }
.trow-done { background: hsl(133 26% 96%); }
.trow-rej { background: hsl(33 30% 95%); }
.cell.is-missing .cell-v { color: var(--error); }
.vhead > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 20px 14px; font-size: 12px; color: var(--text-muted); align-items: center; }
.detail > div { min-width: 180px; max-width: 46ch; }
.sample { border-bottom: 1px solid var(--line); background: hsl(14 100% 97%); }
.sample-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 20px; font-size: 13px; }
.sample-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 20px 8px 44px; border-top: 1px solid var(--line); font-size: 13px; }
.sample-row form { margin: 0; display: inline-flex; gap: 6px; }
.prow a.ptitle { color: var(--ink); text-decoration: none; font-weight: 600; }
.prow a.ptitle:hover { text-decoration: underline; }
.prow > span { min-width: 0; }
.prow .muted, .single .muted { display: block; font-size: 12px; }
.single a { color: var(--ink); text-decoration: none; font-weight: 600; }
.single a:hover { text-decoration: underline; }

/* Cell detail */
.cd-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.cd-value { font-size: 22px; font-weight: 600; line-height: 28px; overflow-wrap: anywhere; }
.cd-entry { font-size: 13px; line-height: 20px; }
.cd-mail { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.cd-mail-h { padding: 10px 14px; border-bottom: 1px solid var(--line); background: hsl(33 70% 97%); }
.cd-mail-b { margin: 0; padding: 12px 14px; font: 400 13px/22px Inter, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 460px; overflow: auto; }
.cd-section { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.cd-flag { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: hsl(14 100% 95%); font-size: 13px; }
.cd-comment { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.cd-comment .avatar { width: 24px; height: 24px; font-size: 10px; }

/* Dialogs */
dialog.dialog { padding: 0; color: var(--ink); }
dialog.dialog::backdrop { background: rgba(20,36,26,.32); }
.dialog-h h2 { margin: 0; font-size: 18px; }
.dialog-h p { margin-top: 4px; }
.dialog ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.statbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.statbox b { display: block; font-size: 20px; line-height: 26px; }
.keygrid { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; align-items: center; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 400px; max-width: 100%; padding: 28px; }
.login h1 { margin: 14px 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.login label { font-size: 13px; font-weight: 500; }
.login input[type="text"], .login input[type="password"] { height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px;
  font: 400 15px Inter, sans-serif; color: var(--ink); background: #fff; }
.login .errors { margin: 0; padding: 10px 12px; list-style: none; border-radius: 8px; background: var(--error-tint); color: var(--error); font-size: 13px; }
.login .note { margin-top: 14px; font-size: 12px; color: var(--text-muted); }

/* Generic tables on the other screens */
.grid-h, .grid-r { display: grid; gap: 12px; align-items: center; padding: 10px 16px; }
.grid-h { font-size: 12px; font-weight: 600; color: var(--text-muted); background: hsl(33 70% 96%); border-bottom: 1px solid var(--line); }
.grid-r { border-top: 1px solid var(--line); font-size: 13px; color: var(--ink); text-decoration: none; }
.grid-r:first-of-type { border-top: 0; }
a.grid-r:hover { background: hsl(var(--foreground) / .04); color: var(--ink); }
.grid-r.is-sel { background: hsl(14 100% 95%); box-shadow: inset 3px 0 0 var(--accent); }
.prose { font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.prose h2 { font-size: 16px; margin: 18px 0 6px; }
.prose h3 { font-size: 14px; margin: 14px 0 4px; }
.prose p { margin: 0 0 8px; }
.prose ul, .prose ol { margin: 0 0 8px; padding-left: 20px; }
.prose table { border-collapse: collapse; font-size: 13px; margin: 0 0 10px; }
.prose td, .prose th { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.pre { white-space: pre-wrap; font: 400 13px/20px Inter, sans-serif; overflow-wrap: anywhere; }
.field input[type="date"].input { font-family: Inter, sans-serif; }
@media (max-width: 900px) { .cols > .side { position: static; max-width: none; } }

/* Fallarten: intake checklist — one block per point (where it comes from, what if it is missing) */
.ifact { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.ifact .input { height: 30px; font-size: 13px; }
.ifact textarea.input { height: auto; padding: 6px 10px; line-height: 18px; resize: vertical; color: var(--text-muted); }
.ifact .lbl, .ipreview .lbl { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-muted); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; }
.ipreview { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: hsl(133 26% 96%); font-size: 13px; line-height: 20px; display: flex; flex-direction: column; gap: 6px; max-width: 76ch; }
.ipreview ol, .ipreview ul { margin: 0 0 6px; padding-left: 20px; }
.itable { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.itable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line-strong); }
.itable td { vertical-align: top; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }

/* Screen-reader-only labels (the search on "Fallarten", M7). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
/* The preview under the search box while typing (acl.web.search.preview). */
.search-form { position: relative; }
.search-preview { position: absolute; right: 0; top: 40px; width: 440px; max-width: calc(100vw - 32px); max-height: min(70vh, 560px);
  overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20,36,26,.16); padding: 6px; z-index: 45; }
.search-preview .sp-group { display: flex; justify-content: space-between; padding: 8px 10px 4px; font: 600 11px Inter, sans-serif;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.search-preview .sp-option { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 7px 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 13px; }
.search-preview .sp-option[aria-selected="true"] { background: var(--hover); }
.search-preview .sp-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-preview .sp-state { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.search-preview .sp-sub { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.search-preview mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-preview .sp-all { border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 8px 8px; font-weight: 600;
  grid-template-columns: 1fr; color: var(--accent); }
.search-preview .sp-empty { padding: 10px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 600px) { .search-preview { position: fixed; left: 16px; right: 16px; width: auto; max-width: none; } }
/* The top bar draws its own layer (backdrop-filter); lift it above the page panels so the
   user menu and the search preview inside it are not covered by them. */
.topbar { position: relative; z-index: 30; }
