:root {
  --bg: #f2f6f3;
  --surface: #ffffff;
  --surface-2: #e7eef0;
  --ink: #171a18;
  --muted: #66706b;
  --line: #d5ded8;
  --accent: #2f6f55;
  --accent-2: #b4553b;
  --accent-3: #2e6f96;
  --danger: #a53d3d;
  --ok: #27694c;
  --warn: #96651e;
  --shadow: 0 18px 44px rgba(31, 33, 29, .08);
  --shadow-soft: 0 8px 24px rgba(31, 33, 29, .06);
  --shadow-lift: 0 10px 28px rgba(31, 33, 29, .08);
  --focus-ring: rgba(46, 111, 150, .24);
  --accent-ring: rgba(47, 111, 85, .14);
  --active-border: rgba(47, 111, 85, .38);
  --radius: 8px;
  --body-background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,0) 360px),
    repeating-linear-gradient(90deg, rgba(23,26,24,.018) 0 1px, transparent 1px 68px),
    linear-gradient(135deg, rgba(46,111,150,.08), rgba(180,85,59,.05) 48%, rgba(47,111,85,.08)),
    var(--bg);
  --header-bg: rgba(242, 246, 243, .92);
  --hairline: rgba(23, 26, 24, .1);
  --hairline-soft: rgba(23, 26, 24, .08);
  --panel-bg: rgba(255, 255, 255, .93);
  --panel-soft: rgba(255, 255, 255, .72);
  --panel-solid: #fbfdf9;
  --hero-panel-bg: linear-gradient(150deg, rgba(255,255,255,.94), rgba(239,247,244,.9)), var(--surface);
  --preview-panel-bg: linear-gradient(180deg, rgba(255,255,255,.96), rgba(239,247,244,.92)), var(--surface);
  --soft-accent-bg: rgba(47, 111, 85, .08);
  --soft-blue-bg: rgba(46, 111, 150, .075);
  --info-bg: rgba(46, 111, 150, .065);
  --input-bg: #fbfdf9;
  --input-border: #c9d6d0;
  --button-border: #ccd8d2;
  --label: #38413d;
  --chip-ink: #394742;
  --pill-ink: #244d3f;
  --blue-ink: #285269;
  --active-ink: #103426;
  --selected-muted: #49625a;
  --on-primary: #ffffff;
  --input-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  --page-gutter: clamp(16px, 4vw, 48px);
  --panel-pad: clamp(20px, 2.2vw, 28px);
  --grid-gap: clamp(20px, 2.2vw, 28px);
  --card-gap: clamp(18px, 1.8vw, 22px);
  --section-gap: clamp(26px, 3vw, 34px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1513;
  --surface: #151d1a;
  --surface-2: #202b27;
  --ink: #eef5ef;
  --muted: #a4b2aa;
  --line: #34433c;
  --danger: #ef8b86;
  --ok: #78d9a6;
  --warn: #e5b56f;
  --shadow: 0 18px 44px rgba(0, 0, 0, .38);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .28);
  --shadow-lift: 0 10px 30px rgba(0, 0, 0, .32);
  --focus-ring: rgba(95, 180, 220, .28);
  --accent-ring: rgba(104, 205, 158, .2);
  --active-border: rgba(104, 205, 158, .44);
  --body-background:
    linear-gradient(180deg, rgba(20,28,25,.88), rgba(20,28,25,0) 360px),
    repeating-linear-gradient(90deg, rgba(238,245,239,.028) 0 1px, transparent 1px 68px),
    linear-gradient(135deg, rgba(69,151,191,.12), rgba(205,117,83,.08) 48%, rgba(99,191,148,.1)),
    var(--bg);
  --header-bg: rgba(15, 21, 19, .9);
  --hairline: rgba(238, 245, 239, .13);
  --hairline-soft: rgba(238, 245, 239, .1);
  --panel-bg: rgba(21, 29, 26, .94);
  --panel-soft: rgba(27, 37, 33, .72);
  --panel-solid: #17211e;
  --hero-panel-bg: linear-gradient(150deg, rgba(25,35,31,.96), rgba(20,32,29,.9)), var(--surface);
  --preview-panel-bg: linear-gradient(180deg, rgba(25,35,31,.96), rgba(19,29,26,.92)), var(--surface);
  --soft-accent-bg: rgba(104, 205, 158, .12);
  --soft-blue-bg: rgba(95, 180, 220, .12);
  --info-bg: rgba(95, 180, 220, .1);
  --input-bg: #111916;
  --input-border: #3d4e46;
  --button-border: #40534b;
  --label: #c7d4cd;
  --chip-ink: #d2ded8;
  --pill-ink: #a8e4c6;
  --blue-ink: #9bd0eb;
  --active-ink: #dff8ec;
  --selected-muted: #c4d7cf;
  --on-primary: #08100d;
  --input-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(47, 111, 85, .24);
  color: var(--ink);
}

