:root {
  --ink: #172033;
  --muted: #687589;
  --paper: #f4f7fb;
  --panel: #ffffff;
  --line: #d8e1ee;
  --primary: #2457c5;
  --primary-dark: #193f91;
  --primary-soft: #eaf1ff;
  --accent: #15a88f;
  --amber: #f5b84b;
  --violet: #7462f2;
  --pink: #ec5d91;
  --danger: #d54747;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
  --soft-shadow: 0 10px 26px rgba(36, 87, 197, 0.12);
  --deep-shadow: 0 26px 70px rgba(23, 32, 51, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(36, 87, 197, 0.16), transparent 24rem),
    linear-gradient(180deg, #fbfdff, var(--paper));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  color: inherit;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100vh;
  padding-bottom: 76px;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(140deg, rgba(23, 32, 51, 0.92), rgba(36, 87, 197, 0.82)),
    url("https://images.unsplash.com/photo-1450101499163-c8848c66ca85?auto=format&fit=crop&w=1400&q=80") center/cover;
}

.splash.active {
  display: grid;
}

.splash-card {
  width: min(420px, 100%);
  padding: 28px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.splash-card h1 {
  margin: 18px 0 8px;
  font-size: 3rem;
  line-height: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  font-weight: 900;
}

.brand-mark.big {
  width: 70px;
  height: 70px;
  font-size: 1.5rem;
  background: #fff;
  color: var(--primary);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

main {
  width: min(1120px, calc(100% - 26px));
  margin: 0 auto;
}

.screen {
  display: none;
  padding: 20px 0;
}

.screen.active {
  display: block;
}

.hero,
.panel,
.quick-card,
.metric,
.capture-card label,
.phone-preview,
.tool-panel,
.file-drop,
.preview-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(23, 32, 51, 0.06);
}

.hero {
  display: grid;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(23, 32, 51, 0.92), rgba(36, 87, 197, 0.82)),
    url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1300&q=80") center/cover;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 12px 0 8px;
  font-size: clamp(2.1rem, 8vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

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

.hero-chips span,
.tool-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 850;
  backdrop-filter: blur(10px);
}

.smart-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -18px 12px 16px;
  position: relative;
  z-index: 2;
}

.smart-strip article {
  padding: 12px;
  text-align: left;
  border: 1px solid rgba(216, 225, 238, 0.7);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 16px rgba(23, 32, 51, 0.06);
  backdrop-filter: blur(14px);
}

.smart-strip strong,
.smart-strip span,
.smart-strip small {
  display: block;
}

.smart-strip strong {
  color: var(--primary);
  margin: 4px 0 2px;
  font-size: 1.08rem;
  line-height: 1.1;
}

.smart-strip span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.smart-strip small {
  color: #8a96aa;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  color: #103573;
  background: #eef5ff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scan-fab {
  display: grid;
  place-items: center;
  gap: 7px;
  width: 136px;
  height: 136px;
  border: 0;
  border-radius: 50%;
  color: #172033;
  background: var(--amber);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.22);
  font-weight: 900;
  cursor: pointer;
}

.scan-fab i {
  width: 42px;
  height: 42px;
}

.search-box {
  position: relative;
  margin: 14px 0;
}

.search-box i {
  position: absolute;
  left: 13px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-action {
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 18px rgba(36, 87, 197, 0.2);
}

.search-action i {
  position: static;
  width: 20px;
  height: 20px;
  padding: 0;
  color: currentColor;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.search-box input,
.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.search-box input {
  padding-left: 42px;
}

.home-search-results {
  margin: -4px 0 18px;
  padding: 14px;
  border: 1px solid rgba(216, 225, 238, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(23, 32, 51, 0.08);
}

.home-search-results[hidden] {
  display: none;
}

.empty-result {
  min-height: 132px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
  border: 1px dashed rgba(142, 155, 176, 0.45);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.86);
}

.empty-result i {
  color: var(--primary);
}

.action-grid,
.metrics,
.form-grid,
.editor-grid,
.settings-grid,
.plan-grid,
.sign-layout,
.admin-panels,
.share-grid {
  display: grid;
  gap: 14px;
}

.action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.settings-status p {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 10px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid rgba(216, 225, 238, 0.78);
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.86);
}

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

.settings-status span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 2px 10px;
}

.section-label span {
  font-size: 1.05rem;
  font-weight: 950;
}

.section-label small {
  color: var(--muted);
  font-weight: 800;
}

.section-head.compact {
  margin-bottom: 10px;
}

.feature-center {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(216, 225, 238, 0.78);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(36, 87, 197, 0.1), transparent 9rem),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 26px rgba(23, 32, 51, 0.07);
}

.feature-pills,
.feature-grid {
  display: grid;
  gap: 10px;
}

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

.feature-pill,
.feature-card {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid #dce6f4;
  border-radius: 14px;
  background: #fff;
}

