:root {
  --ink: #17211b;
  --text: #38443d;
  --muted: #6f7b72;
  --line: #dce3dc;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --sage: #dbe9dc;
  --green: #246b46;
  --green-dark: #184e34;
  --gold: #d99c2b;
  --coral: #d9674e;
  --blue: #3d6f8f;
  --neon: #00d9ff;
  --neon-green: #25f28f;
  --shadow: 0 22px 65px rgba(23, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(251, 250, 246, 0.92);
  border-bottom: 1px solid rgba(220, 227, 220, 0.82);
  backdrop-filter: blur(16px);
}

.admin-shell {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(23, 78, 52, 0.86)),
    var(--paper);
}

.admin-page {
  background: #f3f6f4;
}

.modal-open {
  overflow: hidden;
}

.admin-login-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
}

.admin-login-dialog {
  position: relative;
  width: 100%;
  display: grid;
  justify-items: center;
}

.admin-login-card {
  display: grid;
  gap: 18px;
  width: min(100%, 440px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin-bottom: 10px;
  font-size: 3rem;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 72px);
  background: #111827;
  border-bottom: 1px solid #263244;
  color: #e5e7eb;
}

.admin-header .brand {
  color: #fff;
}

.admin-header .brand-mark {
  background: #22c55e;
  color: #052e16;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #cbd5e1;
  font-size: 0.94rem;
}

.admin-nav a:hover {
  color: #fff;
}

.admin-header .header-action {
  background: #1f2937;
  border: 1px solid #334155;
  color: #fff;
}

.flash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 12px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid;
  font-weight: 800;
}

.flash-banner button {
  flex: 0 0 auto;
  width: 30px;
  min-height: 30px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.flash-success {
  border-color: #7cb98f;
  background: #e7f5eb;
  color: #184e34;
}

.flash-warning {
  border-color: #d8ad4a;
  background: #fff5d7;
  color: #76520f;
}

.flash-error {
  border-color: #d68a80;
  background: #fde8e4;
  color: #8a2d22;
}

.flash-modal {
  width: min(90vw, 720px);
  margin: 0 auto 10px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 0.92rem;
  box-shadow: 0 14px 38px rgba(2, 6, 23, 0.22);
}

.flash-modal button {
  width: 28px;
  min-height: 28px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid rgba(111, 123, 114, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-pill + .status-pill {
  margin-left: 6px;
}

.status-neon,
.status-new,
.status-active,
.status-in-progress,
.status-proof-ready {
  border-color: rgba(0, 217, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(37, 242, 143, 0.12)),
    #f7feff;
  color: #027c94;
  box-shadow:
    0 0 0 1px rgba(0, 217, 255, 0.06),
    0 0 14px rgba(0, 217, 255, 0.18);
}

.status-implemented,
.status-complete,
.status-completed,
.status-mailed {
  border-color: rgba(37, 242, 143, 0.38);
  background:
    linear-gradient(135deg, rgba(37, 242, 143, 0.18), rgba(36, 107, 70, 0.08)),
    #f7fff9;
  color: #0b7442;
}

.status-warning,
.status-reviewing,
.status-awaiting-artwork,
.status-not-started,
.status-pending {
  border-color: rgba(217, 156, 43, 0.34);
  background: #fffaf0;
  color: #8a620e;
}

.status-closed {
  border-color: rgba(111, 123, 114, 0.2);
  background: #f4f6f5;
  color: var(--muted);
}

.brand,
.main-nav,
.hero-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
}

.main-nav {
  gap: 24px;
  color: var(--muted);
  font-size: 0.94rem;
}

.main-nav a:hover {
  color: var(--green-dark);
}

.header-action,
.button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 800;
}

.header-action {
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
}

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

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

.inline-link {
  color: var(--green-dark);
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 72px);
  padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 72px) 58px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.06;
}

