:root { --bg:#fff7f1; --card:#fff; --ink:#1f1d1a; --muted:#7c736a; --accent:#e36b3b; --good:#3b8c5e; --warn:#caa400; --line:#f0e6dd; --radius: 14px; }
* { box-sizing:border-box; }
html, body { margin:0; background:var(--bg); color:var(--ink); font: 16px/1.5 -apple-system,BlinkMacSystemFont,Inter,sans-serif; }
header { display:flex; justify-content:space-between; align-items:center; padding: 0.75rem 1.25rem; background: white; border-bottom:1px solid var(--line); }
.brand { color: var(--accent); text-decoration:none; font-weight:700; }
nav { display:flex; gap: 0.75rem; align-items:center; }
nav a, nav button.link { color: var(--muted); text-decoration:none; background:none; border:0; cursor:pointer; font: inherit; padding:0; }
nav a:hover { color: var(--ink); }
main { max-width: 720px; margin: 1rem auto 4rem; padding: 0 1rem; }
.hero { text-align:center; padding: 3rem 1rem; }
.hero h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.hero p { color: var(--muted); }
.cta { display:inline-block; padding: 0.7rem 1.4rem; background: var(--accent); color:white; border-radius: var(--radius); text-decoration:none; margin-top:1rem; font-weight: 600; }
.panel { background: var(--card); padding: 1.25rem; border-radius: var(--radius); margin: 1rem 0; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.panel.narrow { max-width: 420px; margin: 2.5rem auto; }
.request { background: var(--card); padding: 1.25rem; border-radius: var(--radius); margin: 0.75rem 0; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.request h1, .request h3 { margin: 0 0 0.5rem; }
.request img.hero-img { width:100%; height: auto; border-radius: 10px; margin: 0.5rem 0; }
label { display:block; margin: 0.5rem 0; color: var(--muted); font-size: 0.85rem; }
label.check { display:flex; gap: 0.4rem; align-items: center; }
input, select, textarea { width:100%; margin-top: 0.25rem; padding: 0.6rem 0.8rem; border-radius: 10px; border: 1px solid var(--line); background: white; color: var(--ink); font: inherit; }
button { font: inherit; cursor: pointer; padding: 0.6rem 1rem; border-radius: var(--radius); border: 0; background: #eee; }
button.primary { background: var(--accent); color: white; font-weight: 600; }
button.link { background: transparent; color: var(--muted); padding: 0.3rem 0.5rem; }
.bar { height: 8px; background: #f3e9de; border-radius: 999px; overflow: hidden; margin: 0.4rem 0; }
.bar span { display:block; height:100%; background: var(--good); }
.muted { color: var(--muted); font-size: 0.85rem; }
.rowflex { display:flex; justify-content:space-between; align-items:baseline; }
.badge { padding: 0.15rem 0.6rem; border-radius: 999px; font-size:0.75rem; background:#eee; color:#333; }
.badge.open { background:#e7f4ec; color: var(--good); }
.badge.received { background:#fff3d2; color: #6a5400; }
.badge.closed { background:#eee; color: #555; }
.flash { padding: 0.6rem 0.8rem; border-radius: 10px; margin: 0.5rem 0; }
.flash.error { background:#fdecec; color:#8a2a2a; }
.flash.info { background:#e6f4ea; color: var(--good); }
.empty { text-align:center; color: var(--muted); padding: 2rem; }
.inline { display: inline-flex; gap: 0.5rem; align-items: center; }
code { font: 13px/1 ui-monospace, monospace; background: #f4ecde; padding: 0.2rem 0.4rem; border-radius: 6px; user-select: all; }
.notice { padding: 1rem 1.25rem; border-radius: 10px; margin: 0.5rem 0; }
.notice-warn { background: #fff7e0; color: #6b4f00; border: 1px solid #f1d77a; }
.notice p { margin: 0.25rem 0; }

/* ============================================================
 * Polish layer — added by the cross-project UI polish sweep.
 * Focus rings, mobile breakpoints, loading affordances, empty
 * states. Keep below your existing rules so it overrides them.
 * ============================================================ */

/* Accessible focus rings on every interactive element. The base CSS
 * uses platform-default outlines which disappear on most themes — this
 * restores a visible 2px ring without breaking native keyboard nav. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent, #5b8def);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Mobile: stack form rows, shrink hero padding, full-width buttons. */
@media (max-width: 600px) {
    main { padding: 0 0.75rem 3rem; }
    .panel, .request, .claim { padding: 1rem 0.9rem; }
    .hero { padding: 2rem 1rem; }
    .hero h1 { font-size: 1.6rem; }
    .rowflex { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
    button.primary, .cta { width: 100%; text-align: center; }
    nav { gap: 0.5rem; flex-wrap: wrap; }
}

/* Loading spinner — drop in next to a submit button via:
 *   <button class="primary" data-loading="Saving…">Save</button>
 * The aria-busy attribute is toggled by app.js when the form submits. */
[aria-busy="true"] { cursor: progress; opacity: 0.7; pointer-events: none; }
.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: white;
    border-radius: 50%; animation: spin 0.8s linear infinite;
    vertical-align: -2px; margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty-state — use:
 *   <div class="empty-state">
 *     <h3>No items yet</h3><p>Add your first one to get started.</p>
 *   </div>  */
.empty-state {
    text-align: center; padding: 2.5rem 1rem;
    color: var(--muted, #888);
}
.empty-state h3 { margin: 0 0 0.4rem; color: var(--ink, inherit); font-weight: 600; }
.empty-state p  { margin: 0 auto; max-width: 360px; line-height: 1.45; }

/* Smooth card hover. Cheap polish that makes lists feel alive without
 * adding interactive surfaces we don't want clickable. */
.panel, .request, .claim, .card {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a:has(> .card):hover .card,
a.cardlink:hover { transform: translateY(-1px); }

/* Better flash bars — slightly larger, with a left bar to scan. */
.flash, .notice {
    border-left: 4px solid currentColor;
    padding-left: 0.9rem !important;
}

/* Skip-link for keyboard users — visible on focus only. */
.skip-link {
    position: absolute; top: -100px; left: 0;
    background: var(--accent, #5b8def); color: white;
    padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { top: 0; }


/* Section heading separator used on the dashboard between registries +
 * requests so the list isn't a wall of cards. */
.section-h {
    margin: 1.5rem 0 0.5rem;
    font-size: 1rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    border-top: 1px solid var(--line); padding-top: 1rem;
}
.bar { height: 10px; }  /* slightly thicker so the % is legible */
.badge {
    text-transform: uppercase; letter-spacing: 0.04em;
    font-weight: 600; font-size: 0.7rem;
}