.feature-pill {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.feature-pill strong {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.feature-pill span,
.feature-card h3 {
  font-weight: 900;
}

.feature-card {
  grid-template-columns: 46px minmax(0, 1fr);
}

.feature-card h3 {
  margin: 0 0 4px;
}

.feature-card p {
  margin: 0 0 8px;
}

.feature-card strong {
  display: inline-flex;
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.status-ready .feature-icon,
.status-ready i {
  color: #138a76;
}

.status-ready strong {
  color: #08705f;
  background: #e8fbf7;
}

.status-next .feature-icon,
.status-next i {
  color: #2457c5;
}

.status-next strong {
  color: #193f91;
  background: #eaf1ff;
}

.status-native .feature-icon,
.status-native i {
  color: #9a6411;
}

.status-native strong {
  color: #8a5a04;
  background: #fff5df;
}

.markup-preview {
  min-height: 260px;
  margin: 14px 0;
  place-items: center;
  text-align: center;
}

.markup-preview strong {
  color: rgba(36, 87, 197, 0.7);
  font-size: 2rem;
  transform: rotate(-18deg);
}

.markup-preview span {
  color: var(--muted);
  font-weight: 850;
}

.markup-preview {
  background:
    linear-gradient(135deg, rgba(36, 87, 197, 0.04), rgba(21, 168, 143, 0.04)),
    repeating-linear-gradient(0deg, #eef2f7 0 1px, transparent 1px 34px),
    #ffffff;
}

.quick-card {
  display: grid;
  gap: 7px;
  min-height: 128px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.tool-badge {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #17304d;
  font-size: 0.7rem;
  font-weight: 950;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.quick-card:hover,
.btn:hover {
  transform: translateY(-1px);
}

.quick-card i {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.quick-card strong {
  font-size: 1.04rem;
}

.quick-card span,
.muted {
  color: var(--muted);
}

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

.section-head h2,
.panel h2 {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.7rem);
  line-height: 1.05;
}

.section-head p {
  margin: 6px 0 0;
}

.panel {
  padding: 16px;
}

.btn,
.chip,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.btn.primary {
  color: #fff;
  background: var(--primary);
}

.btn.secondary {
  color: var(--ink);
  border-color: var(--line);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
}

.btn.full {
  width: 100%;
}

.icon-btn {
  width: 42px;
  padding: 0;
  border-color: var(--line);
}

.chip {
  min-height: 38px;
  padding: 8px 12px;
  border-color: rgba(255, 255, 255, 0.3);
}

.chip.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.language-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.button-row.tight {
  margin: 0;
}

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

.recent-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.recent-thumb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 74px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 6px;
}

.recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-item h3 {
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.recent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.recent-actions .btn {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.8rem;
}

.capture-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.capture-card label,
.file-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 18px;
  text-align: center;
  border-style: dashed;
  cursor: pointer;
}

.capture-card em {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 850;
}

.capture-card i,
.file-drop i {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

.workspace {
  display: grid;
  gap: 14px;
}

.phone-preview {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: #1a2433;
}

.phone-preview canvas {
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: contain;
}

.edge-frame {
  position: absolute;
  inset: 38px 28px;
  z-index: 2;
  border: 3px solid rgba(245, 184, 75, 0.96);
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.empty-canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.76);
}

.tool-panel {
  padding: 16px;
}

.tool-status {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 14px;
}

.tool-status span {
  border-color: #cfe0ff;
  background: #f2f7ff;
  color: var(--primary-dark);
}

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

.mode-btn {
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 850;
}

.mode-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

label {
  display: block;
  margin: 12px 0 6px;
  color: #35445a;
  font-weight: 850;
  font-size: 0.9rem;
}

.page-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 8px;
}

.page-thumb {
  position: relative;
  flex: 0 0 92px;
  min-height: 122px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.page-card {
  flex: 0 0 150px;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.page-card .page-thumb {
  flex-basis: auto;
  width: 100%;
}

.page-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.page-tools button {
  min-height: 34px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.page-thumb.active {
  border-color: var(--primary);
}

.page-thumb img,
.page-thumb canvas {
  width: 100%;
  height: 122px;
  object-fit: cover;
}

.page-thumb span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 3px 6px;
  color: #fff;
  background: rgba(23, 32, 51, 0.72);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.page-strip.large,
.page-strip.organiser {
  flex-wrap: wrap;
  overflow: visible;
}

.page-strip.large .page-thumb,
.page-strip.organiser .page-thumb {
  flex-basis: 130px;
  min-height: 168px;
}

.empty-state {
  display: none;
  place-items: center;
  gap: 8px;
  min-height: 300px;
  text-align: center;
}

.empty-state.show {
  display: grid;
}

.empty-state > i {
  width: 54px;
  height: 54px;
  color: var(--primary);
}

.file-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.file-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compress-meter {
  height: 14px;
  overflow: hidden;
  margin: 14px 0;
  border-radius: 999px;
  background: #e8edf5;
}

.compress-meter span {
  display: block;
  width: 48%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.estimate,
.warning-list article {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.warning-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-color: #ffd3d3;
  background: #fff6f6;
}

.warning-list article p {
  margin: 3px 0 0;
  color: var(--muted);
}

.warning-list .safe {
  border-color: #bdeee3;
  background: #f0fffb;
}

.warning-list .safe i {
  color: #138a76;
}

.warning-list .danger i {
  color: var(--danger);
}

.ocr-explainer {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid #dce6f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.ocr-explainer h3 {
  margin: 0 0 4px;
}

.ocr-explainer p {
  margin: 0;
}

.compact-drop {
  min-height: 120px;
}

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

.image-tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
  min-height: 300px;
  padding: 26px;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(18, 28, 46, 0.95), rgba(21, 168, 143, 0.76)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1300&q=82") center/cover;
  box-shadow: var(--deep-shadow);
}

.image-tool-hero h2 {
  margin: 12px 0 8px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
}

.image-tool-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 750;
}

.image-tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.image-tool-badges span {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 950;
  backdrop-filter: blur(12px);
}

.image-editor-panel {
  padding: 20px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 253, 0.96));
}

.image-upload-drop {
  min-height: 136px;
  border-color: rgba(36, 87, 197, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(21, 168, 143, 0.16), transparent 9rem),
    radial-gradient(circle at bottom left, rgba(116, 98, 242, 0.12), transparent 8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.image-info-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 11px 12px;
  color: #40516a;
  border: 1px solid rgba(207, 224, 255, 0.82);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 255, 251, 0.76));
  font-size: 0.88rem;
  font-weight: 800;
}

.image-info-note i,
.image-info-note svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.form-fill-panel {
  padding: 20px;
  border-radius: 18px;
}

.form-fill-drop {
  border-color: rgba(36, 87, 197, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(36, 87, 197, 0.12), transparent 9rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.form-fill-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.form-fill-stage {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 560px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(36, 87, 197, 0.12), transparent 10rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.9));
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.55), 0 18px 38px rgba(23, 32, 51, 0.08);
}

.form-fill-stage canvas {
  width: 100%;
  max-height: 660px;
  object-fit: contain;
  border: 1px solid rgba(216, 225, 238, 0.72);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(23, 32, 51, 0.14);
  touch-action: none;
  cursor: default;
}

.form-fill-stage > span {
  padding: 6px 10px;
  color: var(--muted);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 850;
}

.image-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.image-control-stack {
  display: grid;
  gap: 12px;
}

.image-control-card {
  padding: 16px;
  border: 1px solid rgba(216, 225, 238, 0.84);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(36, 87, 197, 0.07), transparent 8rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.95));
  box-shadow: 0 14px 30px rgba(23, 32, 51, 0.07);
}

.compact-editor-card {
  display: grid;
  gap: 10px;
}

.control-note {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(234, 241, 255, 0.86), rgba(240, 255, 251, 0.7));
}

.control-note strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.control-note span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.image-control-card .tool-status {
  margin-top: 0;
}

.image-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.image-tool-row .btn,
.image-tool-row .icon-btn {
  margin: 0;
}

.compact-select {
  width: auto;
  min-width: 132px;
  flex: 1 1 132px;
}

.range-input {
  padding: 0;
  accent-color: var(--primary);
}

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

.slider-label strong {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  font-size: 0.78rem;
}

.smart-slider {
  height: 46px;
  padding: 0 2px;
  box-shadow: none;
}

.image-resize-preview {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 520px;
  margin: 0;
  padding: 16px;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(21, 168, 143, 0.13), transparent 10rem),
    radial-gradient(circle at bottom left, rgba(36, 87, 197, 0.12), transparent 11rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.9)),
    repeating-linear-gradient(45deg, #eef2f7 0 10px, #f8fbff 10px 20px);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.55), 0 18px 38px rgba(23, 32, 51, 0.08);
}

.image-resize-preview canvas {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border: 1px solid rgba(216, 225, 238, 0.72);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(23, 32, 51, 0.16);
  touch-action: none;
  cursor: default;
}

.image-resize-preview canvas:active {
  cursor: default;
}

.image-canvas-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(216, 225, 238, 0.76);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
}

.image-canvas-actions .btn {
  min-height: 40px;
  padding: 8px 11px;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.08);
}

.image-resize-preview img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.14);
}

.image-resize-preview span {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  font-weight: 850;
}

