/* Advertiser portal — loads after landing.css, reuses its nav/btn system */

.portal-body { background: #f6f8f9; min-height: 100vh; }
.portal-main { max-width: 1100px; margin: 0 auto; padding: 32px 20px 80px; }
.portal-nav-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #0f766e; background: #ccfbf1; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.portal-logout-form { display: inline; }
.portal-logout-btn { cursor: pointer; font: inherit; border: none; }

/* auth */
.portal-auth-body { background: linear-gradient(160deg, #042f2e 0%, #0f766e 60%, #134e4a 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.portal-auth-card { background: #fff; border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 440px; box-shadow: 0 24px 60px rgba(2, 44, 34, .35); }
.portal-auth-logo { display: inline-block; margin-bottom: 14px; }
.portal-auth-card h1 { font-size: 24px; margin: 0 0 4px; color: #0f172a; }
.portal-auth-sub { color: #64748b; margin: 0 0 18px; font-size: 14px; }
.portal-auth-btn { width: 100%; margin-top: 8px; }
.portal-auth-switch { margin-top: 16px; font-size: 13px; color: #64748b; text-align: center; }
.portal-auth-switch a { color: #0f766e; font-weight: 600; }
.portal-form label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 12px; }
.portal-form input, .portal-form select, .portal-form textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-weight: 400; color: #0f172a; background: #fff; }
.portal-form input:focus, .portal-form select:focus, .portal-form textarea:focus { outline: 2px solid #0f766e; outline-offset: 1px; border-color: #0f766e; }
.portal-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

/* dashboard */
.portal-welcome h1 { margin: 0 0 2px; font-size: 26px; color: #0f172a; }
.portal-welcome p { margin: 0 0 24px; color: #64748b; font-size: 14px; }
.portal-empty { background: #fff; border: 1px dashed #cbd5e1; border-radius: 16px; text-align: center; padding: 60px 24px; }
.portal-empty h2 { margin: 0 0 6px; color: #0f172a; }
.portal-empty p { color: #64748b; max-width: 460px; margin: 0 auto 20px; }
.portal-ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.portal-ad-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.portal-ad-preview { display: flex; gap: 10px; padding: 14px; min-height: 110px; align-items: center; }
.portal-ad-preview img { width: 72px; height: 72px; max-width: 72px; max-height: 72px; object-fit: contain; border-radius: 8px; flex: none; }
.portal-ad-preview-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; min-width: 0; }
.portal-ad-preview-text strong { font-size: 15px; line-height: 1.2; }
.portal-ad-preview-text span { opacity: .92; }
.portal-ad-meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 0; }
.portal-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; }
.portal-status-live { background: #dcfce7; color: #166534; }
.portal-status-paused { background: #fef9c3; color: #854d0e; }
.portal-status-draft { background: #e2e8f0; color: #475569; }
.portal-status-ended { background: #fee2e2; color: #991b1b; }
.portal-ad-dates { font-size: 12px; color: #94a3b8; }
.portal-ad-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #f1f5f9; margin-top: 10px; }
.portal-ad-stats div { text-align: center; padding: 10px 4px; }
.portal-ad-stats div + div { border-left: 1px solid #f1f5f9; }
.portal-ad-stats b { display: block; font-size: 18px; color: #0f172a; }
.portal-ad-stats span { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.portal-ad-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid #f1f5f9; margin-top: auto; }
.portal-act { cursor: pointer; font: inherit; }

/* editor */
.portal-editor-main { max-width: 1200px; }
body.cv-mode .portal-editor-main { max-width: 1560px; }
.portal-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 600px; gap: 28px; align-items: start; }
/* canvas studio needs room: form column spans the full grid width */
body.cv-mode .portal-editor-grid { grid-template-columns: minmax(0, 1fr); }
body.cv-mode .portal-editor-preview { display: none; }
.portal-editor-form h1 { margin: 0 0 16px; font-size: 24px; color: #0f172a; }
.portal-editor-form fieldset { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px; margin: 0 0 16px; }
.portal-editor-form legend { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #0f766e; padding: 0 6px; }
.portal-editor-form label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 12px; }
.portal-editor-form input, .portal-editor-form select, .portal-editor-form textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-weight: 400; color: #0f172a; }
.portal-editor-form input:focus, .portal-editor-form select:focus, .portal-editor-form textarea:focus { outline: 2px solid #0f766e; outline-offset: 1px; border-color: #0f766e; }
.portal-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.portal-row2 > span { display: block; }
.portal-upload-zone { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 16px; margin-bottom: 12px; background: #f8fafc; }
.portal-upload-zone.drag { border-color: #0f766e; background: #f0fdfa; }
.portal-upload-hint { font-size: 12px; color: #94a3b8; font-weight: 400; }
.portal-upload-name { font-size: 12px; color: #0f766e; font-weight: 600; }
.portal-cap-row[hidden] { display: none; }
.portal-save-row { display: flex; align-items: center; gap: 12px; }
.portal-save-msg { font-size: 14px; color: #166534; font-weight: 600; }

/* live preview */
.portal-editor-preview { position: sticky; top: 90px; }
.portal-editor-preview h2 { font-size: 16px; color: #334155; margin: 0 0 10px; }
.portal-live-ad { display: flex; gap: 14px; border-radius: 16px; padding: 18px; color: #fff; background: #0f766e; box-shadow: 0 14px 34px rgba(15, 23, 42, .18); }
.portal-live-row-rev { flex-direction: row-reverse; }
.portal-live-col { flex-direction: column; }
.portal-live-img { flex: none; width: 120px; height: 120px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.portal-live-img img { width: 100%; height: 100%; object-fit: cover; }
.portal-live-img-ph { font-size: 11px; opacity: .8; text-align: center; padding: 6px; }
.portal-live-img-top { width: 100%; height: 140px; }
.portal-live-ad.portal-live-row-rev + * { clear: none; }
.portal-live-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.portal-live-biz { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.portal-live-head { font-size: 20px; line-height: 1.15; }
.portal-live-sub { font-size: 13px; opacity: .9; }
.portal-live-offer { font-size: 15px; font-weight: 700; margin-top: 4px; }
.portal-live-promo { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .1em; border: 1.5px dashed currentColor; border-radius: 6px; padding: 3px 8px; margin-top: 6px; }
.portal-live-ad.portal-live-row-rev { flex-wrap: wrap; }
.portal-preview-note { font-size: 12px; color: #94a3b8; margin: 10px 2px 0; }

/* analytics */
.portal-analytics-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.portal-analytics-head h1 { margin: 0; font-size: 24px; color: #0f172a; }
.portal-analytics-sub { margin: 4px 0 0; font-size: 13px; color: #64748b; }
.portal-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.portal-kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; text-align: center; }
.portal-kpi-num { display: block; font-size: 26px; font-weight: 800; color: #0f172a; }
.portal-kpi-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; }
.portal-chart-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.portal-chart-section h2 { margin: 0 0 14px; font-size: 16px; color: #334155; }
.portal-chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; border-bottom: 1px solid #e2e8f0; padding-bottom: 0; }
.portal-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; min-width: 0; }
.portal-chart-stack { display: flex; flex-direction: column-reverse; width: 100%; max-width: 28px; height: 100%; justify-content: flex-start; }
.portal-bar { width: 100%; border-radius: 2px 2px 0 0; min-height: 0; }
.portal-bar-view { background: #0f766e; }
.portal-bar-impression { background: #5eead4; }
.portal-bar-save { background: #f59e0b; }
.portal-bar-redemption { background: #dc2626; }
.portal-chart-day { font-size: 9px; color: #94a3b8; margin-top: 4px; white-space: nowrap; }
.portal-chart-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: #64748b; flex-wrap: wrap; }
.portal-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.portal-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; padding: 8px 10px; border-bottom: 1px solid #e2e8f0; }
.portal-table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; color: #334155; }

@media (max-width: 900px) {
  .portal-editor-grid { grid-template-columns: 1fr; }
  .portal-editor-preview { position: static; }
}

/* color swatch picker */
.portal-color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.portal-color-label { font-size: 13px; font-weight: 600; color: #334155; min-width: 84px; }
.portal-swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.portal-swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid rgba(15, 23, 42, .15); cursor: pointer; padding: 0; transition: transform .08s ease, box-shadow .08s ease; }
.portal-swatch:hover { transform: scale(1.12); }
.portal-swatch[data-selected="true"] { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15, 118, 110, .45); transform: scale(1.15); }
.portal-swatch-custom { position: relative; width: 30px; height: 30px; border-radius: 8px; border: 2px dashed #94a3b8; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.portal-swatch-custom input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.portal-swatch-custom span { font-size: 16px; color: #64748b; font-weight: 700; pointer-events: none; }

/* per-section color + alignment rows (merged with text inputs) */
.portal-sec-note { font-size: 12.5px; color: #64748b; margin: 0 0 12px; }
.portal-sec-row { padding: 10px 0 12px; border-bottom: 1px solid #f1f5f9; }
.portal-sec-row:last-of-type { border-bottom: none; }
.portal-field-label { display: block; font-size: 13px; font-weight: 600; color: #334155; }
.portal-field-hint { font-weight: 400; color: #94a3b8; }
.portal-biz-static { font-size: 13px; color: #64748b; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 8px; padding: 8px 12px; margin-top: 4px; }
.portal-sec-row label { margin-bottom: 0; }
.portal-sec-row input[type="text"], .portal-sec-row textarea { margin-top: 4px; margin-bottom: 6px; }
.portal-sec-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.portal-sec-tools input[type="color"] { display: inline-block; width: 34px; height: 28px; padding: 0; border: 1.5px solid rgba(15, 23, 42, .2); border-radius: 7px; background: none; cursor: pointer; flex: none; }
.portal-sec-auto { font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #64748b; background: #f1f5f9; border: 1.5px solid #e2e8f0; border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.portal-sec-auto.on { color: #0f766e; background: rgba(15, 118, 110, .12); border-color: rgba(15, 118, 110, .45); }
.portal-sec-align { display: inline-flex; gap: 4px; margin-left: auto; }
.portal-sec-align button { font: inherit; font-size: 12px; font-weight: 700; color: #475569; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 7px; width: 30px; height: 28px; cursor: pointer; padding: 0; }
.portal-sec-align button:hover { background: #eef2f7; }
.portal-sec-align button.on { color: #fff; background: #0f766e; border-color: #0f766e; }
.portal-live-terms { font-size: 11px; opacity: .75; margin-top: 6px; }

/* dual previews: mobile (full device width) + wider devices (grid tile) */
.portal-preview-block { margin-bottom: 22px; }
.portal-preview-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: 0 0 8px; }
.portal-preview-frame { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; }

/* phone frame: card spans the full width of the device */
.portal-frame-mobile { max-width: 420px; border: 8px solid #0f172a; border-radius: 28px; background: #fff; padding: 22px 12px 14px; position: relative; }
.portal-frame-mobile::before { content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 84px; height: 12px; border-radius: 999px; background: #0f172a; }
.portal-frame-mobile .portal-live-ad { border-radius: 12px; }
.portal-frame-mobile .portal-live-img { width: 96px; height: 96px; } /* real supporter card: 96px image on phones */

/* desktop: card at true grid-tile width (a 1366px laptop renders 3×431px columns) next to a
   clipped ghost tile, so the preview reads as one tile of a continuing multi-column grid */
.portal-frame-desktop { max-width: 560px; position: relative; padding: 14px; display: flex; gap: 16px; overflow: hidden; }
.portal-frame-desktop > .portal-live-ad { position: relative; z-index: 1; flex: none; width: 430px; max-width: 100%; }
.portal-frame-desktop::after { content: ''; flex: 1 0 90px; min-width: 90px; border: 1.5px dashed #cbd5e1; border-radius: 14px; background: #e9eef5; }

/* images shrink to fit, never overflow */
.portal-live-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* the native file input must stay hidden even inside .portal-form (display:block rule above) */
.portal-form input[type="file"][hidden], .portal-upload-zone input[hidden] { display: none !important; }

/* Light-theme button overrides for portal pages: landing.css .btn-secondary is
   white-on-transparent (built for dark hero sections) — invisible on white cards. */
.portal-body .btn-secondary {
  background: #fff;
  color: #0f766e;
  border-color: #0f766e;
}
.portal-body .btn-secondary:hover {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #0f766e;
  transform: none;
}

/* Auth pages (login/register) render the same components on a WHITE card:
   landing.css paints .nav-logo white (dark hero header) and .btn-secondary
   white-on-transparent — both invisible on the white .portal-auth-card.
   Match the supporter login lockup: dark "Fund" + teal "Hub". */
.portal-auth-body .nav-logo { color: #0f172a; }
.portal-auth-body .nav-logo:hover { color: #0f172a; }
.portal-auth-body .nav-logo-accent { color: #0f766e; }
.portal-auth-body .btn-secondary {
  background: #fff;
  color: #0f766e;
  border-color: #0f766e;
}
.portal-auth-body .btn-secondary:hover {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #0f766e;
  transform: none;
}
/* "or" divider between password form and passkey button (mirrors supporter
   Login.svelte .pk-divider — EJS pages ship no scoped styles) */
.portal-auth-body .pk-divider {
  display: flex; align-items: center; gap: 10px;
  color: #94a3b8; font-size: 12px; margin: 14px 0;
}
.portal-auth-body .pk-divider::before,
.portal-auth-body .pk-divider::after {
  content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.btn.btn-danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}
.btn.btn-danger:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
  transform: none;
}

/* coupon-area ZIP widget (dashboard) */
.portal-zip-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.portal-zip-label { font-size: 13px; color: #64748b; font-weight: 600; }
.portal-zip-val { font-size: 14px; color: #0f766e; }
.portal-zip-none { color: #b45309; }
.portal-zip-form { gap: 6px; }
.portal-zip-form input { width: 90px; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.portal-zip-note { font-size: 12px; color: #94a3b8; margin: 6px 0 0; }

/* multi-ZIP chips (dashboard) */
.portal-zip-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.portal-zip-chip {
  background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4;
  border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700;
}
.portal-zip-form input { width: 260px; }

/* --- Account menu (email dropdown): shared across portals --- */
.acct-menu { position: relative; list-style: none; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 6px 14px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; max-width: 230px;
}
.acct-btn:hover { background: rgba(255,255,255,.18); }
.acct-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.acct-icon { flex: 0 0 auto; opacity: .85; }
.acct-caret { flex: 0 0 auto; opacity: .7; transition: transform .15s ease; }
.acct-btn[aria-expanded="true"] .acct-caret { transform: rotate(180deg); }
.acct-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 210px; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 38px rgba(2,6,23,.28), 0 2px 8px rgba(2,6,23,.14);
  border: 1px solid #e2e8f0; padding: 6px;
}
.acct-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; border-radius: 8px;
  padding: 9px 12px; font: inherit; font-size: 14px; font-weight: 600;
  color: #0f172a; cursor: pointer; text-decoration: none;
}
a.acct-item:hover, button.acct-item:hover { background: #f1f5f9; color: #0f172a; }
.acct-item svg { flex: 0 0 auto; color: #64748b; }
.acct-danger { color: #b91c1c !important; }
.acct-danger svg { color: #b91c1c; }
.acct-danger:hover { background: #fef2f2 !important; }
.acct-sep { height: 1px; background: #e2e8f0; margin: 5px 8px; }
.acct-pop form { margin: 0; }
@media (max-width: 767px) {
  .acct-menu { width: 100%; }
  .acct-btn { max-width: 100%; }
  .acct-pop { left: 0; right: auto; }
}

/* fix: .nav-links a in landing.css paints anchor items white — override for account menu */
.nav-links .acct-item { color: #0f172a !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; }
.nav-links a.acct-item:hover { color: #0f172a !important; background: #f1f5f9; }
.nav-links .acct-item.acct-danger, .nav-links .acct-item.acct-danger:hover { color: #b91c1c !important; }

/* ===== canvas studio (advanced designer tab) ===== */
.portal-mode-tabs { display: flex; gap: 8px; margin: 0 0 16px; border-bottom: 2px solid #e2e8f0; }
.portal-mode-tab { font: inherit; font-size: 14px; font-weight: 700; color: #64748b; background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 8px 16px; cursor: pointer; }
.portal-mode-tab:hover { color: #0f172a; }
.portal-mode-tab.on { color: #0f766e; border-bottom-color: #0f766e; }

.portal-canvas-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.portal-canvas-toolbar .btn { padding: 6px 12px; font-size: 13px; }
.portal-canvas-bg { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; font-weight: 600; color: #334155; }
.portal-canvas-bg input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1.5px solid rgba(15,23,42,.2); border-radius: 7px; cursor: pointer; }

.portal-canvas-wrap { display: flex; flex-direction: row; gap: 14px; align-items: stretch; }
.portal-canvas-stage { flex: 1 1 auto; min-width: 0; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 24px 24px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; overflow: auto; max-height: 82vh; min-height: 480px; }
.portal-canvas-artboard { position: relative; background: #fff; border: 1px dashed #cbd5e1; border-radius: 4px; box-shadow: 0 2px 10px rgba(15,23,42,.06); }
.cv-widget { position: absolute; cursor: grab; }
.cv-widget.sel { outline: 2px solid #0f766e; outline-offset: 1px; }
.cv-widget img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.cv-text { display: flex; align-items: center; overflow: visible; padding-right: 4px; box-sizing: border-box; }
.cv-handle { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #0f766e; border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; }
.portal-canvas-props { flex: 0 0 280px; max-width: 280px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; overflow-y: auto; max-height: 82vh; align-self: flex-start; position: sticky; top: 84px; }
.portal-canvas-props h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: 0 0 10px; }
.portal-cv-note { font-size: 13px; color: #94a3b8; }
.portal-cv-row { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 10px; }
.portal-cv-row input, .portal-cv-row select, .portal-cv-row textarea { display: block; width: 100%; margin-top: 3px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 7px; font: inherit; font-weight: 400; color: #0f172a; }
.portal-cv-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.portal-cv-chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #334155; }
.portal-cv-chk input { width: auto; }

/* props panel under the artboard: controls flow horizontally */
.portal-canvas-props .portal-cv-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.portal-canvas-props .portal-cv-panel-grid .portal-cv-row:first-child { grid-column: 1 / -1; }
.portal-canvas-props .portal-cv-row { margin-bottom: 10px; }
.portal-canvas-props .portal-cv-toolbar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* zoom + size row above the artboard */
.portal-canvas-zoom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.portal-canvas-zoom button { font: inherit; font-size: 13px; font-weight: 700; color: #334155; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 7px; min-width: 28px; height: 26px; cursor: pointer; padding: 0 6px; }
.portal-canvas-zoom button:hover { background: #eef2f7; }
.portal-canvas-zoom .portal-cv-zoomval { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

/* keep the artboard reasonably big even on narrow screens */
.portal-canvas-artboard { min-width: 560px; }
@media (max-width: 900px) {
  .portal-canvas-wrap { flex-direction: column; }
  .portal-canvas-props { position: static; max-width: none; flex: 1 1 auto; max-height: 300px; }
  .portal-canvas-artboard { min-width: 420px; }
}

/* dashboard: canvas-designed ads preview as image */
.portal-ad-preview .portal-ad-canvas-img { width: 100%; height: auto; display: block; }

/* ---- publish options modal (#5) ---- */
.portal-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 60;
}
.portal-modal-backdrop[hidden] { display: none; }
.portal-modal {
  background: #fff; border-radius: 12px; padding: 24px; width: min(440px, 92vw);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3); max-height: 86vh; overflow-y: auto;
}
.portal-modal h2 { margin: 0 0 8px; font-size: 1.25rem; }
.portal-modal label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 0.9rem; }
.portal-modal select, .portal-modal input[type="number"] {
  width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; margin-top: 4px;
}
.portal-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---- published coupon snapshot view (#6) ---- */
.portal-snapshot { max-width: 720px; margin: 0 auto; }
.portal-snapshot h1 { font-size: 1.5rem; margin: 0 0 10px; }
.portal-snapshot-banner {
  background: #fef9c3; border: 1px solid #fde047; color: #854d0e;
  border-radius: 8px; padding: 12px 14px; font-size: 0.92rem; margin: 0 0 12px;
}
.portal-snapshot-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: #475569; font-size: 0.9rem; margin-bottom: 18px; }
.portal-snapshot-view { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; background: #f8fafc; }
.portal-snapshot-canvas { display: block; max-width: 480px; width: 100%; margin: 0 auto; border-radius: 8px; }
.portal-snapshot-preview { max-width: 480px; margin: 0 auto; }
.portal-snapshot-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---- sticky editor action bar + persistent save indicator ---- */
.portal-main { padding-top: 96px; } /* clear the 73px fixed nav (was 32px: h1 sat behind it) */
.portal-editor-actions {
  position: sticky; top: 81px; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  background: rgba(246, 248, 249, 0.92); backdrop-filter: blur(6px);
  padding: 10px 4px; margin: -12px 0 14px; border-bottom: 1px solid #e2e8f0;
}
.portal-editor-actions-spacer { flex: 1; }
.portal-save-msg { font-size: 0.88rem; font-weight: 600; }
.portal-save-ok { color: #15803d; }
.portal-save-pending { color: #b45309; }
.portal-save-saving { color: #1d4ed8; }
.portal-save-error { color: #b91c1c; }

/* ---- canvas "Preview in book" phone modal ---- */
.portal-preview-phone {
  position: relative; width: 340px; max-height: 88vh; background: #0f172a;
  border-radius: 38px; padding: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
}
.portal-preview-notch {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 22px; background: #0f172a; border-radius: 999px; z-index: 2;
}
.portal-preview-screen {
  background: #eef2f6; border-radius: 28px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 0; flex: 1;
}
.portal-preview-header {
  padding: 40px 18px 12px; background: #0f766e; color: #fff;
  display: flex; align-items: baseline; gap: 8px; justify-content: space-between;
}
.portal-preview-title { font-weight: 800; font-size: 16px; }
.portal-preview-sub { font-size: 11px; opacity: 0.85; }
.portal-preview-feed { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.portal-preview-slot, .portal-preview-mine { flex: none; }
.pvslot-card {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14); display: flex; flex-direction: column; gap: 3px;
}
.pvslot-biz { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #0f766e; font-weight: 800; }
.pvslot-head { font-size: 15px; color: #0f172a; }
.pvslot-offer { font-size: 12px; color: #475569; line-height: 1.45; }
.pvslot-actions { display: flex; justify-content: center; padding: 8px 0 2px; }
.pvslot-redeem {
  background: #0f766e; color: #fff; border-radius: 999px; padding: 7px 24px;
  font-size: 13px; font-weight: 800;
}
.pvslot-canvas { padding: 0; overflow: hidden; background: #fff; }
.pvslot-canvas img { display: block; width: 100%; height: auto; }
.portal-preview-mine { position: relative; outline: 3px solid #f59e0b; outline-offset: 2px; border-radius: 14px; }
.pvslot-mine-tag {
  position: absolute; top: -11px; left: 12px; z-index: 3;
  background: #f59e0b; color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px;
}
.portal-preview-close {
  position: absolute; top: -12px; right: -12px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: #0f172a; font-size: 20px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

/* category card (adv_category_shared) */
.mkt-cat-add { display: flex; gap: 10px; align-items: center; }
.mkt-cat-add select { border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; font-size: 14px; min-width: 200px; }

/* welcome banner after claim (#37) */
.portal-hero-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); color: #fff;
  border-radius: 16px; padding: 22px 26px; margin: 0 0 28px; flex-wrap: wrap; }
.portal-hero-banner h2 { margin: 0 0 4px; font-size: 20px; color: #fff; }
.portal-hero-banner p { margin: 0; color: rgba(255,255,255,0.92); font-size: 14px; }
.portal-hero-actions { display: flex; align-items: center; gap: 10px; }
.portal-hero-dismiss { background: rgba(255,255,255,0.22); border: none; color: #fff; width: 32px; height: 32px;
  border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; }
.portal-hero-dismiss:hover { background: rgba(255,255,255,0.35); }
