/* Moving Matters — shared moving-budget tracker. Clean, mobile-friendly UI. */

:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --ink: #1f2933;
    --muted: #6b7785;
    --line: #e2e8f0;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --ok: #15803d;
    --ok-bg: #dcfce7;
    --err: #b91c1c;
    --err-bg: #fee2e2;
    --over: #b91c1c;
    --under: #15803d;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.25rem;
    background: var(--brand);
    color: #fff;
}
.brand { font-weight: 700; font-size: 1.15rem; }
.who { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
/* Logout sits on the blue topbar — force a light color (brand-on-brand would be invisible). */
.who .link { color: #fff; opacity: .9; }
.who .link:hover { opacity: 1; color: #fff; }

.wrap { max-width: 1000px; margin: 1.5rem auto; padding: 0 1rem; }
.foot { text-align: center; color: var(--muted); padding: 2rem 1rem; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
h1 { margin: 0 0 .25rem; }
h2 { margin: 0 0 1rem; font-size: 1.15rem; }
h3 { margin: 1rem 0 .5rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.muted { color: var(--muted); }

/* Forms */
.stack { display: flex; flex-direction: column; gap: .85rem; }
.row { display: flex; gap: .85rem; }
.row > label { flex: 1; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: #374151; }
input[type=text], input[type=password], select {
    font: inherit;
    padding: .55rem .65rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

button { font: inherit; cursor: pointer; }
button.primary {
    background: var(--brand);
    color: #fff;
    border: 0;
    padding: .6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}
button.primary:hover { background: var(--brand-dark); }
button.link { background: none; border: 0; color: var(--brand); padding: .2rem .35rem; font-weight: 600; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--err); }
form.inline { display: inline; }

/* Login */
.login { max-width: 380px; margin: 3rem auto; }

/* Summary cards */
.summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-value { font-size: 1.35rem; font-weight: 700; }
.stat-value.over { color: var(--over); }
.stat-value.under { color: var(--under); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }

/* Breakdown bars */
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.bars li { display: grid; grid-template-columns: 9rem 1fr auto; align-items: center; gap: .6rem; font-size: .85rem; }
.bar-track { background: var(--line); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); }
.bar-amt { font-variant-numeric: tabular-nums; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }

/* Items table */
.table-wrap { overflow-x: auto; }
table.items { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.items th, table.items td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.items th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.items .num { text-align: right; font-variant-numeric: tabular-nums; }
input.mini, select.mini { width: auto; max-width: 7rem; padding: .3rem .4rem; display: inline-block; }

/* Tabs (pure CSS: radios toggle panels) */
.tab-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tab-nav { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1.25rem; }
.tab-btn {
    padding: .6rem 1.1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    user-select: none;
}
.tab-btn:hover { color: var(--ink); }
.tab-panel { display: none; }
/* Show the panel whose radio is checked; highlight its tab button. */
#tab-expenses:checked  ~ #panel-expenses,
#tab-budget:checked    ~ #panel-budget,
#tab-proposals:checked ~ #panel-proposals { display: block; }
#tab-expenses:checked  ~ .tab-nav .tab-btn[for="tab-expenses"],
#tab-budget:checked    ~ .tab-nav .tab-btn[for="tab-budget"],
#tab-proposals:checked ~ .tab-nav .tab-btn[for="tab-proposals"] {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
/* Keyboard focus visibility for the (visually hidden) radios. */
#tab-expenses:focus-visible  ~ .tab-nav .tab-btn[for="tab-expenses"],
#tab-budget:focus-visible    ~ .tab-nav .tab-btn[for="tab-budget"],
#tab-proposals:focus-visible ~ .tab-nav .tab-btn[for="tab-proposals"] { outline: 2px solid var(--brand); outline-offset: 2px; }
.tab-count { display: inline-block; min-width: 1.2em; padding: 0 .4em; border-radius: 999px; background: var(--line); color: var(--muted); font-size: .72rem; font-weight: 700; vertical-align: middle; }

/* Budget status banner (Expenses tab) */
.budget-status .bs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.budget-status .bs-head h2 { margin: 0 0 .75rem; }

/* Budget overview */
.budget-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.budget-head h2 { margin: 0; }
.inline-set, .target-add { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.target-add { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.inline-label { font-size: .8rem; }
input.mini-wide { width: 9rem; }
button.primary.small { padding: .5rem .8rem; }

.progress { background: var(--line); border-radius: 8px; height: 16px; overflow: hidden; margin: 1rem 0 .5rem; }
.progress-fill { display: block; height: 100%; background: var(--brand); transition: width .25s; }
.progress-fill.over, .bar-fill.over { background: var(--over); }
.progress-legend { margin: 0; font-size: .95rem; }
.progress-legend .over { color: var(--over); font-weight: 600; }
.progress-legend .under { color: var(--under); font-weight: 600; }

table.targets { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.targets th, table.targets td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.targets th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.targets .num { text-align: right; font-variant-numeric: tabular-nums; }
table.targets .over { color: var(--over); }
table.targets .under { color: var(--under); }
table.targets .bar-track { min-width: 90px; }

/* Status badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge.status-planned   { background: #e0e7ff; color: #3730a3; }
.badge.status-purchased { background: #fef3c7; color: #92400e; }
.badge.status-paid      { background: var(--ok-bg); color: var(--ok); }
.badge.excluded-tag     { background: #f1f5f9; color: var(--muted); }

/* Item toggled out of the personal budget picture (session what-if, not deleted) */
table.items tr.is-excluded td { opacity: .5; }
table.items tr.is-excluded .num { text-decoration: line-through; }
table.items tr.is-excluded td.actions { opacity: 1; }   /* keep the Include button readable */

/* Row actions */
td.actions { white-space: nowrap; }
td.actions .link { padding: .2rem .4rem; }

/* Edit form */
.edit-card { max-width: 560px; }
.form-actions { display: flex; align-items: center; gap: 1rem; }
.btn-cancel { color: var(--muted); font-weight: 600; text-decoration: none; }
.btn-cancel:hover { text-decoration: underline; }
small.small, .muted.small { font-size: .8rem; }

/* Alerts */
.alert { padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; font-size: .9rem; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--err-bg); color: var(--err); }

/* Proposals (what-if vendor quotes) */
button.btn-toggle {
    background: #fff;
    color: var(--brand);
    border: 1px solid var(--brand);
    padding: .5rem .8rem;
    border-radius: 8px;
    font-weight: 600;
}
button.btn-toggle:hover { background: #eff6ff; }

/* What-if impact summary */
.impact-lines { list-style: none; margin: .5rem 0 0; padding: 0; }
.impact-lines li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .92rem;
}
.impact-lines li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.impact-lines li.added span:first-child { color: var(--muted); }
.impact-lines li.total {
    border-bottom: 0; border-top: 2px solid var(--line);
    font-weight: 700; font-size: 1rem; margin-top: .2rem;
}
.impact-lines li.impact-subhead {
    border-bottom: 0; padding: .55rem 0 .15rem;
    font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 700;
}
.impact-lines li.subtotal { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line); }
.impact-lines li.muted-line { color: var(--muted); font-style: italic; }

/* Scope group + proposal cards */
.scope-group h2 { display: flex; align-items: baseline; gap: .5rem; }
.proposal-list { display: flex; flex-direction: column; gap: .85rem; }
.proposal { border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
.proposal.is-included { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #f8fbff; }
.proposal.finish-deferred { border-left: 3px dashed var(--muted); }
.proposal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.proposal-title { margin: 0; font-size: 1.02rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.proposal-head p { margin: .25rem 0 0; }
.proposal-allin { text-align: right; display: flex; flex-direction: column; gap: .1rem; }
.proposal-allin-val { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.proposal-figs { list-style: none; margin: .65rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
.proposal-figs li { display: flex; justify-content: space-between; gap: 1rem; }
.proposal-figs li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.proposal-cond { margin: .6rem 0 0; }
.proposal-actions { display: flex; align-items: center; gap: .75rem; margin-top: .85rem; flex-wrap: wrap; }
.proposal-actions .pstatus-form select.mini { max-width: 9rem; }
.proposal-detail .proposal-head { margin-bottom: .5rem; }

/* Decision-status badges */
.badge.pstatus-candidate   { background: #e2e8f0; color: #475569; }
.badge.pstatus-shortlisted { background: #e0e7ff; color: #3730a3; }
.badge.pstatus-chosen      { background: var(--ok-bg);  color: var(--ok); }
.badge.pstatus-rejected    { background: var(--err-bg); color: var(--err); }

/* Client-supplied line rows on the detail table */
table.items tr.line-client { background: #fbfaf7; }

/* Deferred line items — kept on record, not counted in the all-in */
table.items tr.line-deferred { opacity: .6; }
table.items tr.line-deferred td.num { text-decoration: line-through; }
.tag-deferred {
    display: inline-block; padding: .05rem .45rem; border-radius: 999px;
    background: #fef3c7; color: #92400e; font-size: .68rem; font-weight: 700; vertical-align: middle;
}
.impact-lines li.deferred-line { border-bottom: 0; color: var(--muted); font-style: italic; }
.impact-lines li.deferred-line span:last-child { text-decoration: line-through; font-style: normal; }
.proposal-figs li.fig-deferred { color: var(--muted); }
.proposal-figs li.fig-deferred span:last-child { text-decoration: line-through; }

/* Mobile */
@media (max-width: 760px) {
    .summary { grid-template-columns: repeat(2, 1fr); }
    .cols { grid-template-columns: 1fr; }
    .row { flex-direction: column; }
    .bars li { grid-template-columns: 6rem 1fr auto; }
}

/* Narrow phones (e.g. iPhone 12 mini, 360px): collapse data tables into stacked cards
   so every field + the row actions are reachable without horizontal scrolling. */
@media (max-width: 600px) {
    .wrap { padding: 0 .75rem; }
    .card { padding: 1rem; }

    table.items, table.targets,
    table.items tbody, table.targets tbody,
    table.items tr, table.targets tr,
    table.items td, table.targets td { display: block; width: 100%; }

    table.items thead, table.targets thead { display: none; }   /* labels move into each cell */

    table.items tr, table.targets tr {
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: .55rem .8rem;
        margin-bottom: .75rem;
    }

    table.items td, table.targets td {
        border: 0;
        padding: .3rem 0;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        text-align: right;
    }
    table.items td.num, table.targets td.num { text-align: right; }

    /* Field label, from the cell's data-label attribute. */
    table.items td::before, table.targets td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        font-size: .78rem;
        text-align: left;
    }

    /* Lead cell (item name / category) = full-width card title, no inline label. */
    table.items td.cell-item, table.targets td.cell-item {
        display: block;
        text-align: left;
        font-size: 1.02rem;
        border-bottom: 1px solid var(--line);
        padding-bottom: .45rem;
        margin-bottom: .25rem;
    }
    table.items td.cell-item::before, table.targets td.cell-item::before { display: none; }

    /* Actions row: buttons grouped to the right, label pushed left. */
    table.items td.actions { justify-content: flex-end; gap: 1rem; padding-top: .5rem; }
    table.items td.actions::before { margin-right: auto; }

    /* Progress bar fills the available width in its card row. */
    table.targets td[data-label="Progress"] .bar-track { flex: 1; min-width: 0; }
}

/* ===================================================================
   Usability helpers: inline tooltips + collapsible "How this works"
   =================================================================== */

/* Inline help marker — a small "i" badge that shows a tooltip on hover or tap. */
.hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.05rem; height: 1.05rem; margin-left: .25rem;
    border-radius: 50%; background: var(--line); color: var(--muted);
    font-size: .72rem; font-weight: 700; font-style: normal; line-height: 1;
    cursor: help; position: relative; vertical-align: middle; user-select: none;
}
.hint:hover, .hint:focus { background: var(--brand); color: #fff; outline: none; }
.hint::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: 240px; white-space: normal;
    background: var(--ink); color: #fff; font-weight: 400; font-size: .78rem; line-height: 1.35;
    text-align: left; padding: .5rem .6rem; border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,.20); z-index: 30;
    opacity: 0; visibility: hidden; transition: opacity .12s ease;
}
.hint:hover::after, .hint:focus::after { opacity: 1; visibility: visible; }

/* Collapsible "How this works" panel shown at the top of each tab. */
details.help {
    background: #eef4ff; border: 1px solid #d6e2fb; border-radius: var(--radius);
    padding: .55rem .9rem; margin-bottom: 1.1rem;
}
details.help > summary {
    cursor: pointer; font-weight: 600; color: var(--brand-dark);
    list-style: none; display: flex; align-items: center; gap: .4rem;
}
details.help > summary::before { content: "\24D8"; font-size: 1.05rem; } /* circled i */
details.help > summary::-webkit-details-marker { display: none; }
details.help[open] > summary { margin-bottom: .5rem; }
details.help p { margin: .45rem 0; font-size: .9rem; color: var(--ink); }
details.help em { font-style: normal; color: var(--brand-dark); font-weight: 600; }

/* Small "Our decision:" label next to the shared status dropdown. */
.pstatus-label { font-size: .8rem; color: var(--muted); margin-right: .15rem; }

@media (max-width: 600px) {
    .hint::after { max-width: 175px; }
    /* Roomier tap targets so Include / Edit / Delete aren't easy to mis-tap. */
    table.items td.actions .link { padding: .45rem .6rem; }
}

/* ===================================================================
   Bigger usability features: welcome, "Your view", undo, inline save
   =================================================================== */

/* First-run welcome card (only shown on an empty budget). */
.card.welcome { border-left: 4px solid var(--brand); background: #f8fbff; }
.card.welcome h2 { margin-top: 0; }
.card.welcome ol { margin: .6rem 0 .4rem 1.1rem; padding: 0; }
.card.welcome ol li { margin: .35rem 0; }

/* "Your view" indicator — a quiet, persistent reminder the picture is personal. */
.yourview {
    margin: .6rem 0 0; font-size: .82rem; font-weight: 600; color: var(--ink);
    display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.yourview .muted { font-weight: 400; }

/* Undo link sitting inside the green flash bar after a delete. */
.undo-form { margin-left: .6rem; }
.undo-btn { color: var(--ok); text-decoration: underline; font-weight: 700; }
.undo-btn:hover { color: #0f5c2e; }

/* Inline "Saved ✓" next to the decision dropdown (set by app.js). */
.pstatus-saved { font-size: .78rem; color: var(--muted); margin-left: .35rem; white-space: nowrap; }
.pstatus-saved.ok { color: var(--ok); font-weight: 600; }

/* Keyboard focus ring for the ARIA tabs enhanced by app.js. */
.tab-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Clear "rough-in only / finish deferred" markers (more visible than the strike-through). */
.badge.badge-roughin { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.tag-roughin {
    display: inline-block; background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
    border-radius: 999px; padding: 0 .45rem; font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.proposal-allin .muted.small { display: block; margin-top: .15rem; }

/* ===========================================================================
   Box Inventory (Phase 3) — packing.maxbonilla.com
   Mobile-first and thumb-sized: this is used one-handed, standing over a box.
   =========================================================================== */

.tight { margin: 0 0 .15rem; }
.crumb { margin: 0 0 .6rem; }
.crumb a { color: var(--muted); text-decoration: none; font-size: .9rem; }

.box-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }

.btn.big { font-size: 1rem; padding: .7rem 1.05rem; }
.btn.wide { width: 100%; }
.btn.done { background: var(--ok, #16a34a); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }

/* Search: "which box is X in?" */
.search-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.search-row input[type="search"] { flex: 1 1 12rem; min-width: 0; padding: .65rem .75rem; font-size: 1rem; }

.hits { list-style: none; margin: .6rem 0 0; padding: 0; }
.hits li + li { border-top: 1px solid var(--line, #e5e7eb); }
.hits a { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline;
          padding: .6rem .1rem; text-decoration: none; color: inherit; }
.hits a:hover { background: #f8fafc; }
.hit-box { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Filter chips (also used for box status) */
.filter-row, .status-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.chip { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--line, #e5e7eb);
        border-radius: 999px; font-size: .82rem; text-decoration: none; color: var(--muted);
        background: #fff; cursor: pointer; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* Box list */
.box-grid { list-style: none; margin: 0; padding: 0; }
.box-grid li + li { border-top: 1px solid var(--line, #e5e7eb); }
.box-grid a { display: flex; align-items: center; gap: .8rem; padding: .75rem .1rem;
              text-decoration: none; color: inherit; }
.box-grid a:hover { background: #f8fafc; }
.box-num { font-weight: 800; font-size: 1.15rem; min-width: 2.6rem; color: var(--brand); }
.box-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.box-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px;
        font-size: .72rem; font-weight: 700; white-space: nowrap; }
.pill.s-packing    { background: #fef3c7; color: #92400e; }
.pill.s-packed     { background: #dbeafe; color: #1e40af; }
.pill.s-in_transit { background: #ede9fe; color: #5b21b6; }
.pill.s-unpacked   { background: #dcfce7; color: #166534; }

/* --- The packing screen -------------------------------------------------- */
.count-badge { background: var(--brand); color: #fff; font-weight: 800; border-radius: 999px;
               min-width: 2.1rem; text-align: center; padding: .25rem .55rem; font-size: 1.05rem; }

.contents { list-style: decimal; margin: .8rem 0; padding-left: 1.6rem; }
.contents li { display: flex; align-items: baseline; gap: .5rem; padding: .5rem 0;
               border-bottom: 1px solid var(--line, #e5e7eb); }
.contents .it-name { flex: 1; font-size: 1.02rem; word-break: break-word; }
.contents .it-by { white-space: nowrap; }
.it-del button { font-size: 1rem; padding: .15rem .4rem; }

/* Newly dictated rows flash briefly so you can see it landed without looking away. */
.just-added { animation: flash-in .9s ease-out; }
@keyframes flash-in { from { background: #dcfce7; } to { background: transparent; } }

/* The add row: big field, big button, side by side and thumb-reachable. */
.add-row { display: flex; gap: .5rem; align-items: stretch; margin-top: .5rem; }
.add-row input[type="text"] { flex: 1; min-width: 0; padding: .85rem .8rem; font-size: 1.05rem;
                              border-radius: 10px; }
.add-btn { white-space: nowrap; border-radius: 10px; }
.add-btn.busy { opacity: .6; }
.add-btn.failed { background: var(--danger, #dc2626); border-color: transparent; color: #fff; }
.mic-tip { margin-top: .5rem; }

.box-details { margin-top: .9rem; }
.box-details summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: .35rem 0; }
.danger-zone { margin-top: .9rem; padding-top: .6rem; border-top: 1px solid var(--line, #e5e7eb); }

/* On a phone, stack the add row so both targets are full width and unmissable. */
@media (max-width: 480px) {
    .add-row { flex-direction: column; }
    .add-btn { padding: .85rem 1rem; font-size: 1.05rem; }
    .box-head { flex-direction: column; }
}

/* --- Managed room list --------------------------------------------------- */
.room-list { list-style: none; margin: .6rem 0; padding: 0; }
.room-list li { display: flex; align-items: center; gap: .5rem; padding: .4rem 0;
                border-bottom: 1px solid var(--line, #e5e7eb); }
.room-edit { display: flex; gap: .4rem; flex: 1; min-width: 0; }
.room-edit input[type="text"] { flex: 1; min-width: 0; padding: .5rem .6rem; }
.room-used { white-space: nowrap; min-width: 4.5rem; text-align: right; }
.btn.small { padding: .45rem .7rem; font-size: .85rem; }

@media (max-width: 480px) {
    .room-list li { flex-wrap: wrap; }
    .room-edit { flex: 1 1 100%; }
    .room-used { min-width: 0; text-align: left; }
}
