/* Office Awards Maker */
.count { color: var(--color-deep-warm); }
.opt { font-weight: 600; }
.tool-textarea--short { min-height: 110px; }

/* step cards */
.step h2 { display: flex; align-items: center; gap: 10px; }
.step-num {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--color-yolk-hot); color: var(--color-ink-on-hot);
    border: var(--line) solid var(--color-ink); box-shadow: var(--pop-sm);
    font-family: var(--font-display); font-size: 1rem; line-height: 1;
}
.vote-step h3, .list-head h3 { font-size: 1.05rem; margin: 0 0 4px; color: var(--color-ink); }
.vote-step h3 label { font: inherit; color: inherit; }

.seg--mini { margin-bottom: var(--space-md); }
.seg--mini .seg-btn { font-size: .9rem; min-height: var(--target-min); }
.lib-groups { margin-top: 6px; }
.lib-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.lib-groups .seg-btn { padding: 6px 8px; line-height: 1.2; }

.chip-btn { cursor: pointer; padding: 6px 12px; min-height: var(--target-min); color: var(--color-ink); font: inherit; font-weight: 700; font-size: .9rem; text-align: left; }
.chip-btn:hover { background: var(--color-yolk-soft); }
.chip-btn[aria-pressed="true"] { background: var(--color-yolk); color: var(--color-ink-on-hot); }
.lib-chip[aria-pressed="true"]::before { content: "✓"; font-weight: 900; }
.lib-chips { margin-bottom: var(--space-md); }

.own-add { margin-bottom: var(--space-md); display: grid; gap: 6px; }
.own-row { display: flex; gap: 8px; }
.own-row .tool-input { flex: 1 1 auto; min-width: 0; }
.own-row .btn { flex: 0 0 auto; }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 2px dashed var(--color-soft-gray); padding-top: var(--space-md); }
.list-head h3 { margin: 0; }
.aw-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: aw; }
.aw-item {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start;
    padding: 8px; border: 2px solid var(--color-soft-gray); border-radius: var(--radius-md);
    background: var(--color-eggshell);
}
.aw-fields { display: grid; gap: 6px; min-width: 0; }
.aw-fields .tool-input { padding: 9px 12px; background: var(--color-warm-white); }
.aw-title { font-weight: 800; color: var(--color-ink); }
.aw-cite { font-size: max(16px, .92rem); }
.aw-tools { display: grid; grid-template-columns: repeat(3, var(--target-min)); gap: 4px; }
@media (max-width: 420px) {
    .aw-item { grid-template-columns: minmax(0, 1fr); }
    .aw-tools { justify-content: end; }
}
.icon-btn {
    min-width: var(--target-min); min-height: var(--target-min);
    border: var(--line) solid var(--color-ink); border-radius: var(--radius-sm);
    background: var(--color-warm-white); color: var(--color-ink);
    font-size: 1.05rem; font-weight: 900; cursor: pointer; padding: 0;
}
.icon-btn:hover:not(:disabled) { background: var(--color-yolk-soft); }
.icon-btn--x:hover:not(:disabled) { background: var(--color-coral-soft); }
.icon-btn:disabled { opacity: .35; cursor: default; border-color: var(--color-warm-gray); }
.empty--sm { padding: 18px 14px; margin-top: 8px; }
.empty--sm .empty-emoji { font-size: 28px; }

