:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #003cfe;
  --accent-strong: #002fc4;
  --danger: #b42318;
  --accent-soft: #edf3ff;
  --shadow: 0 16px 44px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 8px 26px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 100%;
  background: var(--bg);
}

body {
  width: 100%;
  min-width: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 220px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.public-home-body .topbar {
  display: none;
}

.public-home-body .container {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.public-home {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.public-home p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 800;
}

.admin-version {
  margin: -28px auto 28px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.floating-bin {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  box-shadow: 0 16px 36px rgba(180, 35, 24, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.floating-bin:hover {
  background: #8f1d14;
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(180, 35, 24, 0.34);
}

.material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(18px, 3vw, 40px);
  min-height: 66px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.04);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 60, 254, 0.18);
}

nav {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-right: auto;
}

nav a,
nav .ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 100%;
  padding: 0 3px;
  color: #101828;
  font-size: 14px;
  font-weight: 800;
  transition: color 160ms ease, opacity 160ms ease;
}

nav a:hover,
nav .ghost:hover,
nav a.active {
  color: var(--accent);
  text-decoration: none;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  transition: background 160ms ease;
}

nav a.active::after {
  background: var(--accent);
}

.nav-icon-only {
  width: 38px;
  min-height: 38px;
  justify-content: center;
  padding-inline: 0;
  border-radius: 999px;
}

.container {
  width: min(1440px, calc(100vw - 32px));
  margin: 34px auto 56px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
}

.panel, .auth-panel, .metrics article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.panel {
  margin-bottom: 22px;
  padding: 24px;
}

.analytics-panel {
  padding: 26px 26px 22px;
  box-shadow: var(--shadow);
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 22px;
  margin-bottom: 22px;
}

.analytics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.analytics-head h2 {
  margin-bottom: 4px;
}

.analytics-head p {
  margin-bottom: 0;
}

.range-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
}

.range-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: none;
}

.range-tabs button:hover,
.range-tabs button.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 60, 254, 0.11);
}

.chart-wrap {
  height: 300px;
}

.chart-wrap canvas {
  height: 100%;
}

.top-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.top-usage-stack {
  display: grid;
  gap: 14px;
}

.top-usage-card {
  margin-bottom: 0;
  padding: 18px;
}

.top-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.top-card-head h2 {
  margin: 0;
}

.top-card-head a {
  font-size: 12px;
  font-weight: 800;
}

.recent-panel {
  padding: 26px;
}

.recent-panel h2 {
  margin-bottom: 18px;
}

.recent-panel table {
  min-width: 760px;
}

.top-usage-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcff;
}

.top-usage-grid h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

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

.top-list-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
}

.top-list-row:hover {
  color: var(--accent);
  text-decoration: none;
}

.top-list-row:last-child {
  border-bottom: 0;
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f1f4f9;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.top-item-main {
  min-width: 0;
}

.top-item-main strong,
.top-item-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-item-main small {
  color: var(--muted);
  font-size: 12px;
}

.top-count {
  font-weight: 900;
}

.narrow {
  max-width: 720px;
}

.auth-panel {
  max-width: 430px;
  margin: 8vh auto;
  padding: 30px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metrics article {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.metrics article::after {
  content: "";
  position: absolute;
  inset: auto -28px -42px auto;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: rgba(0, 60, 254, 0.06);
}

.metrics article:hover {
  border-color: rgba(0, 60, 254, 0.22);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.metric-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
}

.metrics article > div span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  line-height: 1;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea {
  width: 260px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}

select {
  appearance: none;
  background: #fff;
}

.copy-code {
  cursor: pointer;
}

.copy-message {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

input:focus {
  outline: 3px solid rgba(0, 60, 254, 0.16);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 60, 254, 0.04);
}

.editable-target {
  border-color: #9dccf4;
  background: #edf3ff;
}

.editable-target:focus {
  outline-color: rgba(37, 99, 235, 0.18);
  border-color: #3484d6;
  background: #ffffff;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 60, 254, 0.16);
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

button:hover, .button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 60, 254, 0.2);
  text-decoration: none;
}

.button.secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.small {
  min-height: 34px;
  padding: 0 12px;
}

.ghost, .link-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  box-shadow: none;
}

.ghost:hover, .link-button:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}

