/* Sensigngo — brand board: Navy #0B1F44 · Gold #D4AF37 · White · Playfair Display (headings) + Inter / Noto Sans Thai (text) ·
   gold line icons · mascot SENSI. */
:root {
  --sg-navy: #061230;
  --sg-navy-2: #0A1B42;
  --sg-navy-3: #13295C;
  --sg-navy-deep: #020918;
  --sg-gold: #D4AF37;
  --sg-gold-2: #B8952A;
  --sg-gold-3: #E8CB6A;
  --sg-gold-soft: #FBF5E1;
  /* metallic gold (brand board): light catches the top-left, deep amber in the folds */
  --sg-gold-metal: linear-gradient(135deg, #FFF4BF 0%, #F2D579 18%, #D4AF37 38%, #A67C1E 56%, #E9C764 72%, #FFF0B0 86%, #C9992E 100%);
  --sg-gold-glow: 0 0 18px rgba(232, 199, 100, .45);
  --sg-ink: #1F2937;
  --sg-muted: #6B7280;
  --sg-line: #E7E9EF;
  --sg-bg: #F5F6FA;
  --sg-ok: #1B8A5A;
  --sg-ok-bg: #E3F4EC;
  --sg-wait: #C2410C;
  --sg-wait-bg: #FFEDD5;
  --sg-info: #1D4ED8;
  --sg-info-bg: #DBEAFE;
  --sg-end: #B42318;
  --sg-end-bg: #FDE8E6;
  --sg-radius: 16px;
  --sg-shadow: 0 8px 28px -14px rgba(11, 31, 68, .28);
  --side-w: 248px;
}
html { font-size: 15px; }
body { font-family: "Inter", "Noto Sans Thai", system-ui, sans-serif; color: var(--sg-ink); background: var(--sg-bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3, .display-font { font-family: "Playfair Display", "Noto Sans Thai", serif; color: var(--sg-navy); font-weight: 700; }
a { color: var(--sg-navy-2); }
.text-gold { color: var(--sg-gold) !important; }
.text-navy { color: var(--sg-navy) !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82em; word-break: break-all; }
:focus-visible { outline: 3px solid var(--sg-gold); outline-offset: 2px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- brand mark ---------- */
.sg-brand { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; font-family: "Playfair Display", serif; font-weight: 700; font-size: 1.4rem; color: #fff; }
.sg-brand img { height: 30px; width: auto; }
.sg-brand em { font-style: normal; color: var(--sg-gold); }
.sg-brand:hover { color: #fff; }
.sg-brand.is-dark { color: var(--sg-navy); }

/* ---------- buttons & forms ---------- */
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--sg-navy); --bs-btn-border-color: var(--sg-navy); --bs-btn-hover-bg: var(--sg-navy-2); --bs-btn-hover-border-color: var(--sg-navy-2); --bs-btn-active-bg: var(--sg-navy-2); --bs-btn-disabled-bg: var(--sg-navy); }
.btn-gold { background: linear-gradient(180deg, var(--sg-gold-3), var(--sg-gold)); border: 1px solid var(--sg-gold-2); color: var(--sg-navy); box-shadow: 0 6px 16px -8px rgba(212, 175, 55, .8); }
.btn-gold:hover, .btn-gold:focus { background: var(--sg-gold-2); color: #fff; border-color: var(--sg-gold-2); }
.btn-outline-primary { --bs-btn-color: var(--sg-navy); --bs-btn-border-color: var(--sg-navy); --bs-btn-hover-bg: var(--sg-navy); --bs-btn-hover-border-color: var(--sg-navy); }
.btn-outline-gold { border: 1px solid var(--sg-gold); color: var(--sg-gold); background: transparent; }
.btn-outline-gold:hover { background: var(--sg-gold); color: var(--sg-navy); }
.form-control, .form-select { border-radius: 12px; border-color: #D6DAE3; }
.form-control:focus, .form-select:focus { border-color: var(--sg-gold); box-shadow: 0 0 0 .2rem rgba(212, 175, 55, .25); }
.nav-pills .nav-link.active { background: var(--sg-navy); }
.nav-pills .nav-link { color: var(--sg-navy); }

/* ---------- public top bar ---------- */
.sg-nav { background: var(--sg-navy); padding: .7rem 0; }
.sg-nav .nav-link { color: rgba(255, 255, 255, .8); font-weight: 500; }
.sg-nav .nav-link:hover, .sg-nav .nav-link.active { color: var(--sg-gold); }
.sg-nav .navbar-toggler { border-color: rgba(255, 255, 255, .3); }
.sg-nav .navbar-toggler-icon { filter: invert(1); }

/* ---------- member app shell: navy sidebar + white top bar (brand board dashboard preview) ---------- */
.sg-side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: linear-gradient(180deg, var(--sg-navy) 0%, var(--sg-navy-deep) 100%); padding: 1.2rem .9rem; display: flex; flex-direction: column; z-index: 1030; }
.sg-side .sg-brand { padding: 0 .5rem 1.3rem; }
.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 12px; color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500; }
.side-nav a .ico { color: var(--sg-gold); }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: rgba(212, 175, 55, .16); color: #fff; box-shadow: inset 3px 0 0 var(--sg-gold); }
.side-sep { height: 1px; background: rgba(255, 255, 255, .1); margin: .7rem .4rem; }
.side-mascot { margin-top: auto; display: flex; align-items: center; gap: .6rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(212, 175, 55, .25); border-radius: 14px; padding: .6rem .7rem; }
.side-mascot img { height: 58px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.side-mascot b { display: block; color: var(--sg-gold); font-family: "Playfair Display", serif; letter-spacing: .08em; }
.side-mascot span { color: rgba(255, 255, 255, .75); font-size: .8rem; }

.sg-top { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 1rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--sg-line); padding: .6rem 1.4rem; }
.sg-top .sg-brand { color: var(--sg-navy); font-size: 1.25rem; }
.top-search { align-items: center; gap: .5rem; background: var(--sg-bg); border: 1px solid var(--sg-line); border-radius: 12px; padding: .4rem .8rem; width: min(420px, 45vw); color: var(--sg-muted); }
.top-search input { border: 0; background: transparent; outline: none; width: 100%; }
.user-chip { display: flex; align-items: center; gap: .55rem; background: transparent; border: 0; padding: .2rem .3rem; border-radius: 12px; }
.user-chip:hover { background: var(--sg-bg); }
.user-chip b { display: block; font-size: .9rem; color: var(--sg-navy); line-height: 1.2; }
.user-chip small { color: var(--sg-muted); font-size: .76rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sg-navy), var(--sg-navy-3)); color: var(--sg-gold); font-weight: 700; border: 2px solid var(--sg-gold); }
body.has-shell main.sg-main { padding: 0 clamp(1.4rem, 2.2vw, 2.4rem) 2.5rem; }
body.has-shell .sg-alerts { max-width: 1680px; margin-left: auto; margin-right: auto; }
body.has-shell .sg-alerts { padding: 0; }
@media (min-width: 992px) {
  body.has-shell { padding-left: var(--side-w); }
}
@media (max-width: 991.98px) {
  .sg-side { display: none; }
  body.has-shell main.sg-main { padding: 0 .9rem calc(84px + env(safe-area-inset-bottom)); }
  .sg-top { padding: .55rem .9rem; }
}

/* phones: bottom tab bar */
.sg-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around; align-items: flex-end; background: #fff; border-top: 1px solid var(--sg-line); padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -16px rgba(11, 31, 68, .4); }
.sg-tabbar a { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .72rem; color: var(--sg-muted); text-decoration: none; min-width: 58px; }
.sg-tabbar a .ico { color: var(--sg-navy); }
.sg-tabbar a.active { color: var(--sg-navy); font-weight: 700; }
.sg-tabbar a.active .ico { color: var(--sg-gold-2); }
.sg-tabbar .tab-cta .ico { width: 50px; height: 50px; padding: 13px; border-radius: 50%; background: linear-gradient(180deg, var(--sg-gold-3), var(--sg-gold)); color: var(--sg-navy); margin-top: -26px; box-shadow: 0 8px 18px -8px rgba(212, 175, 55, .9); border: 3px solid #fff; }

/* ---------- surfaces ---------- */
.surface { background: #fff; border: 1px solid var(--sg-line); border-radius: var(--sg-radius); box-shadow: var(--sg-shadow); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1.1rem; }
.page-head h1 { font-size: 1.8rem; margin: 0; }
.stat { padding: 1.1rem 1.2rem; height: 100%; display: block; text-decoration: none; transition: transform .15s; }
.stat:hover { transform: translateY(-2px); }
.stat span { color: var(--sg-muted); font-size: .9rem; display: block; }
.stat b { display: block; font-size: 2.1rem; font-family: "Playfair Display", serif; color: var(--sg-navy); line-height: 1.2; margin-top: .2rem; }
.stat.is-wait b { color: #EA7A12; }
.stat.is-info b { color: var(--sg-info); }
.stat.is-ok b { color: var(--sg-ok); }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill.is-ok { background: var(--sg-ok-bg); color: var(--sg-ok); }
.pill.is-wait { background: var(--sg-wait-bg); color: var(--sg-wait); }
.pill.is-draft { background: var(--sg-info-bg); color: var(--sg-info); }
.pill.is-end { background: var(--sg-end-bg); color: var(--sg-end); }

.table-sg { margin: 0; }
.table-sg th { color: var(--sg-muted); font-weight: 600; font-size: .82rem; border-bottom-width: 1px; background: #FAFBFD; }
.table-sg td { vertical-align: middle; border-color: #F0F2F6; }
.table-sg tr[data-href] { cursor: pointer; }
.table-sg tr[data-href]:hover td { background: var(--sg-gold-soft); }

/* mascot */
.mascot { display: block; height: auto; filter: drop-shadow(0 8px 14px rgba(11, 31, 68, .18)); }
.mascot-sm { width: 76px; }
.mascot-md { width: 112px; }
.mascot-lg { width: 150px; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--sg-muted); }
.empty-state .mascot { margin: 0 auto .8rem; }
.greet { position: relative; overflow: hidden; background: linear-gradient(120deg, var(--sg-navy) 0%, var(--sg-navy-2) 60%, var(--sg-navy-3) 100%); color: #fff; border-radius: var(--sg-radius); padding: 1.4rem 1.5rem; display: flex; align-items: center; gap: 1.2rem; }
.greet h1 { color: #fff; font-size: 1.6rem; margin: 0; }
.greet p { color: rgba(255, 255, 255, .78); margin: .2rem 0 0; }
.greet .mascot { width: 104px; margin-bottom: -1.4rem; align-self: flex-end; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35)); }
.greet::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .35), transparent 65%); pointer-events: none; }

/* ---------- landing (brand board hero) ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(circle at 78% 30%, #18346E 0%, var(--sg-navy) 45%, var(--sg-navy-deep) 100%); color: #fff; padding: 4rem 0 0; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 60%, rgba(212, 175, 55, .22), transparent 40%); pointer-events: none; }
.hero .container { position: relative; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.15; font-weight: 800; }
.hero h1 .gold { color: var(--sg-gold); }
.hero p.lead { color: rgba(255, 255, 255, .85); }
.hero .tagline { letter-spacing: .3em; font-size: .78rem; color: var(--sg-gold); font-weight: 600; }
.hero-steps { color: rgba(255, 255, 255, .85); font-weight: 500; }
.hero-steps em { font-style: normal; color: var(--sg-gold); }
/* transparent cut-out: SENSI stands in the golden light, no mask needed */
.hero-mascot { position: relative; width: 100%; max-width: 330px; display: block; margin: 1rem auto 0; filter: drop-shadow(0 0 3px rgba(255, 228, 150, .35)) drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.hero-art { position: relative; }
.hero-art::before { content: ""; position: absolute; inset: 8% 10%; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .28), transparent 65%); filter: blur(10px); }
.hero-pillars { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2.5rem; padding: 1.4rem 0; }
.pillar { display: flex; gap: .8rem; align-items: flex-start; }
.pillar .ico { width: 34px; height: 34px; color: var(--sg-gold); stroke-width: 1.4; }
.pillar b { display: block; color: #fff; }
.pillar span { color: rgba(255, 255, 255, .7); font-size: .88rem; }
.section { padding: 4rem 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 2.2rem; }
.section-head .eyebrow { color: var(--sg-gold-2); letter-spacing: .25em; font-size: .78rem; font-weight: 700; }
.feature { padding: 1.5rem; height: 100%; }
.feature .icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--sg-navy); color: var(--sg-gold); margin-bottom: .9rem; border: 2px solid var(--sg-gold); }
.feature .icon .ico { width: 24px; height: 24px; }
.soon { font-size: .68rem; background: var(--sg-navy); color: var(--sg-gold); border-radius: 999px; padding: .12rem .55rem; vertical-align: middle; font-family: "Inter", sans-serif; }
.values { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.value { text-align: center; width: 120px; }
.value .ring { width: 74px; height: 74px; margin: 0 auto .5rem; border-radius: 50%; display: grid; place-items: center; background: var(--sg-navy); border: 2px solid var(--sg-gold); color: var(--sg-gold); }
.value .ring .ico { width: 32px; height: 32px; stroke-width: 1.4; }
.sensi { background: linear-gradient(120deg, var(--sg-navy), var(--sg-navy-2)); border-radius: 24px; color: #fff; padding: 2.2rem; position: relative; overflow: hidden; }
.sensi h2 { color: var(--sg-gold); font-size: 2.6rem; letter-spacing: .08em; margin: 0; }
.sensi .quote { font-family: "Playfair Display", serif; font-size: 1.15rem; color: var(--sg-gold-3); }
.poses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.pose { background: #fff; border-radius: 16px; padding: .8rem .4rem .6rem; text-align: center; color: var(--sg-navy); font-size: .82rem; font-weight: 600; }
.pose img { height: 92px; width: auto; max-width: 100%; object-fit: contain; display: block; margin: 0 auto .35rem; }
@media (max-width: 575.98px) {
  .poses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sensi { padding: 1.4rem; }
}

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 160px); display: flex; align-items: center; padding: 2.5rem 0; }
.auth-card { max-width: 940px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; padding: 0; }
.auth-art { background: radial-gradient(circle at 60% 35%, var(--sg-navy-3), var(--sg-navy) 70%); color: #fff; padding: 2.2rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h2 { color: #fff; font-size: 1.7rem; }
.auth-art h2 em { font-style: normal; color: var(--sg-gold); }
.auth-art img { width: 170px; align-self: center; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .4)); }
.auth-form { padding: 2.2rem; }
@media (max-width: 767.98px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

/* signers editor */
.signer-row { border: 1px dashed #D1D5DB; border-radius: 14px; padding: .9rem; margin-bottom: .7rem; background: #FCFCFD; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--sg-line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--sg-gold); }
.timeline small { color: var(--sg-muted); }

/* signing page */
.sign-shell { max-width: 1140px; margin: 0 auto; }
.pdf-frame { width: 100%; height: 75vh; min-height: 480px; border: 0; border-radius: var(--sg-radius); background: #E5E7EB; }
.sig-pad { width: 100%; height: 170px; border: 2px dashed var(--sg-gold); border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-typed { font-family: "Playfair Display", serif; font-style: italic; font-size: 2rem; color: var(--sg-navy); min-height: 3rem; }
.dev-otp { background: #FFF7E0; border: 1px dashed var(--sg-gold); border-radius: 12px; padding: .5rem .8rem; font-size: .9rem; }
.step-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; }
.step-head img { width: 72px; filter: drop-shadow(0 6px 10px rgba(6, 18, 48, .18)); }
.step-head h2 { margin: 0; font-size: 1.2rem; }

/* verify */
.verdict { border-radius: var(--sg-radius); padding: 1.4rem; color: #fff; display: flex; align-items: center; gap: 1rem; }
.verdict .mascot { width: 100px; flex-shrink: 0; filter: drop-shadow(0 0 12px rgba(255, 255, 255, .55)) drop-shadow(0 8px 12px rgba(0, 0, 0, .3)); }
.verdict.is-valid { background: linear-gradient(135deg, #136E48, var(--sg-ok)); }
.verdict.is-partial { background: linear-gradient(135deg, #8A5A10, #C98A1B); }
.verdict.is-invalid { background: linear-gradient(135deg, #8E1B12, var(--sg-end)); }
.verdict h2 { color: #fff; margin: 0; font-family: "Inter", sans-serif; font-weight: 800; letter-spacing: .06em; }
.check-row { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--sg-line); }
.check-row:last-child { border-bottom: 0; }
.check-row .mark { font-weight: 800; width: 1.2rem; }
.check-row .mark.ok { color: var(--sg-ok); }
.check-row .mark.no { color: var(--sg-end); }

.secret-box { background: var(--sg-navy); color: var(--sg-gold); border-radius: 14px; padding: 1rem; }
.secret-box code { color: #fff; word-break: break-all; font-size: .95rem; }

footer.sg-foot { background: #fff; border-top: 1px solid var(--sg-line); color: var(--sg-muted); padding: 1.6rem 0; }
footer.sg-foot .sg-brand { font-size: 1.2rem; }
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 1.45rem; }
  .pdf-frame { height: 60vh; min-height: 360px; }
  .greet { padding: 1.1rem; }
  .greet h1 { font-size: 1.3rem; }
}

/* Every page in the app uses the same width: the whole content area, centred on very wide screens. */
.sg-page { width: 100%; max-width: 1680px; margin-left: auto; margin-right: auto; }

/* Mascot poses: cut from the high-resolution sheet (004f4db0-...png). */
/* SENSI on navy: the high-resolution cut-outs stand in a soft golden light (no white disc) */
.mascot-glow { display: block; height: auto; filter: drop-shadow(0 0 3px rgba(255, 228, 150, .35)) drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); }
.auth-art img.mascot-glow { width: 210px; }
.greet .mascot-glow { position: relative; z-index: 1; width: 124px; flex-shrink: 0; align-self: flex-end; margin: -.6rem .4rem -1.4rem 0; }
.side-mascot img.mascot-glow { width: 58px; height: auto; margin: -14px 0 -4px; }

/* ---------- gold shine (brand board): metallic gradient text, glowing gold lines and icons, golden light ---------- */
.sg-brand em, .hero h1 .gold, .sensi h2, .side-mascot b, .hero .tagline, .auth-art h2 em, .stat.is-gold b {
  background: var(--sg-gold-metal); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(232, 199, 100, .35));
}
.hero h1 .gold { animation: gold-shimmer 6s ease-in-out infinite; }
.sensi h2 { animation: gold-shimmer 7s ease-in-out infinite; }
@keyframes gold-shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.btn-gold { position: relative; overflow: hidden; background: var(--sg-gold-metal); background-size: 180% 180%; border: 1px solid #B8862B; color: var(--sg-navy-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 6px rgba(120, 80, 10, .35), 0 6px 18px -6px rgba(232, 199, 100, .75); text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.btn-gold::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent); transform: skewX(-20deg); transition: left .6s; pointer-events: none; }
.btn-gold:hover, .btn-gold:focus { background: var(--sg-gold-metal); background-size: 180% 180%; background-position: 100% 50%; color: var(--sg-navy-deep); border-color: #B8862B; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 8px 26px -6px rgba(240, 205, 110, .95); }
.btn-gold:hover::after { left: 120%; }

.side-nav a .ico, .pillar .ico, .feature .icon, .value .ring, .sg-tabbar a.active .ico { filter: drop-shadow(0 0 6px rgba(232, 199, 100, .55)); }
.side-nav a .ico, .pillar .ico, .value .ring, .feature .icon { color: #F0CF6E; }
.side-nav a.active { background: linear-gradient(90deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .04)); box-shadow: inset 3px 0 0 #F0CF6E; }
.feature .icon, .value .ring, .avatar { border: 0; background: radial-gradient(circle at 50% 35%, var(--sg-navy-3), var(--sg-navy-deep)); box-shadow: 0 0 0 2px #E2BE5A, 0 0 0 4px rgba(226, 190, 90, .18), var(--sg-gold-glow); }
.avatar { color: #F0CF6E; }
.side-mascot { border-color: rgba(232, 199, 100, .4); box-shadow: inset 0 0 18px rgba(212, 175, 55, .12); }
.sg-tabbar .tab-cta .ico { background: var(--sg-gold-metal); box-shadow: 0 0 18px rgba(232, 199, 100, .7), 0 8px 18px -8px rgba(0, 0, 0, .4); }
.auth-art { background: radial-gradient(circle at 60% 35%, var(--sg-navy-3), var(--sg-navy) 55%, var(--sg-navy-deep) 100%); }
.greet { background: linear-gradient(120deg, var(--sg-navy-deep) 0%, var(--sg-navy) 45%, var(--sg-navy-3) 100%); }
.greet::after { background: radial-gradient(circle, rgba(240, 205, 110, .5), transparent 65%); }
.sensi { background: radial-gradient(circle at 85% 20%, rgba(232, 199, 100, .18), transparent 40%), linear-gradient(120deg, var(--sg-navy-deep), var(--sg-navy) 60%, var(--sg-navy-2)); }
.hero-pillars { border-top: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(232, 199, 100, .6), transparent) 1; }

/* golden light in the hero: a warm glow behind SENSI and soft light streaks */
.hero::before { background: radial-gradient(circle at 76% 52%, rgba(240, 205, 110, .32), transparent 34%), radial-gradient(circle at 90% 10%, rgba(240, 205, 110, .12), transparent 30%); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: linear-gradient(115deg, transparent 52%, rgba(255, 226, 140, .16) 58%, transparent 61%), linear-gradient(125deg, transparent 64%, rgba(255, 226, 140, .1) 68%, transparent 70%); }
.hero-art::before { background: radial-gradient(circle, rgba(250, 215, 120, .45), transparent 62%); filter: blur(14px); }
.sg-nav { background: var(--sg-navy-deep); border-bottom: 1px solid rgba(226, 190, 90, .25); }
.sg-top { border-bottom: 1px solid #E9DFC0; }
@media (prefers-reduced-motion: reduce) {
  .hero h1 .gold, .sensi h2 { animation: none; }
  .btn-gold::after { transition: none; }
}
.hero > .container { z-index: 1; }

/* =====================================================================================================================
   Mobile app feel: navy app bar with back button on pushed screens, bottom tab bars, list rows instead of tables,
   bottom sheets for menus and dialogs, sticky action bars, safe areas (notch / home indicator) when added to Home Screen.
   ===================================================================================================================== */
html { -webkit-tap-highlight-color: transparent; }
a, button, .btn, label, select { touch-action: manipulation; }
@media (hover: none) {
  .stat:hover { transform: none; }
  .btn-gold:hover::after { left: -60%; }
}

/* page-load progress bar */
.nav-progress { position: fixed; top: 0; left: 0; z-index: 2000; height: 3px; width: 0; opacity: 0; pointer-events: none; background: var(--sg-gold-metal); box-shadow: 0 0 10px rgba(240, 205, 110, .85); }
.nav-progress.is-loading { opacity: 1; animation: nav-load 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes nav-load { 0% { width: 0; } 15% { width: 45%; } 100% { width: 92%; } }

/* list rows (documents, signers, members) */
.m-list { list-style: none; margin: 0; padding: 0; }
.m-list > li + li { border-top: 1px solid #EEF0F4; }
.m-list > li > a, .m-list .m-row { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; color: var(--sg-ink); text-decoration: none; }
.m-list > li > a:active { background: var(--sg-gold-soft); }
.m-list.is-flat .m-row { padding: .8rem 0; align-items: flex-start; }
.m-doc { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: var(--sg-info-bg); color: var(--sg-info); }
.m-doc.is-ok { background: var(--sg-ok-bg); color: var(--sg-ok); }
.m-doc.is-wait { background: var(--sg-wait-bg); color: var(--sg-wait); }
.m-doc.is-end { background: var(--sg-end-bg); color: var(--sg-end); }
.m-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.m-body b { font-weight: 600; color: var(--sg-navy); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-body small { color: var(--sg-muted); font-size: .8rem; overflow-wrap: anywhere; }
.m-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.m-count { font-size: .78rem; color: var(--sg-muted); }
.m-chev { width: 18px; height: 18px; color: #B7BCC8; }
.m-order { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--sg-info-bg); color: var(--sg-info); font-weight: 700; font-size: .85rem; }
.m-order.is-ok { background: var(--sg-ok-bg); color: var(--sg-ok); }
.m-avatar { width: 38px; height: 38px; font-size: .9rem; flex-shrink: 0; }

/* settings menu rows */
.menu-list { overflow: hidden; }
.menu-list a { display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; color: var(--sg-navy); text-decoration: none; font-weight: 500; }
.menu-list a + a { border-top: 1px solid #EEF0F4; }
.menu-list a > span { flex: 1; }
.menu-list a > .ico:first-child { color: var(--sg-gold-2); }
.menu-list a.is-danger, .menu-list a.is-danger > .ico:first-child { color: var(--sg-end); }
.menu-list a:active { background: var(--sg-gold-soft); }

/* dashboard shortcuts */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-decoration: none; color: var(--sg-navy); font-size: .8rem; font-weight: 600; text-align: center; }
.quick a span { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #F0CF6E; transition: transform .12s;
  background: radial-gradient(circle at 50% 30%, var(--sg-navy-3), var(--sg-navy-deep)); box-shadow: 0 0 0 1px rgba(226, 190, 90, .55), 0 8px 18px -10px rgba(6, 18, 48, .85); }
.quick a .ico { width: 26px; height: 26px; filter: drop-shadow(0 0 5px rgba(232, 199, 100, .6)); }
.quick a:active span { transform: scale(.92); }

/* signing page: document card */
.doc-card { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; text-decoration: none; color: var(--sg-ink); }
.doc-card:active { background: var(--sg-gold-soft); }

/* account bottom sheet content (phones) */
.sheet-account { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.2rem 1rem; border-bottom: 1px solid #EEF0F4; }
.sheet-account b { display: block; color: var(--sg-navy); }
.sheet-account small { color: var(--sg-muted); }
.sheet-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding: .9rem 1rem; border-bottom: 1px solid #EEF0F4; }
.sheet-links a { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .7rem .2rem; border-radius: 14px; background: var(--sg-bg); color: var(--sg-navy); font-size: .8rem; font-weight: 600; text-decoration: none; }
.sheet-links .ico { color: var(--sg-gold-2); }
.sheet-shade { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: .25rem; }
/* the validation summary renders even with no errors */
.validation-summary-valid { display: none; }

@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* pushed screens grow in from the right edge; no sideways shift, which would widen the page and make phones zoom out */
@keyframes page-push { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- tablets and phones ---------- */
@media (max-width: 991.98px) {
  body.has-shell { background: #F2F3F7; }

  /* navy app bar under the status bar */
  .sg-top { min-height: calc(56px + env(safe-area-inset-top)); padding: calc(.45rem + env(safe-area-inset-top)) .6rem .45rem; gap: .35rem;
    background: linear-gradient(180deg, var(--sg-navy-deep), var(--sg-navy)); backdrop-filter: none; border-bottom: 1px solid rgba(226, 190, 90, .3); color: #fff; }
  .sg-top .sg-brand { color: #fff; font-size: 1.25rem; padding-left: .25rem; }
  .user-chip { padding: 0; }
  .user-chip:hover { background: transparent; }
  .user-chip.dropdown-toggle::after { display: none; }
  .avatar { width: 36px; height: 36px; }
  .app-back, .app-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; color: #fff; text-decoration: none; }
  .app-back:active, .app-icon-btn:active { background: rgba(255, 255, 255, .14); }
  .app-back .ico { width: 26px; height: 26px; color: #F0CF6E; stroke-width: 2.2; }
  .app-icon-btn .ico { color: #F0CF6E; }
  .app-title { flex: 1; min-width: 0; color: #fff; font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* bottom tab bar */
  .sg-tabbar { background: rgba(255, 255, 255, .95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid #ECE4C8; padding: .3rem .2rem calc(.35rem + env(safe-area-inset-bottom)); }
  .sg-tabbar a { position: relative; flex: 1; min-width: 0; padding-top: .3rem; font-weight: 500; }
  .sg-tabbar a.active::before { content: ""; position: absolute; top: -.3rem; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--sg-gold-metal); }
  .sg-tabbar a.tab-cta::before { display: none; }
  .sg-tabbar a .ico { transition: transform .12s; }
  .sg-tabbar a:active .ico { transform: scale(.88); }
  .sg-tabbar .tab-cta { color: var(--sg-navy); font-weight: 700; }
  .sg-tabbar a.tab-cta.active .ico { color: var(--sg-navy-deep); }

  /* pushed screens: back button instead of tabs */
  body.is-pushed .sg-tabbar { display: none !important; }
  body.is-pushed.has-shell main.sg-main { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

  /* screens slide in */
  /* backwards, not both: a transform left on main after the animation would trap fixed dialogs and sheets inside it */
  main { animation: page-in .26s ease-out backwards; }
  body.is-pushed main { animation-name: page-push; transform-origin: 100% 30%; }

  /* public pages: compact top bar + bottom tabs */
  .sg-nav { padding: calc(.5rem + env(safe-area-inset-top)) 0 .5rem; }
  .sg-nav > .container { flex-wrap: nowrap; }
  body.has-public { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* account menu -> bottom sheet */
  body.sheet-open .sg-top { z-index: 1070; }
  .user-menu .dropdown-menu { display: block; visibility: hidden; position: fixed !important; inset: auto 0 0 0 !important; transform: translateY(100%) !important; margin: 0 !important;
    width: 100%; max-height: 82vh; overflow-y: auto; border: 0; border-radius: 22px 22px 0 0; padding: .3rem 0 calc(.8rem + env(safe-area-inset-bottom)); z-index: 1065;
    box-shadow: 0 -12px 40px rgba(2, 9, 24, .35) !important; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s; }
  .user-menu .dropdown-menu.show { visibility: visible; transform: none !important; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .user-menu .dropdown-menu::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: #D5D9E2; margin: .35rem auto .6rem; }
  .user-menu .dropdown-item { padding: .8rem 1.2rem; font-size: 1rem; }
  .user-menu .dropdown-header { padding: .6rem 1.2rem .2rem; }
  .sheet-shade { display: block; position: fixed; inset: 0; z-index: 1060; background: rgba(2, 9, 24, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.sheet-open .sheet-shade { opacity: 1; pointer-events: auto; }

  /* signing page: the sign button stays in reach */
  .sign-cta { position: sticky; bottom: 0; z-index: 5; margin: 0 -1.5rem; padding: .75rem 1.5rem calc(.75rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--sg-line); }
}
@media (max-width: 991.98px) and (prefers-reduced-motion: reduce) {
  main, body.is-pushed main { animation: none; }
  .user-menu .dropdown-menu, .sheet-shade { transition: none; }
}

/* ---------- phones ---------- */
@media (max-width: 767.98px) {
  /* no zoom-on-focus on iOS */
  .form-control, .form-select, .form-control-sm, .form-select-sm { font-size: 16px; }
  .surface { border-radius: 18px; }
  .page-head { margin: 1rem 0 .8rem; }
  .page-head h1 { font-size: 1.4rem; }
  .greet { margin-top: .9rem !important; }
  form.surface.p-4 { padding: 1.1rem !important; }

  /* documents: search on top, status chips scroll sideways, rows instead of a table */
  .doc-filter { padding: .75rem !important; gap: .6rem !important; }
  .doc-search { order: -1; width: 100%; margin-left: 0 !important; }
  .doc-search .form-control { border-radius: 999px; padding-left: 1rem; background: var(--sg-bg); }
  .doc-search .btn { border-radius: 999px; padding-inline: 1rem; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: calc(100% + 1.5rem); margin: 0 -.75rem; padding: 0 .75rem; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .btn { flex-shrink: 0; white-space: nowrap; border-radius: 999px; }

  /* document actions: full-width buttons, two per row */
  .page-actions { width: 100%; }
  .page-actions > * { flex: 1 1 40%; }
  .page-actions .btn { width: 100%; }
  .page-actions > .btn-gold { flex-basis: 100%; }

  /* forms: the submit bar sticks to the bottom */
  .form-actions { position: sticky; bottom: 0; z-index: 5; margin: 0 -1.1rem -1.1rem; padding: .75rem 1.1rem calc(.75rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--sg-line); border-radius: 0 0 18px 18px; }
  .form-actions .btn-gold { flex: 1; }

  /* login / register: navy header with SENSI, white sheet for the form */
  body.auth-page { background: var(--sg-navy-deep); }
  body.auth-page .auth-wrap { display: block; min-height: 0; padding: 0; max-width: none; }
  body.auth-page .auth-card { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  body.auth-page .auth-art { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.3rem 1.25rem 2.5rem;
    background: radial-gradient(circle at 85% 35%, rgba(240, 205, 110, .25), transparent 45%), linear-gradient(160deg, var(--sg-navy-deep), var(--sg-navy) 70%, var(--sg-navy-2)); }
  body.auth-page .auth-art h2 { font-size: 1.3rem; }
  body.auth-page .auth-art p { font-size: .88rem; }
  body.auth-page .auth-art img.mascot-glow { width: 108px; flex-shrink: 0; align-self: flex-end; margin-bottom: -1.9rem; position: relative; z-index: 1; }
  .greet .mascot-glow { width: 96px; margin-right: -.3rem; }
  body.auth-page .auth-form { position: relative; background: #fff; border-radius: 26px 26px 0 0; margin-top: -1.4rem; padding: 1.7rem 1.25rem 2rem; min-height: calc(100vh - 250px); }
  body.auth-page .sg-foot { display: none; }
  body.auth-page main > .sg-alerts { padding: 0 1rem; }
}

/* dialogs become bottom sheets on phones */
@media (max-width: 575.98px) {
  .modal-dialog, .modal-dialog-centered { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; max-width: none; min-height: 0; display: block; }
  .modal.fade .modal-dialog { transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  .modal.show .modal-dialog { transform: none; }
  .modal-content { border: 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal-content::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: #D5D9E2; margin: .55rem auto 0; }
  .modal-footer { flex-wrap: nowrap; }
  .modal-footer .btn { flex: 1; }
}

/* launched from the Home Screen */
@media (display-mode: standalone) {
  body.has-public .sg-foot { display: none; }
}

/* =====================================================================================================================
   Phase 2–3: plans & payments, template store, seller portal, platform admin, drag & drop field editor
   ===================================================================================================================== */
.side-nav { overflow-y: auto; min-height: 0; flex: 1 1 auto; margin-bottom: .8rem; scrollbar-width: thin; }
.side-label { color: rgba(255, 255, 255, .45); font-size: .72rem; letter-spacing: .08em; padding: .2rem .8rem .3rem; text-transform: uppercase; }
.sg-top .top-cart { color: var(--sg-navy); }
@media (min-width: 992px) { .sg-top .top-cart { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; } .sg-top .top-cart:hover { background: var(--sg-bg); } }
.min-w-0 { min-width: 0; }
.eyebrow { color: var(--sg-gold-2); letter-spacing: .25em; font-size: .78rem; font-weight: 700; }

/* meters & cards */
.meter { height: 8px; border-radius: 99px; background: #EEF0F4; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--sg-gold-metal); }
.plan-now { background: radial-gradient(circle at 90% 10%, rgba(240, 205, 110, .25), transparent 45%), linear-gradient(140deg, var(--sg-navy-deep), var(--sg-navy) 70%); color: #fff; }
.plan-now .small, .plan-now .text-muted { color: rgba(255, 255, 255, .75) !important; }
.plan-now-name { font-family: "Playfair Display", serif; font-size: 2rem; font-weight: 700; background: var(--sg-gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* plans */
.cycle-switch { display: inline-flex; gap: .2rem; padding: .25rem; border-radius: 999px; background: #fff; border: 1px solid var(--sg-line); margin: 0 auto 1.2rem; position: relative; left: 50%; transform: translateX(-50%); }
.cycle-switch button { border: 0; background: transparent; padding: .45rem 1.1rem; border-radius: 999px; font-weight: 600; color: var(--sg-navy); }
.cycle-switch button.is-on { background: var(--sg-navy); color: #fff; }
.cycle-switch .save { font-size: .72rem; color: var(--sg-gold-2); margin-left: .2rem; }
.cycle-switch button.is-on .save { color: #F0CF6E; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.plan { padding: 1.5rem 1.3rem; display: flex; flex-direction: column; position: relative; }
.plan h3 { font-size: 1.35rem; margin: 0; }
.plan-tag { color: var(--sg-muted); font-size: .86rem; min-height: 2.6em; margin: .3rem 0 .6rem; }
.plan-price span { font-family: "Playfair Display", serif; font-size: 2.1rem; font-weight: 700; color: var(--sg-navy); }
.plan-price small { color: var(--sg-muted); }
.plan-list { list-style: none; padding: 0; margin: 1rem 0 1.3rem; font-size: .9rem; flex: 1; }
.plan-list li { padding: .3rem 0 .3rem 1.4rem; position: relative; }
.plan-list li::before { content: "✓"; position: absolute; left: 0; color: var(--sg-gold-2); font-weight: 800; }
.plan.is-popular { border: 2px solid #E2BE5A; box-shadow: 0 0 0 4px rgba(226, 190, 90, .15), var(--sg-shadow); }
.plan.is-current { outline: 2px dashed var(--sg-navy-3); outline-offset: 3px; }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--sg-gold-metal); color: var(--sg-navy-deep); font-size: .75rem; font-weight: 700; padding: .2rem .8rem; border-radius: 999px; white-space: nowrap; }
@media (max-width: 1199.98px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .plans { grid-template-columns: 1fr; } }

/* payment & invoice */
.pay-amount { font-family: "Playfair Display", serif; font-size: 2.6rem; font-weight: 700; color: var(--sg-navy); }
.pay-qr { width: 260px; max-width: 100%; border-radius: 12px; border: 1px solid var(--sg-line); padding: .5rem; background: #fff; }
.invoice .table tfoot td { border: 0; padding-top: .25rem; padding-bottom: .25rem; }
@media print {
  .sg-side, .sg-top, .sg-tabbar, .sg-nav, .sg-foot, .d-print-none, .nav-progress { display: none !important; }
  body.has-shell { padding-left: 0 !important; background: #fff; }
  .surface { box-shadow: none; border: 0; }
}

/* store */
.store-hero { display: flex; align-items: center; gap: 1.5rem; padding: 1.6rem 1.8rem; margin-top: 1rem; border-radius: var(--sg-radius); color: #fff;
  background: radial-gradient(circle at 85% 40%, rgba(240, 205, 110, .28), transparent 40%), linear-gradient(120deg, var(--sg-navy-deep), var(--sg-navy) 60%, var(--sg-navy-3)); }
.store-hero > div { flex: 1; min-width: 0; }
.store-hero h1 { color: #fff; font-size: 1.9rem; margin: .3rem 0; }
.store-hero p { color: rgba(255, 255, 255, .8); margin-bottom: 1rem; }
.store-hero .eyebrow { color: #F0CF6E; }
.store-hero img { width: 140px; flex-shrink: 0; margin-bottom: -1.6rem; align-self: flex-end; }
.store-search { display: flex; gap: .5rem; max-width: 560px; }
.store-search .form-control { border-radius: 999px; padding-left: 1.1rem; }
.store-search .btn { border-radius: 999px; padding-inline: 1.3rem; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.tpl-card { display: flex; flex-direction: column; gap: .45rem; padding: 1.1rem; text-decoration: none; color: var(--sg-ink); transition: transform .15s, box-shadow .15s; min-height: 220px; }
.tpl-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(6, 18, 48, .4); color: var(--sg-ink); }
.tpl-card b { color: var(--sg-navy); font-size: 1.05rem; line-height: 1.35; }
.tpl-card.is-off { opacity: .7; }
.tpl-cat { align-self: flex-start; font-size: .72rem; font-weight: 600; color: var(--sg-gold-2); background: var(--sg-gold-soft); border-radius: 999px; padding: .15rem .6rem; }
.tpl-doc { display: flex; align-items: center; gap: .4rem; color: var(--sg-navy-3); }
.tpl-doc small { color: var(--sg-muted); }
.tpl-sum { color: var(--sg-muted); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .8rem; color: var(--sg-muted); }
.tpl-price { font-weight: 700; color: var(--sg-navy); font-size: 1rem; white-space: nowrap; }
.tpl-desc { white-space: pre-line; }
/* Seller-written text can hold very long words or links: wrap them instead of widening the page. */
.tpl-card b, .tpl-sum, .tpl-desc, .td-title, .td-summary, .td-list, .license b, .store-count { overflow-wrap: anywhere; }
.preview-box { overflow: hidden; }

/* store: filters + grid */
.store-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: 1.25rem; }
.store-main { min-width: 0; }
@media (min-width: 992px) {
  .store-filters { position: sticky; top: 84px; }
  .store-filters .offcanvas-body { padding: 0; }
}
.sf-box { padding: 1rem 1.1rem; }
.sf-group { padding-bottom: .9rem; margin-bottom: .9rem; border-bottom: 1px solid var(--sg-line); }
.sf-title { font-family: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sg-muted); margin-bottom: .55rem; }
.sf-link { display: block; padding: .32rem .6rem; margin: 0 -.6rem; border-radius: 10px; color: var(--sg-ink); text-decoration: none; font-size: .9rem; }
.sf-link:hover { background: var(--sg-bg); color: var(--sg-navy); }
.sf-link.is-on { background: var(--sg-navy); color: #fff; font-weight: 600; }
.sf-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.sf-pill { font-size: .8rem; padding: .25rem .65rem; border: 1px solid var(--sg-line); border-radius: 999px; color: var(--sg-ink); text-decoration: none; background: #fff; }
.sf-pill:hover { border-color: var(--sg-navy-3); }
.sf-pill.is-on { background: var(--sg-navy); border-color: var(--sg-navy); color: #fff; }
.sf-range { display: flex; align-items: center; gap: .4rem; }
.sf-range span { color: var(--sg-muted); }
.store-filters .form-check { font-size: .9rem; margin-bottom: .25rem; }
.store-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.store-count { color: var(--sg-muted); font-size: .92rem; }
.store-count b { color: var(--sg-navy); }
.ico-sm { width: 16px; height: 16px; vertical-align: -3px; }
.badge-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.bf { font-size: .82rem; font-weight: 600; padding: .3rem .8rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--sg-line); background: #fff; color: var(--sg-ink); transition: background .15s, border-color .15s; }
.bf:hover { border-color: var(--sg-navy-3); color: var(--sg-navy); }
.bf.is-on { color: #fff; border-color: transparent; }
.bf-featured.is-on { background: linear-gradient(135deg, var(--sg-gold-3), var(--sg-gold-2)); color: var(--sg-navy-deep); }
.bf-bestseller.is-on { background: var(--sg-wait); }
.bf-new.is-on { background: var(--sg-ok); }
.bf-verified.is-on { background: var(--sg-info); }
.bf-free.is-on { background: #0F766E; }
.active-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.af { font-size: .8rem; padding: .2rem .4rem .2rem .7rem; border-radius: 999px; background: var(--sg-info-bg); color: var(--sg-navy); text-decoration: none; }
.af span { display: inline-block; margin-left: .25rem; padding: 0 .35rem; border-radius: 50%; font-weight: 700; }
.af:hover span { background: rgba(6, 18, 48, .12); }

/* badges */
.tb-row { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.tb { display: inline-flex; align-items: center; gap: .2rem; font-size: .7rem; font-weight: 700; line-height: 1; padding: .3rem .55rem; border-radius: 999px; white-space: nowrap; }
.tb .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.tb-featured { background: var(--sg-gold-metal); color: var(--sg-navy-deep); box-shadow: 0 0 0 1px rgba(184, 149, 42, .35); }
.tb-featured .ico { fill: currentColor; stroke: none; }
.tb-best { background: var(--sg-wait-bg); color: var(--sg-wait); }
.tb-best .ico { fill: currentColor; stroke: none; }
.tb-new { background: var(--sg-ok-bg); color: var(--sg-ok); }
.tb-free { background: #CCFBF1; color: #0F766E; }
.tb-verified { background: var(--sg-info-bg); color: var(--sg-info); }

/* store cards */
.store-card { padding: 0; overflow: hidden; gap: 0; min-height: 0; }
.store-card.is-featured { box-shadow: 0 0 0 2px rgba(212, 175, 55, .55), var(--sg-shadow); }
.tpl-thumb { position: relative; display: flex; align-items: flex-end; justify-content: space-between; height: 118px; padding: .7rem .8rem;
  background: radial-gradient(circle at 80% 20%, rgba(240, 205, 110, .3), transparent 45%), linear-gradient(135deg, var(--sg-navy-deep), var(--sg-navy-3)); }
.tpl-paper { position: absolute; left: 22px; top: 16px; transform: rotate(-4deg); width: 74px; height: 96px; background: #fff; border-radius: 4px;
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .5); padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.tpl-paper i { display: block; height: 4px; border-radius: 2px; background: #D5D9E2; }
.tpl-paper i:first-child { width: 70%; background: var(--sg-navy-3); }
.tpl-paper i.short { width: 55%; }
.tpl-paper em { margin-top: auto; width: 40px; height: 8px; border-bottom: 2px solid var(--sg-gold); }
.tpl-paper { transition: transform .2s; }
.store-card:hover .tpl-paper { transform: rotate(0deg) translateY(-3px); }
.tpl-facts { position: relative; display: flex; gap: .3rem; margin-left: auto; }
.tpl-facts span { font-size: .68rem; color: #fff; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: .15rem .5rem; backdrop-filter: blur(2px); }
.tpl-body { display: flex; flex-direction: column; gap: .4rem; padding: .9rem 1rem 1rem; flex: 1; }
.tpl-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-card .tpl-sum { -webkit-line-clamp: 2; }
.tpl-seller { font-size: .8rem; color: var(--sg-ink); display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.tpl-verified { width: 15px; height: 15px; color: var(--sg-info); stroke-width: 2.2; }
.store-card .tpl-foot { align-items: center; padding-top: .5rem; border-top: 1px dashed var(--sg-line); }
.store-card .tpl-cat { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* template details */
.tpl-detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "head buy" "main buy"; column-gap: 1.5rem; row-gap: 1rem; }
.td-head { grid-area: head; min-width: 0; }
.td-main { grid-area: main; min-width: 0; }
.td-buy { grid-area: buy; min-width: 0; align-self: start; position: sticky; top: 84px; }
.td-buy .buy-box { position: static; }
.td-title { margin: .5rem 0 .3rem; font-size: 2rem; }
.td-summary { font-size: 1.08rem; color: var(--sg-muted); margin-bottom: .9rem; }
.td-seller { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.td-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--sg-gold-3); background: var(--sg-navy); flex-shrink: 0; }
.td-facts { display: flex; flex-wrap: wrap; gap: .4rem; }
.td-facts span { font-size: .8rem; color: var(--sg-muted); background: #fff; border: 1px solid var(--sg-line); border-radius: 999px; padding: .25rem .7rem; }
.td-facts b { color: var(--sg-navy); }
.td-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.td-list { font-size: .9rem; padding-left: 1.2rem; }
.td-list li { margin-bottom: .2rem; }
.td-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.td-tag { font-size: .8rem; color: var(--sg-navy-3); background: var(--sg-info-bg); border-radius: 999px; padding: .2rem .65rem; text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 991.98px) {
  .store-layout { grid-template-columns: minmax(0, 1fr); margin-top: .25rem; }
  .tpl-detail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "buy" "main"; }
  .td-buy { position: static; }
}
@media (max-width: 575.98px) {
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .td-title { font-size: 1.5rem; }
  .td-cols { grid-template-columns: minmax(0, 1fr); }
  .tpl-thumb { height: 104px; }
}
.preview-box .pdf-frame { border-radius: 0; height: 70vh; }
.buy-box { position: sticky; top: 84px; }
.license { border: 1px solid var(--sg-line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .6rem; background: #fff; }
.license.is-off { opacity: .65; }
.license summary { cursor: pointer; list-style: none; }
.license summary::-webkit-details-marker { display: none; }
.license-price { font-family: "Playfair Display", serif; font-weight: 700; font-size: 1.25rem; color: var(--sg-navy); white-space: nowrap; }
.summary-box { position: sticky; top: 84px; }
@media (max-width: 767.98px) {
  .store-hero { padding: 1.2rem; }
  .store-hero h1 { font-size: 1.4rem; }
  .buy-box, .summary-box { position: static; }
}

/* drag & drop field editor */
.fe-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 1rem; align-items: start; }
.fe-side { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.fe-stage { min-width: 0; }
.fe-pages { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1rem; background: #E3E6EE; border-radius: var(--sg-radius); min-height: 300px; overflow-x: auto; }
.fe-page { position: relative; background: #fff; box-shadow: 0 6px 20px -10px rgba(6, 18, 48, .45); flex-shrink: 0; touch-action: pan-y; }
.fe-page canvas { width: 100%; height: 100%; display: block; }
.fe-page-no { font-size: .75rem; color: var(--sg-muted); margin-top: .6rem; }
.fe-box { position: absolute; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 4px; cursor: move; touch-action: none; user-select: none; display: flex; align-items: center; overflow: hidden; }
.fe-box.is-sign { border-style: dashed; }
.fe-box span { font-size: 11px; font-weight: 600; color: var(--c); padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.fe-box.is-selected { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); z-index: 2; }
.fe-resize { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; background: var(--c); border-radius: 3px 0 2px 0; cursor: nwse-resize; touch-action: none; }
.fe-h { font-size: .78rem; font-weight: 700; color: var(--sg-navy); margin: .2rem 0 .5rem; }
.fe-parties { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.fe-party { border: 2px solid var(--c); background: #fff; color: var(--c); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; font-weight: 600; }
.fe-party.is-on { background: var(--c); color: #fff; }
.fe-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-bottom: .8rem; }
.fe-item { border: 1.5px dashed var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); border-radius: 10px; padding: .45rem .5rem; font-size: .82rem; font-weight: 600; text-align: left; cursor: grab; touch-action: none; }
.fe-item:active { cursor: grabbing; }
.fe-ghost { position: fixed; z-index: 3000; pointer-events: none; transform: translate(-50%, -50%); border: 2px dashed var(--c); color: var(--c); background: #fff; padding: .4rem .8rem; border-radius: 6px; font-size: .8rem; font-weight: 600; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4); }
body.fe-armed .fe-page { cursor: crosshair; outline: 2px dashed var(--sg-gold); outline-offset: 2px; }
.fe-tip { font-size: .76rem; color: var(--sg-muted); margin: 0; }
.fe-roles { margin-bottom: .4rem; }
.fe-role { display: grid; grid-template-columns: 10px 1fr 54px 20px; gap: .35rem; align-items: center; margin-bottom: .35rem; }
.fe-role i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.fe-actions { position: sticky; bottom: -1rem; background: #fff; padding-top: .6rem; margin-top: .6rem; border-top: 1px solid var(--sg-line); }
@media (max-width: 991.98px) {
  .fe-layout { grid-template-columns: 1fr; }
  .fe-side { position: static; max-height: none; order: 0; }
  .fe-pages { padding: .5rem; }
  .fe-actions { position: sticky; bottom: 0; margin: .6rem -1rem -1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); z-index: 5; }
}

/* ---------- back office ---------- */
.bo-head { display: flex; align-items: center; gap: .6rem; margin: -.4rem 0 .6rem; }
.bo-badge { background: var(--sg-navy); color: #F0CF6E; font-size: .72rem; font-weight: 700; letter-spacing: .04em; border-radius: 999px; padding: .2rem .7rem; }
.todo-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
.todo { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; text-decoration: none; color: var(--sg-muted); font-size: .82rem; }
.todo b { font-family: "Playfair Display", serif; font-size: 1.8rem; color: var(--sg-navy); line-height: 1.1; }
.todo.is-hot { border-color: #E2BE5A; box-shadow: 0 0 0 3px rgba(226, 190, 90, .18), var(--sg-shadow); }
.todo.is-hot b { color: var(--sg-wait); }
@media (max-width: 1199.98px) { .todo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: .6rem; padding: .3rem 0; font-size: .85rem; color: var(--sg-ink); text-decoration: none; }
.bar-row b { text-align: right; }
.plan-admin summary { cursor: pointer; list-style: none; }
.plan-admin summary::-webkit-details-marker { display: none; }
.bank-box { background: var(--sg-gold-soft); border: 1px dashed var(--sg-gold); border-radius: 12px; padding: .6rem .8rem; }
.type-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.type-option { position: relative; }
.type-option input { position: absolute; opacity: 0; }
.type-option span { display: block; text-align: center; border: 1.5px solid var(--sg-line); border-radius: 12px; padding: .55rem .4rem; font-size: .86rem; font-weight: 600; color: var(--sg-navy); cursor: pointer; }
.type-option input:checked + span { border-color: var(--sg-gold); background: var(--sg-gold-soft); box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }
.type-option input:focus-visible + span { outline: 3px solid var(--sg-gold); outline-offset: 2px; }

/* ---------- plan features, storage, feature switches ---------- */
.plan-list li.is-off { color: #9aa3b5; text-decoration: line-through; }
.plan-list li.is-off::before { content: "✕"; color: #c4cad6; }
.plan.is-unavailable { opacity: .55; }
.plan-price-for small { font-size: .8rem; }
.plan-form-head { font-size: .78rem; font-weight: 700; color: var(--sg-navy); border-top: 1px dashed var(--sg-line); padding-top: .6rem; margin-top: .3rem; }
.feature-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem 1rem; padding: .6rem .8rem; border: 1px solid var(--sg-line); border-radius: .6rem; }
.feature-checks input:disabled + * , .feature-checks input:disabled { cursor: not-allowed; }
.feature-rows { list-style: none; padding: 0; margin: 0; }
.feature-rows li { display: grid; grid-template-columns: 1fr auto 150px; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--sg-line); }
.feature-rows li:last-child { border-bottom: 0; }
.feature-state { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .5rem 1.2rem; }
.feature-state li { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; }
.feature-state .dot { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; margin-top: .1rem; }
.feature-state .is-on .dot { background: #e5f6ec; color: #1c8a4a; }
.feature-state .is-off .dot { background: #f2f3f6; color: #9aa3b5; }
.feature-state .is-off b { color: #7b8496; }
.feature-switch .form-control { min-width: 220px; }
@media (max-width: 575.98px) {
    .feature-rows li { grid-template-columns: 1fr auto; }
    .feature-rows li select { grid-column: 1 / -1; }
    .feature-switch { width: 100%; }
    .feature-switch .form-control { min-width: 0; }
}
.meter.is-full span { background: #d64545; }

/* ---------- desktop sidebar: collapse to icons (state kept in localStorage, applied before paint) ---------- */
.sg-side, .sg-top, body.has-shell { transition: width .22s ease, padding-left .22s ease, left .22s ease; }
.side-toggle { display: none; width: 38px; height: 38px; border: 1px solid var(--sg-line); border-radius: 11px; background: #fff; color: var(--sg-navy); place-items: center; flex: none; }
.side-toggle:hover { background: var(--sg-bg); }
.side-toggle .ico { width: 20px; height: 20px; transition: transform .22s ease; }
.side-nav a > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 992px) {
  .side-toggle { display: grid; }
  html.side-collapsed { --side-w: 78px; }
  html.side-collapsed .side-toggle .ico { transform: scaleX(-1); }
  html.side-collapsed .sg-side { padding-left: .7rem; padding-right: .7rem; }
  html.side-collapsed .sg-side .sg-brand { justify-content: center; }
  html.side-collapsed .sg-side .sg-brand span,
  html.side-collapsed .side-nav a > span,
  html.side-collapsed .side-label,
  html.side-collapsed .side-mascot div { display: none; }
  html.side-collapsed .side-nav a { justify-content: center; padding: .7rem 0; position: relative; }
  html.side-collapsed .side-nav a.active { box-shadow: inset 3px 0 0 #F0CF6E; }
  html.side-collapsed .side-sep { margin: .55rem .2rem; }
  html.side-collapsed .side-mascot { justify-content: center; padding: .4rem; }
  html.side-collapsed .side-mascot img.mascot-glow { width: 42px; margin: -6px 0 -2px; }
  /* hover label when collapsed */
  html.side-collapsed .side-nav a::after { content: attr(data-label); position: fixed; left: calc(var(--side-w) - 4px); background: var(--sg-navy); color: #fff; font-size: .82rem; padding: .35rem .6rem; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; box-shadow: var(--sg-shadow); border: 1px solid rgba(232, 199, 100, .35); }
  html.side-collapsed .side-nav a:hover::after { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .sg-side, .sg-top, body.has-shell, .side-toggle .ico { transition: none; } }

/* ---------- two-column forms (wide screens); one column below 1200px ---------- */
.form-cols { --bs-gutter-x: 2.5rem; --bs-gutter-y: 1.25rem; }
.form-cols > [class*="col-"] > h2:first-child, .form-cols > [class*="col-"] > .form-section-title:first-child { margin-top: 0; }
@media (min-width: 1200px) {
  .form-cols > [class*="col-"] + [class*="col-"] { border-left: 1px dashed var(--sg-line); }
}
.form-section-title { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; margin-bottom: .9rem; }
.form-section-title .num { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; background: var(--sg-navy); color: #F0CF6E; flex: none; font-family: "Inter", sans-serif; }
.form-note { background: var(--sg-bg); border: 1px solid var(--sg-line); border-radius: 12px; padding: .8rem 1rem; font-size: .88rem; color: var(--sg-muted); }
.form-cols .form-actions { border-top: 1px solid var(--sg-line); padding-top: 1rem; margin-top: .5rem; }

/* legal pages, footer links, the essential-cookies notice */
.sg-foot-legal { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--sg-line); }
.sg-foot-legal a { color: var(--sg-muted); }
.cookie-note { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1080; max-width: 640px; margin: 0 auto; display: flex; gap: .8rem; align-items: center;
  background: #0F1B3D; color: #fff; padding: .75rem 1rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(15, 27, 61, .25); font-size: .9rem; }
.cookie-note[hidden] { display: none; }
.cookie-note a { color: var(--sg-gold); }
@media (max-width: 991.98px) { .cookie-note { bottom: calc(4.6rem + env(safe-area-inset-bottom)); } }
.legal-doc { max-width: 860px; margin: 0 auto; line-height: 1.8; }
.legal-doc h2 { font-size: 1.2rem; margin-top: 1.8rem; }
.legal-doc h3 { font-size: 1.05rem; margin-top: 1.3rem; }
.legal-doc table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .92rem; }
.legal-doc th, .legal-doc td { border: 1px solid var(--sg-line); padding: .45rem .6rem; vertical-align: top; }
.legal-doc th { background: #F5F7FB; }
.legal-scroll { max-height: 46vh; overflow: auto; border: 1px solid var(--sg-line); border-radius: 12px; padding: 1rem 1.2rem; background: #fff; }
.legal-editor { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; min-height: 60vh; }

/* field editor: tick boxes and the sender's own text (shown as it will be printed) */
.fe-box.is-check { justify-content: center; border-radius: 2px; border-width: 1.5px; }
.fe-box.is-check span { padding: 0; font-size: 12px; line-height: 1; }
.fe-box.is-sender { border-style: dotted; background: color-mix(in srgb, var(--c) 6%, transparent); }
.fe-box.is-sender:not(.is-check) span { font-weight: 400; color: #111827; }
.sign-inputs { border: 1px solid var(--sg-line); border-radius: 12px; padding: .8rem .9rem; background: #F8FAFD; }

/* language switch (ไทย / EN) */
.sg-lang { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 2rem; padding: 0 .6rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .45); color: #fff; font-size: .8rem; font-weight: 600; text-decoration: none; margin-right: .5rem; }
.sg-lang:hover { background: rgba(255, 255, 255, .12); color: var(--sg-gold); }

/* departments & who sees a document */
.access-picker .ap-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.ap-opt { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--sg-line); border-radius: 12px; cursor: pointer; background: #fff; }
.ap-opt:has(input:checked) { border-color: var(--sg-navy-3); box-shadow: 0 0 0 2px rgba(19, 41, 92, .12); }
.ap-opt input { margin-top: .2rem; flex-shrink: 0; }
.ap-opt b { display: block; color: var(--sg-navy); }
.ap-opt small { color: var(--sg-muted); }
.ap-custom { margin-top: .75rem; padding: .75rem; border-radius: 12px; background: var(--sg-bg); }
.ap-label { font-size: .78rem; font-weight: 700; color: var(--sg-muted); margin: .25rem 0 .4rem; }
.ap-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.ap-chips .btn { border-radius: 999px; }
.ap-people { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: .15rem; margin-bottom: .4rem; }
.ap-person { display: flex; align-items: center; gap: .55rem; padding: .35rem .45rem; border-radius: 10px; cursor: pointer; background: #fff; min-width: 0; }
.ap-person:has(input:checked) { background: var(--sg-info-bg); }
.ap-person > span:last-child { min-width: 0; }
.ap-person b, .ap-person small { display: block; overflow-wrap: anywhere; }
.ap-person small { color: var(--sg-muted); font-size: .75rem; }
.ap-person .m-avatar { width: 28px; height: 28px; font-size: .8rem; flex-shrink: 0; }
.access-summary { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.ap-tag { font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; background: var(--sg-info-bg); color: var(--sg-navy); overflow-wrap: anywhere; }
.doc-lock { font-size: .75rem; margin-left: .35rem; opacity: .75; }
.dep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.dep-card { border: 1px solid var(--sg-line); border-radius: 14px; padding: .8rem .9rem; background: #fff; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.dep-name { color: var(--sg-navy); overflow-wrap: anywhere; }
.dep-members { display: flex; flex-wrap: wrap; gap: .3rem; }
.dep-chip { font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; background: var(--sg-bg); overflow-wrap: anywhere; }
.dep-chip.is-head { background: var(--sg-gold-soft); color: var(--sg-gold-2); font-weight: 600; }
.dep-actions { display: flex; gap: 1rem; margin-top: auto; }
.dep-empty { padding: 1rem; text-align: center; color: var(--sg-muted); border: 1px dashed var(--sg-line); border-radius: 12px; }
.dep-default { padding-top: .8rem; border-top: 1px solid var(--sg-line); }
.dep-pick { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.dep-pick li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: 10px; }
.dep-pick li:has([data-dep-member]:checked) { background: var(--sg-info-bg); }
.dep-pick-who { display: flex; gap: .55rem; align-items: center; cursor: pointer; min-width: 0; flex: 1; }
.dep-pick-who b, .dep-pick-who small { display: block; overflow-wrap: anywhere; }
.dep-pick-who small { color: var(--sg-muted); font-size: .75rem; }
.dep-pick-head { display: flex; gap: .3rem; align-items: center; font-size: .82rem; white-space: nowrap; cursor: pointer; }
@media (max-width: 575.98px) {
  .access-picker .ap-choice { grid-template-columns: minmax(0, 1fr); }
}