/* step 3 */
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pick-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.pick-item label { font-weight: 800; color: var(--color-ink); overflow-wrap: anywhere; }
/* a long unbroken award or name wraps instead of pushing the page sideways */
.pick-item .tool-select, .ballot-item .tool-select { min-width: 0; max-width: 100%; }
.tally-item, .ballot-item { min-width: 0; }
.tally-item h4, .tally-win, .tie .chip-btn, .ballot-award, .ballot-cite { overflow-wrap: anywhere; }
@media (min-width: 640px) {
    .pick-item { grid-template-columns: minmax(0, 1fr) minmax(160px, 240px); align-items: center; gap: 12px; }
}
.vote-step { border-top: 2px dashed var(--color-soft-gray); padding-top: var(--space-md); margin-top: var(--space-md); }
.vote-step .small { margin: 0 0 8px; }
.link-box { font-size: 14px; margin: 4px 0 8px; color: var(--color-muted-brown); }
.vote-step .row { margin-bottom: 6px; }
.vote-step .row > .btn { flex: 1 1 30%; }
.tally-sum { font-weight: 800; margin: 8px 0; color: var(--color-ink); }
.tally-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tally-notes .notice { margin: 0; font-size: .92rem; }
.tally { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tally-item { border: var(--line) solid var(--color-ink); border-radius: var(--radius-md); padding: 12px 14px; background: var(--color-warm-white); box-shadow: var(--pop-sm); }
.tally-item h4 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.05rem; color: var(--color-ink); }
.bars { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(60px, 34%) minmax(0, 1fr) 2.2em; gap: 8px; align-items: center; font-weight: 700; font-size: .95rem; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 12px; border-radius: 999px; background: var(--color-eggshell); border: 1.5px solid var(--color-warm-gray); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--color-sage); }
.bar-row.is-win .bar span { background: var(--color-yolk-hot); }
.bar-row.is-win .bar { border-color: var(--color-ink); }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; }
.tally-win { margin: 6px 0 0; font-family: var(--font-display); font-weight: 800; color: var(--color-ink); }
.tie { background: var(--color-yolk-soft); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 6px; }
.tie-q { margin: 0 0 6px; color: var(--color-yolk-text); }
.tie .chip-btn { background: var(--color-warm-white); }
.tie .chip-btn[aria-pressed="true"] { background: var(--color-yolk-hot); }

