/* Event Photo Frame — Satv Script
   Warm saffron / deep-red / cream palette taken from the Kavad Yatra emblem.
   Per-event accent colours still flow through --accent. */

:root {
    --accent: #e2570e;
    --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
    --accent-deep: color-mix(in srgb, var(--accent) 58%, #5c0f12);
    --accent-ink: color-mix(in srgb, var(--accent) 42%, #3a1205);

    --saffron: #f26b0f;
    --deep-red: #90191c;
    --gold: #e9a11b;

    --ink: #3a2411;
    --ink-2: #7a6248;
    --ink-3: #a89478;
    --line: #ecdcbf;
    --line-soft: #f3e8d2;
    --surface: #fffdf8;
    --surface-2: #fdf6e7;
    --canvas: #fbf1dd;

    --danger: #c0271f;
    --ok: #2f6b34;

    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(90, 45, 10, .05), 0 1px 3px rgba(90, 45, 10, .09);
    --shadow-md: 0 4px 6px -1px rgba(90, 45, 10, .07), 0 12px 26px -8px rgba(90, 45, 10, .18);
    --shadow-lg: 0 24px 60px -20px rgba(60, 25, 5, .4);

    --font: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --tap: 44px;                 /* minimum comfortable touch target */
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--canvas);
    line-height: 1.55;
    font-size: 15px;
    overflow-x: hidden;             /* nothing may scroll the page sideways */
    -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

img, svg, canvas, video { max-width: 100%; }

a { color: var(--accent-ink); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.015em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }

.wrap {
    width: min(1240px, 100%);
    margin-inline: auto;
    padding-inline: max(1rem, env(safe-area-inset-left));
}
.wrap-narrow { width: min(760px, 100%); margin-inline: auto; padding-inline: 1rem; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-2); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- controls */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: var(--tap);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: .6rem 1.05rem;
    font: inherit;
    font-weight: 700;
    font-size: .9rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    transition: filter .15s, background .15s, border-color .15s, transform .1s;
    white-space: nowrap;
    touch-action: manipulation;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-quiet:hover { background: var(--line-soft); filter: none; }
.btn-danger { background: var(--danger); }
.btn-lg { padding: .9rem 1.5rem; font-size: 1rem; border-radius: 12px; min-height: 52px; }
.btn-sm { padding: .38rem .75rem; font-size: .8rem; border-radius: 8px; min-height: 36px; }
.btn-block { width: 100%; }

label { font-weight: 700; font-size: .82rem; color: var(--ink-2); display: block; margin-bottom: .3rem; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: .9rem;
    background: var(--surface);
    color: var(--ink);
    min-height: var(--tap);
}
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--accent-soft);
    outline-offset: 0;
    border-color: var(--accent);
}
input[type=color] {
    width: 100%; height: 40px; padding: 2px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--surface); cursor: pointer; min-height: 0;
}
input[type=range] { width: 100%; accent-color: var(--accent); min-height: 28px; }
input[type=file] { font-size: .85rem; min-height: 0; padding: .5rem; }

.check {
    display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .84rem;
    color: var(--ink-2); margin: 0; cursor: pointer; min-height: 32px;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }

.field-error { color: var(--danger); font-size: .78rem; margin-top: .25rem; }

.alert { border-radius: 10px; padding: .75rem .95rem; font-size: .87rem; border: 1px solid; }
.alert-ok { background: #eef7ed; border-color: #b9ddb7; color: #245c29; }
.alert-bad { background: #fdf0ee; border-color: #f3c4bd; color: #8d241c; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 1.1rem; }

.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; letter-spacing: .02em; }
.pill-on { background: #e4f3e2; color: #245c29; }
.pill-off { background: var(--line-soft); color: var(--ink-2); }

/* -------------------------------------------------------------- app chrome */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 40;
}
.topbar-in { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; }
.topbar .brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 800; min-height: 40px; }
.topbar .brand img { height: 22px; width: auto; }
.topbar nav { display: flex; gap: .3rem; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.page { padding: 1.5rem 0 3rem; }

/* -------------------------------------------------------------------- table */

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: .55rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--canvas); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); }

