/* ============================================================
   Wolfe's 3D Prints - design system v10 ("Studio")
   A dark, glassy maker-studio look: deep blue-black canvas with
   soft aurora light, Space Grotesk display type over Inter,
   pill buttons, and one gradient that runs red -> ember.
   The logo artwork itself stays black & white.
   ============================================================ */
:root {
    color-scheme: dark;
    --bg: #05070c;
    --bg-2: #080b12;
    --surface: #0d1119;
    --surface-1: #0d1119;
    --surface-2: #121826;
    --surface-3: #1a2334;
    --surface-inset: #070a10;
    --img-bg: #12242f;
    --text: #f4f7fb;
    --muted: #9dabc0;
    --muted-2: #6d7c93;
    --muted-strong: #c3cede;
    --accent: #ee3a3b;
    --accent-2: #ff7a45;
    --accent-dark: #d92c2d;
    --red: #ee3a3b;
    --red-bright: #ff5a4d;
    --amber: #ffb020;
    --teal: #144c67;
    --teal-mid: #2a7ea6;
    --teal-bright: #5cc8e6;
    --danger: #e5484d;
    --ok: #34c172;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 26px;
    --radius: 26px;
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.38);
    --shadow: 0 30px 60px -18px rgba(0, 0, 0, 0.65);
    --ring: 0 0 0 2px var(--bg), 0 0 0 4.5px var(--teal-bright);
    --control-h: 52px;
    --ease: 0.18s ease;
    --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --grad-brand: linear-gradient(94deg, #ff8a5c, var(--accent) 52%, #ff5a3c);
    --grad-btn: linear-gradient(180deg, #f65454, var(--accent-dark));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: #2a3448 var(--bg); }
body {
    margin: 0;
    background:
        radial-gradient(1100px 520px at 88% -140px, rgba(20, 76, 103, 0.5), transparent 62%),
        radial-gradient(820px 460px at -12% 180px, rgba(238, 58, 59, 0.12), transparent 56%),
        radial-gradient(960px 560px at 55% 118%, rgba(255, 176, 32, 0.06), transparent 60%),
        linear-gradient(180deg, #090d15, var(--bg) 460px);
    background-attachment: fixed;
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    font-size: 16.5px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { background: rgba(238, 58, 59, 0.5); color: #fff; }
a { color: var(--teal-bright); text-underline-offset: 3px; }
a:hover { color: #a5e3f7; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 10px; text-wrap: balance; font-weight: 700; }
h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.13em; letter-spacing: -0.01em; }
.grad {
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.small { color: var(--muted); font-size: 0.9em; }
code { background: var(--surface-inset); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); font-size: 0.92em; }
img, canvas, video, iframe { max-width: 100%; }
pre { overflow-x: auto; }

/* ---------- Header: floating glass bar ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(5, 7, 12, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
    border-bottom: 1px solid var(--border);
}
.site-header::after {
    content: ''; display: block; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--amber), var(--teal-bright), var(--teal));
    opacity: 0.9;
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-height: 46px; border-radius: var(--r-md); }
.brand img {
    height: 44px; width: 44px; object-fit: contain; display: block;
    background: #fff; border-radius: 14px; padding: 5px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12em; letter-spacing: -0.01em; white-space: nowrap; }
nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; max-width: 100%; }
nav::-webkit-scrollbar { display: none; }
nav a, nav .nav-logout {
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.94em;
    padding: 10px 15px; border-radius: 999px; white-space: nowrap;
    display: inline-flex; align-items: center; min-height: 44px;
    transition: background var(--ease), color var(--ease);
}
nav a:hover, nav a:active, nav .nav-logout:hover, nav .nav-logout:active { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-logout-form { display: inline-flex; margin: 0; }
.nav-logout { background: none; border: 0; font-family: inherit; cursor: pointer; }
.nav-user { color: var(--amber); font-size: 0.88em; font-weight: 700; padding: 0 8px; white-space: nowrap; }

main.wrap { padding-top: 36px; padding-bottom: 72px; }
.site-footer { position: relative; border-top: 1px solid var(--border); color: var(--muted); padding: 38px 0 calc(38px + env(safe-area-inset-bottom)); font-size: 0.93em; background: rgba(255, 255, 255, 0.015); }
.site-footer::before {
    content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(238, 58, 59, 0.5), rgba(92, 200, 230, 0.5), transparent);
}
.footer-grid { display: flex; gap: 18px 44px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
.footer-brand { display: grid; gap: 6px; max-width: 340px; }
.footer-brand strong { color: var(--text); font-family: var(--font-display); font-size: 1.05em; }
.site-footer p { margin: 3px 0; }
.footer-links { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 52px 0 12px; }
.hero::before {
    content: ''; position: absolute; left: 0; right: 0; top: -30px; height: 430px;
    z-index: -1; pointer-events: none;
    background:
        radial-gradient(440px 250px at 15% 30%, rgba(238, 58, 59, 0.22), transparent 65%),
        radial-gradient(480px 270px at 85% 16%, rgba(61, 155, 196, 0.22), transparent 65%),
        radial-gradient(400px 230px at 55% 90%, rgba(139, 92, 246, 0.15), transparent 65%);
    animation: aurora 16s ease-in-out infinite alternate;
}
@keyframes aurora { from { transform: translateY(0) scale(1); } to { transform: translateY(16px) scale(1.05); } }
.hero-logo {
    width: 136px; max-width: 46vw; height: auto;
    display: inline-block;
    filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 38px rgba(92, 200, 230, 0.3));
}
.hero h1 { margin: 28px 0 12px; font-size: clamp(2.3em, 6.6vw, 3.7em); font-weight: 700; letter-spacing: -0.03em; }
.lede { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 1.1em; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.hero-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.chip {
    font-size: 0.82em; font-weight: 700; color: var(--muted);
    border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
    background: rgba(255, 255, 255, 0.035);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
 overflow-wrap: anywhere; max-width: 100%;}
.chip b { color: var(--text); font-weight: 800; }
.chip-ok { color: #4ade80; border-color: rgba(74, 222, 128, 0.45); }
.script-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre; overflow-x: auto; }
.chip-warn { color: var(--amber); border-color: rgba(255, 176, 32, 0.45); }
.quote-respond { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.quote-respond form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.quote-respond input { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-inset); color: var(--text); font: inherit; }
.quote-respond input[type="number"] { width: 130px; }
.quote-respond input[type="text"] { width: 180px; }

/* ---------- How-it-works steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 36px 0 6px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }
.step {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; display: grid; gap: 8px; align-content: start;
    box-shadow: var(--shadow-sm);
    transition: transform 0.16s ease, border-color var(--ease);
}
.step:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.step h3 { margin: 6px 0 0; }
.step p { margin: 0; color: var(--muted); font-size: 0.95em; }
.step-num {
    width: 46px; height: 46px; border-radius: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.2em; color: #fff;
    box-shadow: var(--shadow-sm);
}
.step-num.n1, .step:nth-child(1) .step-num { background: linear-gradient(145deg, #f65454, var(--accent-dark)); box-shadow: 0 12px 24px -8px rgba(238, 58, 59, 0.6); }
.step-num.n2, .step:nth-child(2) .step-num { background: linear-gradient(145deg, var(--teal-bright), var(--teal)); box-shadow: 0 12px 24px -8px rgba(61, 155, 196, 0.6); }
.step-num.n3, .step:nth-child(3) .step-num { background: linear-gradient(145deg, #ffc44d, #f59e0b); color: #2a1a00; box-shadow: 0 12px 24px -8px rgba(245, 166, 35, 0.55); }

/* ---------- Cards ---------- */
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014)), linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    margin: 26px 0;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.muted-card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008)), linear-gradient(180deg, #12202f, #0c1420); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; }
.form label { display: grid; gap: 8px; font-weight: 600; font-size: 0.95em; }
.form input, .form select, .form textarea, .idea-search input, .captcha-row input {
    background: var(--surface-inset); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 13px 16px; font: inherit; font-size: 16px; font-weight: 400;
    width: 100%; appearance: none; min-height: var(--control-h);
    transition: border-color var(--ease), box-shadow var(--ease);
}
.form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%239dabc0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px;
}
.form textarea { min-height: 0; }
.form input:hover, .form select:hover, .form textarea:hover, .idea-search input:hover, .captcha-row input:hover { border-color: var(--border-strong); }
.form input:focus, .form select:focus, .form textarea:focus, .idea-search input:focus, .captcha-row input:focus {
    outline: none; border-color: var(--teal-bright);
    box-shadow: 0 0 0 4px rgba(92, 200, 230, 0.18);
}
.form input[type="file"] { padding: 12px 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 130px; gap: 15px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form input[type="file"]::file-selector-button {
    font: inherit; font-weight: 700; font-size: 0.92em; color: #fff;
    background: linear-gradient(180deg, var(--teal-mid), var(--teal));
    border: 0; border-radius: var(--r-sm); padding: 9px 16px; margin-right: 12px;
    cursor: pointer; min-height: 40px;
}
.form input[type="file"]::-webkit-file-upload-button {
    font: inherit; font-weight: 700; font-size: 0.92em; color: #fff;
    background: linear-gradient(180deg, var(--teal-mid), var(--teal));
    border: 0; border-radius: var(--r-sm); padding: 9px 16px; margin-right: 12px;
    cursor: pointer; min-height: 40px;
}

/* ---------- Buttons: pill system ---------- */
.btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--grad-btn);
    color: #fff; border: 0; min-height: var(--control-h);
    padding: 13px 26px; border-radius: 999px; font: inherit; font-weight: 700;
    cursor: pointer; text-decoration: none; letter-spacing: -0.01em;
    box-shadow: 0 12px 26px -8px rgba(238, 58, 59, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.1s ease, box-shadow var(--ease), filter var(--ease);
}
.btn::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-130%); transition: transform 0.6s ease;
}
.btn:hover { filter: brightness(1.09); color: #fff; transform: translateY(-1px); box-shadow: 0 16px 30px -8px rgba(238, 58, 59, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn:hover::after { transform: translateX(130%); }
.btn:active { transform: scale(0.98); }
.btn-alt {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.btn-alt:hover { color: #fff; border-color: rgba(92, 200, 230, 0.6); }
.btn-small { padding: 9px 17px; min-height: 42px; font-size: 0.9em; }
.btn-danger { background: linear-gradient(180deg, #e5484d, #b92f34); box-shadow: 0 12px 24px -8px rgba(229, 72, 77, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
@media (max-width: 640px) { .form .btn { width: 100%; } .btn-small { min-height: 44px; } }
.inline-form { display: inline-block; margin-right: 8px; }

/* ---------- Feedback banners ---------- */
.flash { background: rgba(52, 193, 114, 0.13); border: 1px solid rgba(52, 193, 114, 0.5); color: #cdf5dc; padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 20px; font-weight: 600; box-shadow: var(--shadow-sm); }
.errors { background: rgba(229, 72, 77, 0.12); border: 1px solid rgba(229, 72, 77, 0.5); color: #ffd7d8; padding: 11px 17px; border-radius: var(--r-md); margin: 14px 0; }
.errors p { margin: 4px 0; }
.flash-field { outline: 3px solid var(--amber) !important; outline-offset: 1px; }

/* ---------- Library grid ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.8em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-top: 20px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; margin-top: 20px; }
.dash-grid .card { display: flex; flex-direction: column; }
.dash-grid .dash-card-actions { margin-top: auto; padding-top: 14px; }
.dash-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.055); margin: 0; }
.dash-row:last-of-type { border-bottom: 0; }
.dash-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-card-actions { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 20px; } }
.tile {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)), linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    text-decoration: none; color: var(--text); display: flex; flex-direction: column; height: 100%; min-width: 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color var(--ease), box-shadow var(--ease);
    animation: rise 0.5s ease both;
}
.grid .tile:nth-child(2) { animation-delay: 0.04s; }
.grid .tile:nth-child(3) { animation-delay: 0.08s; }
.grid .tile:nth-child(4) { animation-delay: 0.12s; }
.grid .tile:nth-child(5) { animation-delay: 0.16s; }
.grid .tile:nth-child(6) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tile:hover, .tile:active { border-color: rgba(92, 200, 230, 0.55); transform: translateY(-5px); box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(92, 200, 230, 0.25); }
.tile-media { position: relative; display: block; overflow: hidden; background: var(--img-bg); }
.tile-media::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
    background: linear-gradient(180deg, transparent, rgba(4, 6, 10, 0.45)); pointer-events: none;
}
.tile-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--img-bg); transition: transform 0.5s ease; }
.tile:hover .tile-media img { transform: scale(1.05); }
.tile-chip { position: absolute; top: 12px; left: 12px; z-index: 2; }
.tile-noimg { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.92); font-family: var(--font-display); font-weight: 700; font-size: 1.7em; letter-spacing: 0.05em; background: linear-gradient(150deg, var(--teal-mid), var(--teal)); }
.tile-noimg.ext-3mf { background: linear-gradient(150deg, #f65454, #8f1d1e); }
.tile-noimg.ext-zip { background: linear-gradient(150deg, #ffc44d, #b97a0c); color: #2a1a00; }
.tile-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile-body strong { font-family: var(--font-display); font-size: 1.04em; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.tile-body .small { display: block; }
.tile-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 3px; }
.tile-view { color: var(--teal-bright); font-weight: 700; font-size: 0.85em; }
.tag {
    display: inline-block; font-size: 0.72em; font-weight: 800; letter-spacing: 0.06em;
    padding: 3px 10px; border-radius: 999px; vertical-align: 1px; border: 1px solid transparent;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tag-stl { background: rgba(20, 50, 70, 0.72); color: #8fd0ea; border-color: rgba(92, 200, 230, 0.5); }
.tag-3mf { background: rgba(70, 18, 18, 0.72); color: #ff9d9d; border-color: rgba(238, 58, 59, 0.55); }
.tag-zip { background: rgba(70, 50, 8, 0.72); color: #ffcf6b; border-color: rgba(255, 176, 32, 0.55); }
.tile-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    height: 100%; touch-action: pan-y; cursor: grab; position: relative; z-index: 1;
}
.tile-track::-webkit-scrollbar { display: none; }
.tile-track.dragging { scroll-snap-type: none; cursor: grabbing; }
.tile-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: block; height: 100%; }
.tile-slide img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.tile:hover .tile-slide img { transform: none; }
.tile-dots {
    position: absolute; left: 0; right: 0; bottom: 9px; z-index: 2;
    display: flex; gap: 5px; justify-content: center; pointer-events: none;
}
.tile-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.tile-dot.on { background: #fff; }

/* ---------- Preview galleries ---------- */
.preview-gallery {
    display: flex; gap: 13px; overflow-x: auto; padding: 6px 2px 14px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
    touch-action: pan-y; cursor: grab;
}
.preview-gallery.dragging { scroll-snap-type: none; cursor: grabbing; }
.preview-gallery img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.preview-slide { margin: 0; flex: 0 0 82%; max-width: 440px; scroll-snap-align: start; }
@media (min-width: 700px) { .preview-slide { flex-basis: 46%; } }
.preview-slide img {
    width: 100%; height: auto; display: block;
    border-radius: var(--r-md); border: 1px solid var(--border); background: var(--img-bg);
}
.preview-slide figcaption { color: var(--muted); font-size: 0.88em; margin-top: 7px; text-align: center; font-weight: 600; overflow-wrap: anywhere; }
.slide-controls { display: flex; gap: 8px; justify-content: center; margin-top: 9px; flex-wrap: wrap; }

/* ---------- Print detail page ---------- */
.print-head { margin-bottom: 20px; display: grid; gap: 5px; }
.print-head h2 { margin: 2px 0 4px; font-size: clamp(1.6em, 4.6vw, 2.3em); letter-spacing: -0.025em; line-height: 1.15; }
.print-head p { margin: 0; }
.print-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pencil-btn {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted-strong);
    transition: color var(--ease), border-color var(--ease);
}
.pencil-btn svg { width: 18px; height: 18px; }
.pencil-btn:hover { color: var(--teal-bright); border-color: rgba(92, 200, 230, 0.45); }
.rename-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 2px 0; }
.rename-row input[type="text"] {
    flex: 1 1 220px; min-height: 46px; padding: 11px 13px;
    background: var(--surface-inset); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
    color: var(--text); font: inherit;
}
.rename-row input[type="text"]:focus { outline: none; border-color: var(--teal-mid); box-shadow: 0 0 0 4px rgba(92, 200, 230, 0.16); }
.print-layout { display: flex; flex-direction: column; gap: 26px; }
.print-media { min-width: 0; }
.print-media h3 { margin-top: 26px; }
.print-info { display: grid; gap: 13px; align-content: start; }
.print-info h2 { margin: 0; font-size: 1.75em; }
.print-info p { margin: 0; }
@media (min-width: 960px) {
    .print-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 1fr); align-items: start; }
    .print-info {
        position: sticky; top: 100px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014)), linear-gradient(180deg, var(--surface-2), var(--surface-1));
        border: 1px solid var(--border); border-radius: var(--r-lg);
        padding: 24px; box-shadow: var(--shadow-sm);
    }
}
.preview-box img { max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--border); }
.viewer { height: clamp(300px, 58vh, 480px); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); background: var(--img-bg); touch-action: none; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
@media (min-width: 1000px) { .viewer { height: clamp(400px, 64vh, 600px); } }
.viewer canvas { display: block; }
.viewer-msg { padding: 18px; }
.viewer-photo { width: 100%; max-height: 70vh; object-fit: contain; display: block; border-radius: var(--r-md); }
#viewer { margin-top: 16px; }
.request-photo { max-width: 340px; width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--border); display: block; }
.print-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
    .print-actions { flex-direction: column; align-items: stretch; }
    .print-actions .btn { width: 100%; }
    .print-actions .inline-form { display: block; margin-right: 0; }
    .print-actions > .btn { width: 100%; }
    .print-actions form .btn { width: auto; }
}
.print-bottom {
    border-top: 1px solid var(--border); margin-top: 28px; padding-top: 22px;
    display: flex; justify-content: flex-end;
}
@media (max-width: 640px) {
    .print-bottom { justify-content: stretch; }
    .print-bottom form, .print-bottom .btn-danger { width: 100%; }
    #delete-confirm .btn { width: auto; }
}
.preview-solo { margin: 0 0 4px; }
.preview-solo .btn { width: 100%; }