@media (max-width: 760px) {
  .image-tool-hero,
  .image-editor-grid,
  .form-fill-workspace {
    grid-template-columns: 1fr;
  }

  .image-tool-badges {
    justify-content: flex-start;
  }

  .image-tool-badges span {
    width: 58px;
    height: 58px;
  }

  .image-resize-preview {
    min-height: 390px;
  }

  .image-resize-preview canvas {
    max-height: 330px;
  }

  .form-fill-stage {
    min-height: 430px;
  }

  .form-fill-stage canvas {
    max-height: 430px;
  }

  .image-canvas-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 138px;
  }
}

body.dark-mode .image-control-card,
body.dark-mode .image-upload-drop,
body.dark-mode .form-fill-drop {
  background: linear-gradient(180deg, #1a263a, #141f31);
  border-color: #2d3b52;
}

body.dark-mode .control-note {
  background: rgba(36, 87, 197, 0.16);
}

body.dark-mode .image-info-note,
body.dark-mode .image-canvas-actions,
body.dark-mode .image-resize-preview span,
body.dark-mode .form-fill-stage > span {
  color: #dbe8ff;
  background: rgba(18, 28, 46, 0.82);
  border-color: #2d3b52;
}

body.dark-mode .image-resize-preview {
  background:
    radial-gradient(circle at top right, rgba(116, 98, 242, 0.14), transparent 10rem),
    linear-gradient(180deg, rgba(23, 32, 51, 0.94), rgba(18, 28, 46, 0.94));
}

body.dark-mode .form-fill-stage {
  background:
    radial-gradient(circle at top right, rgba(116, 98, 242, 0.14), transparent 10rem),
    linear-gradient(180deg, rgba(23, 32, 51, 0.94), rgba(18, 28, 46, 0.94));
}

.selected-file-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #dce6f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.selected-file-card.selected {
  border-color: #cfe0ff;
  background: linear-gradient(180deg, #ffffff, #eef5ff);
}

.selected-file-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-card p {
  margin: 3px 0 0;
}

.selected-file-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(36, 87, 197, 0.18);
}

.catalog-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.catalog-products-section {
  scroll-margin-top: 84px;
  padding: 12px;
  border: 1px solid rgba(207, 224, 255, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(21, 168, 143, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.86));
  box-shadow: 0 14px 34px rgba(36, 87, 197, 0.08);
}

.catalog-products-section .section-label {
  margin-top: 0;
}

.catalog-workspace {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(36, 87, 197, 0.08), transparent 34%),
    linear-gradient(300deg, rgba(236, 93, 145, 0.08), transparent 38%),
    #fff;
}

.catalog-workspace::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 220px;
  background: linear-gradient(90deg, transparent, rgba(21, 168, 143, 0.18), rgba(245, 184, 75, 0.16), transparent);
  transform: rotate(-6deg);
  animation: catalogShimmer 7s ease-in-out infinite;
  pointer-events: none;
}

.catalog-workspace > * {
  position: relative;
  z-index: 1;
}

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

.catalog-action-tile {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 142px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  border: 1px solid #dce6f4;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(36, 87, 197, 0.1), transparent 6.5rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 26px rgba(23, 32, 51, 0.07);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.catalog-action-tile::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 86px;
  height: 86px;
  border-radius: 28px;
  background: rgba(36, 87, 197, 0.08);
  transform: rotate(18deg);
  pointer-events: none;
}

.catalog-action-tile:nth-child(1) {
  border-color: rgba(116, 98, 242, 0.28);
  background:
    radial-gradient(circle at top right, rgba(116, 98, 242, 0.14), transparent 6rem),
    linear-gradient(180deg, #ffffff, #f8f7ff);
}

.catalog-action-tile:nth-child(3) {
  border-color: rgba(245, 184, 75, 0.36);
  background:
    radial-gradient(circle at top right, rgba(245, 184, 75, 0.18), transparent 6rem),
    linear-gradient(180deg, #ffffff, #fffaf0);
}

.catalog-action-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(23, 32, 51, 0.12);
}

.catalog-action-tile.primary {
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 7rem),
    linear-gradient(135deg, var(--primary), var(--accent));
}

.catalog-action-tile i,
.catalog-action-tile svg {
  width: 34px;
  height: 34px;
  color: var(--primary);
  filter: drop-shadow(0 8px 14px rgba(36, 87, 197, 0.14));
}

.catalog-action-tile.primary i,
.catalog-action-tile.primary svg {
  color: #fff;
}

.catalog-action-tile strong,
.catalog-action-tile span {
  display: block;
}

.catalog-action-tile strong {
  font-size: 1.02rem;
  line-height: 1.15;
}

.catalog-action-tile span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 780;
}

.catalog-action-tile.primary span {
  color: rgba(255, 255, 255, 0.86);
}

.catalog-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: min(82vh, 820px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(207, 224, 255, 0.95);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.98));
  box-shadow: 0 32px 90px rgba(23, 32, 51, 0.28);
}

.catalog-dialog.wide {
  width: min(1080px, calc(100% - 24px));
}

.catalog-dialog::backdrop {
  background: rgba(23, 32, 51, 0.58);
  backdrop-filter: blur(7px);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 18px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(245, 184, 75, 0.32), transparent 11rem),
    linear-gradient(135deg, #2457c5, #15a88f);
}

.dialog-head .icon-btn {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-height: 44px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.dialog-head .icon-btn i,
.dialog-head .icon-btn svg {
  pointer-events: none;
}

.dialog-head h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.12;
}

.dialog-head p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.dialog-head.danger-head {
  background:
    radial-gradient(circle at top right, rgba(245, 184, 75, 0.26), transparent 10rem),
    linear-gradient(135deg, #d54747, #ec5d91);
}

.master-products-panel {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(236, 93, 145, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(244, 247, 251, 0.92));
}

.master-products-panel .section-head h2 {
  font-size: 1.15rem;
}

.master-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.master-search {
  margin: 0;
  min-width: 0;
}

.master-validation {
  padding: 10px 12px;
  color: #9f1d1d;
  border: 1px solid rgba(213, 71, 71, 0.32);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(213, 71, 71, 0.12), rgba(245, 184, 75, 0.1));
  font-size: 0.82rem;
  font-weight: 920;
}

.master-validation[hidden] {
  display: none;
}

.master-search input {
  height: 56px;
  min-height: 56px;
}

.master-search i,
.master-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 1;
  width: 36px;
  height: 36px;
  padding: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 13px;
  transform: translateY(-50%);
  pointer-events: none;
}

.master-toolbar .btn {
  align-self: center;
  height: 56px;
  min-height: 56px;
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
}

.master-toolbar [data-add-master-selected].btn {
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 16px !important;
  border-radius: 14px;
}

.master-summary {
  padding: 10px 12px;
  color: #193f91;
  border: 1px solid rgba(207, 224, 255, 0.9);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(36, 87, 197, 0.1), rgba(21, 168, 143, 0.08));
  font-size: 0.82rem;
  font-weight: 900;
}