:root[data-theme="dark"] ::selection {
  background: rgba(126, 216, 174, .34);
  color: var(--ink);
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--body-background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

img,
canvas,
svg {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform .16s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 760;
}

.brand-mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: url("/paceboard/assets/favicon.svg") center / cover no-repeat;
  box-shadow: var(--shadow-soft);
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 680;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: var(--panel-soft);
  outline: none;
}

body[data-page="create"] .nav-links a[href="/paceboard/"],
body[data-page="share"] .nav-links a[href="/paceboard/share/"],
body[data-page="library"] .nav-links a[href="/paceboard/library/"] {
  color: var(--ink);
  background: var(--soft-accent-bg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--button-border);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.theme-toggle [data-theme-toggle-label="dark"] {
  display: none;
}

:root[data-theme="dark"] .theme-toggle [data-theme-toggle-label="light"] {
  display: none;
}

:root[data-theme="dark"] .theme-toggle [data-theme-toggle-label="dark"] {
  display: inline;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 3vw, 34px) var(--page-gutter) 72px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px clamp(4px, 4vw, 20px) 40px;
  border-top: 1px solid var(--hairline-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ink);
  outline: none;
}

.hero-band,
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: var(--grid-gap);
  align-items: end;
  padding: var(--section-gap) 0 var(--section-gap);
}

.page-heading {
  display: block;
  max-width: 820px;
}

body[data-page="share"] .page-heading,
body[data-page="library"] .page-heading {
  max-width: 940px;
  padding-top: clamp(18px, 2.4vw, 28px);
  padding-bottom: var(--card-gap);
}

body[data-page="share"] h1,
body[data-page="library"] h1 {
  max-width: 760px;
  font-size: clamp(38px, 4.2vw, 56px);
  line-height: 1.41;
}

body[data-page="share"] .lead,
body[data-page="library"] .lead {
  max-width: 740px;
  font-size: clamp(16px, 1.7vw, 19px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 18px;
  font-size: clamp(38px, 4.9vw, 64px);
  line-height: 1.41;
  letter-spacing: 0;
  overflow-wrap: break-word;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.37;
  overflow-wrap: break-word;
  text-wrap: balance;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.32;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
  overflow-wrap: break-word;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.trust-row.compact {
  margin-top: 16px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 780;
}

.trust-row span::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-summary {
  display: grid;
  gap: 12px;
  padding: var(--panel-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--hero-panel-bg);
  box-shadow: var(--shadow-soft);
  background-clip: padding-box;
}

.hero-summary::before {
  content: "";
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.hero-summary em {
  width: max-content;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-accent-bg);
  color: var(--pill-ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 820;
  text-transform: uppercase;
}

.hero-summary span,
.hero-summary small {
  color: var(--muted);
  font-weight: 650;
}

.hero-summary strong {
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: break-word;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.hero-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 780;
}

.app-shell,
.share-shell,
.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 540px);
  gap: var(--grid-gap);
  align-items: start;
}

.share-shell {
  grid-template-columns: minmax(430px, 540px) minmax(0, 1fr);
}

.library-layout {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.editor-panel,
.preview-panel,
.card-section,
.library-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  background-clip: padding-box;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.editor-panel,
.preview-panel,
.card-section {
  padding: var(--panel-pad);
}

.preview-panel {
  position: sticky;
  top: 92px;
  background: var(--preview-panel-bg);
  overflow: hidden;
}

.share-panel {
  display: grid;
  gap: var(--card-gap);
  min-width: 0;
}

.panel-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
}

.panel-heading.inline {
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
}

.panel-heading.inline .btn {
  justify-self: end;
}

.panel-copy {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

#tiktokSettings {
  scroll-margin-top: 96px;
}

.slide-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.draft-note {
  display: grid;
  gap: 5px;
  margin: -2px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--soft-accent-bg), var(--info-bg)),
    var(--panel-solid);
  background-clip: padding-box;
}