/* ---------- Item carousel ---------- */
.carousel { position: relative; margin-top: 6px; }
.carousel-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)), linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border); border-radius: var(--r-lg);
    touch-action: pan-y; cursor: grab;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.dragging { scroll-snap-type: none; cursor: grabbing; }
.carousel-track img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.carousel-slide {
    flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
    margin: 0; padding: 22px 18px 16px;
    display: grid; justify-items: center; align-content: center; gap: 12px;
}
.carousel-slide img {
    max-height: 400px; max-width: 100%; width: auto; height: auto;
    border-radius: var(--r-sm); box-shadow: var(--shadow-sm); background: rgba(255, 255, 255, 0.03);
}
.carousel-slide figcaption { color: var(--muted); font-size: 0.9em; font-weight: 600; }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: rgba(13, 17, 25, 0.82); color: #fff;
    border: 1px solid var(--border-strong);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    box-shadow: var(--shadow-sm);
    transition: background var(--ease), opacity var(--ease);
}
.carousel-btn svg { width: 22px; height: 22px; }
.carousel-btn:hover { background: rgba(61, 155, 196, 0.35); }
.carousel-btn:disabled { opacity: 0.3; cursor: default; }
.carousel-btn:disabled:hover { background: rgba(13, 17, 25, 0.82); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-dots { display: flex; gap: 7px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.carousel-dot {
    width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: var(--border-strong); transition: background var(--ease), transform var(--ease);
    min-height: 9px;
}
.carousel-dot.on { background: var(--teal-bright); transform: scale(1.3); }
.carousel-preview-row { margin: 14px 0 0; }
.carousel-preview-row .btn { width: 100%; }

/* ---------- Status badges ---------- */
.badge { font-size: 0.78em; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: #3d4b5f; color: #fff; text-transform: capitalize; }
.badge-new { background: var(--accent); }
.badge-contacted { background: #b97a0c; }
.badge-printing { background: #2563eb; }
.badge-designing { background: #7c3aed; }
.status-quote { margin-top: 10px; font-size: 1.05rem; }
.badge-done { background: #1d9e57; }
.badge-declined { background: #5b6a7d; }

/* ---------- Upload page ---------- */
.upload-head h2 { font-size: 1.8em; }
.upload-steps { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 18px 0 22px; padding: 0; }
.upload-steps li {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
    padding: 7px 16px 7px 8px; font-weight: 600; font-size: 0.92em; color: var(--muted-strong);
}
.upload-steps li span {
    display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--red-bright), var(--red)); color: #fff;
    font-weight: 800; font-size: 0.85em;
}
.upload-layout { display: grid; gap: 24px; }
.upload-main, .upload-side { display: grid; gap: 18px; align-content: start; min-width: 0; }
.upload-card { padding: 30px; }
.upload-card .dropzone { min-height: 260px; }
.upload-note {
    background: rgba(92, 200, 230, 0.07); border: 1px solid rgba(92, 200, 230, 0.28);
    border-radius: var(--r-md); padding: 16px 18px;
}
.upload-note h3 { margin: 0 0 6px; font-size: 1em; }
.upload-note p { margin: 0; }
@media (min-width: 960px) {
    .upload-layout { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); }
    .upload-side { position: sticky; top: 100px; }
}
.dropzone {
    position: relative; cursor: pointer; text-align: center;
    border: 2px dashed rgba(92, 200, 230, 0.4); border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(20, 76, 103, 0.32), rgba(20, 76, 103, 0.07));
    padding: 38px 20px;
    transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.dropzone:hover { border-color: rgba(92, 200, 230, 0.85); }
.dropzone.dragging { border-color: var(--amber); background: rgba(255, 176, 32, 0.09); transform: scale(1.012); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-inner { pointer-events: none; display: grid; gap: 6px; justify-items: center; }
.dropzone-icon {
    width: 60px; height: 60px; border-radius: 19px; color: #fff;
    background: linear-gradient(145deg, var(--teal-mid), var(--teal));
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); margin-bottom: 8px;
}
.dropzone-icon svg { width: 29px; height: 29px; }
.dropzone-title { font-family: var(--font-display); font-weight: 700; font-size: 1.25em; margin: 0; letter-spacing: -0.01em; }
.dropzone-browse { color: var(--teal-bright); text-decoration: underline; font-weight: 700; }
.dropzone-file { color: #8be9b0; font-weight: 700; margin: 6px 0 0; word-break: break-all; }
.dropzone-file::before { content: '✓ '; }
.upload-progress { display: grid; gap: 7px; }
.progress-track { background: var(--surface-inset); border: 1px solid var(--border); border-radius: 999px; height: 14px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--teal-mid), var(--teal-bright)); transition: width 0.15s ease; }

/* ---------- Idea search ---------- */
.idea-search { display: flex; gap: 10px; margin: 14px 0 8px; }
.idea-search input { flex: 1; min-width: 0; width: auto; border-radius: 999px; padding-left: 20px; }
.idea-results { display: flex; gap: 13px; overflow-x: auto; padding: 8px 2px 14px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
.idea-results:empty { padding: 0; }
.idea-card {
    flex: 0 0 236px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)), linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--ease), transform 0.14s ease;
}
.idea-card:hover { border-color: rgba(92, 200, 230, 0.5); transform: translateY(-3px); }
.idea-card a { color: var(--text); text-decoration: none; display: grid; gap: 8px; }
.idea-card img { width: 100%; height: 176px; object-fit: cover; border-radius: var(--r-sm); background: var(--img-bg); display: block; }
.idea-card strong { font-size: 0.93em; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.42em; }
.idea-card .btn { margin-top: auto; }

/* ---------- CAPTCHA + honeypot ---------- */
.captcha-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.captcha-img { width: 176px; height: 56px; border-radius: var(--r-sm); border: 1px solid var(--border); background: #0d1420; }
.captcha-row input { flex: 1; min-width: 150px; width: auto; }
.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Requests inbox ---------- */
.inbox-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 20px; }
.inbox-title { margin: 0; font-size: 1.8em; letter-spacing: -0.02em; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stat {
    background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px;
    padding: 7px 14px; font-size: 0.88em; color: var(--muted);
}
.stat b { color: var(--text); font-family: var(--font-display); font-size: 1.1em; margin-right: 3px; }
a.stat { text-decoration: none; color: var(--muted); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
a.stat:hover { border-color: rgba(92, 200, 230, 0.45); }
a.stat.active { background: rgba(92, 200, 230, 0.16); border-color: rgba(92, 200, 230, 0.55); color: var(--text); }
.req-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)), linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border-strong); border-radius: var(--r-lg);
    padding: 20px 22px; margin: 0 0 18px; box-shadow: var(--shadow-sm);
    transition: border-color var(--ease), box-shadow var(--ease);
}
.req-head {
    display: flex; align-items: center; gap: 14px; width: 100%;
    background: none; border: 0; color: inherit; font: inherit;
    text-align: left; cursor: pointer; padding: 2px 0; min-height: 48px;
}
.req-head:hover strong { color: var(--teal-bright); }
.req-head .req-who { pointer-events: none; }
.req-avatar {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 15px;
    display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.12em; color: #fff;
    background: linear-gradient(135deg, var(--teal-mid), var(--teal)); box-shadow: var(--shadow-sm);
}
.req-who { display: grid; gap: 1px; min-width: 0; flex: 1; }
.req-who strong { font-size: 1.12em; overflow-wrap: anywhere; }
.req-chevron {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--surface-3); border: 1px solid var(--border); color: var(--muted-strong);
    transition: transform var(--ease), background var(--ease), color var(--ease);
}
.req-chevron svg { width: 18px; height: 18px; }
.req-card.open { border-color: rgba(92, 200, 230, 0.35); box-shadow: var(--shadow); }
.req-card.open .req-chevron { transform: rotate(180deg); background: rgba(92, 200, 230, 0.14); color: var(--teal-bright); }
.req-body { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 6px; animation: reqIn 0.28s ease; }
@keyframes reqIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.req-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 2px; }
.req-desc { margin: 10px 0 2px; color: var(--muted-strong); }
.req-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
    border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px;
}
.req-body .req-actions { border-top: 0; margin-top: 12px; padding-top: 4px; }
.req-actions form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-actions select { width: auto; min-height: 42px; padding: 8px 36px 8px 12px; font-size: 0.95em; }
.req-card .request-photo { margin-top: 8px; }
.invite-btns { display: flex; flex-wrap: wrap; gap: 8px; }
/* Members page - slim layout */
.members-card { padding: 20px 22px 8px; }
.m-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.members-card h2 { font-size: 1.28em; margin: 0; display: flex; align-items: center; gap: 9px; }
.m-count { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted-strong); font-size: .6em; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.m-status { margin: 8px 0 0; color: var(--teal-bright); }
.m-status:empty { display: none; }
.members-card .invite-btns { margin: 0; }
.member-row { padding: 11px 2px; gap: 10px; }
.member-row .req-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: .98em; }
.member-row .req-who strong { font-size: 1.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-row .badge { font-size: .66em; padding: 2px 8px; letter-spacing: .02em; }
.member-row select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: .92em; }
.member-tools { padding: 10px 0 2px; gap: 8px; }
.member-tools input { min-height: 42px; padding: 9px 12px; font-size: .95em; border-radius: 12px; }
.member-actions .edit-btn { margin-left: auto; }
.member-row .req-who .small { overflow-wrap: break-word; }
.member-list { margin-top: 4px; }
.member-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 2px; border-top: 1px solid var(--border);
}
.member-row:first-child { border-top: 0; }
.member-actions { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }

