@font-face {
  font-family: "Inter";
  src: url("/assets/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #f5f9fc;
  --canvas-strong: #eaf1f8;
  --surface: #ffffff;
  --surface-soft: #f8fafd;
  --surface-raised: #ffffff;
  --ink: #0b1830;
  --ink-soft: #50627c;
  --muted: #74839a;
  --line: #d4deeb;
  --line-strong: #becde0;
  --primary: #2563eb;
  --primary-hover: #1d55d8;
  --primary-soft: #e8f0ff;
  --success: #0b8d61;
  --success-soft: #e8f8f2;
  --danger: #d34a43;
  --danger-soft: #fff0ef;
  --warning: #a36500;
  --warning-soft: #fff7e6;
  --shadow: 0 14px 30px rgba(26, 56, 97, .16);
  --shadow-soft: 0 8px 18px rgba(26, 56, 97, .1);
  --header-shadow: 0 8px 14px rgba(26, 56, 97, .08);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --app-width: 430px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #050b14;
  --canvas-strong: #081321;
  --surface: #0d1e33;
  --surface-soft: #10253d;
  --surface-raised: #122943;
  --ink: #f7faff;
  --ink-soft: #bdc9d8;
  --muted: #8191a7;
  --line: #244463;
  --line-strong: #345c80;
  --primary: #4c8dff;
  --primary-hover: #70a4ff;
  --primary-soft: #102d56;
  --success: #42d99c;
  --success-soft: #0b3b32;
  --danger: #ff7b75;
  --danger-soft: #411f25;
  --warning: #ffc96a;
  --warning-soft: #3d321c;
  --shadow: 0 18px 42px rgba(0, 0, 0, .38);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, .28);
  --header-shadow: 0 8px 18px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas-strong);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--canvas-strong) 84%, var(--primary) 16%), var(--canvas-strong));
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button,
summary,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

svg {
  display: block;
}

.app-shell {
  width: min(100%, var(--app-width));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: clip;
  background: var(--canvas);
  border-inline: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--header-shadow);
  backdrop-filter: blur(14px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(8, 28, 59, .2);
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
  letter-spacing: 0;
}

.brand-copy strong {
  font-size: 14px;
  line-height: 18px;
  font-weight: 750;
  color: var(--ink);
}

.brand-copy span {
  margin-top: 1px;
  font-size: 10px;
  line-height: 13px;
  font-weight: 500;
  color: var(--muted);
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle {
  position: relative;
}

.theme-icon {
  position: absolute;
}

.sun-icon {
  display: none;
}

html[data-theme="dark"] .moon-icon {
  display: none;
}

html[data-theme="dark"] .sun-icon {
  display: block;
}

.app-main {
  min-height: calc(100dvh - 136px);
  padding: 18px 16px 28px;
}

.page-heading {
  margin-bottom: 16px;
}

.page-heading h1,
.page-heading p,
.section-heading h2,
.section-heading p,
.destination-section h2,
.adjustments-card h2,
.account-picker-content h2,
.account-picker-content p,
.dialog h2,
.dialog p {
  margin: 0;
  letter-spacing: 0;
}

.page-heading h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 760;
}

.page-heading p {
  margin-top: 2px;
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-soft);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in .2s ease-out;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden-input,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.upload-zone {
  position: relative;
  min-height: 286px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.upload-zone.dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: scale(.995);
}

.upload-zone.has-media {
  min-height: 254px;
  border-style: solid;
  background: #07111d;
}

.empty-upload {
  width: 100%;
  min-height: 286px;
  padding: 32px 26px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  text-align: center;
}

.empty-upload > strong {
  font-size: 16px;
  line-height: 21px;
  font-weight: 700;
}

.empty-upload > span:not(.upload-icon) {
  max-width: 260px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}

.upload-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 3px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.upload-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #07111d;
}

.media-preview.active {
  display: block;
}

.media-badge,
.media-edit-button,
.media-play-button,
.file-bar {
  display: none;
}

.upload-zone.has-media .media-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  min-height: 28px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(11, 24, 48, .88);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 650;
}

.upload-zone.has-media .media-edit-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  min-width: 82px;
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, .95);
  color: #0b1830;
  font-size: 11px;
  font-weight: 700;
}

.media-edit-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.upload-zone.is-video .media-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 60px;
  height: 60px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translate(-50%, -54%);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--primary);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
}

.media-play-button svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-play-button .play-glyph {
  fill: none;
}

.media-play-button .pause-glyph,
.upload-zone.is-playing .media-play-button {
  display: none;
}

.upload-zone.has-media .file-bar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 4;
  min-height: 40px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, .95);
  color: #0b1830;
}

.file-bar > div {
  min-width: 0;
}

.file-bar strong,
.file-bar span {
  display: block;
}