.draft-note strong {
  color: var(--ink);
  font-size: 14px;
}

.draft-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.form-section {
  padding: 24px 0;
  border-top: 1px solid var(--hairline);
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-section.final-section {
  padding-bottom: 0;
}

.section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 18px;
}

.section-row > div {
  min-width: 0;
}

.section-row h3 {
  margin-bottom: 5px;
  font-size: 17px;
}

.section-row p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.section-row > span {
  flex: 0 0 auto;
  justify-self: end;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft-accent-bg);
  color: var(--accent);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: 1fr 110px 1fr;
}

.field {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-bottom: 18px;
}

.field-grid > .field {
  margin-bottom: 0;
}

.field:last-child,
.field-grid:last-child,
.choice-group:last-child,
.toggle-grid:last-child {
  margin-bottom: 0;
}

.field > span,
.choice-heading span {
  color: var(--label);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.3;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--ink);
  line-height: 1.35;
  outline: none;
  box-shadow: var(--input-shadow);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

input,
select {
  height: 48px;
}

select {
  height: 48px;
  padding-right: 46px;
  appearance: none;
  background-color: var(--input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5l5 5 5-5' stroke='%2366706b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  cursor: pointer;
}

:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5l5 5 5-5' stroke='%23a4b2aa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select::-ms-expand {
  display: none;
}

select option {
  background: var(--surface);
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), var(--input-shadow);
}

select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.choice-group {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.choice-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.choice-heading small {
  color: var(--muted);
  font-weight: 700;
}

.segmented,
.theme-row,
.destination-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.destination-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.segmented button,
.theme-row button,
.destination-row button,
.btn {
  min-height: 44px;
  border: 1px solid var(--button-border);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--ink);
  font-weight: 760;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.segmented button,
.theme-row button,
.destination-row button {
  padding: 10px 12px;
  overflow-wrap: break-word;
}

.segmented button,
.theme-row button {
  min-width: 76px;
}

.destination-row button {
  display: grid;
  min-height: 124px;
  gap: 8px;
  align-content: start;
  padding: 13px 14px;
  text-align: left;
}

.destination-kicker {
  width: max-content;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--chip-ink);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.destination-row button strong {
  font-size: 15px;
}

.destination-row button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.segmented button.active,
.theme-row button.active,
.segmented button.is-active,
.theme-row button.is-active {
  border-color: var(--active-border);
  background: var(--soft-accent-bg);
  color: var(--active-ink);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 85, .1);
}

.destination-row button.active,
.destination-row button.is-active {
  border-color: rgba(47, 111, 85, .34);
  background: linear-gradient(180deg, rgba(47, 111, 85, .12), rgba(47, 111, 85, .06));
  color: var(--active-ink);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 85, .12), inset 0 4px 0 var(--accent);
}

.destination-row button.is-active span,
.destination-row button.active span {
  color: var(--selected-muted);
}

.destination-row button[data-destination="manual"].is-active {
  border-color: rgba(180, 85, 59, .34);
  background: linear-gradient(180deg, rgba(180, 85, 59, .1), rgba(46, 111, 150, .055));
  box-shadow: inset 0 0 0 1px rgba(180, 85, 59, .1), inset 0 4px 0 var(--accent-2);
}

.destination-row button[data-destination="tiktok"].is-active {
  border-color: rgba(46, 111, 150, .34);
  background: linear-gradient(180deg, rgba(46, 111, 150, .11), rgba(180, 85, 59, .055));
  box-shadow: inset 0 0 0 1px rgba(46, 111, 150, .1), inset 0 4px 0 var(--accent-3);
}

.segmented button:hover,
.theme-row button:hover,
.destination-row button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

.segmented button:focus-visible,
.theme-row button:focus-visible,
.destination-row button:focus-visible,
.btn:focus-visible,
.small-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-row button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-row span {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--swatch);
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.actions.vertical {
  display: grid;
}

.subtle-actions {
  margin-top: 12px;
}

.primary-actions {
  counter-reset: publish-step;
}

.primary-actions .btn {
  gap: 10px;
  min-height: 48px;
  padding-inline: 16px;
}

.primary-actions .btn::before {
  counter-increment: publish-step;
  content: counter(publish-step);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--soft-blue-bg);
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.primary-actions .btn.primary::before {
  background: rgba(255, 255, 255, .18);
  color: currentColor;
}