/* ---------- Controls outside .form ---------- */
.inline-form select, .card textarea {
    background: var(--surface-inset); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-sm);
    padding: 9px 12px; font: inherit; font-size: 16px; min-height: 44px;
}
.card textarea {
    width: 100%; border-radius: var(--r-md); padding: 13px 14px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 13.5px; line-height: 1.5;
}
.inline-form select:focus, .card textarea:focus {
    outline: none; border-color: var(--teal-bright);
    box-shadow: 0 0 0 4px rgba(92, 200, 230, 0.18);
}
.tile-body strong, .preview-slide figcaption, .idea-card strong, .card li { overflow-wrap: anywhere; }

/* ---------- Legal pages ---------- */
.legal { line-height: 1.7; }
.legal h1 { margin: 0 0 4px; font-size: 1.85em; }
.legal h2 { margin: 24px 0 6px; font-size: 1.15em; color: var(--text); }
.legal p { margin: 6px 0; color: var(--muted); }
.legal p strong { color: var(--text); }

/* ---------- Mobile hamburger menu ---------- */
.nav-toggle {
    display: none; margin-left: auto;
    width: 46px; height: 46px; border-radius: 13px;
    background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
    align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto;
}
.nav-toggle svg { width: 24px; height: 24px; }
@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    .header-in { position: relative; flex-wrap: nowrap; }
    nav.main-nav {
        display: none;
        position: absolute; top: calc(100% + 8px); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        background: #0d1119; border: 1px solid var(--border-strong);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        border-radius: var(--r-md); padding: 10px; box-shadow: var(--shadow);
        overflow: visible; z-index: 60;
    }
    nav.main-nav.open { display: flex; }
    nav.main-nav > * + * { border-top: 1px solid var(--border); }
    nav.main-nav a { width: 100%; padding: 12px 14px; border-radius: var(--r-sm); font-size: 1em; }
    nav.main-nav .nav-logout-form { width: 100%; }
    nav.main-nav .nav-logout { width: 100%; padding: 12px 14px; border-radius: var(--r-sm); font-size: 1em; text-align: left; }
    nav.main-nav .nav-user { padding: 12px 14px 6px; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
    .idea-search { flex-wrap: wrap; }
    .idea-search .btn { flex: 1; }
    .card { padding: 22px; }
    .upload-card { padding: 22px; }
    h1 { font-size: 1.7em; }
    .print-info h2 { font-size: 1.45em; }
    main.wrap { padding-top: 26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
    .hero::before { animation: none; }
}

/* The hidden attribute must always win - a display rule on the same
   element (e.g. .upload-progress's grid) otherwise keeps it on screen. */
[hidden] { display: none !important; }

/* Member edit tools (admin) */
.member-tools { flex-basis: 100%; display: grid; gap: 10px; padding: 14px 0 4px; border-top: 1px dashed var(--border); margin-top: 4px; }
.member-tools form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.member-tools input {
    background: var(--surface-inset); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-sm);
    padding: 9px 12px; font: inherit; font-size: 16px; min-height: 44px; flex: 1 1 180px;
}
.member-tools input:focus { outline: none; border-color: var(--teal-bright); box-shadow: 0 0 0 4px rgba(92, 200, 230, 0.18); }