.danger {
  color: var(--danger);
}

.inline {
  display: inline;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.super-admin-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  color: var(--accent);
  font-size: 14px;
  vertical-align: middle;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.easyform-shell {
  display: grid;
  gap: 22px;
}

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

.easyform-settings label:first-child,
.easyform-settings label:nth-child(3) {
  grid-column: 1 / -1;
}

.easyform-builder {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.easyform-sidebar {
  position: sticky;
  top: 86px;
  min-height: 680px;
  border-right: 1px solid #d8dfc7;
  background: #fffbe6;
}

.field-palette {
  position: static;
  display: grid;
  gap: 18px;
  align-self: start;
  padding: 14px;
}

.builder-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #e2c566;
  background: #fff1b8;
}

.builder-tabs button {
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #5d5819;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.builder-tabs button .material-symbols-rounded {
  font-size: 17px;
}

.builder-tabs button:hover,
.builder-tabs button.active {
  background: #fffbe6;
  color: var(--accent);
  box-shadow: none;
}

.builder-tab-panel {
  display: none;
}

.builder-tab-panel.active {
  display: block;
}

.palette-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf0;
}

.palette-section h3 {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0;
}

.field-palette button {
  justify-content: flex-start;
  gap: 9px;
  min-height: 42px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 13px;
}

.field-palette button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.form-canvas {
  min-height: 680px;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 24px;
}

.form-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.form-canvas-head h2,
.form-canvas-head p {
  margin-bottom: 0;
}

.field-list {
  display: grid;
  gap: 12px;
}

.builder-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.builder-field.selected {
  border-color: #9cc8f5;
  background: #eaf5ff;
  box-shadow: 0 0 0 3px rgba(0, 60, 254, 0.08);
}

.builder-field.dragging {
  opacity: 0.55;
}

.builder-field-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.builder-field-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-field-head small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.drag-handle {
  color: var(--muted);
  cursor: grab;
}

.builder-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(150px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
}

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

.builder-field-grid textarea {
  width: 100%;
  min-height: 90px;
}

.builder-options {
  grid-column: 1 / -1;
}

.builder-preview {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.builder-preview-input,
.builder-preview input,
.builder-preview select,
.builder-preview textarea {
  max-width: 420px;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 4px;
  background: #fff;
}

.builder-preview textarea {
  min-height: 64px;
}

.builder-preview-options {
  display: grid;
  gap: 7px;
}

.builder-preview-options span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.builder-preview-options input,
.builder-preview-price input {
  width: auto;
}

.builder-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(80px, 150px));
  gap: 8px;
}

.address-preview {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  max-width: 560px;
}

.address-preview input:nth-child(1),
.address-preview input:nth-child(2) {
  grid-column: 1 / -1;
}

.small-preview {
  max-width: 170px;
}

.medium-preview {
  max-width: 320px;
}

.builder-preview-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.builder-preview-price input:first-of-type {
  width: 95px;
}

.builder-preview-price input:last-of-type {
  width: 42px;
}

.builder-preview-section {
  padding-top: 8px;
  border-top: 1px dotted var(--line-strong);
  color: var(--muted);
}

.builder-preview-page {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 800;
}

.builder-preview-page::before,
.builder-preview-page::after {
  content: "";
  height: 2px;
  flex: 1;
  border-top: 2px dashed var(--line-strong);
}

.builder-preview-likert {
  display: grid;
  gap: 5px;
  max-width: 420px;
  color: var(--muted);
}

.builder-preview-rating {
  color: #f3c316;
  font-size: 22px;
  letter-spacing: 1px;
}

.field-settings-panel,
.easyform-settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

.easyform-settings label:first-child,
.easyform-settings label:nth-child(3) {
  grid-column: auto;
}