.master-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 460px;
  overflow: auto;
  padding: 2px 3px 4px 0;
}

.master-product-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(216, 225, 238, 0.9);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(116, 98, 242, 0.09), transparent 6rem),
    #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.master-product-card.selected,
.master-product-card:has(.master-select input:checked) {
  border-color: rgba(36, 87, 197, 0.52);
  background:
    radial-gradient(circle at top right, rgba(21, 168, 143, 0.16), transparent 6rem),
    linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 18px 38px rgba(36, 87, 197, 0.16);
}

.master-product-card.delete-pending {
  transform: scale(1.03);
  border-color: rgba(213, 71, 71, 0.58);
  background:
    radial-gradient(circle at top right, rgba(213, 71, 71, 0.18), transparent 6rem),
    linear-gradient(180deg, #ffffff, #fff1f1);
  box-shadow: 0 22px 44px rgba(213, 71, 71, 0.2);
  z-index: 2;
}

.master-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(23, 32, 51, 0.12);
}

.master-product-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 16px;
  background: #eef4ff;
  border: 1px solid rgba(216, 225, 238, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.master-select {
  position: absolute;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 7px;
  color: #08705f;
  background: rgba(232, 251, 247, 0.94);
  border: 1px solid rgba(207, 224, 255, 0.9);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 950;
}

.master-select input {
  width: 12px;
  height: 12px;
}

.master-product-copy {
  min-width: 0;
}

.master-product-copy strong,
.master-product-copy span,
.master-product-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-product-copy strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.master-meta,
.master-sku {
  display: inline-flex !important;
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  margin-top: 6px;
  border-radius: 999px;
}

.master-meta {
  color: var(--primary-dark);
  background: #eaf1ff;
  font-size: 0.74rem;
  font-weight: 950;
}

.master-sku {
  color: #8a5a04;
  background: #fff1d4;
  font-size: 0.7rem;
  font-weight: 900;
}

.master-product-copy small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.master-product-card .btn {
  position: relative;
  z-index: 3;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  touch-action: manipulation;
}

.master-product-card .btn i,
.master-product-card .btn svg {
  pointer-events: none;
}

.delete-dialog {
  width: min(560px, calc(100% - 24px));
}

.delete-dialog-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.delete-product-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(213, 71, 71, 0.26);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(236, 93, 145, 0.12), transparent 7rem),
    linear-gradient(180deg, #ffffff, #fff7f7);
}

.delete-product-preview img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(216, 225, 238, 0.9);
  box-shadow: 0 14px 30px rgba(23, 32, 51, 0.12);
}

.delete-product-preview strong,
.delete-product-preview span,
.delete-product-preview p {
  display: block;
}

.delete-product-preview strong {
  font-size: 1.12rem;
  line-height: 1.18;
}

.delete-product-preview span {
  width: max-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 9px;
  overflow: hidden;
  color: #193f91;
  background: #eaf1ff;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-product-preview p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.catalog-template-section {
  margin: 16px 0;
}

.catalog-template-rows {
  display: grid;
  gap: 14px;
}

.catalog-template-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(216, 225, 238, 0.86);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(36, 87, 197, 0.06), transparent 32%),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 26px rgba(23, 32, 51, 0.05);
}

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

.template-row-head strong,
.template-row-head span {
  display: block;
}

.template-row-head strong {
  font-size: 0.98rem;
  line-height: 1.15;
}

.template-row-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
}

.template-carousel-actions {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.template-arrow {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--primary-dark);
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  background: #eef5ff;
  box-shadow: 0 8px 18px rgba(36, 87, 197, 0.1);
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1;
}

.template-arrow:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.template-arrow[hidden] {
  display: none;
}

.template-arrow:not(:disabled):active {
  transform: scale(0.96);
}

.catalog-template-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 20px) / 3);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.catalog-template {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 250px;
  min-width: 0;
  padding: 11px;
  text-align: left;
  border: 1px solid #dce6f4;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(36, 87, 197, 0.1), transparent 5.8rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.catalog-template:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(23, 32, 51, 0.12);
}

.catalog-template.active {
  border-color: rgba(36, 87, 197, 0.5);
  background: linear-gradient(180deg, #eef5ff, #ffffff);
  box-shadow: 0 12px 26px rgba(36, 87, 197, 0.12);
}

.catalog-template.active {
  position: relative;
  min-height: 282px;
  border-width: 2px;
  transform: scale(1.03);
  z-index: 2;
  box-shadow: 0 20px 42px rgba(36, 87, 197, 0.22);
}

.catalog-template.active::after {
  content: "Selected";
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 4px 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(36, 87, 197, 0.22);
}

.catalog-template.active .template-page {
  height: 172px;
  border-color: rgba(36, 87, 197, 0.34);
}

.template-page {
  display: grid;
  gap: 4px;
  width: 100%;
  height: 150px;
  padding: 9px;
  border: 1px solid rgba(216, 225, 238, 0.95);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.08);
}

