/* Certificates overlay on the shared UNEB + Gadgets shell. */

.cert-app { --cert: #d97706; --cert-soft: rgba(217, 119, 6, 0.14); }
.cert-app textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.cert-app code { font-size: 0.92em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); color: var(--text); }
.cert-app .lede code { font-size: 13px; }
.cert-app svg.cert-doc { display: block; width: 100%; height: auto; }
.cert-app .btn svg { flex: none; }
.cert-app .fine { font-size: 12.5px; line-height: 1.5; }
.cert-app .muted { color: var(--text-3); }
.cert-app [hidden] { display: none !important; }

/* Landing */
body.portal.cert-app {
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(217, 119, 6, 0.16), transparent 58%),
        radial-gradient(720px 380px at 92% 0%, rgba(219, 39, 119, 0.08), transparent 52%),
        var(--bg);
}
.cert-hero-art { position: relative; margin: 0; min-height: 300px; }
.cert-hero-doc { position: absolute; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); background: #fff; }
.cert-hero-main { top: 0; left: 0; width: 88%; transform: rotate(-2deg); }
.cert-hero-card { right: 0; bottom: 0; width: 52%; transform: rotate(4deg); border: 4px solid #fff; }
.cert-occasions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cert-occasions article { padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.cert-occasions b { display: block; margin: 10px 2px 2px; }
.cert-occasions span { display: block; margin: 0 2px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.cert-mini { border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--border); }

/* Desk */
.cert-brief { background: radial-gradient(480px 200px at 100% 0%, rgba(217, 119, 6, 0.18), transparent 62%), var(--surface); }
.cert-brief .desk-kicker { color: var(--cert); }
.cert-quick { display: flex; flex-direction: column; gap: 8px; }
.cert-quick .btn { justify-content: center; }
.rank { display: block; color: inherit; text-decoration: none; }
a.rank:hover .rank-top span { color: var(--primary); }
.rank-top small { color: var(--text-3); font-weight: 600; margin-left: 4px; }
.batch-list { display: grid; gap: 6px; }
.batch-scroll { height: 520px; overflow: auto; }
.batch-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    background: color-mix(in srgb, var(--bg) 50%, transparent);
}
.batch-card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.batch-card strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-card small { color: var(--text-3); font-size: 12px; }
.batch-kind { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.batch-kind.card { background: var(--violet-soft); color: var(--violet); }
.batch-kind svg { width: 18px; height: 18px; }
.cert-starts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cert-starts a { display: block; padding: 12px; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; color: inherit; background: color-mix(in srgb, var(--bg) 50%, transparent); }
.cert-starts a:hover { border-color: var(--cert); background: var(--cert-soft); }
.cert-starts b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.cert-starts span { color: var(--text-2); font-size: 12px; line-height: 1.45; }

/* People */
.list-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 14px; }
.list-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.list-card.on { border-color: var(--cert); box-shadow: 0 0 0 1px var(--cert) inset; }
.list-open { color: inherit; text-decoration: none; min-width: 0; }
.list-card strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.list-card.is-child { border-style: dashed; }
.member-groups { margin: 0 0 14px; }
.member-groups .panel-head { align-items: center; }
.group-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
    margin-top: 10px;
}
.group-label {
    flex: 0 0 auto;
    min-width: 48px;
    padding-top: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
}
.group-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 220px;
}
.group-chips a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 650;
}
.group-chips a em { font-style: normal; color: var(--text-3); font-weight: 700; }
.group-chips a:hover { color: var(--text); border-color: var(--border-strong); }
.group-chips a.on {
    border-color: transparent;
    background: var(--cert-soft);
    color: var(--text);
}
.group-chips a.on em { color: var(--cert); }
.list-actions { display: flex; gap: 12px; }
.list-actions a, .list-actions button { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
.list-strip.compact { margin: 0; }
.cert-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; align-items: center; }
.cert-filter input { flex: 1 1 240px; width: auto; }
.cert-filter select { flex: 0 1 180px; width: auto; }
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: calc(var(--topbar-h) + 6px);
    z-index: 4;
}
.bulk-bar.has-pick { border-color: color-mix(in srgb, var(--cert) 50%, var(--border)); background: color-mix(in srgb, var(--cert-soft) 60%, var(--surface)); }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bulk-actions form { display: flex; gap: 6px; margin: 0; }
.bulk-bar:not(.has-pick) .bulk-actions { opacity: 0.55; }
.cert-table th.pick, .cert-table td.pick { width: 36px; padding-right: 0; }
.cert-table td.pick input, .cert-table th.pick input { width: 16px; height: 16px; accent-color: var(--cert); }
.cert-table td small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.cert-table td small.inline { display: inline; }
.cert-table td small.warn { display: inline; color: var(--danger); }
.cert-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cert-table tr.is-revoked td { opacity: 0.55; }
.cert-table tr.is-revoked td:nth-child(3) { text-decoration: line-through; }
.cert-table .msg-cell { max-width: 280px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
button.name-link { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; color: var(--primary); font-weight: 700; }
.muted-link { color: var(--text-2); text-decoration: none; }
.muted-link:hover { color: var(--primary); }
.share-cell { white-space: nowrap; }
.share-cell .wa { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--text-3); vertical-align: middle; }
.share-cell .wa svg { width: 18px; height: 18px; }
.share-cell .wa.has-number { color: #16a34a; background: rgba(22, 163, 74, 0.12); }
.share-cell button { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.row-actions button.name-link { font-size: inherit; }
.badge.cat-student { border-color: transparent; background: var(--sky-soft); color: var(--sky); }
.badge.cat-staff { border-color: transparent; background: var(--success-soft); color: var(--success); }
.badge.cat-prospect { border-color: transparent; background: var(--amber-soft); color: var(--amber); }
.badge.cat-other { border-color: transparent; background: var(--violet-soft); color: var(--violet); }
.badge svg { width: 12px; height: 12px; margin-right: 3px; }
.cert-pager { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 14px 0; }
.cert-pager a, .cert-pager span { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text-2); text-decoration: none; border: 1px solid var(--border); background: var(--surface); }
.cert-pager a.on { background: var(--cert); border-color: var(--cert); color: #fff; }
.cert-pager span { border: 0; background: none; }
.cert-danger { margin-top: 16px; padding: 14px; border-radius: 12px; border: 1px solid; }
.cert-danger p { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }

/* Import */
.map-grid { display: grid; gap: 8px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 0.9fr); gap: 10px; align-items: center; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.map-head { min-width: 0; }
.map-head strong { display: block; color: var(--text); font-size: 13px; }
.map-head small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 650; cursor: pointer; }
.cert-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--cert); }
.cert-foot { gap: 8px; margin: 4px 0 16px; }
.cert-drop { display: block; margin-bottom: 12px; }
.cert-drop .dz-text svg { width: 20px; height: 20px; }