/* Request form opt-in checkbox */
.form .check-row { display: flex; flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.form .check-row input { width: 22px; height: 22px; min-height: 22px; flex: none; accent-color: var(--red); }

/* My requests page: static (non-accordion) request cards */
.req-head-static { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.req-body-static { padding: 0 18px 16px; }

/* My requests: photo + friendly status tracker */
.myreq-photo { display: block; width: auto; height: auto; max-width: 100%; max-height: 340px; object-fit: contain; margin: 0 auto 4px; border-radius: var(--r-md); border: 1px solid var(--border); }
.status-box { background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; margin: 12px 0; }
.status-headline { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.01em; }
.status-sub { color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.status-steps { display: flex; margin-top: 16px; }
.status-step { flex: 1; text-align: center; position: relative; padding-top: 18px; color: var(--muted); font-size: 0.8rem; }
.status-step::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 13px; height: 13px; border-radius: 50%; background: var(--border); z-index: 1; }
.status-step::after { content: ""; position: absolute; top: 10px; left: calc(-50% + 9px); width: calc(100% - 18px); height: 2px; background: var(--border); }
.status-step:first-child::after { display: none; }
.status-step.done { color: var(--text); }
.status-step.done::before { background: var(--teal); }
.status-step.done::after { background: var(--teal); }
.status-step.current { font-weight: 700; }
.status-step.current::before { box-shadow: 0 0 0 5px rgba(92, 200, 230, 0.25); }

/* Per-request chat */
.chat { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.chat-title { font-size: 1rem; margin: 0 0 10px; }
.chat-thread { display: grid; gap: 10px; margin-bottom: 12px; }
.chat-msg { background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; max-width: 92%; }
.chat-msg.mine { margin-left: auto; background: var(--surface-3); }
.chat-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 3px; }
.chat-body { line-height: 1.5; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; background: var(--surface-inset); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; font: inherit; font-size: 16px; resize: vertical; }
.chat-form textarea:focus { outline: none; border-color: var(--teal-bright); box-shadow: 0 0 0 4px rgba(92, 200, 230, 0.18); }
.nav-badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 0.72rem; padding: 1px 7px; margin-left: 6px; font-weight: 700; }

/* Request editing + subscription toggle */
.notify-toggle { margin: 10px 0 2px; }
.check-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--red); flex: none; }
.req-edit { display: grid; gap: 10px; margin-top: 12px; }
.req-edit label { display: grid; gap: 6px; font-weight: 600; }
.req-edit .check-row { display: flex; }
.req-edit input, .req-edit select, .req-edit textarea {
    background: var(--surface-inset); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-sm);
    padding: 10px 12px; font: inherit; font-size: 16px;
}
.req-edit input:focus, .req-edit select:focus, .req-edit textarea:focus { outline: none; border-color: var(--teal-bright); box-shadow: 0 0 0 4px rgba(92, 200, 230, 0.18); }