/* ------------------------------------------------------------ public page */

.event-page {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    background:
        radial-gradient(1200px 380px at 50% -160px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
        var(--canvas);
}

/* Saffron banner carrying the event emblem and the organising body's mark. */
.event-hero {
    position: relative;
    color: #fff;
    padding: 1rem 0 1.1rem;
    background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 72%, var(--deep-red)) 100%);
    box-shadow: 0 10px 30px -18px rgba(60, 25, 5, .8);
}
.event-hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
    background: repeating-linear-gradient(90deg, var(--gold) 0 22px, #fff5df 22px 44px);
    opacity: .85;
}
.event-hero-in { display: flex; align-items: center; gap: 1rem; }

.hero-logo {
    background: #fff;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 4px 14px -4px rgba(40, 15, 0, .5);
    flex: none;
    display: block;
}
.hero-logo-main { height: 74px; width: 74px; object-fit: contain; }
.hero-logo-partner { height: 58px; width: 58px; object-fit: contain; }

.event-hero h1 { font-size: 1.3rem; margin: 0; color: #fff; text-shadow: 0 1px 2px rgba(80, 30, 0, .35); }
.event-hero p { margin: .2rem 0 0; color: rgba(255, 255, 255, .92); font-size: .9rem; }

/* Legacy alias, still used by the events grid on the home page. */
.event-logo { height: 52px; width: auto; max-width: 140px; object-fit: contain; }

.studio { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 1.25rem; align-items: start; padding: 1.25rem 0 2rem; }
.studio > * { min-width: 0; }

.preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .9rem; position: sticky; top: 1rem; }
.preview-frame { background: repeating-conic-gradient(var(--surface-2) 0% 25%, #ffffff 0% 50%) 50% / 18px 18px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.preview-frame canvas { width: 100%; height: auto; display: block; }

.step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.step + .step { margin-top: .9rem; }
.step-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 800; flex: none; }
.step-head h2 { margin: 0; font-size: .95rem; color: var(--accent-ink); }
.step-body { padding: 1rem; }

.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pick {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
    padding: 1.15rem .6rem; border: 1.5px dashed var(--line); border-radius: 12px;
    background: var(--surface-2); cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--ink-2);
    transition: border-color .15s, background .15s, color .15s;
    min-height: 92px; touch-action: manipulation;
}
.pick:hover, .pick:focus-visible { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.pick svg { width: 24px; height: 24px; }

.name-field + .name-field { margin-top: .9rem; }
.name-field .row-between { margin-bottom: .3rem; gap: .5rem; }
.name-field .script-tag { font-size: .74rem; font-weight: 800; color: var(--accent-ink); }
.name-field input { font-size: 1.05rem; padding: .7rem .8rem; }
.name-field .counter { font-size: .72rem; color: var(--ink-3); margin-top: .25rem; text-align: right; }

.download-panel {
    padding: 1.1rem; border-radius: var(--radius); color: #fff; box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--deep-red)));
}
.download-panel h2 { color: #fff; font-size: 1.05rem; }
.download-panel p { color: rgba(255,255,255,.88); font-size: .84rem; margin-bottom: .9rem; }
.download-panel .btn { background: #fff; color: var(--accent-ink); }
.download-panel .btn:hover { background: #fff8ec; }

/* ------------------------------------------------------------------ cropper */

.modal { position: fixed; inset: 0; z-index: 90; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(45, 20, 5, .65); backdrop-filter: blur(2px); }
.modal-panel {
    position: relative; z-index: 1; width: min(720px, calc(100% - 1.5rem));
    margin: 3vh auto; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 94dvh;
}
.modal-head { padding: .85rem 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.modal-head h2 { margin: 0; font-size: 1rem; }
.modal-body { padding: 1rem; overflow: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: .85rem 1rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

.crop-stage { background: #2a1608; border-radius: 10px; overflow: hidden; max-height: 58vh; }
.crop-stage img { display: block; max-width: 100%; }
.crop-tools { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .8rem; }
.icon-btn {
    width: var(--tap); height: var(--tap); display: grid; place-items: center;
    border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer;
    color: var(--ink); touch-action: manipulation;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

/* Shape the crop viewport to match the mask the photo will land in. */
.cropper-view-box, .cropper-face { border-radius: 0; }
.crop-shaped .cropper-view-box, .crop-shaped .cropper-face { border-radius: var(--crop-radius, 0); clip-path: var(--crop-clip, none); }

/* ------------------------------------------------------------ admin designer */

.designer { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 1.1rem; align-items: start; }
.designer > * { min-width: 0; }

.stage-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .8rem; position: sticky; top: 4.5rem; }

.stage {
    position: relative; border-radius: 10px; overflow: hidden; user-select: none; touch-action: none;
    background: repeating-conic-gradient(var(--surface-2) 0% 25%, #ffffff 0% 50%) 50% / 18px 18px;
}
.stage canvas { width: 100%; height: auto; display: block; pointer-events: none; }

.handle {
    position: absolute; border: 2px solid var(--accent); border-radius: 4px; cursor: move;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset;
}
.handle[data-shape="circle"], .handle[data-shape="ellipse"] { border-radius: 50%; }
.handle.is-selected { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); z-index: 5; }
.handle .tag {
    position: absolute; top: -22px; left: -2px; background: var(--accent); color: #fff;
    font-size: .66rem; font-weight: 700; padding: .1rem .4rem; border-radius: 5px; white-space: nowrap;
}
.handle.is-selected .tag { background: var(--gold); color: #3a2411; }
.handle .grip {
    position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--accent);
    border-radius: 3px; right: -8px; bottom: -8px; cursor: nwse-resize;
}
.handle.is-selected .grip { border-color: var(--gold); }
.handle.is-text { border-style: dashed; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: .8rem; }
.panel > summary {
    list-style: none; cursor: pointer; padding: .85rem 1rem; font-weight: 800; font-size: .88rem;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--accent-ink);
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: "▾"; color: var(--ink-3); font-size: .8rem; transition: transform .15s; }
.panel[open] > summary::after { transform: rotate(180deg); }
.panel > summary:hover { background: var(--surface-2); }
.panel-body { padding: 0 1rem 1rem; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.form-row + .form-row { margin-top: .7rem; }

.slider-row { display: grid; grid-template-columns: 1fr 66px; gap: .5rem; align-items: center; }
.slider-row input[type=number] { padding: .35rem .4rem; font-size: .8rem; text-align: right; min-height: 34px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--surface); padding: .5rem .3rem; font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink-2); cursor: pointer; min-height: 38px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }

.lang-tabs { display: flex; gap: .3rem; margin-bottom: .8rem; flex-wrap: wrap; }
.lang-tabs button { flex: 1 1 90px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .5rem .35rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--ink-2); min-height: 40px; }
.lang-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.lang-tabs button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); margin-right: .3rem; vertical-align: middle; }
.lang-tabs button.has-field .dot { background: #3f9e46; }

.savebar {
    position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
    padding: .7rem 0 calc(.7rem + env(safe-area-inset-bottom)); margin-top: 1.2rem; z-index: 30;
    box-shadow: 0 -4px 14px rgba(90, 45, 10, .08);
}

/* -------------------------------------------------------------------- share */

.share-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; box-shadow: var(--shadow-sm); }
.qr-box img { width: 100%; height: auto; max-width: 260px; }
.copy-row { display: flex; gap: .4rem; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

.poster { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.25rem; text-align: center; box-shadow: var(--shadow-sm); }
.poster h2 { font-size: 1.5rem; margin-bottom: .2rem; color: var(--accent-ink); }
.poster .poster-qr { width: min(250px, 70vw); height: auto; margin: 1.2rem auto; display: block; }

/* -------------------------------------------------------------------- login */

.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1rem;
    background: radial-gradient(1000px 500px at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--canvas); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 1.8rem; }
.login-card .logo { height: 26px; margin-bottom: 1.2rem; }

/* -------------------------------------------------------------- home / footer */

.home-hero { padding: 3rem 0 1.5rem; text-align: center; }
.home-hero h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); color: var(--accent-ink); }
.home-hero p { color: var(--ink-2); max-width: 56ch; margin-inline: auto; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; padding-bottom: 2rem; }
.event-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; display: block; }
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.event-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: var(--canvas); }
.event-card .meta { padding: .7rem .8rem; }
.event-card .meta strong { display: block; font-size: .92rem; }