h1 {
  max-width: 820px;
  margin-bottom: 20px;
  font-size: clamp(2.55rem, 5vw, 4.65rem);
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h3 {
  margin-bottom: 12px;
  font-size: 1.35rem;
}

.hero-text {
  max-width: 650px;
  color: var(--text);
  font-size: 1.18rem;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.campaign-preview {
  display: grid;
  gap: 18px;
}

.postcard {
  aspect-ratio: 1.45;
  padding: clamp(18px, 4vw, 34px);
  background:
    linear-gradient(135deg, rgba(36, 107, 70, 0.12), rgba(217, 156, 43, 0.18)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.postcard-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.postcard-top strong {
  color: var(--green-dark);
}

.ad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(22px, 4vw, 42px);
}

.ad-grid div {
  display: grid;
  min-height: 78px;
  place-items: center;
  border: 1px solid rgba(23, 33, 27, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 900;
}

.campaign-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.campaign-stats div,
.package-card,
blockquote,
.portal-panel,
.dashboard-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.campaign-stats div {
  padding: 18px;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 900;
}

.section,
.process-section,
.order-section,
.portal-section,
.page-hero,
.form-page,
.admin-layout,
.ad-detail {
  padding: 80px clamp(20px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

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

.package-card {
  padding: 28px;
}

.package-card.featured {
  border-color: rgba(36, 107, 70, 0.38);
  box-shadow: var(--shadow);
}

.card-size {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--coral);
  font-size: 0.9rem;
  font-weight: 900;
}

.package-card ul {
  display: grid;
  gap: 8px;
  margin: 22px 0;
  padding-left: 20px;
}

.package-card a {
  color: var(--green-dark);
  font-weight: 900;
}

.process-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.45fr) 1fr;
  gap: 42px;
  background: var(--sage);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 22px;
  border-left: 4px solid var(--green);
  background: rgba(255, 255, 255, 0.62);
}

.steps span,
.dashboard-header span {
  display: block;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 900;
}

.steps strong {
  display: block;
  margin: 8px 0;
  color: var(--ink);
}

.order-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) 1fr;
  gap: 42px;
  align-items: start;
}

.order-form,
.login-form {
  display: grid;
  gap: 16px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(61, 111, 143, 0.022), transparent 46%),
    #fbfcfd;
  color: var(--ink);
  font: inherit;
  min-height: 46px;
  padding: 11px 13px;
}

textarea {
  background:
    linear-gradient(135deg, rgba(61, 111, 143, 0.027), transparent 42%),
    #fbfcfd !important;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(111, 123, 114, 0.32);
  opacity: 1;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: rgba(111, 123, 114, 0.32);
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: rgba(111, 123, 114, 0.32);
  opacity: 1;
}

.full-width,
.order-form button,
.form-status {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--green-dark);
  font-weight: 800;
}

.muted {
  background: #eef3ee;
}

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

blockquote {
  margin: 0;
  padding: 28px;
}

blockquote p {
  color: var(--ink);
  font-size: 1.2rem;
}

cite {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.portal-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.65fr);
  gap: 22px;
  align-items: stretch;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.48fr);
  gap: 28px;
  align-items: end;
  padding: 64px clamp(20px, 5vw, 72px) 36px;
}

.portal-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

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

.portal-summary div,
.portal-card,
.campaign-list-panel,
.postcard-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.portal-summary div {
  padding: 16px;
}

.portal-summary span,
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.portal-summary strong {
  color: var(--ink);
  font-size: 2rem;
}

.portal-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px) 40px;
}

.campaign-list-panel,
.postcard-panel {
  padding: 24px;
}

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

.campaign-row {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.campaign-row:hover {
  border-color: rgba(36, 107, 70, 0.42);
  background: #fff;
}

.campaign-row span,
.campaign-row strong {
  color: var(--ink);
}

.campaign-row small {
  color: var(--muted);
  font-weight: 800;
}

.client-postcard {
  box-shadow: none;
}

.client-ad-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.client-ad-slot {
  display: grid;
  min-height: 118px;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(23, 33, 27, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 900;
}

.selected-slot {
  grid-row: span 2;
  border-color: rgba(36, 107, 70, 0.55);
  background: #fff;
}

.selected-slot span,
.selected-slot em {
  color: var(--green-dark);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-slot p {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.campaign-detail {
  margin-top: 20px;
}

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

.detail-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.detail-grid strong {
  display: block;
  color: var(--ink);
}

.portal-forms {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px) 80px;
}

.portal-card {
  align-content: start;
  padding: 24px;
}

.portal-card h2 {
  grid-column: 1 / -1;
  font-size: 1.85rem;
}

.portal-panel,
.dashboard-preview {
  padding: 30px;
}

.portal-panel {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 0.55fr);
  gap: 30px;
}

.dashboard-preview {
  display: grid;
  gap: 24px;
}

.dashboard-header strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.65rem;
}

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

.status-list div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.dot.complete {
  border-color: var(--green);
  background: var(--green);
}

.dot.active {
  border-color: var(--neon);
  background: var(--neon);
  box-shadow: 0 0 14px rgba(0, 217, 255, 0.5);
}

.site-footer {
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 900;
}

.page-hero {
  max-width: 980px;
  padding-bottom: 30px;
}

.page-hero h1 {
  font-size: clamp(2.45rem, 5vw, 5rem);
}

.compact-page-hero {
  max-width: 760px;
}

.form-page {
  padding-top: 20px;
}

.wide-form {
  max-width: 1120px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.48fr) minmax(0, 0.9fr);
  gap: 24px;
  padding-top: 20px;
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px) 80px;
}