/* ---------- Phone polish (small screens) ---------- */
@media (max-width: 700px) {
    .wrap { padding: 0 14px; }
    .card { padding: 20px 16px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hero { padding-top: 32px; }
    .hero-logo { width: 100px; }
    .idea-card { flex-basis: 74vw; max-width: 260px; }
    .status-box { padding: 12px 10px; }
    .status-step { font-size: 0.72rem; }
    .member-row { gap: 10px; align-items: flex-start; }
    .member-row .req-who { flex: 1 1 calc(100% - 48px); }
    .member-row .req-who > * { min-width: 0; }
    .member-row .member-actions { flex: 0 1 auto; order: 3; margin-left: 0; }
    .member-row .edit-btn { order: 4; margin-left: auto; }
    .member-row .member-tools { order: 5; }
    .member-tools form { flex-direction: column; align-items: stretch; }
    .member-tools input, .member-tools .btn { width: 100%; }
    .member-tools input { flex: 0 0 auto; }
    .quote-respond form { width: 100%; }
    .quote-respond input[type="number"] { flex: 1 1 110px; width: auto; }
    .quote-respond input[type="text"] { flex: 2 1 150px; width: auto; }
    .quote-respond .btn { flex: 1 1 auto; }
    .req-actions { gap: 8px; }
    .req-actions select { flex: 1 1 150px; }
    .chat-form .btn { flex: none; }
    /* Request card header: the title gets the full top row (avatar +
       chevron beside it) and the status badges drop to their own row,
       instead of crushing the title into a narrow column. */
    .req-head { flex-wrap: wrap; row-gap: 8px; }
    .req-head .req-who { flex: 1 1 calc(100% - 108px); }
    .req-head .req-chevron { order: 2; }
    .req-head .badge { order: 3; white-space: nowrap; }
    .req-who .small { overflow-wrap: anywhere; }
}

/* ---------- Laser engraving: service picker + badge ---------- */
.service-pick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.service-pick label { flex: 1 1 150px; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; font-weight: 700; background: var(--surface-inset); }
.service-pick input { width: 20px; height: 20px; accent-color: var(--red); flex: none; margin: 0; }
.service-pick label:has(input:checked) { border-color: var(--red); background: rgba(238, 58, 59, 0.12); }
.badge-laser { background: rgba(139, 92, 246, 0.25); color: #d3c2f8; }

/* ---------- Progress / finished photos on requests ---------- */
.reqphotos { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.reqphoto-admin-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.reqphoto-item { width: 108px; }
.reqphoto-item > a { display: block; }
.reqphoto-item > a img { width: 108px; height: 108px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); display: block; }
.reqphoto-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.reqphoto-stage { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); color: var(--muted-strong); }
.reqphoto-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reqphoto-form input[type="file"], .reqphoto-form select {
    background: var(--surface-inset); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-sm);
    padding: 9px 12px; font: inherit; font-size: 16px; min-height: 44px;
}
.reqphoto-form input[type="file"] { flex: 1 1 220px; min-width: 0; }
.reqphoto-feature { margin: 0 0 6px; }
.reqphoto-feature img { display: block; width: 100%; height: auto; max-height: 380px; object-fit: contain; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-inset); }
.reqphoto-feature figcaption { font-family: var(--font-display); font-weight: 700; margin-top: 6px; }
.reqphoto-view { margin-bottom: 10px; cursor: zoom-out; }
.reqphoto-view img { display: block; width: 100%; height: auto; max-height: 480px; object-fit: contain; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-inset); }
.reqphoto-view .small { display: block; margin-top: 4px; }
.reqphoto-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.reqphoto-thumb { position: relative; flex: none; width: 92px; height: 92px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-inset); cursor: zoom-in; font: inherit; }
.reqphoto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reqphoto-tag { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; background: rgba(5, 7, 12, 0.8); color: #fff; font-size: 0.68rem; font-weight: 700; text-align: left; }
.reqphoto-tag.finished { background: rgba(29, 158, 87, 0.9); }
@media (max-width: 700px) {
    .reqphoto-thumb { width: 80px; height: 80px; }
    .reqphoto-item { width: 96px; }
    .reqphoto-item > a img { width: 96px; height: 96px; }
    .reqphoto-form { flex-direction: column; align-items: stretch; }
    .reqphoto-form input[type="file"], .reqphoto-form select, .reqphoto-form .btn { width: 100%; flex: 0 0 auto; }
}
