/* ============================================================
   Slowise Grāmatvedība
   Mierīgs, lina toņos — "protect your peace, value the slowness".
   Visas krāsas un fonti ir mainīgajos zemāk.
   ============================================================ */

/* --- Fonti (lokāli, bez Google — GDPR un ātrums) --- */
@font-face { font-family: "Jost"; font-weight: 400; font-display: swap; src: url(fonts/jost-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-2199; }
@font-face { font-family: "Jost"; font-weight: 400; font-display: swap; src: url(fonts/jost-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url(fonts/jost-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-2199; }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url(fonts/jost-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-display: swap; src: url(fonts/eb-garamond-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-display: swap; src: url(fonts/eb-garamond-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url(fonts/eb-garamond-latin-500-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url(fonts/eb-garamond-latin-ext-500-italic.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "EB Garamond"; font-weight: 600; font-display: swap; src: url(fonts/eb-garamond-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "EB Garamond"; font-weight: 600; font-display: swap; src: url(fonts/eb-garamond-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
    --linen:      #F2EEE7;   /* fons */
    --paper:      #FBF9F5;   /* kartes */
    --sand:       #E3DBCD;   /* līnijas */
    --sand-deep:  #CBBFAB;   /* "šuves" */
    --taupe:      #74685A;   /* sekundārais teksts */
    --ink:        #2A2420;   /* teksts */
    --berry:      #6F3245;   /* vienīgais akcents */
    --berry-deep: #57263A;
    --berry-soft: #F1E5E8;
    --moss:       #4F5A38;
    --moss-soft:  #E8EBDD;
    --clay:       #94432B;
    --clay-soft:  #F5E4DB;
    --ochre:      #765714;
    --ochre-soft: #F3EAD1;

    --serif: "EB Garamond", Garamond, Georgia, serif;
    --sans:  "Jost", "Futura", system-ui, -apple-system, sans-serif;

    --r: 2px;
    --gutter: 20px;
    --tap: 44px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--linen);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--berry); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--berry-deep); }
code { font-size: 0.88em; background: var(--sand); padding: 0.05em 0.35em; border-radius: var(--r); }
:focus-visible { outline: 2px solid var(--berry); outline-offset: 2px; }
[hidden] { display: none !important; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Vārdzīme --- */
.wordmark {
    display: inline-flex; align-items: baseline; gap: 0.65rem;
    color: var(--ink); text-decoration: none;
}
.wm-brand { font-family: var(--sans); font-weight: 500; letter-spacing: 0.34em; font-size: 0.95rem; }
.wm-sub   { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--taupe); letter-spacing: 0.01em; }
.wordmark-lg .wm-brand { font-size: 1.15rem; }
.wordmark-lg .wm-sub { font-size: 1.35rem; }

/* --- Pogas --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-height: var(--tap); padding: 0 1.35rem;
    font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.2;
    border: 1px solid transparent; border-radius: var(--r);
    cursor: pointer; text-decoration: none; user-select: none;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-deep); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--linen); }
.btn-small { min-height: 36px; padding: 0 0.95rem; font-size: 0.7rem; }
.btn-block { width: 100%; }
.btn-quiet-danger { background: transparent; color: var(--clay); border-color: var(--sand-deep); }
.btn-quiet-danger:hover { border-color: var(--clay); background: var(--clay-soft); color: var(--clay); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: progress; }
label.btn:focus-within { outline: 2px solid var(--berry); outline-offset: 2px; }

.link-btn {
    background: none; border: 0; padding: 0.4rem 0; cursor: pointer;
    font: inherit; font-size: 0.92rem; color: var(--taupe);
    text-decoration: underline; text-decoration-color: var(--sand-deep); text-underline-offset: 4px;
}
.link-btn:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* --- Augšējā josla --- */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) var(--gutter) 0.85rem;
    background: rgba(242, 238, 231, 0.94);
    backdrop-filter: saturate(1.2) blur(8px);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid var(--sand);
}
.logout-form { margin: 0; }

.wrap { max-width: 880px; margin: 0 auto; padding: 2.25rem var(--gutter) 3rem; }

/* --- Pievienošana --- */
.intake { margin-bottom: 3rem; }
.intake h1 {
    font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 6.4vw, 2.8rem);
    line-height: 1.05; margin: 0 0 0.6rem; letter-spacing: -0.01em;
}
.intake h1 em { font-style: italic; color: var(--berry); }
.intake-lead { color: var(--taupe); margin: 0 0 1.4rem; max-width: 34rem; }
.intake-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.intake-hint { font-size: 0.8rem; color: var(--taupe); margin: 0.8rem 0 0; letter-spacing: 0.02em; }

.queue {
    list-style: none; margin: 1.25rem 0 0; padding: 0;
    border-top: 1px solid var(--sand);
}
.queue li {
    display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 0.25rem 0.7rem;
    padding: 0.7rem 0; border-bottom: 1px solid var(--sand); font-size: 0.92rem;
}
.queue .q-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 0.5rem; background: var(--sand-deep); }
.queue .q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .q-state { grid-column: 2; color: var(--taupe); font-size: 0.85rem; }
.queue li.is-busy .q-dot { background: var(--berry); animation: pulse 1.1s ease-in-out infinite; }
.queue li.is-ok .q-dot { background: var(--moss); }
.queue li.is-ok .q-state { color: var(--moss); }
.queue li.is-warn .q-dot { background: var(--ochre); }
.queue li.is-warn .q-state { color: var(--ochre); }
.queue li.is-error .q-dot { background: var(--clay); }
.queue li.is-error .q-state { color: var(--clay); }
.queue-done { margin-top: 0.9rem; }
@keyframes pulse { 50% { opacity: .35; } }

/* --- Mēneši --- */
.month { margin-bottom: 3rem; }
.month-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
    gap: 0.15rem 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--ink);
}
.month-head h2 {
    font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1; margin: 0;
}
.month-year { color: var(--taupe); font-style: italic; }
.month-total {
    grid-row: 1; grid-column: 2; text-align: right;
    font-family: var(--serif); font-weight: 600; font-size: 1.45rem; line-height: 1;
    font-variant-numeric: lining-nums tabular-nums;
    display: flex; flex-direction: column; gap: 0.15rem;
}
.month-stats {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 1rem;
    font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--taupe);
    margin-top: 0.35rem;
}
.stat-attn { color: var(--clay); }