/* Designs */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.lib-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 4px 0 12px;
}
.lib-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
    max-width: 420px;
    margin: 0;
}
.lib-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}
.lib-search input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.lib-search input:focus {
    outline: none;
    border-color: var(--cert);
    box-shadow: 0 0 0 3px var(--cert-soft);
}
.lib-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--text-3);
    font-size: 12.5px;
    margin-left: auto;
}
.lib-meta strong { color: var(--text); font-size: 15px; }
.lib-view-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg) 40%, var(--surface));
}
.lib-view-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-3);
    font: 650 12px/1 inherit;
    cursor: pointer;
}
.lib-view-toggle button svg { width: 14px; height: 14px; }
.lib-view-toggle button:hover { color: var(--text); }
.lib-view-toggle button.on {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.lib-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}
.lib-bulk form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.lib-bulk #libBulkAdd em {
    font-style: normal;
    margin-left: 2px;
    opacity: 0.85;
}
.lib-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-2);
    cursor: pointer;
}
.lib-select-all input { width: 16px; height: 16px; accent-color: var(--cert); cursor: pointer; }
.lib-pick {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    margin: 0;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}
.lib-pick input { width: 15px; height: 15px; margin: 0; accent-color: var(--cert); cursor: pointer; }
.design-card.is-selected {
    border-color: color-mix(in srgb, var(--cert) 55%, var(--border));
    box-shadow: 0 0 0 2px var(--cert-soft), var(--shadow);
}
.lib-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 2px 2px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.lib-tabs button {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font: 650 12.5px/1 inherit;
    cursor: pointer;
    white-space: nowrap;
}
.lib-tabs button em {
    font-style: normal;
    margin-left: 4px;
    color: var(--text-3);
    font-weight: 700;
}
.lib-tabs button:hover { border-color: var(--border-strong); color: var(--text); }
.lib-tabs button.on {
    border-color: transparent;
    background: var(--cert-soft);
    color: var(--text);
}
.lib-tabs button.on em { color: var(--cert); }
.lib-sport-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: -2px 0 14px;
}
.lib-sport-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lib-sport-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.lib-sport-chips button {
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 55%, var(--surface));
    color: var(--text-2);
    font: 650 12px/1 inherit;
    cursor: pointer;
}
.lib-sport-chips button:hover { color: var(--text); border-color: var(--border-strong); }
.lib-sport-chips button.on {
    border-color: transparent;
    background: color-mix(in srgb, #0f766e 18%, var(--surface));
    color: var(--text);
}
.import-templates { margin: 14px 0 0; }
.import-templates .fine { margin: 0 0 6px; }
.import-template-list {
    margin: 0;
    padding: 0 0 0 18px;
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.55;
}
.import-template-list a { font-weight: 700; }
.lib-kind-filters { margin: 0; }
.lib-empty { margin: 18px 0; }
.lib-section[hidden], .design-card[hidden] { display: none !important; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.library-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 22px 0 8px;
}
.library-group-text { min-width: 0; flex: 1 1 200px; }
.library-group h2 { margin: 0; font-size: 16px; }
.library-group p { margin: 3px 0 0; color: var(--text-3); font-size: 12.5px; }
.lib-select-section {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}
.lib-select-section:hover { color: var(--text); border-color: var(--border-strong); }
.lib-select-section input { width: 15px; height: 15px; margin: 0; accent-color: var(--cert); cursor: pointer; }
.lib-select-section:has(input:checked) {
    border-color: transparent;
    background: var(--cert-soft);
    color: var(--text);
}
.lib-select-section:has(input:disabled) {
    opacity: 0.45;
    cursor: default;
}
.library-group-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.lib-share-form { margin: 0; }
.share-link-label { display: grid; gap: 6px; margin: 0; }
.share-link-label span { font-size: 12px; font-weight: 700; color: var(--text-3); }
.share-link-label input {
    width: 100%;
    font: 600 13px/1.4 ui-monospace, Consolas, monospace;
}
.share-channels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn.share-wa {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
.btn.share-wa:hover { filter: brightness(1.05); }
.share-jump {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--cert-soft);
    font-size: 13.5px;
    font-weight: 650;
}
.share-jump a { color: var(--cert); }
.share-board { display: grid; gap: 10px; }
.share-card {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.share-card.is-hit {
    border-color: color-mix(in srgb, var(--cert) 45%, var(--border));
    box-shadow: 0 0 0 3px var(--cert-soft);
}
.share-card h3 { margin: 0; font-size: 16px; }
.share-card .share-blurb { margin: 3px 0 0; color: var(--text-3); font-size: 12.5px; }
.share-card .share-link-label { margin-top: 12px; }
.share-card .share-channels { margin-top: 10px; }
.share-sub {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.share-sub h4 { margin: 0 0 8px; font-size: 13px; }
.share-sub-card {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 45%, var(--surface));
}
.share-sub-card strong { display: block; margin-bottom: 8px; font-size: 13.5px; }
.share-sport-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.share-sport-form select { min-width: 180px; }
.pick-filters { margin: 12px 0; }
.pick-filters em { font-style: normal; margin-left: 4px; opacity: 0.75; }
.share-list-title { margin: 18px 0 10px; font-size: 16px; }
.pick-state {
    display: inline-flex;
    align-items: center;
    height: 18px;
    margin-right: 6px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: 1px;
}
.pick-state-new { background: var(--amber-soft); color: var(--amber); }
.pick-state-added { background: var(--success-soft); color: var(--success); }
.pick-state-dismissed { background: var(--surface-2); color: var(--text-3); }
.share-sub-card.is-hit { box-shadow: 0 0 0 2px var(--cert-soft); }
.pick-inbox {
    margin: 0 0 16px;
    padding: 14px 14px 4px;
    border: 1px solid color-mix(in srgb, var(--cert) 35%, var(--border));
    border-radius: 16px;
    background: var(--cert-soft);
}
.pick-inbox-head h2 { margin: 0; font-size: 16px; }
.pick-inbox-head p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; }
.pick-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px 14px;
    padding: 12px 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.pick-row-copy { min-width: 0; flex: 1 1 220px; }
.pick-row-copy strong { display: block; font-size: 14px; }
.pick-row-copy small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; }
.pick-row-copy p { margin: 6px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.pick-names { color: var(--text-3) !important; font-size: 12.5px !important; }
.pick-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-row-actions form { margin: 0; }
.pick-chosen {
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}
.pick-chosen-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
}
.pick-chosen-thumb {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 10px;
    border: 0;
    cursor: zoom-in;
    background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, color-mix(in srgb, var(--surface-2) 65%, var(--bg)) 8px, color-mix(in srgb, var(--surface-2) 65%, var(--bg)) 16px);
}
.pick-chosen-thumb svg.cert-doc { max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22); }
.pick-chosen-zoom {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 800;
}
.pick-chosen-card strong { display: block; padding: 8px 10px 0; font-size: 13px; }
.pick-chosen-card form { margin: 8px 10px 10px; }
.pick-chosen-card .btn { width: 100%; }
.reply-light {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(12, 10, 9, 0.78);
}
.reply-light[hidden] { display: none !important; }
.reply-light-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: min(980px, 100%);
    margin: 0 auto;
    color: #fff;
}
.reply-light-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.reply-light .btn.ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
}
.reply-light-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: auto;
}
.reply-light-stage svg.cert-doc {
    width: min(980px, 96vw);
    height: auto;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
body.reply-light-open { overflow: hidden; }
.design-card { position: relative; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.design-thumb { display: grid; place-items: center; padding: 14px; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, color-mix(in srgb, var(--surface-2) 70%, var(--bg)) 10px, color-mix(in srgb, var(--surface-2) 70%, var(--bg)) 20px); aspect-ratio: 4 / 3; }
.design-thumb svg.cert-doc { max-height: 100%; width: auto; max-width: 100%; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); border-radius: 3px; }
.design-meta { padding: 12px 14px 6px; flex: 1; }
.design-meta strong { display: block; font-size: 14px; }
.design-meta small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.design-meta p { margin: 6px 0 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.design-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.design-tags .badge + .badge { margin-left: 0; }
.design-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 14px; }
.design-actions form { margin: 0; }