.field-settings-panel textarea,
.easyform-settings textarea,
.settings-box textarea {
  width: 100%;
  min-height: 84px;
  font: inherit;
}

.field-settings-count {
  justify-self: end;
  color: #2d68a7;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.settings-box {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-radius: 12px;
  background: #dff6bd;
  color: var(--ink);
}

.settings-box strong {
  font-size: 13px;
}

.compact-actions {
  justify-content: flex-start;
  gap: 10px;
}

.compact-actions button {
  min-height: 34px;
  padding: 8px 12px;
}

.danger-text {
  color: var(--danger);
}

.check-option {
  align-self: center;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.check-option input,
.checkbox-line input {
  width: auto;
}

.flipbook-create-panel {
  max-width: 860px;
  margin-inline: auto;
  padding: 32px;
  background: #fff;
}

.flipbook-admin-form textarea {
  width: 100%;
  min-height: 96px;
  font: inherit;
}

.flipbook-admin-form [hidden] {
  display: none !important;
}

.flipbook-admin-section,
.flipbook-upload-step {
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: 8px;
  background: #fff;
}

.flipbook-admin-section h2,
.flipbook-upload-step h2 {
  margin: 0;
}

.flipbook-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flipbook-toggle-row > span:first-child {
  display: grid;
  gap: 3px;
}

.flipbook-toggle-row strong {
  color: var(--ink);
}

.flipbook-toggle-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.flipbook-toggle-row input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.flipbook-toggle-switch {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 160ms ease;
}

.flipbook-toggle-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.24);
  transition: transform 160ms ease;
}

.flipbook-toggle-row input:checked + .flipbook-toggle-switch {
  background: #12b76a;
}

.flipbook-toggle-row input:checked + .flipbook-toggle-switch::after {
  transform: translateX(20px);
}

.flipbook-toggle-row input:focus-visible + .flipbook-toggle-switch {
  outline: 3px solid rgba(0, 60, 254, 0.22);
  outline-offset: 3px;
}

.flipbook-toggle-row input:disabled + .flipbook-toggle-switch {
  opacity: 0.55;
  cursor: not-allowed;
}

.flipbook-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 160px;
  padding: 24px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.flipbook-dropzone:hover,
.flipbook-dropzone.is-dragging,
.flipbook-dropzone.has-files {
  background: #fbfcff;
  box-shadow: inset 0 0 0 1px rgba(0, 60, 254, 0.12);
}

.flipbook-dropzone strong {
  font-size: 20px;
  line-height: 1.2;
}

.flipbook-dropzone small {
  color: #767676;
  font-size: 14px;
  font-weight: 500;
}

.flipbook-folder-icon {
  position: relative;
  width: 50px;
  height: 36px;
  border-radius: 6px;
  background: #ffb900;
}

.flipbook-folder-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -7px;
  width: 24px;
  height: 10px;
  border-radius: 5px 5px 0 0;
  background: #ffb900;
}

.flipbook-folder-icon .material-symbols-rounded {
  position: absolute;
  right: -7px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #303030;
  color: #fff;
  font-size: 15px;
}

.flipbook-upload-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.flipbook-upload-button {
  width: min(280px, 100%);
  min-height: 50px;
  background: #159bf2;
  box-shadow: none;
}

.flipbook-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.flipbook-settings-button {
  width: 52px;
  min-height: 50px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.flipbook-settings-button:hover {
  background: #f8faff;
  color: var(--accent);
  box-shadow: none;
}

.flipbook-upload-progress {
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
  margin-inline: auto;
  padding: 12px 14px;
  border: 1px solid rgba(0, 60, 254, 0.16);
  border-radius: 8px;
  background: #f8faff;
}

.flipbook-upload-progress[hidden] {
  display: none;
}

.flipbook-upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.flipbook-upload-progress-head span {
  color: var(--accent);
}

.flipbook-upload-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 60, 254, 0.12);
}

.flipbook-upload-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #159bf2, #003cfe);
  transition: width 180ms ease;
}

.flipbook-admin-form.is-submitting {
  cursor: progress;
}