.month-tools {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.75rem 1rem; padding: 0.85rem 0;
}
.bank { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; font-size: 0.85rem; }
.bank-label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--taupe); }
.bank-item { display: inline-flex; align-items: center; gap: 0.5rem; }
.bank-file {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 0.7rem;
    background: var(--paper); border: 1px solid var(--sand-deep); border-radius: var(--r);
    color: var(--ink); text-decoration: none; font-weight: 500;
}
.bank-file:hover { border-color: var(--ink); color: var(--ink); }
.bank-add {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 0.7rem; cursor: pointer;
    border: 1px dashed var(--sand-deep); border-radius: var(--r); color: var(--taupe);
}
.bank-add:hover, .bank-add:focus-within { border-color: var(--berry); color: var(--berry); }
.bank-replace { cursor: pointer; color: var(--taupe); font-size: 0.8rem; text-decoration: underline; text-decoration-color: var(--sand-deep); text-underline-offset: 3px; }
.bank-replace:hover, .bank-replace:focus-within { color: var(--ink); }
.exports { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.month-empty { color: var(--taupe); font-style: italic; font-family: var(--serif); font-size: 1.15rem; margin: 0.5rem 0 0; }

/* --- Dokumentu saraksts --- */
.docs { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--sand); }
.docs li + li { border-top: 1px solid var(--sand); }
.doc {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 0.9rem;
    width: 100%; padding: 0.75rem 0.9rem; min-height: 72px;
    background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
    transition: background-color .12s;
}
.doc:hover { background: #F7F3EC; }
.doc:focus-visible { outline-offset: -2px; }
.doc.is-booked .doc-main, .doc.is-booked .doc-sum, .doc.is-booked .doc-thumb { opacity: 0.55; }
.doc-thumb {
    width: 48px; height: 48px; border-radius: var(--r); overflow: hidden;
    background: var(--linen); display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--sand);
}
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-pdf { font-size: 0.62rem; letter-spacing: 0.16em; font-weight: 500; color: var(--berry); }
.doc-main { min-width: 0; display: flex; flex-direction: column; }
.doc-vendor { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 0.85rem; color: var(--taupe); }
.doc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.doc-sum { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; line-height: 1; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.doc-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem; }

.chip {
    font-size: 0.62rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 0.2rem 0.45rem; border-radius: var(--r); white-space: nowrap;
}
.chip-ok   { background: var(--moss-soft); color: var(--moss); }
.chip-warn { background: var(--clay-soft); color: var(--clay); }
.chip-dup  { background: var(--ochre-soft); color: var(--ochre); }
.chip-wait { background: var(--sand); color: var(--taupe); }

.more-months { text-align: center; margin: 0 0 2rem; }
.foot {
    display: flex; justify-content: space-between; gap: 1rem;
    border-top: 1px solid var(--sand); padding-top: 1rem; font-size: 0.8rem; color: var(--taupe);
}
.foot a { color: var(--taupe); }