.template-header {
  grid-column: 1 / -1;
  height: 12px;
  border-radius: 5px;
  background:
    linear-gradient(90deg, #2457c5 0 44%, #15a88f 44% 57%, #f5b84b 57%);
}

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

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

.template-4 {
  grid-template-rows: 12px repeat(2, minmax(0, 1fr));
}

.template-6 {
  grid-template-rows: 12px repeat(2, minmax(0, 1fr));
}

.template-8 {
  grid-template-rows: 12px repeat(4, minmax(0, 1fr));
}

.template-9 {
  grid-template-rows: 12px repeat(3, minmax(0, 1fr));
}

.template-12 {
  grid-template-rows: 12px repeat(4, minmax(0, 1fr));
}

.template-product {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  padding: 3px;
  border: 1px solid rgba(216, 225, 238, 0.85);
  border-radius: 6px;
  background: #fbfdff;
}

.template-photo {
  position: relative;
  min-height: 16px;
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(135deg, #2457c5, #15a88f);
}

.template-photo::before,
.template-photo::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.template-photo::before {
  width: 42%;
  height: 42%;
  right: 8%;
  top: 10%;
  background: rgba(255, 255, 255, 0.65);
}

.template-photo::after {
  left: -8%;
  right: -8%;
  bottom: -26%;
  height: 58%;
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(-8deg);
}

.product-style-2 .template-photo {
  background: linear-gradient(135deg, #ec5d91, #f5b84b);
}

.product-style-3 .template-photo {
  background: linear-gradient(135deg, #7462f2, #2457c5);
}

.product-style-4 .template-photo {
  background: linear-gradient(135deg, #15a88f, #9bd86f);
}

.product-style-5 .template-photo {
  background: linear-gradient(135deg, #172033, #687589);
}

.product-style-6 .template-photo {
  background: linear-gradient(135deg, #f5b84b, #2457c5);
}

.template-page.image-only .template-photo {
  min-height: 100%;
}

.template-lines {
  display: grid;
  gap: 2px;
}

.template-lines span {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: #d9e3f2;
}

.template-lines span::before {
  content: attr(data-label);
  display: block;
  padding-left: 2px;
  color: #486078;
  font-size: 0.34rem;
  font-weight: 950;
  line-height: 7px;
}

.template-lines span[data-label="PRICE"] {
  width: 78%;
  background: #e8f7f3;
}

.template-lines span[data-label="PRICE"]::before {
  color: #08705f;
}

.template-lines span[data-label="SKU"] {
  width: 66%;
  background: #fff1d4;
}

.template-lines span[data-label="SKU"]::before {
  color: #8a5a04;
}

.template-lines span[data-label="DESC"] {
  width: 88%;
  background: #edf1fb;
}

.template-lines span[data-label="DESC"]::before {
  color: #516173;
}

.template-lines span[data-label="NAME"] {
  width: 92%;
}

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

.template-copy em {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 7px;
  margin-bottom: 6px;
  overflow: hidden;
  color: #193f91;
  background: #eaf1ff;
  border-radius: 999px;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-copy strong {
  font-size: 0.9rem;
  line-height: 1.15;
}

.template-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
  font-weight: 760;
}

@media (max-width: 560px) {
  .catalog-start-grid {
    grid-template-columns: 1fr;
  }

  .catalog-action-tile {
    min-height: 118px;
  }

  .catalog-dialog {
    width: calc(100% - 16px);
    max-height: 86vh;
    padding: 12px;
  }

  .master-toolbar {
    grid-template-columns: 1fr;
  }

  .master-toolbar .btn {
    width: 100%;
  }

  .master-product-grid {
    grid-template-columns: 1fr;
    max-height: 380px;
  }

  .master-product-card {
    grid-template-columns: 82px minmax(0, 1fr) auto;
  }

  .master-product-card img {
    width: 82px;
    height: 82px;
  }

  .delete-product-preview {
    grid-template-columns: 1fr;
  }

  .delete-product-preview img {
    width: 100%;
    height: 220px;
  }

  .catalog-template-row {
    padding: 10px;
  }

  .template-row-head {
    align-items: flex-start;
  }

  .catalog-template-grid {
    grid-auto-columns: calc((100% - 12px) / 2.35);
    gap: 8px;
  }

  .catalog-template {
    min-height: 226px;
    padding: 8px;
    border-radius: 14px;
  }

  .template-page {
    height: 122px;
    padding: 6px;
    gap: 3px;
  }

  .template-copy em {
    font-size: 0.56rem;
  }

  .template-copy strong {
    font-size: 0.74rem;
  }

  .template-copy span {
    font-size: 0.64rem;
  }

  .template-lines span {
    height: 6px;
  }

  .template-lines span::before {
    font-size: 0.3rem;
    line-height: 6px;
  }
}

.catalog-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(216, 225, 238, 0.86);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.06);
  animation: catalogItemIn 0.34s ease both;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.catalog-item:focus-within {
  transform: translateY(-2px);
  border-color: rgba(36, 87, 197, 0.48);
  background:
    linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 18px 38px rgba(36, 87, 197, 0.16);
}

.catalog-item img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 13px;
  background: #eef4ff;
  border: 1px solid rgba(216, 225, 238, 0.9);
}

.catalog-fields {
  display: grid;
  gap: 8px;
}

.catalog-fields label {
  margin: 0;
  color: #516173;
  font-size: 0.74rem;
  font-weight: 900;
}

.catalog-fields .input {
  margin-top: 4px;
}

.form-grid.tight {
  gap: 8px;
}

.catalog-item .btn {
  min-height: 40px;
  padding: 9px 10px;
}

.catalog-item .btn i,
.catalog-item .btn svg {
  pointer-events: none;
}

.protect-note {
  border-color: #ffe3ad;
  background: #fff9ed;
}

.signature-pad {
  width: 100%;
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.sign-import-panel {
  margin-bottom: 14px;
}

.mini-doc {
  display: grid;
  place-items: end center;
  min-height: 360px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, #eef2f7 0 1px, transparent 1px 34px);
}

.mini-doc img {
  max-width: 220px;
}

.sign-preview-doc {
  place-items: center;
  padding: 14px;
  overflow: hidden;
}

.sign-page-preview {
  position: relative;
  width: min(260px, 100%);
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.12);
  touch-action: none;
  cursor: grab;
}

.sign-page-preview:active {
  cursor: grabbing;
}

.sign-page-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  opacity: 0.88;
}

.sign-overlay {
  position: absolute;
  left: 72%;
  top: 75%;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 130px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  transform: translate(-50%, -50%);
  touch-action: none;
  user-select: none;
}

.sign-preview-img {
  max-width: 150px;
  max-height: 58px;
}

.sign-overlay strong,
.sign-date {
  color: #172033;
  font-size: 0.78rem;
}

.sign-placeholder {
  color: var(--muted);
  font-weight: 850;
}

.sign-page-preview em {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 900;
}

.sign-scope-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  max-width: 116px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  color: #2457c5;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(36, 87, 197, 0.16);
  font-size: 0.68rem;
  font-weight: 900;
}

.sign-pages-input[hidden] {
  display: none;
}

.sign-preview-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}

.sign-preview-empty i {
  color: var(--primary);
}

.metric {
  padding: 16px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.metric strong {
  display: block;
  margin: 6px 0;
  font-size: 1.55rem;
}

.plan-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.plan-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.price {
  font-size: 2rem;
  font-weight: 950;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 86px;
  z-index: 90;
  display: none;
  padding: 14px 16px;
  color: #fff;
  background: #172033;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 66px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  cursor: pointer;
}

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

.legal {
  max-width: 760px;
}

@media (min-width: 760px) {
  .app {
    padding-bottom: 0;
  }

  .bottom-nav {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 170px;
    align-items: center;
  }

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

  .editor-grid,
  .sign-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .form-grid,
  .settings-grid,
  .plan-grid,
  .metrics,
  .admin-panels,
  .share-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .action-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  main {
    width: min(100% - 22px, 1120px);
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: 380px;
    align-content: space-between;
  }

  .scan-fab {
    width: 120px;
    height: 120px;
  }

  .file-row {
    grid-template-columns: auto 1fr;
  }
}

/* Native-app polish layer */
body {
  background:
    radial-gradient(circle at top right, rgba(116, 98, 242, 0.18), transparent 22rem),
    radial-gradient(circle at top left, rgba(21, 168, 143, 0.14), transparent 18rem),
    linear-gradient(180deg, #fbfdff, var(--paper));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(36, 87, 197, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 87, 197, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}

.splash-card {
  animation: riseIn 0.55s ease both;
}

.topbar {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.05);
}

.brand-mark {
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 10px 22px rgba(36, 87, 197, 0.26);
}

.screen.active {
  animation: screenIn 0.28s ease both;
}

.hero {
  position: relative;
  background:
    radial-gradient(circle at 88% 18%, rgba(245, 184, 75, 0.42), transparent 14rem),
    linear-gradient(135deg, rgba(23, 32, 51, 0.94), rgba(36, 87, 197, 0.84), rgba(116, 98, 242, 0.72)),
    url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1300&q=80") center/cover;
}

.hero::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  transform: rotate(12deg);
}

.scan-fab {
  animation: pulseGlow 2.2s ease-in-out infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.scan-fab:hover {
  transform: translateY(-2px) scale(1.02);
}

.quick-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.quick-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -34px auto;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(36, 87, 197, 0.08);
}

.quick-card:nth-child(3n + 2)::after {
  background: rgba(21, 168, 143, 0.1);
}

.quick-card:nth-child(3n)::after {
  background: rgba(245, 184, 75, 0.16);
}

.quick-card:hover,
.recent-item:hover,
.plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 87, 197, 0.42);
  box-shadow: var(--soft-shadow);
}

.quick-card i {
  color: #fff;
  padding: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(36, 87, 197, 0.2);
}

.btn,
.chip,
.icon-btn,
.mode-btn,
.page-thumb,
.recent-item,
.plan-card {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 12px 24px rgba(36, 87, 197, 0.22);
}

.btn.secondary:hover,
.icon-btn:hover,
.mode-btn:hover {
  border-color: rgba(36, 87, 197, 0.35);
  background: var(--primary-soft);
}

.chip.active,
.mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
}