.flipbook-admin-form.is-submitting button[type="submit"] {
  opacity: 0.72;
  cursor: wait;
}

.flipbook-settings-panel[hidden] {
  display: none;
}

.flipbook-upload-mode {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  background: #eef4ff;
}

.flipbook-upload-mode[hidden],
.flipbook-bulk-meta[hidden] {
  display: none;
}

.flipbook-file-list {
  display: grid;
  gap: 8px;
}

.flipbook-file-list div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flipbook-file-list strong,
.flipbook-bulk-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flipbook-file-list small {
  color: var(--muted);
  font-weight: 800;
}

.flipbook-bulk-meta {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.flipbook-bulk-meta-head h3,
.flipbook-bulk-meta-head p {
  margin-bottom: 4px;
}

.flipbook-bulk-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flipbook-library {
  display: grid;
  gap: 24px;
}

.flipbook-document-list {
  display: grid;
  gap: 14px;
}

.flipbook-document-row {
  display: grid;
  grid-template-columns: 92px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 116px;
  padding: 14px 20px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}

.flipbook-cover {
  display: grid;
  place-items: center;
  width: 90px;
  height: 86px;
  border-radius: 4px;
  background: #f2f4f7;
  overflow: hidden;
  color: var(--accent);
}

.flipbook-cover img {
  max-width: 76px;
  max-height: 86px;
  object-fit: contain;
}

.flipbook-cover:hover {
  text-decoration: none;
}

.flipbook-document-main h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 500;
}

.flipbook-document-main h2 a {
  color: #333;
}

.flipbook-document-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #999;
  font-size: 13px;
}

.flipbook-document-meta > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f8fafc;
}

.flipbook-document-meta .flipbook-public-pill {
  gap: 4px;
  background: #e9f5ff;
  color: #0792f2;
}

.flipbook-public-pill .material-symbols-rounded {
  font-size: 14px;
}

.flipbook-document-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.flipbook-document-actions a,
.flipbook-document-actions .link-button,
.flipbook-document-actions .muted-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3b3b3b;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

.flipbook-document-actions a:hover,
.flipbook-document-actions .link-button:hover {
  color: var(--accent);
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.flipbook-document-actions .muted-action {
  color: #aaa;
}

.flipbook-document-actions .copy-action {
  position: relative;
}

.copy-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 7px;
  background: #101828;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.copy-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 10px;
  height: 10px;
  background: #101828;
  transform: translateX(-50%) rotate(45deg);
}

.copy-tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.flipbook-document-actions .archive-action {
  color: var(--danger);
}

.flipbook-document-actions .archive-action:hover {
  color: #8f1d14;
}

@media (max-width: 1100px) {
  .flipbook-document-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .flipbook-document-actions {
    grid-column: 2;
    flex-wrap: wrap;
    gap: 10px 16px;
  }
}

@media (max-width: 680px) {
  .flipbook-create-panel {
    padding: 18px;
  }

  .flipbook-document-row {
    display: grid;
  }

  .flipbook-document-row {
    grid-template-columns: 76px minmax(0, 1fr);
    padding: 12px;
  }

  .flipbook-cover {
    width: 76px;
    height: 76px;
  }

  .flipbook-document-actions {
    grid-column: 1 / -1;
  }

}