.primary-actions .btn:disabled::before {
  background: var(--surface-2);
  color: var(--muted);
}

.ready-copy {
  margin: -8px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.channel-copy {
  margin-top: 10px;
  padding-top: 2px;
}

.channel-card {
  display: none;
}

body[data-page="share"][data-channel="download"] [data-download-panel],
body[data-page="share"][data-channel="manual"] [data-manual-panel] {
  display: block;
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-blue-bg);
  color: var(--blue-ink);
  font-size: 11px;
  font-weight: 820;
}

.manual-mockup {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(180,85,59,.1), rgba(46,111,150,.08)),
    var(--panel-solid);
  background-clip: padding-box;
}

.manual-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--label);
  font-size: 13px;
}

.manual-toolbar span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
}

.manual-slides {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.manual-slide {
  display: block;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--hairline-soft);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.manual-slide canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.manual-caption {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.manual-caption strong {
  color: var(--ink);
}

.file-pack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.file-item {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: var(--panel-solid);
  background-clip: padding-box;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.file-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--hairline-soft);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.file-thumb canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.file-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.file-copy strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.file-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.settings-lock {
  display: none;
  gap: 6px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft-accent-bg);
  color: var(--muted);
  line-height: 1.45;
}

.settings-lock strong {
  color: var(--ink);
}

.tiktok-settings-heading {
  margin-bottom: 24px;
}

.tiktok-settings-heading .channel-pill {
  align-self: start;
  margin-top: 2px;
}

.tiktok-account-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--soft-accent-bg), var(--info-bg)),
    var(--panel-solid);
  background-clip: padding-box;
}

.tiktok-account-panel .status-row {
  min-height: 64px;
  border-color: var(--active-border);
  background: var(--panel-bg);
}

.tiktok-account-panel .account-actions {
  justify-self: end;
  margin: 0;
  padding-top: 0;
}

.tiktok-account-panel .account-actions .btn.secondary {
  border-color: var(--active-border);
  background: var(--panel-bg);
  color: var(--ink);
}

.tiktok-controls {
  display: grid;
  gap: 0;
  padding-top: 0;
}

.tiktok-controls .field,
.tiktok-controls .field-grid,
.tiktok-controls .toggle-grid,
.tiktok-controls .disclosure-box,
.tiktok-controls .consent-row {
  margin-bottom: 0;
}

.tiktok-controls .field-grid.two {
  align-items: end;
}

.tiktok-controls .field > span {
  margin-bottom: 1px;
}

.settings-group {
  display: grid;
  gap: 14px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}

.settings-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.settings-group.final-settings-group {
  padding-bottom: 0;
}

.settings-group-heading {
  display: grid;
  gap: 5px;
  max-width: 640px;
}

.settings-group-heading h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
}

.settings-group-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

body[data-page="share"][data-channel="download"] [data-tiktok-panel],
body[data-page="share"][data-channel="download"] [data-tiktok-action],
body[data-page="share"][data-channel="manual"] [data-tiktok-panel],
body[data-page="share"][data-channel="manual"] [data-tiktok-action] {
  display: none;
}

body[data-page="share"][data-channel="tiktok"][data-tiktok-ready="false"] [data-connect-required] {
  display: grid;
}

body[data-page="share"][data-channel="tiktok"][data-tiktok-ready="false"] [data-requires-tiktok-account] {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
  text-decoration: none;
  overflow-wrap: break-word;
  text-align: center;
}

.btn.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.btn.secondary {
  background: var(--panel-solid);
  color: var(--ink);
}

body[data-page="share"][data-channel="tiktok"] #downloadBtn {
  border-color: var(--button-border);
  background: var(--panel-solid);
  color: var(--ink);
}

.btn.small {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 13px;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.phone-frame {
  position: relative;
  width: min(100%, 448px);
  margin: 0 auto;
  padding: 16px;
  border-radius: 46px;
  background:
    linear-gradient(145deg, #222722, #0f1210 48%, #252a25);
  box-shadow:
    0 30px 72px rgba(23, 26, 24, .24),
    0 0 0 1px rgba(255, 255, 255, .15) inset,
    0 0 0 1px rgba(0, 0, 0, .35);
}

body[data-page="share"] .preview-panel .phone-frame {
  width: min(100%, 400px);
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 92px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
}

.phone-frame::after {
  content: "";
  position: absolute;
  top: 19px;
  right: 64px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #090b0a;
  box-shadow: 0 0 0 2px rgba(255,255,255,.08), inset 0 0 0 2px rgba(55, 81, 70, .45);
}

.phone-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 32px;
  background: #fff;
}

.slide-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.slide-card,
.slide-thumb {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.slide-card.active,
.slide-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-lift);
  transform: translateY(-1px);
}