.recent-thumb {
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--amber));
}

.capture-card label,
.file-drop {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(234, 241, 255, 0.82)),
    #fff;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.capture-card label:hover,
.file-drop:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: var(--soft-shadow);
}

.phone-preview {
  background:
    radial-gradient(circle at center, rgba(36, 87, 197, 0.24), transparent 15rem),
    #1a2433;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.04), var(--shadow);
}

.edge-frame {
  animation: edgeScan 1.7s ease-in-out infinite;
}

.tool-panel {
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.page-thumb {
  box-shadow: 0 8px 16px rgba(23, 32, 51, 0.08);
}

.page-thumb.active {
  transform: translateY(-2px);
}

.page-card {
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.08);
}

.compress-meter span {
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--amber));
  transition: width 0.22s ease;
}

.signature-pad {
  box-shadow: inset 0 0 0 1px rgba(36, 87, 197, 0.04);
}

.mini-doc {
  box-shadow: inset 0 0 0 8px #f8fbff;
}

.metric {
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(36, 87, 197, 0.08);
}

.bottom-nav {
  min-height: 70px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 -12px 28px rgba(23, 32, 51, 0.08);
}

.bottom-nav button {
  position: relative;
}

.bottom-nav button.active::before {
  content: "";
  position: absolute;
  top: 7px;
  width: 42px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  z-index: -1;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.22), 0 0 0 0 rgba(245, 184, 75, 0.34);
  }
  50% {
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.22), 0 0 0 12px rgba(245, 184, 75, 0);
  }
}

@keyframes edgeScan {
  0%,
  100% {
    border-color: rgba(245, 184, 75, 0.96);
  }
  50% {
    border-color: rgba(21, 168, 143, 0.96);
  }
}

@keyframes catalogShimmer {
  0%,
  100% {
    transform: translateX(-8%) rotate(-6deg);
    opacity: 0.58;
  }
  50% {
    transform: translateX(8%) rotate(-6deg);
    opacity: 0.9;
  }
}

@keyframes catalogItemIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Mobile-first color system: visible without hover */
.quick-card {
  border: 0;
  color: #fff;
  box-shadow: 0 14px 30px rgba(23, 32, 51, 0.12);
}

.quick-card strong,
.quick-card span {
  position: relative;
  z-index: 1;
}

.quick-card > span:not(.tool-badge):not(.tool-icon) {
  color: rgba(255, 255, 255, 0.82);
}

.quick-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 7rem);
}

.quick-card::after {
  background: rgba(255, 255, 255, 0.16);
}

