/**
 * @file        sg-sharekit.css
 * @description Styles of the sharekit module: hub, photo pickers, image set strip, share cards, QR block, story mode, embed editor and embed frames, link page, PDF journal form, postcards (S6-01 to S6-12), share limits admin (D6-07)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         07f52854-355c-4120-aedf-b489ff75499e
 * @version     0.3.0.3
 * @created     2026-12-01
 * @updated     2026-12-04
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* Hub and shared bits (mobile first, 360 px) */
.sgk-hub { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.sgk-hub__item h2 { font-size: 1.1rem; margin: 0 0 4px; }
.sgk-hub__trips li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.sgk-hub__trips a { min-height: 44px; display: inline-flex; align-items: center; }
.sgk-break { overflow-wrap: anywhere; word-break: break-word; }
.sgk-inline { display: inline; }
.sgk-two { display: grid; gap: 12px; }
.sgk-tabs { flex-wrap: wrap; }

/* Photo pickers (S6-01, S6-10): greyed-out photos say why */
.sgk-picker { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sgk-pick label { position: relative; display: block; min-height: 44px; cursor: pointer; }
.sgk-pick input { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; margin: 0; }
.sgk-pick img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.sgk-pick input:checked ~ img { outline: 3px solid var(--accent); outline-offset: -3px; }
.sgk-pick--off label { cursor: not-allowed; }
.sgk-pick--off img { filter: grayscale(1); opacity: 0.45; }
.sgk-pick__note { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 0.75rem; overflow-wrap: anywhere; }
.sgk-strip { list-style: none; margin: 0 0 12px; padding: 0; display: flex; gap: 8px; overflow-x: auto; }
.sgk-strip li { flex: 0 0 40%; }
.sgk-strip img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Share cards (S6-02) */
.sgk-card-preview { margin: 0 0 12px; }
.sgk-card-preview img { display: block; width: 100%; max-width: 420px; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* Story mode (S6-04): small map above the text on phones, sticky beside it from 1,024 px */
.sgk-story { display: grid; gap: 16px; margin: 0 0 24px; }
.sgk-story__aside { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; }
.sgk-story__map { height: 180px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.sgk-story__map .sgk-route { width: 100%; height: 100%; }
.sgk-story__map { position: relative; }
.sgk-story__live { position: absolute; inset: 0; }
.sgk-story__map:not(.is-live) .sgk-story__live { visibility: hidden; }
.sgk-story__step { padding: 16px 0; border-top: 1px solid var(--border); scroll-margin-top: 200px; }
.sgk-story__step h2 { margin: 0 0 4px; }
.sgk-story__body { font-size: 1.05rem; line-height: 1.65; overflow-wrap: anywhere; }
.sgk-story__photos { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sgk-story__photos img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.sgk-route__bg { fill: var(--surface, #FBFCFF); }
.sgk-route__line { fill: none; stroke: var(--ink-muted, #50606D); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sgk-route__dot { fill: var(--ink-muted, #50606D); }
.sgk-route__dot.is-current { fill: var(--orange, #FA5800); r: 8px; }
@media (min-width: 1024px) {
  .sgk-story { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
  .sgk-story--nomap { grid-template-columns: minmax(0, 1fr); }
  .sgk-story__aside { top: 16px; padding: 0; }
  .sgk-story__map { height: 70vh; }
  .sgk-story__step { scroll-margin-top: 24px; }
}

/* Embed editor (S6-05) */
.sgk-embed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sgk-embed-item h3 { margin: 0 0 8px; }
.sgk-embed-item--new { border-color: var(--accent); }
.sgk-embed-preview { display: block; width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sgk-embed-item textarea { width: 100%; font-family: var(--font-mono); font-size: 0.85rem; }

/* Link page (S6-07) and editor (S6-08) */
.sgk-link-row__tools { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sgk-link-row__tools { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; padding-left: 40px; }
.sgk-link-row__tools form { display: inline; }
/* Public pages render without the app shell, so they keep their own 16 px side padding. */
.sgk-linkpage { max-width: 592px; margin: 0 auto; padding: 16px 16px 32px; }
.sgk-linkpage h1 { margin: 12px 0 0; }
.sgk-linkpage__bio { overflow-wrap: anywhere; }
.sgk-linkpage__links { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.sgk-linkpage__trip { margin: 16px 0; text-align: left; }


/* Postcards (S6-10, S6-11): flip on wide screens, stacked with reduced motion */
.sgk-design { padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.sgk-postcard { max-width: 672px; margin: 0 auto; padding: 16px; }
.sgk-postcard__card { position: relative; display: grid; perspective: 1200px; }
.sgk-postcard__side { grid-area: 1 / 1; border-radius: var(--radius-lg); overflow: hidden; border: 6px solid var(--surface); box-shadow: 0 2px 12px rgba(28, 44, 55, 0.18); backface-visibility: hidden; transition: transform 0.6s ease; background: var(--surface); }
.sgk-postcard__front { position: relative; }
.sgk-postcard__front img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.sgk-postcard__stamp { position: absolute; top: 12px; right: 12px; padding: 6px 10px; border: 2px dashed currentColor; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.8rem; color: #FBFCFF; background: rgba(28, 44, 55, 0.55); }
.sgk-postcard__back { transform: rotateY(180deg); padding: 24px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; }
.sgk-postcard__msg { font-size: 1.15rem; line-height: 1.6; overflow-wrap: anywhere; margin: 0 0 16px; }
.sgk-postcard__from { margin: 0; color: var(--ink-muted); }
.sgk-postcard.is-turned .sgk-postcard__front { transform: rotateY(180deg); }
.sgk-postcard.is-turned .sgk-postcard__back { transform: rotateY(360deg); }
.sgk-postcard--airmail .sgk-postcard__side { border-image: repeating-linear-gradient(45deg, #A83900 0 10px, #FBFCFF 10px 20px, #1C2C37 20px 30px, #FBFCFF 30px 40px) 6; }
.sgk-postcard--stamp .sgk-postcard__back { background: var(--beige); color: var(--warm-ink); }
.sgk-postcard--sunset .sgk-postcard__back { background: linear-gradient(160deg, #EADDD3, #F2F4F6); color: #1C2C37; }
.sgk-postcard--night .sgk-postcard__back { background: #1C2C37; color: #F2F4F6; }
.sgk-postcard--night .sgk-postcard__from { color: #AEB8C1; }
.sgk-reference { font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) {
  .sgk-postcard__card { gap: 12px; }
  .sgk-postcard__side { grid-area: auto; transition: none; backface-visibility: visible; }
  .sgk-postcard__back, .sgk-postcard.is-turned .sgk-postcard__front, .sgk-postcard.is-turned .sgk-postcard__back { transform: none; }
  [data-sgk-flip] { display: none; }
}
@media (min-width: 720px) {
  .sgk-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .sgk-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sgk-strip li { flex-basis: 22%; }
  .sgk-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Phase 6 mockup pass (S6-02 to S6-12): shared pieces ── */
.sgk-icon { width: 20px; height: 20px; flex: none; }
.sgk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; margin: 0 0 16px; }
.sgk-head__text { min-width: 0; flex: 1 1 240px; }
.sgk-head h1 { margin: 0; overflow-wrap: anywhere; }
.sgk-head__sub { color: var(--ink-muted); margin: 6px 0 0; }
.sgk-head__aside { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sgk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin: 0 0 12px; min-width: 0; }
.sgk-card h2 { font-size: 1.1rem; margin: 0 0 12px; }
.sgk-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin: 0 0 10px; }
.sgk-card__head h2, .sgk-card__head h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.sgk-label, .sgk-step__title { display: block; font-weight: 600; margin: 0 0 6px; }
.sgk-field { margin: 0 0 14px; }
.sgk-stack { min-width: 0; }
.sgk-work { display: grid; gap: 12px; align-items: start; }
.sgk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.sgk-actions--center { justify-content: center; }
.sgk-actions--end { justify-content: flex-end; }
.sgk-actions--stack { flex-direction: column; }
.sgk-actions .sg-button, .sgk-notice .sg-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.sgk-notice { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg); margin: 0 0 12px; overflow-wrap: anywhere; }
.sgk-notice p { margin: 0; }
.sgk-notice__text { min-width: 0; flex: 1 1 200px; }
.sgk-notice__title { font-weight: 600; }
.sgk-notice__extra { flex: 1 1 100%; }
.sgk-notice--warn { border-color: var(--border-warm); background: var(--beige); color: var(--warm-ink); }
.sgk-notice--success { border-color: var(--ink); }
.sgk-notice--error { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sgk-empty { text-align: center; padding: 24px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); margin: 8px 0; }
.sgk-empty h1, .sgk-empty h2, .sgk-empty h3, .sgk-empty h4 { font-size: 1.1rem; margin: 8px 0 4px; }
.sgk-empty p { color: var(--ink-muted); margin: 0; }
.sgk-empty__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--bg); color: var(--ink-muted); }
.sgk-seg, .sgk-choices { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.sgk-seg legend, .sgk-choices legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.sgk-seg__row, .sgk-seglinks { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); max-width: 100%; }
.sgk-seg__item { display: inline-flex; }
.sgk-seg__radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sgk-seg__opt, .sgk-seglink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; justify-content: center; padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); text-decoration: none; }
.sgk-seg__radio:checked + .sgk-seg__opt, .sgk-seglink[aria-current] { background: var(--navy); color: #fff; }
.sgk-seg__radio:focus-visible + .sgk-seg__opt { outline: 3px solid var(--focus); outline-offset: 2px; }
:root[data-theme="dark"] .sgk-seg__radio:checked + .sgk-seg__opt, :root[data-theme="dark"] .sgk-seglink[aria-current] { background: var(--ink); color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sgk-seg__radio:checked + .sgk-seg__opt, :root:not([data-theme="light"]) .sgk-seglink[aria-current] { background: var(--ink); color: var(--bg); } }
.sgk-choices__grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sgk-choice { position: relative; display: block; cursor: pointer; }
.sgk-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sgk-choice__body { display: flex; flex-direction: column; gap: 4px; min-height: 44px; height: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); overflow-wrap: anywhere; }
.sgk-choice__label { font-weight: 600; }
.sgk-choice__sub { color: var(--ink-muted); font-size: 0.8rem; }
.sgk-choice input:checked + .sgk-choice__body { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sgk-choice input:focus-visible + .sgk-choice__body { outline: 3px solid var(--focus); outline-offset: 2px; }
.sgk-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; cursor: pointer; }
.sgk-switch__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sgk-switch__label { font-weight: 600; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sgk-switch__sub { color: var(--ink-muted); font-size: 0.9rem; }
.sgk-switch input { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; margin: 0; }
.sgk-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transition: transform 0.15s; }
.sgk-switch input:checked { background: var(--ink); }
.sgk-switch input:checked::after { transform: translateX(18px); }
.sgk-switch input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sgk-switch--off { cursor: not-allowed; }
.sgk-switch--off input { opacity: 0.45; cursor: not-allowed; }
.sgk-danger { color: var(--accent); }
.sgk-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.sgk-more form { margin: 0 0 8px; }
.sgk-tool { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
.sgk-tool.sgk-danger { color: var(--accent); }
.sg-link-button.sgk-danger { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

/* S6-03 QR block */
.sgk-qr { display: block; }
.sgk-qr__legend { float: left; width: 100%; font: 600 1.1rem/1.3 var(--font-head, inherit); margin: 0 0 4px; padding: 0; }
.sgk-qr > .sgk-switch { clear: both; }
.sgk-qr__controls { display: grid; gap: 12px; margin-top: 8px; }
.sgk-qr__fields select { min-height: 44px; max-width: 100%; }
.sgk-qr__preview { position: relative; min-height: 120px; padding: 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.sgk-qr__eyebrow { font-size: 0.75rem; color: var(--ink-muted); text-transform: uppercase; }
.sgk-qr__url { font-size: 0.8rem; }
.sgk-qr__pin { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-strong); }
/* The pin sits in the chosen corner: right by default, left for tl and bl, at the top for tl and tr. */
.sgk-qr__preview--tl .sgk-qr__pin, .sgk-qr__preview--bl .sgk-qr__pin { right: auto; left: 10px; }
.sgk-qr__preview--tl .sgk-qr__pin, .sgk-qr__preview--tr .sgk-qr__pin { top: 10px; bottom: auto; }
.sgk-qr__preview--tl, .sgk-qr__preview--tr { padding-top: 58px; }

/* S6-02 cards and S6-05 embeds */
.sgk-preview .sgk-card-preview img { margin: 0 auto; }
.sgk-stage { padding: 12px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); margin: 0 0 10px; }
.sgk-code { margin: 12px 0 0; }
.sgk-code textarea { width: 100%; font-size: 0.85rem; }
.sgk-step { padding: 12px 0; border-top: 1px solid var(--border); }
.sgk-step__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sgk-step__row .sgk-step__title { margin: 0; }
.sgk-step textarea { width: 100%; }
.sgk-embeds h2 { font-size: 1.1rem; }

/* S6-08 link editor, S6-07 link page */
.sgk-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sgk-link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.sgk-link-row__pos { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 0.8rem; }
.sgk-link-row__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.sgk-link-row__tools form { display: inline; }
.sgk-linkpreview__phone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 24px; background: var(--bg); text-align: center; }
.sgk-linkpreview__links { list-style: none; margin: 8px 0 0; padding: 0; width: 100%; display: grid; gap: 6px; }
.sgk-linkpreview__links li { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; font-size: 0.9rem; }
.sgk-linkpage__head { text-align: center; }
.sgk-linkpage__head p { margin: 4px 0; }
.sgk-linkpage__label { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); margin: 16px 0 8px; text-align: left; }
.sgk-linkpage__link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; text-align: left; overflow-wrap: anywhere; }
.sgk-linkpage__link:hover { border-color: var(--ink); }
.sgk-linkpage__trip .sgk-card__head a { min-height: 44px; display: inline-flex; align-items: center; }
.sgk-linkpage__card { display: block; padding: 0; overflow: hidden; color: inherit; text-decoration: none; }
.sgk-linkpage__cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.sgk-linkpage__cardbody { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px 16px; }
.sgk-linkpage__cardfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 6px; }
.sgk-linkpage__read { font-weight: 600; color: var(--accent); }
.sgk-linkpage__foot { text-align: center; }
.sgk-linkpage__foot a { display: inline-flex; align-items: center; min-height: 44px; }
.sgk-code .sg-button, .sgk-jobrow .sg-button, .sgk-head__aside .sg-button, .sgk-more .sg-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

/* S6-09 journal */
.sgk-steps { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.sgk-steprow { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.sgk-steprow input { width: 20px; height: 20px; flex: none; margin: 0; }
.sgk-steprow__text { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.sgk-estimate__pages { font: 600 1.6rem/1.2 var(--font-mono, monospace); margin: 4px 0; }
.sgk-estimate--over .sgk-estimate__pages, .sgk-estimate__over { color: var(--accent); }
.sgk-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sgk-jobrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* S6-11 postcard page, S6-12 report */
.sgk-postcard__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.sgk-postcard__head h1 { margin: 0; font-size: 1.4rem; overflow-wrap: anywhere; }
.sgk-postcard__head .sg-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.sgk-postcard__rm { display: none; }
.sgk-postcard__card { cursor: pointer; margin: 0 0 16px; }
.sgk-postcard__band { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; background: rgba(28, 44, 55, 0.6); color: #FBFCFF; font-size: 0.85rem; }
.sgk-postcard__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px; border-top: 1px dashed currentColor; padding-top: 10px; }
.sgk-postcard__post { font-size: 0.75rem; padding: 4px 8px; border: 1px solid currentColor; border-radius: var(--radius-sm); }
.sgk-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sgk-follow__text { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; }
.sgk-follow .sg-button { min-height: 44px; display: inline-flex; align-items: center; }
.sgk-postcard__report a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-muted); }
.sgk-report { max-width: 560px; width: calc(100% - 32px); margin: 16px auto; }
.sgk-report .sgk-choices__grid { grid-template-columns: minmax(0, 1fr); }
.sgk-report--state { text-align: center; }
.sgk-report--state .sgk-empty { border: 0; }
.sgk-report__ref { font-size: 1rem; }
@media (prefers-reduced-motion: reduce) {
  .sgk-postcard__rm { display: block; padding: 10px 12px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
  .sgk-postcard__head [data-sgk-flip] { display: none; }
  .sgk-postcard__card { cursor: default; }
}
@media (min-width: 720px) {
  .sgk-qr__controls { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
}
@media (min-width: 1024px) {
  .sgk-work { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sgk-work--aside { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .sgk-work--aside .sgk-estimate, .sgk-linkpreview { position: sticky; top: 16px; }
}

/* Embed frames (S6-06): their own page without sg.css, so the tokens are set here (NFR-604) */
body.sgk-embed { --e-bg: #FBFCFF; --e-ink: #1C2C37; --e-muted: #50606D; --e-border: #DFE3E7; --e-accent: #A83900; --surface: #F2F4F6; --ink-muted: #50606D; --orange: #FA5800;
  margin: 0; padding: 12px; background: var(--e-bg); color: var(--e-ink); font: 15px/1.45 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) {
  body.sgk-embed { --e-bg: #14212A; --e-ink: #F2F4F6; --e-muted: #AEB8C1; --e-border: #2E3E4A; --e-accent: #FF8C5F; --surface: #22323D; --ink-muted: #AEB8C1; }
}
.sgk-embed h1 { font: 600 1.1rem/1.3 Sora, "IBM Plex Sans", system-ui, sans-serif; margin: 0 0 4px; }
.sgk-embed__meta { color: var(--e-muted); margin: 0 0 8px; font-size: 0.9rem; }
.sgk-embed__map svg { display: block; width: 100%; height: auto; max-height: 300px; }
.sgk-embed__photo { display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; border-radius: 8px; margin: 0 0 8px; }
.sgk-embed__open { display: inline-flex; align-items: center; min-height: 44px; color: var(--e-accent); font-weight: 600; }
.sgk-embed__counters { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sgk-embed__counters li { display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--e-border); border-radius: 8px; }
.sgk-embed__num { font: 600 1.4rem/1.2 "IBM Plex Mono", ui-monospace, Consolas, monospace; }
.sgk-embed__live { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.sgk-embed__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); flex: 0 0 auto; }
.sgk-embed__brand { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--e-border); font-size: 0.8rem; color: var(--e-muted); }
.sgk-embed__brand a { color: var(--e-muted); }
.sgk-embed__stage { position: relative; border: 1px solid var(--e-border); border-radius: 8px; overflow: hidden; }
.sgk-embed__cta { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--e-ink); color: var(--e-bg); font-weight: 600; text-decoration: none; white-space: nowrap; }
.sgk-embed__kicker { margin: 0 0 4px; font: 0.8rem/1.3 "IBM Plex Mono", ui-monospace, Consolas, monospace; color: var(--e-muted); }
.sgk-embed__step { display: grid; gap: 10px; }
@media (min-width: 480px) { .sgk-embed__step { grid-template-columns: 2fr 3fr; align-items: start; } .sgk-embed__step .sgk-embed__photo { margin: 0; } .sgk-embed__counters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sgk-embed__badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--e-accent); color: var(--e-accent); font-weight: 600; }
.sgk-embed__empty { margin: 0; padding: 24px 8px; text-align: center; color: var(--e-muted); }
/* The world map of the scratch embed: the rules of sg.css and the plain colour mode, because sg.css isn't loaded here. */
.sgk-embed .sg-world { width: 100%; height: auto; display: block; }
.sgk-embed .sg-world .sg-c { fill: var(--surface); stroke: var(--e-border); stroke-width: 0.4; }
.sgk-embed .sg-world .sg-c--visited, .sgk-embed .sg-world .sg-c--new { fill: url(#sg-hatch-visited); stroke: #6B2D19; }
.sgk-embed .sg-world .sg-c.sg-atlas-later { fill: var(--surface); stroke: var(--e-border); }

/* D6-07 share limits (admin): setting rows, queue and report rows */
.sgk-admin h2 { margin: 0 0 8px; font-size: 1.15rem; }
.sgk-admin__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; margin: 0 0 12px; }
.sgk-admin__top h2 { margin: 0; }
.sgk-admin__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; border-top: 1px solid var(--border); }
.sgk-admin__number { width: 6rem; min-height: 44px; flex: none; }
.sgk-chip--warn { border-color: var(--border-warm); background: var(--beige); color: var(--warm-ink); }
.sgk-report-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sgk-report-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.sgk-report-row--open { border-color: var(--border-warm); background: var(--beige); }
.sgk-report-row__text { min-width: 0; flex: 1 1 16rem; }
.sgk-report-row__text p { margin: 0; overflow-wrap: anywhere; }
.sgk-report-row__meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