.site-footer {
    margin-top: auto; background: #3a1608; color: #f0dcc0; font-size: .84rem;
    padding: 1.6rem 0 calc(1.6rem + env(safe-area-inset-bottom));
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer-in { display: flex; gap: 1.2rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.site-footer .brandmark { display: flex; align-items: center; gap: .6rem; }
.site-footer .brandmark img { height: 22px; filter: invert(1) brightness(2); }
.site-footer .contact { display: flex; gap: .25rem 1rem; flex-wrap: wrap; align-items: center; }
/* Inline text links are too thin to tap comfortably — give them real height. */
.site-footer .contact a,
.site-footer .contact span { display: inline-flex; align-items: center; min-height: 38px; }

.busy { position: fixed; inset: 0; background: rgba(255, 250, 240, .82); display: none; place-items: center; z-index: 120; font-weight: 700; text-align: center; padding: 1rem; }
.busy.on { display: grid; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto .6rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================================================================== */
/*  Responsive                                                            */
/* ===================================================================== */

@media (max-width: 1080px) {
    .designer { grid-template-columns: 1fr; }
    .stage-card { position: static; }
}

@media (max-width: 900px) {
    .studio { grid-template-columns: 1fr; gap: 1rem; }
    .preview-card { position: static; }
    .share-grid { grid-template-columns: 1fr; }
    .qr-box { max-width: 320px; margin-inline: auto; }
}

@media (max-width: 680px) {
    body { font-size: 15px; }

    /* iOS zooms the page when a focused field is under 16px. */
    input[type=text], input[type=email], input[type=password], input[type=number],
    input[type=url], select, textarea { font-size: 16px; }

    h1 { font-size: 1.35rem; }

    .wrap, .wrap-narrow { padding-inline: max(.85rem, env(safe-area-inset-left)); }
    .page { padding: 1rem 0 2rem; }

    .event-hero { padding: .85rem 0 .95rem; }
    .event-hero-in { gap: .7rem; }
    .event-hero h1 { font-size: 1.05rem; }
    .event-hero p { font-size: .8rem; }
    .hero-logo-main { height: 56px; width: 56px; }
    .hero-logo-partner { height: 44px; width: 44px; }

    .studio { padding: .9rem 0 1.5rem; }
    .preview-card { padding: .6rem; border-radius: 12px; }
    .step-body { padding: .85rem; }
    .step-head { padding: .7rem .85rem; }

    .grid2, .grid3 { grid-template-columns: 1fr; }

    /* Full-height sheet — a centred dialog is unusable on a phone. */
    .modal-panel {
        width: 100%; margin: 0; max-height: 100dvh; height: 100dvh;
        border-radius: 0;
    }
    .modal-body { flex: 1; }
    .modal-foot { padding-bottom: calc(.85rem + env(safe-area-inset-bottom)); }
    .modal-foot .btn { flex: 1; }
    .crop-stage { max-height: 58dvh; }
    .crop-tools { justify-content: center; }

    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .site-footer-in { gap: .8rem; }
    .site-footer .contact { gap: .6rem 1rem; }

    .topbar-in { gap: .5rem; }
    .topbar .brand span { display: none; }
    .topbar nav .btn { padding-inline: .6rem; }
}

@media (max-width: 400px) {
    .pick-row { grid-template-columns: 1fr; }
    .pick { flex-direction: row; gap: .6rem; min-height: 60px; padding: .85rem; }
}

/* Coarse pointers get the roomier hit areas regardless of width. */
@media (pointer: coarse) {
    .btn-sm { min-height: 40px; }
    .handle .grip { width: 18px; height: 18px; right: -10px; bottom: -10px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}

@media print {
    .topbar, .savebar, .no-print, .site-footer { display: none !important; }
    body { background: #fff; }
    .poster { border: 0; box-shadow: none; }
}