.lib-shell.is-list .design-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lib-shell.is-list .design-card {
    flex-direction: row;
    align-items: center;
    min-height: 88px;
}
.lib-shell.is-list .lib-pick {
    position: static;
    flex: 0 0 auto;
    margin: 0 0 0 12px;
    box-shadow: none;
}
.lib-shell.is-list .design-thumb {
    flex: 0 0 112px;
    width: 112px;
    aspect-ratio: 4 / 3;
    padding: 8px;
}
.lib-shell.is-list .design-meta {
    padding: 10px 8px 10px 4px;
    min-width: 0;
}
.lib-shell.is-list .design-meta p {
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lib-shell.is-list .design-actions {
    margin-left: auto;
    padding: 10px 14px;
    flex-wrap: nowrap;
}
@media (max-width: 720px) {
    .lib-view-toggle button span { display: none; }
    .lib-shell.is-list .design-card {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .lib-shell.is-list .lib-pick { margin: 10px 0 0 10px; }
    .lib-shell.is-list .design-thumb { flex-basis: 96px; width: 96px; }
    .lib-shell.is-list .design-meta { flex: 1 1 140px; }
    .lib-shell.is-list .design-actions {
        width: 100%;
        margin-left: 0;
        padding-top: 0;
        justify-content: flex-end;
    }
}

.design-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr); gap: 14px; align-items: start; }
.design-fields { display: grid; gap: 12px; min-width: 0; }
.design-fields .panel h2 { margin-bottom: 10px; }
.design-preview { position: sticky; top: calc(var(--topbar-h) + 12px); display: grid; gap: 10px; }
.preview-frame { display: grid; place-items: center; min-height: 240px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, color-mix(in srgb, var(--surface-2) 70%, var(--bg)) 10px, color-mix(in srgb, var(--surface-2) 70%, var(--bg)) 20px); transition: opacity 0.15s; }
.preview-frame svg.cert-doc { max-height: 70vh; width: auto; max-width: 100%; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); border-radius: 3px; }
.preview-frame.is-loading { opacity: 0.65; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-actions .btn { flex: 1 1 auto; justify-content: center; }
.preview-actions.minor .btn { flex: 0 0 auto; }
.seg-toggle { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); width: fit-content; max-width: 100%; }
.seg-toggle label { margin: 0; cursor: pointer; }
.seg-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.seg-toggle span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 700; }
.seg-toggle input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); outline: 1px solid var(--border-strong); }
.seg-toggle input:focus-visible + span { box-shadow: var(--ring); }
.field > span { display: block; margin-bottom: 6px; }
.color-pair { display: flex; gap: 6px; align-items: center; }
.color-pair input[type="color"] { width: 44px; flex: none; padding: 3px; cursor: pointer; }
.color-pair input:not([type="color"]) { text-transform: lowercase; font-family: ui-monospace, Consolas, monospace; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip-btn { height: 28px; padding: 0 9px; border-radius: 8px; border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 700; font-family: ui-monospace, Consolas, monospace; cursor: pointer; }
.chip-btn:hover { border-color: var(--cert); color: var(--cert); background: var(--cert-soft); }
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

/* Messages */
.msg-tabs a { gap: 7px; }
.tone-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); display: inline-block; }
.msg-hint { margin: 0; color: var(--text-2); font-size: 13.5px; }
.msg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.msg-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.msg-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); }
.msg-card blockquote { margin: 0; font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--text); }
.msg-card mark { background: var(--cert-soft); color: var(--cert); border-radius: 4px; padding: 0 3px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.msg-card cite { color: var(--text-3); font-size: 12.5px; font-style: normal; font-weight: 700; }
.msg-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.msg-card.is-off { opacity: 0.5; }
.msg-tag { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.msg-actions { display: flex; gap: 10px; align-items: center; }
.msg-actions form { margin: 0; }
.msg-actions button { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.msg-actions .danger-link { color: var(--danger); }
.row-actions .danger-link,
.row-actions button.danger-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--danger);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.btn.ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.design-signs { margin-top: 8px; }
.cert-table tr.is-revoked td { opacity: 0.72; }

/* Shared wizard chrome */
.cert-wizard { display: grid; gap: 12px; padding-bottom: 88px; }
.wiz-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 4px;
}
.gen-wiz-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.wiz-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.wiz-step:disabled { opacity: 0.55; cursor: default; }
.wiz-step.is-on {
    border-color: var(--cert);
    box-shadow: 0 0 0 1px var(--cert) inset, var(--shadow);
    background: var(--cert-soft);
    color: var(--text);
}
.wiz-step.is-done .step-no { background: color-mix(in srgb, var(--cert) 72%, #000); }
.wiz-step-copy { display: grid; gap: 1px; min-width: 0; }
.wiz-step-copy b { font-size: 13px; font-weight: 800; color: inherit; }
.wiz-step-copy small { color: var(--text-3); font-size: 12px; font-weight: 650; }
.wiz-footer {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
}
.wiz-footer > p { margin: 0 auto 0 4px; color: var(--text-2); font-size: 13px; font-weight: 650; }
.wiz-footer .btn { min-width: 120px; justify-content: center; }
.wiz-footer .btn.primary { min-width: 180px; }
@media (max-width: 980px) {
    .gen-wiz-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .wiz-steps,
    .gen-wiz-steps { grid-template-columns: 1fr 1fr; }
    .wiz-step-copy small { display: none; }
    .wiz-footer { flex-wrap: wrap; }
    .wiz-footer > p { order: -1; width: 100%; margin: 0 0 4px; }
}

/* Generate */
.gen-form { display: grid; gap: 12px; padding-bottom: 88px; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: var(--cert); color: #fff; font-size: 12px; vertical-align: 1px; flex: none; }
.gen-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.gen-type {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.gen-type input { position: absolute; opacity: 0; pointer-events: none; }
.gen-type strong { font-size: 14.5px; }
.gen-type span { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.gen-type em { color: var(--text-3); font-size: 12px; font-style: normal; font-weight: 700; }
.gen-type:has(input:checked),
.gen-type-link:hover {
    border-color: var(--cert);
    box-shadow: 0 0 0 1px var(--cert) inset;
    background: var(--cert-soft);
}
.gen-designs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px); gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.gen-design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.gen-design {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.gen-design input { position: absolute; opacity: 0; pointer-events: none; }
.gen-design:has(input:checked) { border-color: var(--cert); box-shadow: 0 0 0 2px var(--cert); background: var(--cert-soft); }
.gen-lib-card { border-style: dashed; }
.gen-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--bg) 70%, transparent); border-radius: 8px; overflow: hidden; }
.gen-thumb svg.cert-doc { max-height: 100%; width: auto; max-width: 100%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); border-radius: 2px; }
.gen-name { color: var(--text); font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.gen-design-meta { color: var(--text-3); font-size: 11.5px; font-weight: 700; }
.gen-design-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.gen-lib-block { margin-top: 18px; }
.gen-empty-designs { margin-top: 12px; }
.gen-sources { margin: 8px 0 14px; }
.gen-count { margin: 10px 0 0; color: var(--text-2); font-size: 13px; }
.gen-count b { color: var(--text); font-size: 16px; }
.gen-review-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.gen-review-head .gen-count { margin: 0; }
.gen-review-list {
    max-height: min(52vh, 420px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    padding: 8px 10px;
}
.gen-review-ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gen-review-ul li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.gen-review-ul strong { font-size: 13.5px; }
.gen-review-ul small { color: var(--text-3); font-size: 12px; }
.gen-polish-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
    gap: 16px;
    align-items: start;
}
.gen-live {
    position: sticky;
    top: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background:
        radial-gradient(420px 180px at 20% 0%, rgba(217, 119, 6, 0.1), transparent 60%),
        var(--surface-2);
    box-shadow: var(--shadow);
}
.gen-live-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.gen-live-head strong { font-size: 13px; }
.gen-live-head span { color: var(--text-3); font-size: 12px; font-weight: 700; }
.gen-live-stage {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 8px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    border: 1px dashed var(--border-strong);
}
.gen-live-stage.is-loading { opacity: 0.55; }
.gen-live-stage svg.cert-doc {
    width: 100%;
    height: auto;
    max-height: min(58vh, 520px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    border-radius: 4px;
    background: #fff;
}
.gen-live-skel {
    width: 70%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 70%, #fff) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: cert-skel-shine 1.15s ease-in-out infinite;
}
.picked-names { display: flex; flex-wrap: wrap; gap: 6px; }
.picked-names span { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 650; }
.picked-names small { color: var(--text-3); }
.gen-submit.wiz-footer .btn.primary { min-width: 220px; }
@media (max-width: 960px) {
    .gen-polish-grid { grid-template-columns: 1fr; }
    .gen-live { position: static; }
}

/* Batch */
.batch-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: -6px 0 12px; }
.batch-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--text-2); font-size: 13px; }
.batch-facts span:not(.badge) + span::before { content: none; }
.batch-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cert-danger-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0; }
.cert-danger-row form { margin: 0; }
.cert-danger-row .fine { margin: 0; }