.market-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.46fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px) 40px;
}

.research-result-panel,
.research-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.research-result-panel {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.research-result-panel .detail-grid a {
  color: var(--green-dark);
}

.assistant-output {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 16px;
}

.research-comparison {
  display: grid;
  gap: 8px;
}

.comparison-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 78px 58px 48px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

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

.comparison-row span {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.comparison-row em {
  color: var(--green-dark);
  font-style: normal;
  font-weight: 900;
}

.comparison-row a {
  color: var(--green-dark);
  font-weight: 900;
}

.market-history-section {
  padding: 20px clamp(20px, 5vw, 72px) 80px;
}

.research-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.research-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
}

.research-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.research-card strong {
  display: block;
  color: var(--ink);
  font-size: 1.12rem;
}

.research-card p {
  margin: 0;
}

.config-editor {
  max-width: 1120px;
}

.config-note {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #cbd9cd;
  border-radius: 8px;
  background: #f4f8f5;
  color: var(--text);
}

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

.config-note p {
  margin: 0;
}

.db-lab {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px) 80px;
}

.options-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px) 40px;
}

.template-designer {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px) 80px;
}

.template-sidebar,
.template-preview-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.template-sidebar {
  align-self: start;
  display: grid;
  gap: 20px;
  padding: 22px;
}

.template-tools {
  display: grid;
  gap: 16px;
}

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

.saved-template-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.saved-template-group {
  display: grid;
  gap: 8px;
}

.saved-template-group + .saved-template-group {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.saved-template-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0;
}

.saved-template-group > div {
  display: grid;
  gap: 8px;
}

.saved-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.saved-template-card.is-active {
  border-color: var(--neon);
  box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.12);
}

.saved-template-card strong,
.saved-template-card span,
.saved-template-card small {
  display: block;
}

.saved-template-card strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.saved-template-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.saved-template-card small {
  color: #718279;
  font-size: 0.72rem;
  font-weight: 800;
}

.saved-template-card .button {
  min-height: 34px;
  padding: 8px 11px;
}

.drag-source-panel {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 14px;
  border: 1px dashed #aebbad;
  border-radius: 8px;
  background: #f8faf8;
}

.drag-source-empty {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

#dragSourceImage {
  display: block;
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
  cursor: grab;
}

.asset-pool-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.asset-pool-panel strong,
.asset-pool-panel span {
  display: block;
}

.asset-pool-panel strong {
  color: var(--ink);
}

.asset-pool-panel span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.template-asset-pool {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.template-asset-card {
  position: relative;
  display: grid;
  min-height: 76px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: grab;
}

.template-asset-card.is-selected {
  border-color: var(--neon);
  box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.12);
}

.template-asset-card img {
  width: 100%;
  height: 62px;
  object-fit: contain;
  pointer-events: none;
}

.template-asset-card button {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 22px;
  min-height: 22px;
  place-items: center;
  border: 1px solid rgba(138, 45, 34, 0.24);
  border-radius: 6px;
  background: #fff5f3;
  color: #8a2d22;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.template-meta {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.template-meta strong {
  color: var(--ink);
}

.template-preview-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 24px;
}

.template-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.template-preview-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.8rem);
}

.template-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
}

.template-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.template-legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-small {
  background: #e9f3ec;
}

.legend-medium {
  background: #fff2cf;
}

.legend-large {
  background: #f8d8cf;
}

.legend-xl {
  background: #dbeafe;
}

.template-legend .legend-reserved {
  background: #e5e7eb;
}

.template-stage {
  display: grid;
  justify-items: center;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef3ee 25%, transparent 25%),
    linear-gradient(-45deg, #eef3ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef3ee 75%),
    linear-gradient(-45deg, transparent 75%, #eef3ee 75%),
    #f8faf8;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.template-card {
  display: grid;
  width: min(100%, 620px);
  max-height: 78vh;
  gap: 5px;
  padding: 10px;
  border: 5px solid rgba(23, 33, 27, 0.22);
  border-radius: 8px;
  background: #d1d8d1;
  box-shadow: var(--shadow);
}

.template-slot {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-height: 42px;
  padding: 7px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  cursor: copy;
  font: inherit;
  overflow: hidden;
  text-align: center;
}

.template-slot span,
.template-slot strong,
.template-slot em {
  position: relative;
  z-index: 1;
}

.template-slot span,
.template-slot em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.template-slot strong {
  font-size: clamp(0.78rem, 1.2vw, 0.96rem);
}

.template-slot-small {
  background: #e9f3ec;
}

.template-slot-medium {
  background: #fff2cf;
}

.template-slot-large {
  background: #f8d8cf;
}

.template-slot-xl {
  background: #dbeafe;
}

.template-slot-reserved {
  border-style: dashed;
  background:
    repeating-linear-gradient(
      -45deg,
      #f3f4f6,
      #f3f4f6 8px,
      #e5e7eb 8px,
      #e5e7eb 16px
    );
  color: #4b5563;
  cursor: not-allowed;
}

.template-slot-reserved strong {
  max-width: 18ch;
}

.template-slot.drag-over {
  outline: 3px solid var(--green);
  outline-offset: -3px;
}

.template-slot.has-placement {
  outline: 3px solid var(--green);
  outline-offset: -3px;
  background: #fff;
}

.template-slot.has-placement img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
}