/* --- Paziņojumi --- */
.notice {
    border: 1px solid; border-radius: var(--r); padding: 0.75rem 0.9rem; margin: 0 0 0.75rem;
    font-size: 0.92rem;
}
.notice p { margin: 0 0 0.5rem; }
.notice p:last-child { margin-bottom: 0; }
.notice > .btn { margin-top: 0.15rem; }
.notice-error { background: var(--clay-soft); border-color: #E6C3B3; color: var(--clay); }
.notice-warn, .notice-dup { background: var(--ochre-soft); border-color: #E3D29F; color: var(--ochre); }
.notice-wait { background: var(--paper); border-color: var(--sand); color: var(--taupe); }
.notice-ok { background: var(--moss-soft); border-color: #CDD3B8; color: var(--moss); }
.notice-detail { font-size: 0.78rem; opacity: 0.85; word-break: break-word; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.notice a { color: inherit; }

/* --- Dokumenta logs (dialog) --- */
.sheet {
    width: min(640px, 100vw); max-width: 100vw; max-height: min(92vh, 980px);
    margin: auto; padding: 0; border: 0; border-radius: var(--r);
    background: var(--paper); color: var(--ink);
    box-shadow: 0 24px 60px rgba(42, 36, 32, 0.22);
    overflow: hidden auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(42, 36, 32, 0.48); }
.sheet[open] { display: flex; flex-direction: column; }
.sheet > * { flex-shrink: 0; }
.sheet-head {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.9rem 1.25rem; background: var(--paper); border-bottom: 1px solid var(--sand);
}
.sheet-title {
    margin: 0; min-width: 0; font-family: var(--serif); font-weight: 500; font-size: 1.4rem; line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-head-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.sheet-close {
    width: var(--tap); height: var(--tap); border: 0; background: none; cursor: pointer;
    font-size: 1.7rem; line-height: 1; color: var(--taupe); border-radius: var(--r);
}
.sheet-close:hover { color: var(--ink); background: var(--linen); }
.sheet-notices { padding: 1rem 1.25rem 0; }
.sheet-notices:not(:has(.notice:not([hidden]))) { padding-top: 0; }

.tabs {
    display: flex; gap: 1.5rem; padding: 0.4rem 1.25rem 0; border-bottom: 1px solid var(--sand);
    overflow-x: auto; scrollbar-width: none;
}
.tab {
    background: none; border: 0; padding: 0.75rem 0 0.7rem; cursor: pointer; white-space: nowrap;
    font-family: var(--sans); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--taupe); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--berry); }
.tab:hover { color: var(--ink); }
.pane { padding: 1.25rem; }

.orig img { display: block; width: 100%; height: auto; border: 1px solid var(--sand); background: var(--linen); }
.orig iframe { display: block; width: 100%; height: 62vh; border: 1px solid var(--sand); background: #fff; }
.orig-open { margin: 0.6rem 0 0; font-size: 0.85rem; text-align: right; }

/* --- Izvilkums: apģērba birka (paraksta elements) --- */
.label-tag {
    position: relative; max-width: 380px; margin: 0.5rem auto;
    background: var(--linen); padding: 14px;
    border-radius: 3px 3px 10px 10px;
}
.label-tag::before {                     /* birkas caurums */
    content: ""; position: absolute; top: 18px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
    border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--sand-deep);
}
.label-inner {
    border: 1px dashed var(--sand-deep); border-radius: 2px 2px 7px 7px;  /* iešūtā šuve */
    padding: 2.6rem 1.4rem 1.6rem; text-align: center;
}
.label-kicker { margin: 0 0 0.5rem; font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--taupe); }
.label-vendor { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.7rem; line-height: 1.15; overflow-wrap: anywhere; }
.label-reg { margin: 0.3rem 0 0; font-size: 0.78rem; color: var(--taupe); letter-spacing: 0.04em; }
.label-rows { margin: 1.4rem 0 0; padding: 0; text-align: left; }
.label-rows div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.42rem 0; border-bottom: 1px dotted var(--sand-deep); font-size: 0.92rem; }
.label-rows dt { color: var(--taupe); }
.label-rows dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.label-total { display: flex; justify-content: space-between; align-items: baseline; margin: 1rem 0 0; }
.label-total span { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; }
.label-total strong { font-family: var(--serif); font-weight: 600; font-size: 2.1rem; line-height: 1; color: var(--berry); font-variant-numeric: lining-nums; }
.label-summary { margin: 1.1rem 0 0; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--taupe); line-height: 1.35; }