/* Recognitions */
.rec-layout { display: grid; gap: 12px; }
.rec-form-panel .fine { margin: 0 0 14px; }
.rec-section-title {
    margin: 4px 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
}
.rec-section-title em { font-style: normal; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--text-2); }
.rec-poster-note { margin: 0 0 14px; }
.rec-poster-demo {
    width: 148px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #111;
}
.rec-poster-demo-photo {
    height: 92px;
    display: grid;
    place-items: center;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
    background:
        linear-gradient(160deg, rgba(255,255,255,.08), transparent 40%),
        #374151;
}
.rec-poster-demo-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 8px 8px 10px;
    background: #0a0a0a;
    color: #fff;
    text-align: center;
}
.rec-poster-demo-bar b { font-size: 13px; letter-spacing: 0.08em; }
.rec-poster-demo-bar small { font-size: 8px; letter-spacing: 0.16em; color: #e7e5e4; }
.rec-poster-demo-bar span { margin-top: 3px; font-size: 12px; font-weight: 700; }
.rec-templates,
.rec-layouts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}
.rec-tpl,
.rec-layout-pick {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    cursor: pointer;
    min-width: 0;
}
.rec-tpl input,
.rec-layout-pick input { position: absolute; opacity: 0; pointer-events: none; }
.rec-tpl strong,
.rec-layout-pick strong { font-size: 13px; line-height: 1.3; }
.rec-tpl span,
.rec-layout-pick span { color: var(--text-3); font-size: 12px; line-height: 1.4; }
.rec-tpl:has(input:checked),
.rec-layout-pick:has(input:checked) {
    border-color: var(--cert);
    box-shadow: 0 0 0 1px var(--cert) inset;
    background: var(--cert-soft);
}
.rec-tpl.tone-sky:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--primary-soft); }
.rec-tpl.tone-green:has(input:checked) { border-color: var(--success); box-shadow: 0 0 0 1px var(--success) inset; background: var(--success-soft, rgba(16, 185, 129, 0.12)); }
.rec-tpl.tone-violet:has(input:checked) { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet) inset; background: var(--violet-soft); }
.rec-tpl.tone-rose:has(input:checked) { border-color: #e11d48; box-shadow: 0 0 0 1px #e11d48 inset; background: rgba(225, 29, 72, 0.1); }
.rec-photo-block {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin: 14px 0;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.rec-photo-preview {
    width: 132px;
    height: 132px;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--border);
}
.rec-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.rec-photo-preview.is-empty {
    background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px);
}
.rec-photo-preview.is-empty span { color: var(--text-3); font-size: 11px; font-weight: 700; text-align: center; padding: 8px; }
.rec-photo-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rec-photo-copy strong { font-size: 13.5px; }
.rec-photo-copy small { color: var(--text-3); font-size: 12px; line-height: 1.45; }
.rec-photo-copy input[type="file"] { font-size: 12.5px; padding: 6px 8px; }
.rec-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.rec-month-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rec-design-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rec-design-actions .fine { flex: 1 1 100%; margin: 0; }
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.rec-card {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 45%, transparent);
}
.rec-card-photo {
    width: 108px;
    height: 132px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
}
.rec-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.rec-card-photo span { color: var(--text-3); font-size: 11px; font-weight: 700; }
.rec-card-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rec-badge,
.rec-layout-tag {
    display: inline-flex;
    align-self: start;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.rec-badge {
    background: var(--cert-soft);
    color: var(--cert);
}
.rec-layout-tag {
    background: var(--surface-2);
    color: var(--text-3);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
.rec-card.tone-sky .rec-badge { background: var(--primary-soft); color: var(--primary); }
.rec-card.tone-green .rec-badge { background: var(--success-soft, rgba(16, 185, 129, 0.12)); color: var(--success); }
.rec-card.tone-violet .rec-badge { background: var(--violet-soft); color: var(--violet); }
.rec-card.tone-rose .rec-badge { background: rgba(225, 29, 72, 0.1); color: #e11d48; }
.rec-card-body h3 { margin: 2px 0 0; font-size: 15px; letter-spacing: -0.02em; }
.rec-meta { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.4; }
.rec-cite { margin: 4px 0 0; color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.rec-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rec-card-actions form { margin: 0; }
.rec-foot { margin-top: auto; color: var(--text-3); font-size: 11.5px; }

@media (max-width: 720px) {
    .rec-photo-block { grid-template-columns: 1fr; }
    .rec-photo-preview { width: 100%; height: 180px; }
    .rec-card { grid-template-columns: 88px minmax(0, 1fr); }
    .rec-card-photo { width: 88px; height: 110px; }
}

/* School details */
.sub-h { margin-top: 18px !important; }
.serial-sample { height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; border: 1px dashed var(--border-strong); color: var(--text); }
.sign-grid { display: grid; gap: 8px; }
.sign-row { display: grid; grid-template-columns: 24px 1fr 1fr; gap: 8px; align-items: center; }
.sign-row b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); font-size: 12px; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.image-slot { display: flex; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.image-preview { width: 84px; height: 84px; flex: none; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.image-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-preview.is-empty { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 6px, var(--surface-2) 6px, var(--surface-2) 12px); }
.image-preview.is-empty span { color: var(--text-3); font-size: 10.5px; font-weight: 700; text-align: center; padding: 4px; }
.image-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.image-copy strong { font-size: 13px; }
.image-copy small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.image-copy form { margin: 0; }
.image-form input[type="file"] { font-size: 12px; padding: 6px 8px; }

@media (max-width: 1100px) {
    .design-editor { grid-template-columns: 1fr; }
    .design-preview { position: static; order: -1; }
    .preview-frame svg.cert-doc { max-height: 46vh; }
}
@media (max-width: 720px) {
    .cert-occasions, .cert-starts { grid-template-columns: 1fr; }
    .cert-hero-art { min-height: 220px; }
    .map-row { grid-template-columns: 1fr; }
    .sign-row { grid-template-columns: 24px 1fr; }
    .sign-row input:last-child { grid-column: 2; }
    .gen-submit { flex-direction: column; align-items: stretch; bottom: 70px; }
    .gen-submit .btn { min-width: 0; }
    .bulk-bar { position: static; }
    .cert-filter select { flex: 1 1 140px; }
}

/* Soft navigation + skeleton */
.cert-app .workspace { position: relative; min-height: 40vh; }
.cert-app .workspace.is-loading > .cert-shell-page { opacity: 0; pointer-events: none; }
.cert-skel {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 4px 2px 24px;
    background: var(--bg);
}
.cert-skel[hidden] { display: none !important; }
.cert-skel i {
    display: block;
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 45%, var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: cert-skel-shine 1.15s ease-in-out infinite;
}
.cert-skel i.w2 { width: 55%; }
.cert-skel i.block { height: 120px; border-radius: 12px; margin-bottom: 10px; }
.cert-skel-head { display: grid; gap: 10px; margin-bottom: 18px; }
.cert-skel-head i:first-child { width: 120px; height: 12px; }
.cert-skel-head i.w2 { width: min(280px, 70%); height: 28px; }
.cert-skel-lede { display: grid; gap: 8px; margin-bottom: 22px; max-width: 640px; }
.cert-skel-lede i { height: 12px; width: 100%; }
.cert-skel-lede i:last-child { width: 72%; }
.cert-skel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.cert-skel-card {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    gap: 8px;
}
@keyframes cert-skel-shine {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Lazy design thumbs */
.cert-lazy-thumb {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 100%;
}
.cert-lazy-thumb img,
.cert-lazy-thumb > svg.cert-doc {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    border-radius: 3px;
    background: #fff;
}
.cert-lazy-thumb.is-ready img,
.cert-lazy-thumb.is-ready > svg.cert-doc { opacity: 1; }
.cert-lazy-thumb.is-ready .cert-thumb-skel,
.cert-lazy-thumb.is-error .cert-thumb-skel { display: none; }
.cert-thumb-skel {
    position: absolute;
    inset: 12%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 70%, #fff) 50%, var(--surface) 100%);
    background-size: 200% 100%;
    animation: cert-skel-shine 1.15s ease-in-out infinite;
    box-shadow: inset 0 0 0 1px var(--border);
}
.gen-thumb .cert-lazy-thumb img,
.gen-thumb .cert-lazy-thumb > svg.cert-doc { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); }

.pass-cell { width: 44px; }
.pass-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border);
    background: #fff;
}
.pass-missing { color: var(--text-3); font-size: 12px; }
.rec-photo-preview:not(.is-empty) > span { display: none; }
.pass-photo-block { margin-top: 16px; }
.id-photo-panel {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px dashed var(--border-strong, var(--border));
    background: var(--surface-2);
}
.id-photo-panel .rec-section-title { margin: 0 0 6px; }
.id-photo-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.gen-review-ul em.pass-ok,
.gen-review-ul em.pass-miss {
    margin-left: 8px;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}
.gen-review-ul em.pass-ok { background: var(--success-soft, rgba(16, 185, 129, 0.14)); color: var(--success); }
.gen-review-ul em.pass-miss { background: var(--surface); color: var(--text-3); border: 1px solid var(--border); }

.photo-id-meta { display: grid; gap: 12px; margin-top: 8px; }
.photo-id-meta > div { display: grid; gap: 4px; }
.photo-id-meta strong { font-size: 12.5px; }
.photo-id-meta span { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.photo-officer-sign {
    width: 160px;
    height: 56px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
}
.photo-officer-sign img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 12px;
}
.photo-review-card {
    position: relative;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}
.photo-review-card.is-new { border-color: var(--accent, #c9a227); }
.photo-review-keep {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    z-index: 1;
}
.photo-review-thumb {
    width: 96px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-review-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-review-thumb span { color: var(--text-3); font-size: 11px; font-weight: 700; text-align: center; padding: 8px; }
.photo-review-fields { display: grid; gap: 8px; min-width: 0; padding-right: 56px; }
.photo-review-fields .field { margin: 0; }
.photo-review-fields .field span { font-size: 11.5px; }
.photo-review-fields input,
.photo-review-fields select { font-size: 13px; padding: 6px 8px; }
.photo-review-file { margin: 0; word-break: break-word; }
.photo-review-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
@media (max-width: 640px) {
    .photo-review-card { grid-template-columns: 1fr; }
    .photo-review-thumb { width: 100%; height: 180px; }
    .photo-review-fields { padding-right: 0; padding-top: 28px; }
}