.quick-card.tone-blue {
  background: linear-gradient(145deg, #2457c5, #5b78f0);
}

.quick-card.tone-green {
  background: linear-gradient(145deg, #0f8f7a, #19c6a8);
}

.quick-card.tone-amber {
  background: linear-gradient(145deg, #d78611, #f5b84b);
}

.quick-card.tone-pink {
  background: linear-gradient(145deg, #d94f83, #ec5d91);
}

.quick-card.tone-violet {
  background: linear-gradient(145deg, #624ee8, #927df8);
}

.quick-card .tool-icon i {
  color: #17304d;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.quick-card i {
  color: #17304d;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.btn.secondary.tinted {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: #cfe0ff;
}

.bottom-nav button {
  color: #768399;
}

.bottom-nav button i,
.bottom-nav button svg {
  padding: 6px;
  border-radius: 14px;
  background: transparent;
}

.bottom-nav button.active i,
.bottom-nav button.active svg {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 8px 18px rgba(36, 87, 197, 0.25);
}

.bottom-nav button.active::before {
  display: none;
}

.smart-strip article:nth-child(1) {
  background: linear-gradient(145deg, #fff, #eaf1ff);
}

.smart-strip article:nth-child(2) {
  background: linear-gradient(145deg, #fff, #e9fbf7);
}

.smart-strip article:nth-child(3) {
  background: linear-gradient(145deg, #fff, #fff5df);
}

/* Mobile search pill */
.search-box {
  margin: 18px 0;
}

.search-box input {
  min-height: 58px;
  padding-left: 60px;
  border: 1px solid #d7e4f8;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.94));
  box-shadow: 0 12px 28px rgba(36, 87, 197, 0.08);
  font-size: 1rem;
  font-weight: 750;
}

.search-box input::placeholder {
  color: #8a96aa;
  font-weight: 750;
}

.search-box i {
  left: 13px;
  width: 36px;
  height: 36px;
  padding: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(36, 87, 197, 0.2);
}

.search-box:focus-within input {
  border-color: rgba(36, 87, 197, 0.52);
  box-shadow: 0 14px 34px rgba(36, 87, 197, 0.14), 0 0 0 4px rgba(36, 87, 197, 0.1);
}

.search-box:focus-within i {
  background: linear-gradient(135deg, var(--violet), var(--pink));
}

.mode-btn {
  background: #f8fbff;
}

.mode-btn.active {
  box-shadow: 0 10px 20px rgba(21, 168, 143, 0.2);
}

.page-tools button {
  background: #f8fbff;
}

.page-tools button:nth-child(1),
.page-tools button:nth-child(2) {
  color: var(--primary);
  background: #eaf1ff;
}

.page-tools button:nth-child(3) {
  color: #8a5a04;
  background: #fff5df;
}

.page-tools button:nth-child(4) {
  color: var(--danger);
  background: #fff0f0;
}

@media (max-width: 560px) {
  .quick-card {
    padding: 14px;
  }

  .tool-icon {
    width: 46px;
    height: 46px;
  }

  .search-box input {
    min-height: 56px;
    border-radius: 17px;
  }
}

/* Bottom navigation mobile tab treatment */
.bottom-nav {
  min-height: 76px;
  padding: 7px 10px 8px;
  gap: 6px;
  z-index: 80;
}

.bottom-nav button {
  min-height: 56px;
  min-width: 0;
  border-radius: 18px;
  color: #768399;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease;
}

.bottom-nav button * {
  pointer-events: none;
}

.bottom-nav button i,
.bottom-nav button svg {
  width: 38px;
  height: 38px;
  padding: 7px;
  color: #6f7b91;
  background: #f2f5fa;
  border: 1px solid #e3eaf4;
  border-radius: 14px;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.14s ease;
}

.bottom-nav button.active {
  color: var(--primary-dark);
  background: linear-gradient(180deg, #eef5ff, #ffffff);
  box-shadow: inset 0 0 0 1px #d6e5ff, 0 8px 18px rgba(36, 87, 197, 0.12);
}

.bottom-nav button.active i,
.bottom-nav button.active svg {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 8px 18px rgba(36, 87, 197, 0.25);
  transform: translateY(-2px);
}

.bottom-nav button:nth-child(2).active i,
.bottom-nav button:nth-child(2).active svg {
  background: linear-gradient(135deg, #15a88f, #25c2a8);
}

.bottom-nav button:nth-child(3).active i,
.bottom-nav button:nth-child(3).active svg {
  background: linear-gradient(135deg, #2457c5, #15a88f);
}

.bottom-nav button:nth-child(4).active i,
.bottom-nav button:nth-child(4).active svg {
  background: linear-gradient(135deg, #7462f2, #ec5d91);
}

/* Refined mobile tool cards with document-preview art */
.action-grid {
  gap: 12px;
}

.quick-card {
  min-height: 158px;
  align-content: space-between;
  border: 1px solid rgba(216, 225, 238, 0.78);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
  box-shadow: 0 12px 26px rgba(23, 32, 51, 0.08);
}

.quick-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.95;
  background:
    linear-gradient(90deg, var(--card-accent, #2457c5) 0 5px, transparent 5px),
    radial-gradient(circle at 92% 14%, var(--card-glow, rgba(36, 87, 197, 0.16)), transparent 5.6rem);
}

.quick-card::after {
  display: none;
}

.quick-card.tone-blue {
  --card-accent: #2457c5;
  --card-glow: rgba(36, 87, 197, 0.18);
}

.quick-card.tone-green {
  --card-accent: #15a88f;
  --card-glow: rgba(21, 168, 143, 0.17);
}

.quick-card.tone-amber {
  --card-accent: #f5b84b;
  --card-glow: rgba(245, 184, 75, 0.22);
}

.quick-card.tone-pink {
  --card-accent: #ec5d91;
  --card-glow: rgba(236, 93, 145, 0.18);
}

.quick-card.tone-violet {
  --card-accent: #7462f2;
  --card-glow: rgba(116, 98, 242, 0.18);
}

.tool-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-right: 42px;
}

.tool-main strong,
.tool-main span {
  display: block;
}

.tool-main strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.tool-main span span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.tool-badge {
  color: var(--card-accent, var(--primary));
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 12%, #fff);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--primary)) 26%, #fff);
}

.quick-card .tool-icon i,
.quick-card i {
  color: var(--card-accent, var(--primary));
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.tool-art {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 0;
  display: block;
  width: 62px;
  height: 74px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.62)),
    color-mix(in srgb, var(--card-accent, var(--primary)) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--primary)) 18%, #fff);
  box-shadow: 0 12px 20px rgba(23, 32, 51, 0.08);
  transform: rotate(4deg);
}

.tool-art span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 38%, #fff);
}

.tool-art span:nth-child(1) {
  top: 18px;
}

.tool-art span:nth-child(2) {
  top: 31px;
  right: 22px;
}

.tool-art span:nth-child(3) {
  top: 48px;
  width: 24px;
  height: 14px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 24%, #fff);
}

@media (max-width: 560px) {
  .quick-card {
    min-height: 150px;
    padding: 14px 12px 12px 16px;
  }

  .tool-main {
    grid-template-columns: 42px minmax(0, 1fr);
    padding-right: 34px;
  }

  .tool-icon {
    width: 42px;
    height: 42px;
  }

  .tool-art {
    width: 54px;
    height: 64px;
    opacity: 0.92;
  }
}

/* Clean tool card reset: no repeated preview artwork */
.quick-card {
  min-height: 132px;
  padding: 14px;
  align-content: start;
  gap: 12px;
  color: var(--ink);
  background:
    radial-gradient(circle at 96% 0, var(--card-glow, rgba(36, 87, 197, 0.12)), transparent 5.2rem),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(216, 225, 238, 0.85);
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.07);
}

.quick-card::before {
  background: linear-gradient(180deg, var(--card-accent, #2457c5), transparent 82%);
  width: 4px;
  right: auto;
  opacity: 1;
}

.tool-art {
  display: none;
}

.tool-main {
  grid-template-columns: 48px minmax(0, 1fr);
  padding-right: 0;
}

.tool-icon {
  width: 48px;
  height: 48px;
  color: #fff;
  background: linear-gradient(135deg, var(--card-accent, var(--primary)), color-mix(in srgb, var(--card-accent, var(--primary)) 72%, #ffffff));
  border: 0;
  box-shadow: 0 10px 18px color-mix(in srgb, var(--card-accent, var(--primary)) 22%, transparent);
}

.quick-card .tool-icon i,
.quick-card i {
  color: #fff;
}

.tool-main strong {
  color: #142035;
}

.tool-main span span {
  color: #657289;
}

.tool-badge {
  justify-self: start;
  color: var(--card-accent, var(--primary));
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 10%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--primary)) 20%, #ffffff);
}

@media (max-width: 560px) {
  .quick-card {
    min-height: 124px;
    padding: 13px;
  }

  .tool-main {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .tool-icon {
    width: 44px;
    height: 44px;
  }
}

/* Dark mode */
body.dark-mode {
  --ink: #edf4ff;
  --muted: #aab8cc;
  --paper: #101827;
  --panel: #172033;
  --line: #29364b;
  background:
    radial-gradient(circle at top right, rgba(116, 98, 242, 0.18), transparent 22rem),
    linear-gradient(180deg, #111a2b, #0c1220);
}

body.dark-mode .topbar,
body.dark-mode .bottom-nav,
body.dark-mode .panel,
body.dark-mode .feature-center,
body.dark-mode .recent-item,
body.dark-mode .tool-panel,
body.dark-mode .preview-panel,
body.dark-mode .plan-card {
  background: rgba(23, 32, 51, 0.92);
  border-color: #29364b;
}

body.dark-mode .quick-card,
body.dark-mode .quick-card.tone-blue,
body.dark-mode .quick-card.tone-green,
body.dark-mode .quick-card.tone-amber,
body.dark-mode .quick-card.tone-pink,
body.dark-mode .quick-card.tone-violet,
body.dark-mode .feature-pill,
body.dark-mode .feature-card {
  background: linear-gradient(180deg, #1a263a, #141f31) !important;
  border-color: #2d3b52;
}

body.dark-mode .tool-main strong,
body.dark-mode .feature-card h3,
body.dark-mode .recent-item h3 {
  color: #f4f8ff;
}

body.dark-mode .input,
body.dark-mode .search-box input,
body.dark-mode .mode-btn,
body.dark-mode .page-tools button {
  color: #edf4ff;
  background: #121c2e;
  border-color: #2d3b52;
}

body.dark-mode .search-box input::placeholder {
  color: #7f8da3;
}

body.dark-mode .smart-strip article {
  background: rgba(23, 32, 51, 0.86);
  border-color: #29364b;
}

body.dark-mode .mini-doc,
body.dark-mode .signature-pad {
  background: #111a2b;
  border-color: #29364b;
}

/* Top mobile app bar treatment */
.topbar {
  min-height: 74px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(216, 225, 238, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.9));
  box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

.topbar .brand {
  padding: 5px 8px 5px 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.topbar .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 1.2rem),
    linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 12px 24px rgba(36, 87, 197, 0.28);
}

.topbar .brand > span:last-child {
  display: grid;
  gap: 1px;
  font-size: 1.34rem;
  line-height: 1.08;
}

.topbar .brand small {
  color: #657289;
  font-size: 0.78rem;
  font-weight: 850;
}

.topbar .icon-btn {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  color: var(--primary-dark);
  background:
    linear-gradient(180deg, #ffffff, #f2f7ff);
  border-color: #d8e6ff;
  box-shadow: 0 10px 22px rgba(36, 87, 197, 0.12);
}

.topbar .icon-btn i {
  width: 26px;
  height: 26px;
}

.topbar .icon-btn:active {
  transform: scale(0.96);
}

/* Rich mobile app finish */
.topbar {
  min-height: 72px;
  border-bottom-color: rgba(216, 225, 238, 0.72);
}

.brand {
  letter-spacing: 0;
}

.brand small {
  margin-top: 1px;
  font-weight: 800;
}

.hero,
.panel,
.quick-card,
.recent-item,
.capture-card label,
.file-drop,
.phone-preview,
.tool-panel,
.preview-panel,
.plan-card,
.metric {
  border-color: rgba(216, 225, 238, 0.74);
}

.hero {
  min-height: 410px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: var(--deep-shadow);
}

.panel,
.tool-panel,
.preview-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.94));
}

.quick-card {
  min-height: 142px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 251, 255, 0.96));
}

.quick-card:active,
.btn:active,
.bottom-nav button:active {
  transform: scale(0.98);
}

.quick-card:nth-child(1) i,
.quick-card:nth-child(5) i,
.quick-card:nth-child(9) i {
  background: linear-gradient(135deg, #2457c5, #7462f2);
}

.quick-card:nth-child(2) i,
.quick-card:nth-child(6) i,
.quick-card:nth-child(10) i {
  background: linear-gradient(135deg, #15a88f, #25c2a8);
}

.quick-card:nth-child(3) i,
.quick-card:nth-child(7) i {
  background: linear-gradient(135deg, #f5b84b, #ec5d91);
}

.quick-card:nth-child(4) i,
.quick-card:nth-child(8) i {
  background: linear-gradient(135deg, #ec5d91, #7462f2);
}

.search-box input,
.input {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.search-box input:focus,
.input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(36, 87, 197, 0.16);
  border-color: rgba(36, 87, 197, 0.5);
}

.home-search-box .search-action {
  left: 16px;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
}

.home-search-box input {
  padding-left: 76px;
}

.home-search-box .search-action i {
  position: static;
  width: 20px;
  height: 20px;
  padding: 0;
  color: currentColor;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

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

.empty-canvas i {
  width: 58px;
  height: 58px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.page-tools button:hover {
  background: var(--primary-soft);
  border-color: rgba(36, 87, 197, 0.34);
}

.toast {
  left: 50%;
  right: auto;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(23, 32, 51, 0.94);
  backdrop-filter: blur(14px);
}

.bottom-nav {
  min-height: 76px;
  border-top-color: rgba(216, 225, 238, 0.72);
}

.bottom-nav i,
.bottom-nav svg {
  width: 24px;
  height: 24px;
}

.fallback-icon {
  display: inline-grid;
  place-items: center;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  font-size: 0.9rem;
}

.bottom-nav button.active {
  font-weight: 950;
}

@media (max-width: 560px) {
  .hero {
    min-height: 430px;
    padding: 22px;
  }

  .smart-strip {
    margin-left: 4px;
    margin-right: 4px;
  }

  .quick-card {
    min-height: 136px;
  }
}

/* Final DocQuick tool style: calm productivity app tiles */
.action-grid {
  gap: 10px;
}

.quick-card,
.quick-card.tone-blue,
.quick-card.tone-green,
.quick-card.tone-amber,
.quick-card.tone-pink,
.quick-card.tone-violet {
  min-height: 118px;
  padding: 12px;
  gap: 9px;
  align-content: start;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.96)) !important;
  border: 1px solid #dce6f4;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.07);
}

.quick-card::before {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  opacity: 1;
  background:
    linear-gradient(90deg, var(--card-accent, var(--primary)) 0 4px, transparent 4px),
    radial-gradient(circle at top right, color-mix(in srgb, var(--card-accent, var(--primary)) 12%, transparent), transparent 5rem);
}

.quick-card::after,
.tool-art {
  display: none !important;
}

.quick-card.tone-blue {
  --card-accent: #2c64d8;
}

.quick-card.tone-green {
  --card-accent: #13a88e;
}

.quick-card.tone-amber {
  --card-accent: #e89a17;
}

.quick-card.tone-pink {
  --card-accent: #df5788;
}

.quick-card.tone-violet {
  --card-accent: #725eea;
}

.tool-badge {
  justify-self: start;
  padding: 3px 7px;
  color: var(--card-accent);
  background: color-mix(in srgb, var(--card-accent) 9%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--card-accent) 18%, #ffffff);
  border-radius: 999px;
  font-size: 0.64rem;
  line-height: 1.2;
}

.tool-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding-right: 0;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-accent) 13%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--card-accent) 22%, #ffffff);
  box-shadow: none;
}

.quick-card .tool-icon i,
.quick-card i {
  width: 25px;
  height: 25px;
  color: var(--card-accent);
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.tool-main strong {
  color: #172033;
  font-size: 0.92rem;
  line-height: 1.15;
}

.tool-main span span {
  margin-top: 4px;
  color: #6b7688;
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 750;
}

.quick-card:active {
  transform: scale(0.985);
  background: color-mix(in srgb, var(--card-accent) 5%, #ffffff) !important;
}

@media (max-width: 560px) {
  .action-grid {
    gap: 10px;
  }

  .quick-card,
  .quick-card.tone-blue,
  .quick-card.tone-green,
  .quick-card.tone-amber,
  .quick-card.tone-pink,
  .quick-card.tone-violet {
    min-height: 112px;
    padding: 11px;
    border-radius: 15px;
  }

  .tool-main {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
  }

  .tool-icon {
    width: 40px;
    height: 40px;
  }

  .tool-main strong {
    font-size: 0.88rem;
  }

  .tool-main span span {
    font-size: 0.72rem;
  }

  .catalog-item {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .catalog-item img {
    width: 74px;
    height: 74px;
  }

  .catalog-item .btn {
    grid-column: 1 / -1;
    justify-self: end;
  }
}