/* step 4 */
.cert-opts { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .cert-opts { grid-template-columns: 1fr 1fr; } }
.cert-actions { margin-bottom: var(--space-md); }
.cert-list { display: grid; gap: var(--space-lg); }
.cert-tools { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ================= the certificate =================
   Drawn in container units (1cqi = 1% of the paper's width), so the same
   certificate scales to a phone preview, a laptop and a printed page. */
.cert-paper { container-type: inline-size; width: 100%; }
.cert-sheet {
    --c-ink: #221E1A; --c-gold: #B8892A; --c-muted: #67625A; --c-deep: #4A453E;
    position: relative;
    aspect-ratio: 1.414;
    background:
        radial-gradient(circle at 0 0, rgba(233, 178, 60, .16), rgba(233, 178, 60, 0) 35cqi),
        radial-gradient(circle at 100% 100%, rgba(233, 178, 60, .16), rgba(233, 178, 60, 0) 35cqi),
        #FBF5E6;
    color: var(--c-ink);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(34, 30, 26, .08), 0 10px 28px rgba(90, 85, 77, .16);
    outline: 1px solid rgba(34, 30, 26, .12);
    overflow: hidden;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.cert-sheet::before, .cert-sheet::after { content: ""; position: absolute; pointer-events: none; }
.cert-sheet::before { inset: 2.2cqi; border: .45cqi solid var(--c-ink); }
.cert-sheet::after { inset: 3.2cqi; border: .16cqi solid var(--c-gold); }
.cert-body {
    position: absolute; inset: 5.4cqi 8cqi 4.6cqi;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    z-index: 1;
}
/* corner diamonds where the gold rule turns */
.cert-corner {
    position: absolute; width: 1.1cqi; height: 1.1cqi; background: var(--c-ink);
    transform: translate(-50%, -50%) rotate(45deg); z-index: 1;
}
.cert-corner--tl { left: 3.28cqi; top: 3.28cqi; }
.cert-corner--tr { left: calc(100% - 3.28cqi); top: 3.28cqi; }
.cert-corner--bl { left: 3.28cqi; top: calc(100% - 3.28cqi); }
.cert-corner--br { left: calc(100% - 3.28cqi); top: calc(100% - 3.28cqi); }
.cert-body p { margin: 0; }
.cert-main {
    flex: 1 1 auto; width: 100%; min-height: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding-bottom: 1cqi;
}
.cert-event {
    font-family: var(--font-family); font-weight: 800; font-size: 1.45cqi;
    letter-spacing: .3em; text-transform: uppercase; color: var(--c-muted);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cert-kicker {
    display: flex; align-items: center; gap: 1.5cqi; margin-top: 1.9cqi !important;
    font-family: var(--font-family); font-weight: 800; font-size: 1.7cqi;
    letter-spacing: .18em; text-transform: uppercase; color: var(--c-gold);
}
.cert-kicker::before, .cert-kicker::after { content: ""; width: 6cqi; height: .14cqi; background: var(--c-gold); }
.cert-award {
    font-family: var(--font-display); font-weight: 800; color: var(--c-ink);
    font-size: calc(4.6cqi * var(--fit, 1)); line-height: 1.08;
    margin: 0; max-width: 100%; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cert-to { font-family: var(--font-family); font-style: italic; font-weight: 600; font-size: 1.7cqi; color: var(--c-muted); margin-top: 2.2cqi !important; }
.cert-name {
    font-family: var(--font-display); font-weight: 900; color: var(--c-ink);
    font-size: calc(7.2cqi * var(--fit, 1)); line-height: 1.12;
    margin-top: .6cqi !important; padding: 0 3cqi .5cqi;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: linear-gradient(#E9B23C, #E9B23C) bottom / 100% .34cqi no-repeat;
    border-bottom: .1cqi solid var(--c-ink);
    min-width: 30cqi;
}
.cert-cite {
    font-family: var(--font-family); font-style: italic; font-weight: 600; font-size: 1.9cqi;
    color: var(--c-deep); max-width: 64cqi; line-height: 1.35; margin-top: 1.8cqi !important; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cert-foot {
    margin-top: auto; width: 100%;
    display: grid; grid-template-columns: 1fr 12cqi 1fr; align-items: end; gap: 4cqi;
}
.cert-sign { display: flex; flex-direction: column; align-items: center; justify-self: center; width: 22cqi; }
.cert-val {
    width: 100%; border-bottom: .15cqi solid var(--c-ink); padding-bottom: .5cqi;
    font-family: var(--font-family); font-weight: 700; font-size: 1.8cqi; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cert-signer { font-family: var(--font-display); font-size: 2.2cqi; }
.cert-cap {
    margin-top: .8cqi; font-family: var(--font-family); font-weight: 800; font-size: 1.15cqi;
    letter-spacing: .2em; text-transform: uppercase; color: var(--c-muted);
}
.cert-seal { width: 12cqi; margin-bottom: -.6cqi; }
.cert-seal svg { display: block; width: 100%; height: auto; }

/* ================= the ballot ================= */
.ballot-view { max-width: var(--w-page); margin: 2vh auto 0; }
.ballot-card { padding: 24px 20px; }
.ballot-card > .tool-emoji, .ballot-card > h1 { text-align: center; }
.ballot-card h1 { margin: 0 0 var(--space-md); overflow-wrap: anywhere; }
.ballot-card h1:focus, .ballot-card h2:focus { outline: none; }
.ballot-lede { text-align: center; color: var(--color-muted-brown); margin: 0 0 var(--space-md); }
.small-notice { font-size: .92rem; }
.ballot-list { list-style: none; margin: 0 0 var(--space-md); padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ballot-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px; border: 2px solid var(--color-soft-gray); border-radius: var(--radius-md); background: var(--color-eggshell); }
.ballot-item label { display: grid; gap: 2px; }
.ballot-award { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--color-ink); }
.ballot-cite { font-size: .9rem; color: var(--color-muted-brown); }
.ballot-item .tool-select { background-color: var(--color-warm-white); }
#ballot-done { text-align: center; }
#ballot-done h2 { color: var(--color-ink); }
.vote-code {
    display: block; margin: var(--space-md) 0; padding: 14px;
    background: var(--color-cream); border: 2px dashed var(--color-ink); border-radius: var(--radius-md);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem;
    word-break: break-all; text-align: left; max-height: 9.5em; overflow: auto;
    -webkit-user-select: all; user-select: all;
}
body .btn.btn-big { min-height: 60px; font-size: 1.15rem; margin-bottom: var(--space-md); }
#ballot-done .row { justify-content: center; margin-bottom: var(--space-sm); }

/* ================= print: certificates only, one per page ================= */
@media print {
    @page { size: landscape; margin: 10mm; }
    .tool-head, #step3, #step4 > :not(.cert-list), .cert-tools, #ballot-view { display: none !important; }
    .tool-grid { display: block !important; }
    .cert-list { display: block; }
    .cert { break-after: page; page-break-after: always; break-inside: avoid; animation: none !important; }
    .cert:last-child { break-after: auto; page-break-after: auto; }
    .cert-paper { width: 257mm; margin: 0 auto; }
    .cert-sheet { box-shadow: none; outline: 0; border-radius: 0; }
}
