/* ADHD Brain Dump Template — live triage deck + printable A4/US Letter sheets.
 * Warm stationery ink + amber accent inspired by 3ThingsPal's calm negative space.
 */
.adhd-brain-dump-template-page {
    --abd-ink: #1f2933;
    --abd-ink-deep: #111820;
    --abd-amber: #b45309;
    --abd-amber-soft: #fef3c7;
    --abd-paper: #faf8f2;
    --abd-border: #e5dfd1;
    --tool-peek-bg: #1f2933;
}

.abd-container { max-width: 820px; margin: auto; padding: 64px 24px; }
.abd-title { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.12; text-wrap: balance; margin: 0 0 20px; }
.abd-lede { font-size: 1.1rem; line-height: 1.7; max-width: 690px; margin-bottom: 30px; text-wrap: pretty; }

.abd-form { display: grid; gap: 22px; padding-block: 12px 20px; }
.abd-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.abd-field[hidden] { display: none; }
.abd-field legend { font-weight: 700; margin-bottom: 12px; }
.abd-options { display: flex; flex-wrap: wrap; gap: 10px; }
.abd-options input { position: absolute; opacity: 0; pointer-events: none; }
.abd-options label {
    display: flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 10px 16px; border-radius: 12px; background: #fff;
    box-shadow: 0 1px 4px rgb(0 0 0 / .08); cursor: pointer;
}
.abd-options input:checked + label { background: var(--abd-ink); color: #fff; }
.abd-options input:focus-visible + label { outline: 2px solid var(--abd-amber); outline-offset: 3px; }

.abd-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.abd-detail { display: grid; gap: 6px; min-width: 0; }
.abd-detail label { font-size: .84rem; font-weight: 600; }
.abd-detail input {
    box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px;
    padding: 10px 12px; border: 1px solid #d4cfc4; border-radius: 10px;
    background: #fff; color: #222; font: inherit;
}
.abd-detail input:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; }

/* Prevent toolkit's fieldset label counter from repeating inside text-input groups. */
.adhd-brain-dump-template-page .tk-app .tk-q .abd-detail label::before {
    content: none !important;
    counter-increment: none;
}

.abd-result-label { text-transform: uppercase; font-size: .75rem; letter-spacing: .1em; color: var(--abd-amber); font-weight: 700; }
.abd-result-headline { font-size: 1.75rem; font-weight: 700; margin: 8px 0 10px; overflow-wrap: anywhere; }
.abd-result-body { line-height: 1.6; margin: 0 0 18px; }

/* ----------------------------------------------------------- live triage UI */
.abd-deck {
    display: grid;
    gap: 18px;
}