.slide-card canvas,
.slide-thumb canvas {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #fff;
}

.slide-card span,
.slide-thumb span {
  display: block;
  padding: 7px 5px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.preview-stats div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  background-clip: padding-box;
}

.preview-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.preview-stats strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.public-section {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: var(--grid-gap);
  align-items: start;
  margin-top: var(--section-gap);
  padding: var(--section-gap) 0 8px;
  border-top: 1px solid var(--hairline);
}

.public-copy h2 {
  max-width: 520px;
  margin-bottom: 12px;
}

.public-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.proof-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  box-shadow: var(--shadow-soft);
  background-clip: padding-box;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.proof-card span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 18px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft-blue-bg);
  color: var(--blue-ink);
  font-size: 11px;
  font-weight: 840;
}

.proof-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.32;
}

.proof-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.product-note {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--info-bg);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  background-clip: padding-box;
}

.product-note strong {
  color: var(--ink);
}

.caption-box {
  min-height: 132px;
}

.status-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.status-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  background-clip: padding-box;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.status-row strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.status-row span {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: break-word;
}

.status-row.ready {
  border-color: rgba(39, 105, 76, .38);
  background: rgba(39, 105, 76, .075);
}

.status-row.ready strong::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(39, 105, 76, .12);
}

.status-row.warn {
  border-color: rgba(150, 101, 30, .38);
  background: rgba(150, 101, 30, .08);
}

.status-row.error {
  border-color: rgba(165, 61, 61, .42);
  background: rgba(165, 61, 61, .08);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--label);
  line-height: 1.4;
  font-weight: 680;
  background-clip: padding-box;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.check-row input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.check-row:has(input:checked) {
  border-color: var(--active-border);
  background:
    linear-gradient(135deg, var(--soft-accent-bg), rgba(46, 111, 150, .035)),
    var(--panel-solid);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-row-detail {
  gap: 12px;
  min-height: 64px;
  padding: 14px;
}

.check-copy {
  display: grid;
  gap: 4px;
}

.check-copy strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.check-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 660;
  line-height: 1.38;
}

.check-row.is-disabled {
  opacity: .58;
}

.disclosure-box {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(180, 85, 59, .06), rgba(46, 111, 150, .05)),
    var(--panel-soft);
  background-clip: padding-box;
}

.commercial-options {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.commercial-options.visible {
  display: grid;
}

.consent-row {
  margin-bottom: 0;
  border-color: var(--active-border);
  background:
    linear-gradient(135deg, var(--soft-accent-bg), rgba(46, 111, 150, .045)),
    var(--panel-solid);
}

.consent-row .check-copy strong {
  font-size: 15px;
}

.share-checklist {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.share-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
}

.share-check span {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #a9a095;
  border-radius: 50%;
}

.share-check.done {
  color: var(--ok);
}

.share-check.done span {
  border-color: var(--ok);
  background: var(--ok);
}

.library-summary {
  position: sticky;
  top: 92px;
}

.library-count {
  display: inline-flex;
  width: max-content;
  margin: -8px 0 14px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-blue-bg);
  color: var(--blue-ink);
  font-size: 12px;
  font-weight: 820;
}

.library-list {
  display: grid;
  gap: var(--card-gap);
}

.library-item {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
}

.library-item:hover {
  border-color: var(--hairline);
  box-shadow: var(--shadow-soft);
}

.library-thumb {
  width: 92px;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  object-fit: cover;
}

.library-item p {
  margin-bottom: 10px;
  color: var(--muted);
  overflow-wrap: break-word;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.small-button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--button-border);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--ink);
  font-weight: 760;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.small-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.palette-row {
  display: flex;
  gap: 6px;
}

.palette-row span {
  width: 34px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  line-height: 1.5;
  background-clip: padding-box;
}

.empty-state h3 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 18px;
}

.empty-state p {
  margin-bottom: 16px;
}