.template-slot.has-placement span {
  align-self: end;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--green-dark);
}

.server-limit-panel {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f4;
  color: var(--text);
}

.server-limit-panel strong {
  color: var(--ink);
}

.logo-preview {
  min-height: 20px;
}

.logo-library {
  padding: 40px clamp(20px, 5vw, 72px) 80px;
}

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

.logo-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.logo-card img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f1f5f1 25%, transparent 25%),
    linear-gradient(-45deg, #f1f5f1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f5f1 75%),
    linear-gradient(-45deg, transparent 75%, #f1f5f1 75%),
    #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.logo-card code {
  overflow-wrap: anywhere;
  color: var(--green-dark);
  font-size: 0.82rem;
}

.db-theme {
  --ink: #f8fafc;
  --text: #cbd5e1;
  --muted: #94a3b8;
  --line: #253246;
  --paper: #0f172a;
  --surface: #111827;
  --sage: #172033;
  --green: #22c55e;
  --green-dark: #86efac;
  --gold: #f59e0b;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.38);
}

.db-theme .site-header {
  background: rgba(15, 23, 42, 0.94);
  border-bottom-color: #263244;
}

.db-theme .brand-mark {
  background: #22c55e;
  color: #052e16;
}

.db-theme .header-action {
  background: #1f2937;
  border: 1px solid #334155;
  color: #e5e7eb;
}

.db-theme .page-hero {
  color: var(--text);
}

.db-theme .button.secondary {
  border-color: #334155;
  background: #1f2937;
  color: #e5e7eb;
}

.db-theme .button.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.db-sidebar,
.query-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.db-sidebar {
  align-self: start;
  padding: 20px;
}

.db-sidebar h2 {
  font-size: 1.35rem;
}

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

.table-list button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.table-list button:hover {
  border-color: rgba(36, 107, 70, 0.42);
}

.query-panel {
  display: grid;
  gap: 20px;
  min-width: 0;
  padding: 24px;
}

.query-panel textarea {
  border-color: #334155;
  background: #0b1220;
  color: #dbeafe;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0b1220;
}

.bulk-toolbar[hidden] {
  display: none;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}

.check-control input,
.row-selector {
  width: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

.result-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.result-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.result-table th,
.result-table td {
  max-width: 320px;
  padding: 10px 12px;
  border-bottom: 1px solid #1e293b;
  text-align: left;
  vertical-align: top;
}

.result-table th {
  position: sticky;
  top: 0;
  background: #172033;
  color: var(--ink);
  font-weight: 900;
}

.result-table td {
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.result-table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.34);
}

.result-table tbody tr:hover {
  background: rgba(34, 197, 94, 0.09);
}

.select-col {
  width: 58px;
  text-align: center;
}

.request-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.request-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.request-item:hover {
  border-color: rgba(36, 107, 70, 0.42);
}

.request-item span,
.request-item strong {
  color: var(--ink);
}

.request-item small {
  color: var(--muted);
  font-weight: 800;
}

.admin-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-editor h2 {
  grid-column: 1 / -1;
  font-size: 1.75rem;
}

.mini-request {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.mini-request a,
.form-status a {
  color: var(--green-dark);
  font-weight: 900;
}

.ad-detail {
  min-height: calc(100vh - 72px);
}

.ad-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.55fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 1040px) {
  .hero,
  .process-section,
  .order-section,
  .portal-section,
  .portal-panel,
  .portal-hero,
  .portal-workspace,
  .portal-forms,
  .admin-layout,
  .config-layout,
  .market-layout,
  .db-lab,
  .options-layout,
  .template-designer,
  .ad-detail-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 740px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .admin-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .header-action {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  h1 {
    font-size: 2.65rem;
  }

  .package-grid,
  .steps,
  .research-history,
  .order-form,
  .admin-editor,
  .portal-summary,
  .detail-grid,
  .testimonial-row,
  .campaign-stats,
  .logo-grid {
    grid-template-columns: 1fr;
  }

  .postcard-top {
    flex-direction: column;
  }

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

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

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

  .selected-slot {
    grid-row: auto;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .template-preview-header {
    flex-direction: column;
  }
}