.abd-wall-panel {
    background: var(--abd-paper);
    border: 1px solid var(--abd-border);
    border-radius: 14px;
    padding: 16px;
    display: grid;
    gap: 12px;
}
.abd-wall-row { display: grid; gap: 6px; }
.abd-wall-row label { font-size: .85rem; font-weight: 700; color: var(--abd-ink); }
.abd-wall-row input {
    box-sizing: border-box; width: 100%; min-height: 44px;
    padding: 10px 12px; border: 1px solid #d4cfc4; border-radius: 10px;
    background: #fff; color: #222; font: inherit;
}
.abd-wall-row input:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; }
.abd-brick-group { display: grid; gap: 8px; }
.abd-brick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.abd-brick-btn {
    min-height: 36px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid #d4cfc4; background: #fff; color: #222;
    font: inherit; font-size: .8rem; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.abd-brick-btn:hover { border-color: var(--abd-amber); background: #fffdf5; }
.abd-brick-btn.is-on { background: var(--abd-ink); border-color: var(--abd-ink); color: #fff; font-weight: 600; }
.abd-brick-btn:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; }

.abd-today-card {
    background: #fff;
    border: 2px solid var(--abd-ink);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgb(31 41 51 / .06);
    display: grid;
    gap: 14px;
}
.abd-today-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.abd-today-head h3 { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--abd-ink); }
.abd-cap-pill {
    display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px;
    font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
    background: #f3f1ea; color: #444;
}
.abd-cap-pill.is-full { background: var(--abd-amber-soft); color: #92400e; }

.abd-limit-alert {
    margin: 0; padding: 10px 14px; border-radius: 10px;
    background: var(--abd-amber-soft); border: 1px solid #f59e0b;
    color: #78350f; font-size: .86rem; font-weight: 600; line-height: 1.45;
}

.abd-today-slots { display: grid; gap: 10px; }
.abd-slot {
    display: flex; align-items: center; gap: 12px; min-height: 52px;
    padding: 10px 12px; border-radius: 12px;
    border: 1px solid #e6e2d8; background: #fffdf9;
    transition: background .15s ease, border-color .15s ease;
}
.abd-slot.is-empty { border-style: dashed; background: #faf9f5; color: #777; }
.abd-slot.is-done { background: #f3faf5; border-color: #b7dfc4; }
.abd-slot-idx {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--abd-ink); color: #fff; font-size: .78rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.abd-slot.is-empty .abd-slot-idx { background: #dcd7cb; color: #555; }
.abd-slot-ghost { font-size: .86rem; font-style: italic; }
.abd-check {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
    border: 2px solid #9ca3af; background: #fff; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font: 800 .9rem/1 sans-serif; cursor: pointer;
}
.abd-slot.is-done .abd-check { background: #1f6b3a; border-color: #1f6b3a; }
.abd-check:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; }
.abd-slot-text { flex: 1; min-width: 0; font-size: .96rem; font-weight: 600; overflow-wrap: anywhere; }
.abd-slot.is-done .abd-slot-text { text-decoration: line-through; color: #5f6f64; font-weight: 500; }
.abd-slot-act {
    flex-shrink: 0; min-height: 34px; padding: 4px 10px; border-radius: 8px;
    border: 1px solid #dcd7cb; background: #fff; color: #444;
    font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
}
.abd-slot-act:hover { background: #f5f2ea; color: #111; }

.abd-first-step {
    padding-top: 12px; border-top: 1px solid #efebe0;
    display: grid; gap: 6px;
}
.abd-first-step label { font-size: .82rem; font-weight: 700; color: #444; }
.abd-first-step input {
    box-sizing: border-box; width: 100%; min-height: 42px;
    padding: 9px 12px; border: 1px solid #d4cfc4; border-radius: 10px;
    background: #faf9f5; color: #222; font: inherit; font-size: .9rem;
}
.abd-first-step input:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; background: #fff; }

.abd-dump-form {
    background: var(--abd-paper);
    border: 1px solid var(--abd-border);
    border-radius: 14px;
    padding: 16px;
    display: grid;
    gap: 10px;
}
.abd-dump-form label { font-size: .88rem; font-weight: 700; color: var(--abd-ink); }
.abd-dump-row { display: flex; gap: 10px; align-items: stretch; }
.abd-dump-row textarea {
    flex: 1; min-width: 0; min-height: 54px; resize: vertical;
    box-sizing: border-box; padding: 10px 12px;
    border: 1px solid #d4cfc4; border-radius: 10px;
    background: #fff; color: #222; font: inherit; line-height: 1.45;
}
.abd-dump-row textarea:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; }
.abd-add-btn {
    flex-shrink: 0; min-height: 48px; padding: 10px 18px; border: 0; border-radius: 12px;
    background: var(--abd-ink); color: #fff; font: inherit; font-weight: 700;
    cursor: pointer; transition: transform .12s ease, background .15s ease;
}
.abd-add-btn:hover { background: var(--abd-ink-deep); }
.abd-add-btn:active { transform: scale(.97); }
.abd-add-btn:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; }
.abd-dump-note { margin: 0; font-size: .82rem; font-weight: 600; color: var(--abd-amber); }

.abd-mini-kicker { display: block; font-size: .78rem; color: #555; font-weight: 600; }
.abd-starters { display: grid; gap: 8px; padding-top: 4px; }
.abd-starter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.abd-starter-btn {
    min-height: 34px; padding: 5px 11px; border-radius: 999px;
    border: 1px solid #ddd6c5; background: #fff; color: #333;
    font: inherit; font-size: .79rem; cursor: pointer;
}
.abd-starter-btn:hover { border-color: var(--abd-ink); background: #fffdf5; }

.abd-park-wrap {
    border: 1px solid var(--abd-border);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}
.abd-park-toggle {
    width: 100%; border: 0; background: #f8f6f0; color: #222;
    padding: 13px 16px; text-align: left; font: inherit; font-size: .86rem;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    cursor: pointer;
}
.abd-park-toggle:hover { background: #f2efe5; }
.abd-park-toggle:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: -2px; }
.abd-chevron { flex-shrink: 0; font-size: .76rem; font-weight: 700; color: #555; }
.abd-park-list { display: grid; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid #eee9dc; }
.abd-park-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 11px; border-radius: 10px; background: #faf9f5; border: 1px solid #ece7db;
}
.abd-park-text { flex: 1; min-width: 0; font-size: .9rem; overflow-wrap: anywhere; }
.abd-park-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.abd-pick-btn {
    min-height: 34px; padding: 5px 11px; border-radius: 8px; border: 0;
    background: var(--abd-ink); color: #fff; font: inherit; font-size: .78rem; font-weight: 700;
    cursor: pointer;
}
.abd-pick-btn.is-capped { background: #e8e3d6; color: #555; }
.abd-ghost-btn {
    min-height: 34px; padding: 5px 9px; border-radius: 8px;
    border: 1px solid #d4cfc4; background: #fff; color: #444;
    font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
}
.abd-del-btn {
    width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent;
    color: #777; font: 700 1.05rem/1 sans-serif; cursor: pointer;
}
.abd-del-btn:hover { background: #f2e4e4; color: #9c1f27; }

.abd-dropped { display: grid; gap: 7px; padding: 12px 14px; border-radius: 12px; background: #f8f7f3; border: 1px dashed #d4cfc4; }
.abd-dropped-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.abd-dropped-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
    border-radius: 999px; background: #fff; border: 1px solid #e0dbd0;
    font-size: .78rem; color: #666; text-decoration: line-through;
}
.abd-dropped-chip button {
    border: 0; background: transparent; color: #333; cursor: pointer; font-size: .8rem; padding: 0 2px;
}

.abd-deck-foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
}
.abd-foot-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.abd-mini-btn {
    min-height: 38px; padding: 7px 13px; border-radius: 10px;
    border: 1px solid #d4cfc4; background: #fff; color: #222;
    font: inherit; font-size: .83rem; font-weight: 600; cursor: pointer;
}
.abd-mini-btn:hover:not(:disabled) { background: #f5f2ea; }
.abd-mini-btn:disabled { opacity: .45; cursor: not-allowed; }
.abd-mini-btn:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 2px; }
.abd-copy-status { font-size: .82rem; font-weight: 700; color: #1f6b3a; }

/* ----------------------------------------------------- printable sheet UI */
.abd-print-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin: 16px 0 24px; }
.abd-print-btn {
    flex-shrink: 0; min-height: 48px; padding: 12px 20px; border: 0;
    border-radius: 14px; background: var(--abd-ink); color: #fff;
    font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s ease;
}
.abd-print-btn:active { transform: scale(.96); }
.abd-print-btn:focus-visible { outline: 2px solid var(--abd-amber); outline-offset: 3px; }
.abd-blank-toggle {
    min-height: 44px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid #d4cfc4; background: #fff; color: #222;
    font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
}
.abd-print-actions p { font-size: .8rem; line-height: 1.5; margin: 0; flex: 1 1 240px; }

.abd-sheet {
    --sheet-content: 840px;
    box-sizing: border-box;
    padding: 26px;
    background: #fff;
    color: #222;
    border: 1px solid #ddd;
    box-shadow: 0 8px 24px rgb(0 0 0 / .06);
    font-variant-numeric: tabular-nums;
}
.abd-sheet[data-paper="letter"] { --sheet-content: 770px; }
.abd-sheet .abd-sheet-kicker { font-size: .65rem; letter-spacing: .12em; margin: 0; color: #555; }
.abd-sheet h2 {
    font: 700 clamp(1.15rem, 3vw, 1.7rem)/1.25 var(--font-ui);
    overflow-wrap: anywhere; margin: 5px 0 14px;
}
.abd-sheet-meta { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px 16px; margin-bottom: 14px; }
.abd-sheet .abd-write { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: .72rem; min-width: 0; }
.abd-write span { flex-shrink: 0; font-weight: 600; }
.abd-write b {
    font-weight: 400; min-width: 0; flex: 1; min-height: 1.45em;
    border-bottom: 1px solid #999; overflow-wrap: anywhere;
}
.abd-sheet-content { min-height: var(--sheet-content); display: flex; flex-direction: column; gap: 12px; }
.abd-sheet-rule {
    margin: 0; padding: 7px 10px; background: #fafafa; border: 1px solid #bbb;
    font-size: .68rem; line-height: 1.45; color: #222;
}

body.page-sketch .abd-sheet-box, .abd-sheet-box {
    margin: 0; padding: 11px 13px; background: #fff; border: 1px solid #999;
    display: flex; flex-direction: column; gap: 8px;
}
body.page-sketch .abd-sheet-box-strong, .abd-sheet-box-strong {
    border: 2px solid #222; background: #fcfcfc;
}
body.page-sketch .abd-sheet-fold, .abd-sheet-fold {
    border-style: dashed; background: #fafafa;
}
.abd-box-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap;
    font-size: .7rem; border-bottom: 1px solid #d5d5d5; padding-bottom: 5px;
}
.abd-box-head span { font-size: .63rem; color: #555; }

.abd-dump-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.abd-park-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.abd-drop-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.abd-dump-line {
    min-height: 24px; border-bottom: 1px solid #bbb;
    font-size: .72rem; line-height: 1.6; padding-top: 2px; overflow-wrap: anywhere;
}

.abd-slots { display: grid; gap: 9px; }
.abd-slot-row { display: flex; align-items: center; gap: 8px; }
.abd-slot-num {
    width: 20px; height: 20px; border: 1.5px solid #222; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 700; flex-shrink: 0;
}
.abd-slot-box { font-size: .95rem; line-height: 1; flex-shrink: 0; }
.abd-slot-line {
    flex: 1; min-height: 24px; border-bottom: 1.2px solid #555;
    font-size: .78rem; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere;
}
.abd-step-strip { padding-top: 4px; }

.abd-brick-print {
    display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .68rem; padding-top: 2px;
}

.abd-bucket-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1;
}
.abd-bucket-card {
    border: 1px solid #999; padding: 9px 11px; background: #fff;
    display: flex; flex-direction: column; gap: 4px;
}
.abd-bucket-card h3 { margin: 0; font-size: .74rem; font-weight: 700; }
.abd-bucket-card p { margin: 0 0 4px; font-size: .62rem; color: #555; }
.abd-bucket-line {
    min-height: 22px; border-bottom: 1px solid #bbb; font-size: .7rem; line-height: 1.55; overflow-wrap: anywhere;
}

.abd-sheet-footer {
    display: flex; justify-content: space-between; gap: 10px;
    border-top: 1px solid #999; padding-top: 10px; margin-top: 14px; font-size: .64rem;
}

.abd-prose { margin-top: 44px; line-height: 1.8; }
.abd-prose h2 { margin-top: 30px; text-wrap: balance; }

@media (max-width: 720px) {
    .abd-details { grid-template-columns: 1fr; }
    .abd-dump-row { flex-direction: column; }
    .abd-bucket-grid, .abd-dump-grid, .abd-park-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .abd-container { padding: 40px 16px; }
    .abd-options { flex-direction: column; }
    .abd-options label { width: 100%; box-sizing: border-box; }
    .abd-print-actions { flex-direction: column; align-items: stretch; }
    .abd-sheet { padding: 12px; --sheet-content: 520px; }
    .abd-sheet[data-paper="letter"] { --sheet-content: 480px; }
    .abd-sheet-meta { grid-template-columns: 1fr; }
    .abd-sheet-footer { font-size: .56rem; flex-direction: column; gap: 4px; }
    .abd-park-item { flex-direction: column; align-items: stretch; }
    .abd-park-acts { justify-content: flex-end; }
}

@media print {
    html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
    body.adhd-brain-dump-template-page > :not(main),
    main > :not(.abd-container),
    .abd-container > :not(.adhd-brain-dump-template),
    .adhd-brain-dump-template .tk-app > :not(.tk-r),
    .adhd-brain-dump-template .tk-r > :not(.abd-result),
    .abd-result:has(.abd-sheet) > :not(.abd-sheet),
    .abd-dump-form, .abd-deck-foot, .abd-slot-act, .abd-park-acts { display: none !important; }
    main, .abd-container, .adhd-brain-dump-template, .adhd-brain-dump-template .tk-app,
    .adhd-brain-dump-template .tk-r, .abd-result {
        display: block !important; position: static !important;
        margin: 0 !important; padding: 0 !important;
        width: 100% !important; max-width: none !important;
        height: auto !important; max-height: none !important;
        overflow: visible !important; border: 0 !important; box-shadow: none !important;
        background: #fff !important; transform: none !important; opacity: 1 !important;
    }
    .abd-result *, .abd-result *::before, .abd-result *::after {
        animation: none !important; transition: none !important;
        opacity: 1 !important; transform: none !important;
    }
    .abd-sheet {
        display: flex; flex-direction: column;
        height: 252mm; padding: 0; margin: 0; border: 0; box-shadow: none;
        font-family: Arial, sans-serif; break-inside: avoid;
    }
    .abd-sheet[data-paper="letter"] { height: 234mm; }
    .abd-sheet-head { flex-shrink: 0; }
    .abd-sheet h2 { font: 700 15pt/1.18 Arial, sans-serif; margin: 1mm 0 2mm; }
    .abd-sheet .abd-sheet-kicker { font-size: 7pt; }
    .abd-sheet-meta { grid-template-columns: 1fr 1fr 1.2fr; margin-bottom: 2.2mm; gap: 1.5mm 4mm; }
    .abd-sheet .abd-write { font-size: 7.8pt; }
    .abd-sheet-content { min-height: 0; flex: 1; gap: 2.4mm; }
    .abd-sheet-rule { padding: 1.5mm 2.2mm; font-size: 7.2pt; }
    .abd-sheet-box { padding: 2.2mm 3mm; gap: 1.8mm; }
    .abd-box-head { font-size: 7.4pt; padding-bottom: 1.2mm; }
    .abd-box-head span { font-size: 6.5pt; }
    .abd-dump-grid, .abd-park-grid, .abd-bucket-grid { grid-template-columns: 1fr 1fr; gap: 1.8mm 4mm; }
    .abd-dump-line { min-height: 7.5mm; font-size: 7.8pt; }
    .abd-sheet[data-paper="letter"] .abd-dump-line { min-height: 6.4mm; }
    .abd-slot-line { min-height: 7.5mm; font-size: 8.4pt; }
    .abd-bucket-card { padding: 2mm 2.6mm; }
    .abd-bucket-card h3 { font-size: 7.8pt; }
    .abd-bucket-card p { font-size: 6.4pt; }
    .abd-bucket-line { min-height: 6.8mm; font-size: 7.4pt; }
    .abd-sheet[data-paper="letter"] .abd-bucket-line { min-height: 5.8mm; }
    .abd-sheet-footer { flex-direction: row; font-size: 7pt; margin-top: 2mm; padding-top: 1.6mm; }
}

@media (prefers-reduced-motion: reduce) {
    .abd-add-btn, .abd-print-btn, .abd-brick-btn, .abd-slot { transition: none; }
}
