:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e4e7ee;
  --text: #131722;
  --muted: #626b80;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --accent: #06b6d4;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
header.site .inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; display: block;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.logo-word { letter-spacing: -.01em; }
.logo-word em { font-style: normal; color: var(--brand); }
nav.main { display: flex; gap: 20px; margin-left: auto; align-items: center; }
nav.main a { color: var(--muted); font-weight: 500; font-size: .95rem; }
nav.main a:hover { color: var(--text); text-decoration: none; }
nav.main a.active { color: var(--brand); font-weight: 600; }
nav.main a.active::after {
  content: ''; display: block; height: 2px; margin-top: 3px;
  border-radius: 2px; background: var(--brand);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  background: var(--brand); color: #fff; transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: #eef0f6; color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--danger); border-color: #f2c9c9; }
.btn.danger:hover { background: #fdecec; color: var(--danger); }
.btn.block { width: 100%; }

/* ---------- form controls ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=url], input[type=email], input[type=password],
input[type=tel], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
textarea { min-height: 96px; resize: vertical; }
input[type=color] { width: 100%; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .02em;
  background: #eef2ff; color: var(--brand-dark);
}
.badge.ok { background: #e7f7f0; color: var(--ok); }
.badge.off { background: #f1f3f7; color: var(--muted); }

/* ---------- hero + generator ---------- */
.hero { padding: 56px 0 28px; text-align: center; }
.hero p.lede { font-size: 1.12rem; color: var(--muted); max-width: 620px; margin: 0 auto; }

.generator { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; padding-bottom: 56px; }
.types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.type-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.type-btn:hover { border-color: #c9cede; color: var(--text); }
.type-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.preview { position: sticky; top: 88px; text-align: center; }
.preview-frame {
  background: #fff; border-radius: 12px; padding: 16px;
  border: 1px solid var(--border); display: grid; place-items: center; min-height: 260px;
}
.preview-frame img { width: 100%; max-width: 240px; image-rendering: pixelated; }
/* Square modules stay crisp when the browser shrinks them without smoothing.
   Shaped ones are curves, and the same setting turns them into a staircase, so
   a code with a shape style chosen is scaled the ordinary way instead. */
.preview-frame.smooth img { image-rendering: auto; }
/* Says what the code on screen is before it is saved: a real, scannable code
   that carries a "save this first" note instead of your content. */
.preview-tag {
  margin: 10px 0 0; font-size: .78rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
/* ---- shape picker ---- */
.shape-h { margin: 24px 0 4px; font-size: 1rem; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 14px; }
.swatch {
  aspect-ratio: 1; padding: 6px; cursor: pointer; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.swatch:hover:not(:disabled) { border-color: #c9cede; }
.swatch.on { border-color: var(--brand); background: #eef2ff; box-shadow: 0 0 0 2px rgba(79, 70, 229, .14); }
.swatch:disabled { opacity: .55; cursor: not-allowed; }
.swatch svg { width: 100%; height: 100%; display: block; }
/* The frame swatches are little pictures in the frame's own colour, so they are
   left with the fills they were drawn with; the shape glyphs take theirs here. */
.swatch:not(.frame-swatch) path { fill: var(--text); }
.swatch.on:not(.frame-swatch) path { fill: var(--brand-dark); }
/* The picker sits next to its checkbox rather than under it: unchecked, the
   pair reads as one control that is currently switched off. */
.opt-color-row { display: flex; align-items: center; gap: 8px; }
.opt-color-row input[type=checkbox] { width: 16px; height: 16px; flex: none; }
.opt-color-row input[type=color] { flex: 1; min-width: 0; }
/* Eight swatches in a row stop being legible on a phone. */
@media (max-width: 560px) { .swatches { grid-template-columns: repeat(4, 1fr); } }

/* ---- outer frame picker ---- */
/* There are more frames than fit a row and each one is a small picture rather
   than a glyph, so they scroll sideways instead of wrapping into a block that
   would push the rest of the form off the screen. */
.frame-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px;
  margin-bottom: 6px; scrollbar-width: thin;
}
.frame-swatch { flex: 0 0 62px; aspect-ratio: 24 / 30; padding: 7px; }
/* "No frame" is a cross rather than a picture, and follows the swatch's own
   selected state like the shape glyphs do. */
.frame-swatch svg { color: var(--text); }
.frame-swatch.on svg { color: var(--brand-dark); }
[data-frame-fields][hidden], [data-frame-color][hidden] { display: none; }

.check { display: flex; align-items: center; gap: 8px; font-size: .85rem; margin-top: 12px; }
.check input { width: 16px; height: 16px; }
.check .muted { font-weight: 400; }
.preview .err { color: var(--danger); font-size: .9rem; }
.dl { display: grid; gap: 8px; margin-top: 16px; }

.steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 28px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); font-weight: 600; }
.step i {
  width: 22px; height: 22px; border-radius: 50%; background: #e6e9f2; color: var(--muted);
  display: grid; place-items: center; font-size: .74rem; font-style: normal;
}
.step.on i { background: var(--brand); color: #fff; }
.step.on { color: var(--text); }
.step + .step::before { content: ""; width: 26px; height: 1px; background: var(--border); }

/* ---------- marketing sections ---------- */
section.band { padding: 56px 0; }
section.band.alt { background: #fff; border-block: 1px solid var(--border); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature .ico { font-size: 1.6rem; margin-bottom: 10px; }

/* ---------- pricing ---------- */
/* stretch, not start: every card is the height of the tallest one in the row, so
   the feature lists line up and the buttons sit on a single baseline. */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; height: 100%; }
/* the list absorbs the slack, so a shorter card pads in the middle and not below the button */
.plan ul { flex: 1 0 auto; }
.plan .btn.block { margin-top: auto; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12), var(--shadow); }
.plan .price { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 9px; }
.plan li { padding-left: 24px; position: relative; font-size: .94rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan .tag { position: absolute; top: -11px; right: 18px; }

/* ---------- table / dashboard ---------- */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
/* Sortable headers: the arrow is faint until the column is the active sort. */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sortable:focus-visible { color: var(--text); }
th.sortable.sorted { color: var(--text); }
.sort-ind { margin-left: 6px; font-size: .8em; opacity: .35; }
th.sortable.sorted .sort-ind { opacity: 1; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ---------- support tickets ---------- */
/* A ticket is a row that opens into its conversation, so the list and the
   thread are the same screen — a complaint and the answer to it belong
   together, and a separate page per ticket would only add a back button. */
.ticket + .ticket { border-top: 1px solid var(--border); }
.ticket-head { display: flex; align-items: center; gap: 12px; padding: 14px 4px; cursor: pointer; }
.ticket-head:hover { color: var(--brand); }
.ticket-head:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.ticket-body { padding: 4px 4px 18px; display: grid; gap: 10px; }
.msg {
  background: #f7f8fc; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; max-width: 46em;
}
/* Ours sits on the other side and in the brand tint, so a long thread reads as
   a conversation at a glance rather than a wall of identical boxes. */
.msg.from-staff { background: #eef0ff; border-color: #d9dcff; margin-left: auto; }
.reply textarea { width: 100%; }
/* A status change in the thread: something that happened to the ticket rather
   than something either side said, so it is a line and not a bubble. */
.ticket-body .event {
  font-size: .82rem; color: var(--muted); text-align: center; padding: 4px 8px;
  border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border);
}

/* ---------- account panel ---------- */
.account-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
}
.account .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.account .stat {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fbfcfe;
  display: flex; flex-direction: column; gap: 2px;
}
.account .stat .k { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.account .stat .v { font-size: 1.5rem; letter-spacing: -.02em; }
.account .stat .s { font-size: .82rem; color: var(--muted); }

/* ---------- list filters ---------- */
.toolbar {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: minmax(190px, 2fr) repeat(3, minmax(140px, 1fr)) minmax(100px, .7fr) auto;
  padding: 18px 20px;
}
.toolbar label.field { margin-bottom: 0; }
.toolbar input[type=search] {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.listbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.selall { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.selall input { width: 17px; height: 17px; accent-color: var(--brand); }
.pick { width: 17px; height: 17px; accent-color: var(--brand); }
tr.picked { background: #f7f8ff; }
.qr-thumb {
  width: 46px; height: 46px; display: block; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; padding: 2px;
}
#listCard { overflow-x: auto; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; font-size: .9rem; }
.pager[hidden] { display: none; }

@media (max-width: 880px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar label.field:first-child, .toolbar #fReset { grid-column: 1 / -1; }
}

/* ---------- modal ---------- */
@keyframes modal-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.modal-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 19, 30, .5);
  backdrop-filter: blur(6px) saturate(.9);
  -webkit-backdrop-filter: blur(6px) saturate(.9);
  display: grid; place-items: center; padding: 20px;
  animation: modal-fade .18s ease-out;
}
.modal-back[hidden] { display: none; }

.modal {
  position: relative; overflow: hidden;
  background: var(--surface); color: var(--text);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px; padding: 28px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px -12px rgba(16, 24, 40, .32), 0 8px 20px -8px rgba(16, 24, 40, .18);
  animation: modal-rise .24s cubic-bezier(.22, 1, .36, 1);
}
/* the brand hairline that tops every popup */
.modal::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.modal.danger::before { background: linear-gradient(90deg, var(--danger), #f97316); }
.modal.ok::before { background: linear-gradient(90deg, var(--ok), var(--accent)); }

.modal h3 { margin-bottom: 4px; font-size: 1.22rem; }
.modal > p.muted:first-of-type { margin-top: 0; }

/* header: optional round glyph, title block, dismiss button */
.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-head .modal-ico {
  flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: #eef2ff; color: var(--brand-dark);
}
.modal.danger .modal-head .modal-ico { background: #fdecec; color: var(--danger); }
.modal.ok .modal-head .modal-ico { background: #e7f7f0; color: var(--ok); }
.modal-head .modal-title { flex: 1; min-width: 0; }
.modal-head h3 { margin: 0 0 2px; }
.modal-head p { margin: 0; font-size: .9rem; color: var(--muted); }

.modal-x {
  flex: none; width: 32px; height: 32px; margin: -4px -6px 0 0;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 1.1rem; line-height: 1;
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.modal-x:hover { background: #eef0f6; color: var(--text); }
.modal-x:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* body scrolls on its own so the header and footer stay put on short screens */
.modal-body { max-height: min(58vh, 520px); overflow: auto; margin: 0 -6px; padding: 0 6px; }
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: #d8dce8; border-radius: 999px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: #c3c9da; }

.modal-text { font-size: .95rem; color: var(--muted); margin: 0; white-space: pre-line; }
.modal-text + .modal-text { margin-top: 10px; }
.modal-list {
  list-style: none; margin: 14px 0 0; padding: 14px 16px; display: grid; gap: 7px;
  background: #fbfcfe; border: 1px solid var(--border); border-radius: 12px; font-size: .9rem;
}
.modal-list li { display: flex; gap: 10px; }
.modal-list li b { flex: none; min-width: 96px; color: var(--muted); font-weight: 600; }
.modal-list li span { min-width: 0; overflow-wrap: anywhere; }

.modal-foot { display: flex; gap: 10px; margin-top: 20px; }
.modal-foot .btn { flex: 1; }
.modal-foot.stack { flex-direction: column; }
@media (max-width: 460px) {
  .modal { padding: 22px 18px; border-radius: 16px; }
  .modal-foot { flex-direction: column-reverse; }
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(19, 23, 34, .96); color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  padding: 12px 18px; border-radius: 12px; max-width: min(460px, calc(100vw - 32px));
  font-size: .9rem; z-index: 80;
  box-shadow: 0 14px 34px -10px rgba(16, 24, 40, .45);
  animation: toast-in .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast[hidden] { display: none; }
.toast::before {
  content: "✓"; flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem;
  background: var(--ok); color: #fff;
}
.toast.err { background: rgba(153, 27, 27, .97); }
.toast.err::before { content: "!"; background: #fff; color: var(--danger); font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .modal-back, .modal, .toast { animation: none; }
}

.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-top: 12px; }
.bars .bar { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }

footer.site { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: .9rem; background: #fff; }
footer.site .inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

@media (max-width: 880px) {
  .generator { grid-template-columns: 1fr; }
  .preview { position: static; }
  nav.main { gap: 12px; }
  nav.main a.hide-sm { display: none; }
}

/* ==================== small screens ==================== */

/* The hamburger only exists below the nav breakpoint. */
.nav-toggle { display: none; }

@media (max-width: 760px) {
  header.site .inner { gap: 12px; }
  .nav-toggle {
    display: grid; place-content: center; gap: 5px;
    margin-left: auto; width: 42px; height: 42px; flex: none;
    padding: 0; border: 1px solid var(--border); border-radius: 10px;
    background: #fff; cursor: pointer;
  }
  .nav-toggle span {
    display: block; width: 18px; height: 2px; border-radius: 2px;
    background: var(--text); transition: transform .18s, opacity .18s;
  }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* The panel drops out of the header rather than pushing the page down, so
     opening it never moves the content you were looking at. */
  nav.main {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 20px 16px;
    box-shadow: 0 14px 28px -18px rgba(16, 24, 40, .4);
  }
  nav.main.open { display: flex; }
  nav.main a, nav.main a.hide-sm { display: block; padding: 11px 4px; font-size: 1rem; }
  nav.main a.active::after { display: none; }
  nav.main a.active { color: var(--brand); }
  nav.main .btn { width: 100%; padding: 11px 16px; font-size: .95rem; margin-top: 4px; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 36px 0 20px; }
  section.band { padding: 40px 0; }
  .card { padding: 18px 16px; }
  .modal-back { padding: 12px; }

  /* Two-up fields are unreadable at phone width; every field takes the row. */
  .row { grid-template-columns: 1fr; }

  .steps { gap: 6px 12px; }
  .step + .step::before { display: none; }

  .type-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .type-card { padding: 14px 8px; }
  .type-card .ico { width: 38px; height: 38px; font-size: 1.15rem; }

  /* Filters stack; search and the reset button each take the full width. */
  .toolbar { grid-template-columns: 1fr; padding: 14px 16px; }

  /* Comfortable targets for a thumb, and room for a long email or URL. */
  .btn { padding: 11px 18px; }
  .btn.sm { padding: 8px 12px; }
  .msg { max-width: 100%; }
  .modal-list li { flex-direction: column; gap: 2px; }
  .modal-list li b { min-width: 0; }
  footer.site .inner { flex-direction: column; gap: 8px; }
}

/* ---------- dashboard list as cards ----------
   A seven-column table on a phone is either a sideways scroll or unreadable
   type, so below this width each row becomes a stacked card: the header row is
   dropped and every cell carries its own label from data-label. */
@media (max-width: 760px) {
  #listCard { overflow-x: visible; }
  /* Each row is its own card, so the panel around them would only be a second
     border drawn around the first. */
  #listCard:has(.cards) { padding: 0; background: none; border: 0; box-shadow: none; }
  .cards thead { display: none; }
  .cards, .cards tbody, .cards tr, .cards td { display: block; width: 100%; }
  .cards tr {
    position: relative; border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 12px 12px 68px; margin-bottom: 12px; background: #fff;
  }
  .cards tr.picked { background: #f7f8ff; }
  .cards td { border: 0; padding: 3px 0; overflow-wrap: anywhere; }
  .cards td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700;
  }
  /* Checkbox and thumbnail pin to the gutter the padding above reserves. */
  .cards td.c-pick { position: absolute; top: 12px; left: 12px; padding: 0; }
  .cards td.c-thumb { position: absolute; top: 40px; left: 12px; padding: 0; }
  .cards .pick { width: 20px; height: 20px; }
  .cards td.actions {
    display: flex; flex-wrap: wrap; gap: 8px;
    text-align: left; white-space: normal; margin-top: 10px;
  }
  .cards td.actions .btn { flex: 1; min-width: 92px; }
}

/* The grids and panels below set their own display, which outranks the plain
   [hidden] rule — so hiding one has to say so louder. */
[hidden] { display: none !important; }

/* ---------- type picker grid ---------- */
.type-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.type-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 12px; text-align: center; cursor: pointer; font: inherit; color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s, box-shadow .15s, transform .1s;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.type-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.type-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }
.type-card .ico {
  width: 46px; height: 46px; border-radius: 50%; background: #eef2ff;
  display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 6px;
}
.type-card .nm { font-weight: 700; font-size: .97rem; }
.type-card .bl { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.type-card .pro {
  position: absolute; top: 8px; right: 8px; font-size: .62rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark);
  background: #eef2ff; border-radius: 999px; padding: 2px 7px;
}
.type-groups { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* Static / Dynamic sits above the groups and reads as the bigger choice. */
.mode-tabs { display: flex; gap: 6px; margin-bottom: 18px; padding: 4px; border-radius: 12px;
  background: #f1f3f7; width: fit-content; }
.mode-tab {
  padding: 8px 22px; border-radius: 9px; border: 0; background: transparent;
  font: inherit; font-size: .95rem; font-weight: 700; color: var(--muted); cursor: pointer;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

/* Nothing to click yet, so the card drops the hover lift and the pointer. */
.type-card.soon { cursor: default; opacity: .72; }
.type-card.soon:hover { border-color: var(--border); transform: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.type-card .soon-tag {
  margin-top: 8px; font-size: .68rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand-dark);
  background: #eef2ff; border-radius: 999px; padding: 3px 9px;
}

/* ---------- repeaters & file inputs ---------- */
.repeat { margin-bottom: 16px; }
.repeat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.repeat-head span { font-size: .82rem; font-weight: 600; color: var(--muted); }
.repeat-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: #fbfcfe; }
.repeat-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: .85rem; }
.repeat-item .repeat-item { background: #fff; }
input[type=file] { width: 100%; font-size: .9rem; padding: 9px; border: 1px dashed var(--border); border-radius: 10px; background: #fff; }
.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

.logo-status { display: flex; align-items: center; gap: 10px; font-size: .85rem; margin-top: 6px; }
.logo-thumb {
  width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; background: #fff;
}

.notice {
  background: #eef2ff; border: 1px solid #d9dffb; color: var(--brand-dark);
  border-radius: 12px; padding: 14px 16px; font-size: .9rem; margin-bottom: 16px;
}
.notice b { display: block; margin-bottom: 2px; }

/* Single sign-on buttons, above the email form in the auth modal. */
.sso { margin-bottom: 4px; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.sso-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  font-weight: 700; font-size: .8rem; color: var(--brand-dark);
}
.sso-or {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 6px; color: var(--muted); font-size: .8rem;
}
.sso-or::before, .sso-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