.empty-state .actions {
  margin-top: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: min(92vw, 520px);
  min-height: 58px;
  transform: translate(-50%, 18px) scale(.98);
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--panel-bg), var(--panel-solid)),
    var(--surface);
  color: var(--ink);
  box-shadow: 0 22px 58px rgba(23, 26, 24, .22), var(--shadow-soft);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  background-clip: padding-box;
  transition: opacity .18s ease, transform .18s ease;
}

.toast::before {
  content: "";
  width: 4px;
  height: 100%;
  min-height: 34px;
  border-radius: 999px;
  background: var(--accent);
}

.toast[data-tone="success"] {
  border-color: rgba(39, 105, 76, .42);
  background:
    linear-gradient(135deg, rgba(47, 111, 85, .14), rgba(46, 111, 150, .08)),
    var(--panel-bg);
}

.toast[data-tone="success"]::before {
  background: var(--ok);
}

.toast[data-tone="warning"] {
  border-color: rgba(150, 101, 30, .44);
}

.toast[data-tone="warning"]::before {
  background: var(--warn);
}

.toast.show,
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

@media (max-width: 1040px) {
  .hero-band,
  .app-shell,
  .share-shell,
  .library-layout,
  .public-section {
    grid-template-columns: 1fr;
  }

  .hero-band {
    align-items: start;
  }

  .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-panel,
  .library-summary {
    position: static;
  }

  .share-shell .preview-panel {
    order: -1;
  }
}

@media (max-width: 720px) {
  :root {
    --page-gutter: 12px;
    --panel-pad: 18px;
    --grid-gap: 18px;
    --card-gap: 16px;
    --section-gap: 24px;
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    gap: 12px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-height: 38px;
  }

  .nav-links {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
    margin-left: 0;
  }

  .nav-links a {
    padding-inline: 8px;
    text-align: center;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 76px;
  }

  main {
    padding-top: 18px;
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
    padding-bottom: 56px;
  }

  h1 {
    margin-bottom: 14px;
    font-size: clamp(33px, 9.2vw, 44px);
  }

  body[data-page="share"] h1,
  body[data-page="library"] h1 {
    font-size: clamp(32px, 8.8vw, 42px);
  }

  .lead {
    font-size: 16px;
    line-height: 1.56;
  }

  .hero-band,
  .page-heading {
    padding-top: 22px;
    padding-bottom: var(--section-gap);
  }

  .field-grid.two,
  .field-grid.three,
  .split-grid,
  .toggle-grid,
  .commercial-options,
  .destination-row,
  .proof-grid {
    grid-template-columns: 1fr;
  }

  .section-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-row > span {
    width: auto;
    justify-self: end;
  }

  .trust-row {
    gap: 8px;
    margin-top: 14px;
  }

  .trust-row span {
    min-height: 30px;
    padding: 6px 9px;
  }

  .panel-heading.inline {
    grid-template-columns: 1fr;
  }

  .panel-heading.inline .btn {
    justify-self: start;
  }

  #tiktokSettings {
    scroll-margin-top: 150px;
  }

  .actions {
    align-items: stretch;
  }

  .actions .btn {
    flex: 1 1 160px;
  }

  .destination-row button {
    min-height: auto;
  }

  .slide-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    overflow-x: visible;
    padding-bottom: 4px;
  }

  .file-pack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .file-item {
    min-width: 0;
  }

  .manual-slides {
    gap: 6px;
  }

  .channel-pill {
    justify-self: start;
  }

  .tiktok-account-panel {
    grid-template-columns: 1fr;
  }

  .tiktok-account-panel .account-actions {
    justify-self: stretch;
  }

  .tiktok-account-panel .account-actions .btn {
    width: 100%;
  }

  .phone-frame {
    width: min(100%, 360px);
    padding: 11px;
    border-radius: 36px;
  }

  .phone-frame::before {
    width: 72px;
    height: 6px;
  }

  .phone-frame::after {
    top: 15px;
    right: 48px;
    width: 7px;
    height: 7px;
  }

  .phone-canvas {
    border-radius: 26px;
  }

  .slide-card,
  .slide-thumb {
    min-width: 0;
  }

  .slide-card span,
  .slide-thumb span {
    padding-inline: 2px;
    font-size: 10px;
  }

  .preview-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .status-row,
  .library-item {
    grid-template-columns: 1fr;
  }

  .library-thumb {
    width: 100%;
    max-width: 150px;
  }

  .library-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