.file-bar strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-bar span {
  margin-top: 1px;
  font-size: 8px;
  line-height: 10px;
  color: #74839a;
}

.text-button {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.compose-card {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.field {
  min-width: 0;
}

.caption-field,
.hashtag-field {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.caption-field {
  padding: 9px 11px 7px;
}

.hashtag-field {
  padding: 8px 11px 7px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field label,
.field .label,
.label-row span {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 14px;
  font-weight: 650;
}

.label-row span {
  color: var(--muted);
  font-weight: 450;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface-soft);
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.field input,
.field select {
  height: 48px;
  margin-top: 6px;
  padding: 0 12px;
  font-size: 12px;
}

.field textarea {
  height: 62px;
  min-height: 62px;
  padding: 7px 0 0;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  line-height: 17px;
}

.hashtag-field input {
  height: 26px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 550;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.caption-field textarea:focus,
.hashtag-field input:focus {
  box-shadow: none;
}

.field input:read-only,
.field input:disabled {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--line) 28%);
}

.destination-section {
  margin-top: 14px;
}

.destination-section h2 {
  margin-bottom: 7px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.destination-summary {
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.destination-summary:hover,
.destination-summary:focus-visible {
  border-color: var(--primary);
}

.platform-stack {
  display: flex;
  flex: 0 0 auto;
}

.platform-stack img {
  width: 32px;
  height: 32px;
  border: 2px solid var(--surface);
  border-radius: 9px;
  background: var(--surface);
}

.platform-stack img + img {
  margin-left: -3px;
}

.destination-summary-copy {
  min-width: 0;
  flex: 1;
}

.destination-summary-copy strong,
.destination-summary-copy span {
  display: block;
}

.destination-summary-copy strong {
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.destination-summary-copy span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron,
.summary-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.publish-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 8px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 50px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 18px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 14px color-mix(in srgb, var(--primary) 25%, transparent);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.danger-button {
  border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.primary-button svg,
.secondary-button svg,
.danger-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button.compact {
  min-height: 42px;
  margin-top: 8px;
  padding-inline: 14px;
  font-size: 12px;
}

.reset-button {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 45;
  height: calc(72px + env(safe-area-inset-bottom));
  padding: 8px 5px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 -8px 18px rgba(26, 56, 97, .1);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  min-width: 0;
  height: 56px;
  padding: 6px 2px 5px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}

.bottom-nav button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav span {
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  line-height: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status {
  min-height: 58px;
  margin-bottom: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px var(--success-soft);
}

.system-status strong,
.system-status span {
  display: block;
}

.system-status strong {
  font-size: 12px;
  line-height: 16px;
}

.system-status span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 13px;
}

.settings-stack {
  display: grid;
  gap: 10px;
}

.service-card,
.content-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.service-card summary {
  min-height: 70px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.service-card summary::-webkit-details-marker {
  display: none;
}

.service-card[open] summary {
  border-bottom: 1px solid var(--line);
}

.service-card[open] .summary-chevron {
  transform: rotate(90deg);
}

.social-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: hidden;
  display: inline-flex;
  border-radius: 10px;
}

.social-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-copy {
  min-width: 0;
  flex: 1;
}

.service-copy strong,
.service-copy span {
  display: block;
}

.service-copy strong {
  font-size: 13px;
  line-height: 17px;
  font-weight: 700;
}

.service-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 13px;
}

.connection-badge,
.status-pill {
  min-height: 26px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--success) 58%, var(--line));
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 9px;
  line-height: 1;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.warn {
  border-color: color-mix(in srgb, var(--warning) 55%, var(--line));
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.error {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.ready {
  border-color: var(--line);
  background: var(--primary-soft);
  color: var(--ink-soft);
}

.service-body {
  padding: 14px 12px;
  display: grid;
  gap: 12px;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.button-grid .primary-button,
.button-grid .secondary-button,
.button-grid .danger-button {
  min-height: 46px;
  font-size: 12px;
}

.content-card {
  margin-top: 12px;
  padding: 14px 12px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h2,
.appearance-card h2 {
  font-size: 14px;
  line-height: 18px;
  font-weight: 720;
}

.section-heading p,
.appearance-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.connection-list,
.history-list,
.audit-list {
  display: grid;
  gap: 8px;
}

.connections-card .connection-list {
  margin-top: 12px;
}

.connection-row,
.history-row {
  min-width: 0;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.connection-copy,
.history-title {
  min-width: 0;
  flex: 1;
}

.connection-copy strong,
.connection-copy span,
.history-title strong,
.history-title span {
  display: block;
}

.connection-copy strong,
.history-title strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-copy span,
.history-title span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appearance-card {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.theme-switch {
  height: 38px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.theme-switch span {
  min-width: 50px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

html:not([data-theme="dark"]) .theme-switch span:first-child,
html[data-theme="dark"] .theme-switch span:last-child {
  background: var(--primary);
  color: #fff;
}

.section-toolbar {
  min-height: 46px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-toolbar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 15px;
}

.history-row {
  min-height: 76px;
  padding: 11px;
  background: var(--surface);
}

.history-links {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-links a {
  color: var(--primary);
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
}

.preview-box {
  padding: 18px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}

.preview-box strong,
.preview-box span {
  display: block;
}

.preview-box strong {
  font-size: 12px;
  line-height: 17px;
}

.preview-box span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.admin-card {
  margin-top: 0;
}

.admin-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.admin-form .primary-button {
  margin-top: 2px;
}

.security-card {
  margin-bottom: 2px;
}

.security-card .audit-list {
  margin-top: 12px;
}

.audit-item {
  min-height: 58px;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.audit-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
}

.audit-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audit-item strong,
.audit-item span {
  display: block;
}

.audit-item strong {
  font-size: 11px;
  line-height: 15px;
}

.audit-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 13px;
}

.logout-button {
  width: 100%;
  margin-top: 12px;
}

.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  overflow-y: auto;
  background: var(--canvas-strong);
  overscroll-behavior: contain;
}

.screen-overlay.open {
  display: block;
}

.overlay-shell {
  width: min(100%, var(--app-width));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--canvas);
  border-inline: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.overlay-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 64px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--header-shadow);
  backdrop-filter: blur(14px);
}

.overlay-header > div {
  min-width: 0;
}

.overlay-header strong,
.overlay-header span {
  display: block;
}

.overlay-header strong {
  font-size: 14px;
  line-height: 18px;
}

.overlay-header span {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-content,
.account-picker-content {
  padding: 18px 16px max(28px, env(safe-area-inset-bottom));
}

.editor-preview {
  position: relative;
  min-height: 338px;
  max-height: 48vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #07111d;
}

.editor-preview img,
.editor-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
}

.editor-preview img.active,
.editor-preview video.active {
  display: block;
}

.filter-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.filter {
  min-width: 0;
  height: 70px;
  padding: 5px;
  display: grid;
  grid-template-rows: 38px auto;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
}

.filter.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.filter-swatch {
  width: 100%;
  height: 38px;
  display: block;
  border-radius: 6px;
  background: linear-gradient(145deg, #87b7e8 0 48%, #dce9f2 48% 67%, #6d8f8a 67%);
}

.filter-swatch.clean {
  filter: brightness(1.08) contrast(1.02) saturate(.88);
}

.filter-swatch.warm {
  filter: sepia(.22) brightness(1.04) saturate(1.17);
}

.filter-swatch.contrast {
  filter: contrast(1.28) saturate(.8);
}

.filter > span:last-child {
  overflow: hidden;
  font-size: 9px;
  line-height: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adjustments-card {
  margin-top: 16px;
  padding: 14px 16px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.adjustments-card h2 {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 17px;
}

.range-row + .range-row {
  margin-top: 14px;
}

.range-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-row label,
.range-row strong {
  font-size: 11px;
  line-height: 14px;
}

.range-row label {
  color: var(--ink-soft);
  font-weight: 500;
}

.range-row strong {
  color: var(--ink);
  font-weight: 700;
}

.range-row input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 2px 0 0;
  padding: 0;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
}

.range-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary) 0 var(--range-progress, 50%), var(--line) var(--range-progress, 50%) 100%);
}

.range-row input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  border: 1px solid var(--primary);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(26, 51, 89, .15);
}

.range-row input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.range-row input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--primary);
}

.range-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 1px solid var(--primary);
  border-radius: 50%;
  background: var(--surface);
}

.editor-content > .primary-button {
  width: 100%;
  margin-top: 18px;
}

.account-picker-content > h2 {
  font-size: 26px;
  line-height: 32px;
  font-weight: 760;
}

.account-picker-content > p {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 17px;
}

.select-all-control {
  position: relative;
  margin-top: 14px;
}

.select-all-control > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.select-all-card {
  min-height: 54px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.check-visual {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--primary);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: #fff;
}

.check-visual svg {
  opacity: 0;
}

.check-visual::after {
  width: 14px;
  height: 2px;
  display: none;
  border-radius: 999px;
  background: #fff;
  content: "";
}

.select-all-control > input:checked + .select-all-card .check-visual,
.select-all-control > input:indeterminate + .select-all-card .check-visual {
  background: var(--primary);
}

.select-all-control > input:checked + .select-all-card .check-visual svg {
  opacity: 1;
}

.select-all-control > input:indeterminate + .select-all-card .check-visual::after {
  display: block;
}

.select-all-control > input:focus-visible {
  outline: 0;
}

.select-all-control > input:focus-visible + .select-all-card {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.check-visual svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.select-all-card > span:nth-child(2) strong,
.select-all-card > span:nth-child(2) span {
  display: block;
}

.select-all-card > span:nth-child(2) strong {
  font-size: 12px;
  line-height: 16px;
}

.select-all-card > span:nth-child(2) span,
.select-all-card > span:nth-child(3) {
  color: var(--muted);
  font-size: 9px;
  line-height: 12px;
}

.select-all-card > span:nth-child(3) {
  color: var(--primary);
  font-weight: 650;
}

.account-list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.account-group h3 {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 650;
}

.account-group-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.destination-control {
  position: relative;
}

.destination-control + .destination-control {
  border-top: 1px solid var(--line);
}

.destination-control > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.destination {
  position: relative;
  min-height: 58px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.destination.disabled {
  opacity: .5;
  cursor: not-allowed;
}

.destination-control > input:focus-visible {
  outline: 0;
}

.destination-control > input:focus-visible + .destination {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.destination > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.destination > span:nth-child(2) strong,
.destination > span:nth-child(2) span {
  display: block;
}

.destination > span:nth-child(2) strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination > span:nth-child(2) span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 12px;
}

.destination-check {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface-soft);
}

.destination-control > input:checked + .destination .destination-check {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 18px;
  background-repeat: no-repeat;
}

.account-continue {
  position: sticky;
  bottom: 12px;
  width: 100%;
  margin-top: 18px;
}

body.overlay-open {
  overflow: hidden;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(2, 9, 18, .58);
  backdrop-filter: blur(4px);
}

.dialog-backdrop.open {
  display: flex;
}

.dialog {
  width: min(100%, 390px);
  max-height: min(780px, calc(100dvh - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .32);
  animation: dialog-in .22s ease-out;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialog-head {
  min-height: 86px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-check {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 22px;
  font-weight: 800;
}

.dialog-check.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.dialog-check.progress {
  color: transparent;
}

.dialog-check.progress::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dialog h2 {
  font-size: 18px;
  line-height: 23px;
  font-weight: 750;
}

.dialog p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
}

.dialog-body {
  min-height: 0;
  padding: 14px 16px 16px;
  overflow-y: auto;
}

.dialog-status-list {
  display: grid;
  gap: 8px;
}

.dialog-status {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.dialog-status .status-pill {
  grid-column: 1 / -1;
  min-height: 24px;
}

.dialog-body > .primary-button {
  width: 100%;
  margin-top: 14px;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas-strong);
}

.login-shell {
  width: min(100%, var(--app-width));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 16px 22px;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border-inline: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-topbar {
  display: flex;
  justify-content: flex-end;
}

.login-brand {
  margin-top: 26px;
  text-align: center;
}

.login-brand img {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 7px 18px rgba(8, 28, 59, .24);
}

.login-brand h1 {
  margin: 18px 0 0;
  font-size: 26px;
  line-height: 32px;
  letter-spacing: 0;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 15px;
}

.login-card {
  margin-top: 36px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.login-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 26px;
  letter-spacing: 0;
}

.login-card > p {
  margin: 2px 0 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.login-card .field + .field {
  margin-top: 14px;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap svg {
  position: absolute;
  top: 20px;
  left: 13px;
  z-index: 2;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-input-wrap input {
  padding-left: 43px;
}

.remember-row {
  margin: 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.remember-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.login-card .primary-button {
  width: 100%;
  min-height: 46px;
}

.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  line-height: 15px;
  font-weight: 650;
}

.secure-connection {
  width: min(282px, 100%);
  min-height: 52px;
  margin: 30px auto 0;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.secure-connection svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: var(--success);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secure-connection strong,
.secure-connection span {
  display: block;
}

.secure-connection strong {
  font-size: 10px;
  line-height: 14px;
}

.secure-connection span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  line-height: 11px;
}

.login-footer {
  margin-top: auto;
  padding-top: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 9px;
  line-height: 12px;
}

@media (min-width: 560px) {
  body {
    padding-block: 16px;
  }

  .app-shell,
  .overlay-shell,
  .login-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
  }

  .app-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .bottom-nav {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .login-shell {
    min-height: calc(100dvh - 32px);
  }
}

@media (max-width: 360px) {
  .app-main,
  .editor-content,
  .account-picker-content {
    padding-inline: 12px;
  }

  .app-header {
    padding-inline: 12px;
  }

  .page-heading h1 {
    font-size: 25px;
  }

  .platform-stack img {
    width: 29px;
    height: 29px;
  }

  .destination-summary-copy strong {
    font-size: 11px;
  }

  .filter-grid {
    gap: 5px;
  }

  .filter {
    padding-inline: 3px;
  }
}

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