/* --- Formas --- */
.field { display: block; margin-bottom: 0.9rem; }
.field-label { display: block; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--taupe); margin-bottom: 0.35rem; }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
    width: 100%; min-height: var(--tap); padding: 0.55rem 0.75rem;
    font-family: var(--sans); font-size: 1rem; color: var(--ink);
    background: #fff; border: 1px solid var(--sand-deep); border-radius: var(--r);
    -webkit-appearance: none; appearance: none;
}
select {
    background-image: linear-gradient(45deg, transparent 50%, var(--taupe) 50%), linear-gradient(135deg, var(--taupe) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem;
}
textarea { min-height: 70px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--berry); box-shadow: 0 0 0 3px var(--berry-soft); }
.check { display: inline-flex; align-items: center; gap: 0.55rem; min-height: var(--tap); cursor: pointer; font-size: 0.95rem; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--berry); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 5.5rem; gap: 0 0.75rem; }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-top: 0.5rem; border-top: 1px solid var(--sand); }
.edit-actions .btn { margin-left: auto; }
.form-msg { min-height: 1.3em; margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--clay); }
.form-msg.is-ok { color: var(--moss); }

/* --- Paziņojums apakšā --- */
.toast {
    position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    z-index: 100; max-width: calc(100vw - 2rem);
    background: var(--ink); color: var(--linen); padding: 0.75rem 1.1rem; border-radius: var(--r);
    font-size: 0.9rem; box-shadow: 0 10px 30px rgba(42, 36, 32, 0.25);
}
.toast.is-error { background: var(--clay); color: #fff; }

/* --- Pieslēgšanās un vienkāršās lapas --- */
.login-body, .plain-body {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem var(--gutter);
}
.login-card, .plain-card {
    width: 100%; max-width: 400px;
    background: var(--paper); border: 1px solid var(--sand); border-radius: var(--r);
    padding: 2.4rem 1.75rem 2rem;
}
.plain-wide { max-width: 720px; }
.login-lead { font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; margin: 1.6rem 0 1.6rem; }
.login-lead em { color: var(--berry); }
.login-card form { margin-top: 0.5rem; }
.login-card .check { margin: 0.1rem 0 1rem; }
.plain-title { font-family: var(--serif); font-weight: 500; font-size: 2rem; margin: 1.4rem 0 0.4rem; line-height: 1.1; }
.plain-lead { color: var(--taupe); margin: 0 0 1.5rem; }

/* --- Diagnostika --- */
.diag-group { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--taupe); font-weight: 500; margin: 1.75rem 0 0.4rem; }
.diag { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sand); }
.diag li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.1rem 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--sand); font-size: 0.92rem; }
.diag-state { font-size: 0.66rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 0.2rem; }
.diag-ok .diag-state { color: var(--moss); }
.diag-warn .diag-state { color: var(--ochre); }
.diag-fail .diag-state { color: var(--clay); }
.diag-note { grid-column: 2; color: var(--taupe); font-size: 0.85rem; }
.diag-form { margin-top: 0.4rem; }
.diag-form .notice { margin-top: 0.9rem; }
.diag-help { font-size: 0.88rem; color: var(--taupe); margin: 0 0 0.9rem; }
.hash-out { white-space: pre-wrap; word-break: break-all; background: #fff; border: 1px solid var(--sand); padding: 0.6rem; font-size: 0.8rem; color: var(--ink); user-select: all; }
.diag-foot { margin: 2rem 0 0; font-size: 0.78rem; color: var(--taupe); }

/* --- Telefons --- */
@media (max-width: 640px) {
    :root { --gutter: 16px; }
    .wrap { padding-top: 1.6rem; }
    .wm-brand { font-size: 0.82rem; letter-spacing: 0.3em; }
    .wm-sub { font-size: 1.05rem; }
    .intake-actions .btn { flex: 1 1 100%; }
    .month-head h2 { font-size: 1.7rem; }
    .month-total { font-size: 1.25rem; }
    .month-tools { align-items: flex-start; }
    .bank { width: 100%; }
    .bank-label { flex-basis: 100%; }
    .exports { width: 100%; }
    .exports .btn { flex: 1 1 0; }
    .docs { margin: 0 calc(var(--gutter) * -1); border-left: 0; border-right: 0; }
    .doc { padding: 0.75rem var(--gutter); gap: 0.75rem; grid-template-columns: 44px minmax(0, 1fr) auto; }
    .doc-thumb { width: 44px; height: 44px; }
    .doc-sum { font-size: 1.15rem; }

    .sheet { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
    .sheet-head { padding-top: calc(0.9rem + env(safe-area-inset-top, 0px)); }
    .sheet-title { font-size: 1.25rem; }
    .pane { padding: 1rem var(--gutter) calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
    .orig iframe { height: 70vh; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .edit-actions .btn { width: 100%; margin-left: 0; }
    .login-card, .plain-card { padding: 2rem 1.25rem 1.6rem; }
    .diag li { grid-template-columns: 1fr; }
    .diag-note { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