.flipbook-check-grid,
.flipbook-colours {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flipbook-colours input {
  min-height: 46px;
  padding: 4px;
}

.compact-copy {
  max-width: 280px;
  min-height: 32px;
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.admin-note + small {
  display: block;
  margin-top: 4px;
}

.public-flipbook-body .container {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.is-hidden {
  display: none;
}

.public-form-body {
  background: var(--bg);
}

.public-form-body .container {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.public-form-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.public-form-card {
  width: min(680px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.public-form-card textarea {
  width: 100%;
  min-height: 120px;
  font: inherit;
}

.public-field {
  display: grid;
  gap: 8px;
}

.public-field small {
  color: var(--muted);
  font-weight: 600;
}

.option-list {
  display: grid;
  gap: 9px;
  padding: 10px 0 2px;
}

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

.address-grid input:first-child,
.address-grid input:last-child {
  grid-column: 1 / -1;
}

.form-section-break {
  padding: 18px 0 8px;
  border-top: 1px solid var(--line);
}

.form-section-break h2 {
  margin: 0;
  font-size: 21px;
}

.form-page-break {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-page-break::before,
.form-page-break::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.rating-options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-choice {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.rating-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-choice span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.rating-choice input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.docusign-placeholder {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
}

.likert-wrap {
  overflow-x: auto;
}

.likert-table {
  min-width: 0;
  border-collapse: collapse;
}

.likert-table th,
.likert-table td {
  padding: 10px 8px;
  border: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.likert-table th:first-child,
.likert-table td:first-child {
  width: 42%;
  text-align: left;
  font-weight: 800;
}

.likert-table input {
  width: auto;
}

.public-form-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.public-form-head img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #f0b5ad;
  border-radius: 8px;
  background: #fff1ef;
  color: var(--danger);
  font-weight: 700;
}

.alert.success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.table-wrap {
  overflow-x: auto;
}

.filter-bar {
  margin-bottom: 16px;
  max-width: 520px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1040px;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover {
  background: #f8faff;
}

#shortlinks-table th:nth-child(4),
#shortlinks-table th:nth-child(5),
#shortlinks-table td:nth-child(4),
#shortlinks-table td:nth-child(5),
#safevideos-table th:nth-child(3),
#safevideos-table th:nth-child(4),
#safevideos-table td:nth-child(3),
#safevideos-table td:nth-child(4) {
  min-width: 132px;
}

.truncate {
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  min-width: 190px;
  white-space: nowrap;
}

.actions > .icon-action,
.actions > .inline {
  margin-right: 8px;
  vertical-align: middle;
}

.actions > :last-child {
  margin-right: 0;
}

.actions .inline {
  display: inline-flex;
}

.admin-note {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.usage-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.date-with-user {
  white-space: nowrap;
}

.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px dotted rgba(102, 112, 133, 0.78);
  cursor: help;
}

.tooltip-trigger::before,
.tooltip-trigger::after {
  position: absolute;
  left: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.tooltip-trigger::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  z-index: 30;
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #17211b;
  color: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 10px 24px rgba(23, 33, 27, 0.18);
}

.tooltip-trigger::after {
  content: "";
  bottom: calc(100% + 4px);
  z-index: 31;
  border: 6px solid transparent;
  border-top-color: #17211b;
}

.tooltip-trigger:hover::before,
.tooltip-trigger:hover::after,
.tooltip-trigger:focus::before,
.tooltip-trigger:focus::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.qr-download, .icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

button.icon-action {
  min-height: 36px;
  appearance: none;
  font: inherit;
  box-shadow: none;
}

.qr-download:hover, .icon-action:hover {
  border-color: var(--accent);
  background: #edf3ff;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 60, 254, 0.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.icon-action.danger {
  color: var(--danger);
}

.icon-action.danger:hover {
  border-color: var(--danger);
  background: #fff1ef;
  color: var(--danger);
}

.icon-action.toggle-active {
  color: var(--accent);
}

.icon-action.toggle-active:hover {
  border-color: var(--accent);
  background: #edf3ff;
  color: var(--accent);
}

.icon-action.toggle-disabled {
  color: #d97706;
}

.icon-action.toggle-disabled:hover {
  border-color: #d97706;
  background: #fff7ed;
  color: #d97706;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.status.on {
  background: #e6f6ec;
  color: var(--accent);
}

.status.off {
  background: #f2f4f3;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  text-align: center;
}

canvas {
  width: 100%;
  height: 300px;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.video-shell {
  display: grid;
  gap: 12px;
  min-height: calc(100vh - 120px);
  align-content: center;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
  background: #0e1511;
  box-shadow: none;
}

.video-frame iframe, .video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-frame iframe {
  opacity: 0;
}

.video-frame iframe.active {
  opacity: 1;
}

.video-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  min-height: 100%;
  border-radius: 0;
  background:
    linear-gradient(rgba(14, 21, 17, 0.18), rgba(14, 21, 17, 0.28)),
    var(--video-poster, linear-gradient(135deg, #001a6f, #003cfe));
  background-position: center;
  background-size: cover;
  color: #fff;
  box-shadow: none;
}

.video-play span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(74px, 9vw, 108px);
  height: clamp(74px, 9vw, 108px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  font-size: clamp(28px, 4vw, 44px);
  animation: playPulse 1.7s ease-out infinite;
}

.video-play i {
  margin-left: 0.12em;
}

.safevideo-footer {
  color: #8b9690;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

@keyframes playPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.34);
  }
  70% {
    transform: scale(1.04);
    box-shadow: 0 0 0 22px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.embed-body {
  margin: 0;
  background: #0e1511;
}

.embed-container {
  width: 100%;
  margin: 0;
}

.embed-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #0e1511;
}

.embed-frame {
  border-radius: 0;
  box-shadow: none;
}

.embed-brand {
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .topbar {
    padding-inline: 20px;
  }

  .container {
    width: calc(100vw - 24px);
    margin-top: 28px;
  }

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

  .analytics-layout {
    grid-template-columns: 1fr;
  }

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

  .easyform-builder {
    grid-template-columns: 1fr;
  }

  .easyform-sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .analytics-head {
    align-items: stretch;
  }

  .range-tabs {
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .topbar, .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: 0;
    padding-block: 12px;
  }

  nav {
    align-self: auto;
    gap: 14px;
  }

  nav a {
    min-height: 38px;
  }

  .analytics-head {
    flex-direction: column;
  }

  .range-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .range-tabs button {
    flex: 1 0 auto;
  }

  .chart-wrap {
    height: 300px;
  }

  .top-usage-grid,
  .top-usage-stack {
    grid-template-columns: 1fr;
  }

  .metrics, .grid-two {
    grid-template-columns: 1fr;
  }

  .easyform-settings,
  .builder-field-grid,
  .field-palette,
  .compound-grid {
    grid-template-columns: 1fr;
  }

  nav {
    gap: 12px;
  }

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

@media (max-width: 560px) {
  .topbar {
    gap: 12px;
    padding: 12px 14px;
  }

  .brand img {
    width: 36px;
    height: 36px;
    border-radius: 7px;
  }

  nav {
    gap: 8px;
  }

  nav a span:not(.material-symbols-rounded) {
    display: none;
  }
}

@media (max-width: 1180px) {
  .table-wrap {
    overflow-x: visible;
  }

  #shortlinks-table, #safevideos-table, .bin-table {
    min-width: 0;
  }

  #shortlinks-table thead, #safevideos-table thead, .bin-table thead {
    display: none;
  }

  #shortlinks-table, #shortlinks-table tbody, #shortlinks-table tr, #shortlinks-table td,
  #safevideos-table, #safevideos-table tbody, #safevideos-table tr, #safevideos-table td,
  .bin-table, .bin-table tbody, .bin-table tr, .bin-table td {
    display: block;
    width: 100%;
  }

  #shortlinks-table tr, #safevideos-table tr, .bin-table tr {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }

  #shortlinks-table td, #safevideos-table td, .bin-table td {
    display: grid;
    grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
    gap: 14px;
    padding: 7px 0;
    border-bottom: 0;
  }

  #shortlinks-table td::before, #safevideos-table td::before, .bin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  #shortlinks-table td:first-child, #safevideos-table td:first-child {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #shortlinks-table td:first-child::before, #safevideos-table td:first-child::before {
    content: none;
  }

  #shortlinks-table .truncate, #safevideos-table .truncate, .bin-table .truncate {
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #shortlinks-table .actions, #safevideos-table .actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    min-width: 0;
  }

  #shortlinks-table .actions > .icon-action,
  #shortlinks-table .actions > .inline,
  #safevideos-table .actions > .icon-action,
  #safevideos-table .actions > .inline {
    margin-right: 0;
  }
}
