/*
 * The Traders Conference — mailer UI
 * Brand: Poppins (ExtraBold/Black for display), navy #021F63, green #16CC81, white.
 * Tokens follow shadcn/ui naming so components read the same way across the app.
 */
:root {
  /* Brand */
  --brand-navy: #021F63;
  --brand-navy-2: #0A2C7A;
  --brand-navy-3: #0E3590;
  --brand-green: #16CC81;
  --brand-green-strong: #0B7A4E;   /* green that passes 4.5:1 as text on white */
  --brand-green-soft: #E7F9F1;

  /* Surfaces & text */
  --background: #F5F7FB;
  --foreground: #0B1633;
  --card: #FFFFFF;
  --muted: #F1F4F9;
  --muted-foreground: #5A6479;
  --border: #E3E7EF;
  --input: #D3D9E4;

  /* Roles */
  --primary: var(--brand-navy);
  --primary-hover: var(--brand-navy-2);
  --primary-foreground: #FFFFFF;
  --accent: var(--brand-green);
  --accent-foreground: var(--brand-navy);
  --destructive: #C8261D;
  --destructive-soft: #FDECEB;
  --success: var(--brand-green-strong);
  --success-soft: var(--brand-green-soft);
  --warning: #A84D06;
  --warning-soft: #FFF4E5;
  --info-soft: #E8EEFB;
  --ring: rgba(22, 204, 129, .45);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(2, 31, 99, .05);
  --shadow-sm: 0 1px 3px rgba(2, 31, 99, .07), 0 1px 2px rgba(2, 31, 99, .04);
  --shadow-lg: 0 16px 40px -8px rgba(2, 31, 99, .22), 0 4px 10px -4px rgba(2, 31, 99, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  font-family: var(--font);
  font-size: 14px;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); line-height: 1.55; }
a { color: var(--primary); text-decoration: none; font-weight: 500; transition: color .15s var(--ease); }
a:hover { color: var(--brand-navy-3); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--foreground); }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -.015em; margin-bottom: 14px; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); font-size: .88em; background: var(--muted); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }
strong, .strong { font-weight: 600; }
.muted { color: var(--muted-foreground); }
.small { font-size: 13px; }
.danger { color: var(--destructive); }
.break { word-break: break-all; }
.icon { width: 18px; height: 18px; flex: none; }
::selection { background: var(--brand-green); color: var(--brand-navy); }

:focus-visible { outline: 2px solid var(--brand-green); outline-offset: 2px; }

/* ---- Shell ---- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--brand-navy);
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(22, 204, 129, .10) 0%, transparent 55%);
  color: rgba(255, 255, 255, .74);
  display: flex; flex-direction: column; padding: 22px 14px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 2px 10px 26px; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 160px; height: auto; }
.brand-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-navy);
  background: var(--brand-green); padding: 2px 8px; border-radius: 4px; line-height: 1.5;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  color: rgba(255, 255, 255, .74); padding: 10px 12px; border-radius: var(--radius); font-weight: 500; font-size: 14px;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav a .icon { opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .10); color: #fff; font-weight: 600; }
.nav a.active .icon { color: var(--brand-green); opacity: 1; }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-green);
}
.sidebar-foot {
  margin-top: auto; padding: 14px 6px 0; border-top: 1px solid rgba(255, 255, 255, .10);
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--brand-green); color: var(--brand-navy); font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
}
.who { color: #fff; font-weight: 600; min-width: 0; flex: 1; line-height: 1.3; }
.who small { display: block; color: rgba(255, 255, 255, .6); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot form { margin: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); border: 0;
  background: transparent; color: rgba(255, 255, 255, .7); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { padding: 32px 40px 72px; min-width: 0; max-width: 1320px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1::before {
  /* Echoes the green bar on the "T" of the logo. */
  content: ""; display: block; width: 28px; height: 6px; border-radius: 2px; background: var(--brand-green); margin-bottom: 12px;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-actions form { margin: 0; }
.crumb { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted-foreground); margin: 0 0 10px -4px; }
.crumb .icon { width: 16px; height: 16px; }
.crumb:hover { color: var(--foreground); }
.crumb + h1::before { display: none; }
.subtitle { margin: 8px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted-foreground); }

/* ---- Cards & layout ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: 22px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head form { margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.split-side .card h2 { font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > h2 { margin-bottom: -4px; }
.empty { text-align: center; padding: 40px 16px; }
.empty h2 { margin-bottom: 8px; }
.empty p { max-width: 460px; margin: 0 auto 16px; }
.empty .btn { margin: 4px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted-foreground); font-size: 11.5px; font-weight: 600; margin: 18px 0; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats-tight { margin: 12px 0 14px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat {
  position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px; color: inherit; box-shadow: var(--shadow-xs); font-weight: 400;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
a.stat:hover { text-decoration: none; color: inherit; border-color: #C5CEDF; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stats > .stat:first-child { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.stats > .stat:first-child .stat-label, .stats > .stat:first-child .stat-note { color: rgba(255, 255, 255, .72); }
.stats > .stat:first-child .stat-value { color: #fff; }
.stats > .stat:first-child::after {
  content: ""; position: absolute; right: 20px; top: 20px; width: 22px; height: 6px; border-radius: 2px; background: var(--brand-green);
}
a.stat:first-child:hover { border-color: var(--brand-navy); box-shadow: var(--shadow-lg); }
.stats-tight .stat { box-shadow: none; background: var(--muted); border-color: transparent; padding: 14px 16px; }
.stats-tight > .stat:first-child { background: var(--muted); color: inherit; border-color: transparent; }
.stats-tight > .stat:first-child .stat-label, .stats-tight > .stat:first-child .stat-note { color: var(--muted-foreground); }
.stats-tight > .stat:first-child .stat-value { color: var(--foreground); }
.stats-tight > .stat:first-child::after { display: none; }
.stat-label { font-size: 12.5px; color: var(--muted-foreground); font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--foreground); }
.stats-tight .stat-value { font-size: 24px; }
.stat-value small { font-size: 14px; color: var(--muted-foreground); font-weight: 500; letter-spacing: 0; }
.stat-note { font-size: 12.5px; color: var(--muted-foreground); }
.meter { display: block; height: 6px; background: var(--muted); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.meter > span { display: block; height: 100%; background: var(--brand-green); border-radius: 99px; transition: width .6s var(--ease); }
.meter-lg { height: 10px; margin: 10px 0 6px; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin: 0 -22px; }
.card > .table-wrap:first-child { margin-top: -10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 22px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12.5px; color: var(--muted-foreground); font-weight: 500; white-space: nowrap; }
.table tbody tr { transition: background-color .12s var(--ease); }
.table tbody tr:hover { background: #F8FAFD; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td a.strong { color: var(--foreground); }
.table td a.strong:hover { color: var(--primary); }
.row-actions { display: flex; gap: 16px; justify-content: flex-end; align-items: flex-start; white-space: nowrap; }
.row-actions form { margin: 0; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--muted); color: #475067; white-space: nowrap; line-height: 1.6; border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-subscribed, .badge-sent { background: var(--success-soft); color: var(--success); }
.badge-sending, .badge-scheduled { background: var(--info-soft); color: var(--primary); }
.badge-sending::before { animation: pulse 1.4s ease-in-out infinite; }
.badge-paused { background: var(--warning-soft); color: var(--warning); }
.badge-unsubscribed, .badge-skipped, .badge-draft, .badge-queued { background: var(--muted); color: #475067; border-color: var(--border); }
.badge-bounced, .badge-failed { background: var(--destructive-soft); color: var(--destructive); }
@keyframes pulse { 50% { opacity: .25; } }

/* ---- Forms ---- */
label { display: flex; flex-direction: column; gap: 7px; font-weight: 500; font-size: 13.5px; color: var(--foreground); }
label small, .label small { color: var(--muted-foreground); font-weight: 400; }
.label { font-weight: 500; font-size: 13.5px; }
input, select, textarea {
  font: inherit; font-size: 14px; color: inherit; width: 100%; height: 40px; padding: 8px 12px;
  border: 1px solid var(--input); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; }
input[type="file"] { height: auto; padding: 8px; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 600; margin-right: 12px; padding: 6px 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--brand-navy); color: #fff; cursor: pointer;
}
input::placeholder, textarea::placeholder { color: #8A93A6; }
input:hover, select:hover, textarea:hover { border-color: #B9C2D3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-navy); box-shadow: 0 0 0 3px var(--ring); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6479' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
input[type="checkbox"] { width: 17px; height: 17px; padding: 0; box-shadow: none; accent-color: var(--brand-navy); cursor: pointer; flex: none; }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.check.consent { align-items: flex-start; background: var(--brand-green-soft); border: 1px solid #BDEFD8; padding: 14px 16px; border-radius: var(--radius); line-height: 1.5; }
.check.consent input { margin-top: 2px; }
.checks { border: 0; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.checks legend { margin-bottom: 10px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--background) 35%); padding: 20px 0 10px; margin-top: 0; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px; }
.filters input[type="search"] {
  flex: 1 1 260px; width: auto; padding-left: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6479' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center;
}
.filters select { width: auto; min-width: 150px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 13.5px;
  height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--input); background: #fff; color: var(--foreground);
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); letter-spacing: -.005em;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--muted); color: var(--foreground); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.page-actions .btn-primary, .btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); }
.page-actions .btn-primary:hover, .btn-accent:hover { background: #12B572; border-color: #12B572; color: var(--accent-foreground); }
.btn-danger-ghost { color: var(--destructive); }
.btn-danger-ghost:hover { background: var(--destructive-soft); border-color: #F5C2BF; color: var(--destructive); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--primary); cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--destructive); }

/* ---- Flash (alerts) ---- */
.flash { position: relative; padding: 12px 16px 12px 18px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; font-size: 13.5px; overflow: hidden; }
.flash::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: currentColor; opacity: .7; }
.flash-success { background: var(--success-soft); border-color: #BDEFD8; color: #075A39; }
.flash-error { background: var(--destructive-soft); border-color: #F5C2BF; color: #8E1A13; }
.flash-warn { background: var(--warning-soft); border-color: #FBD9A8; color: #7A3804; }
.flash a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Details & lists ---- */
.facts { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted-foreground); }
.facts dd { margin: 0; word-break: break-word; font-weight: 500; }
.problems { margin: 0 0 14px; padding-left: 18px; color: var(--destructive); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.history li { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: 0; padding-bottom: 0; }
.checks-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.checks-list .ok { color: var(--success); }
.checks-list .bad { color: var(--destructive); }
.checklist { padding-left: 20px; }
.checklist li { margin-bottom: 10px; }
.checklist li::marker { color: var(--brand-green-strong); font-weight: 700; }
pre.code { background: var(--brand-navy); color: #E3EAF8; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; white-space: pre; margin: 10px 0; font-family: var(--mono); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 18px; }
.seg, .tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius); }
.seg button, .tab {
  font: inherit; font-size: 13px; font-weight: 600; padding: 5px 14px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted-foreground); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.seg button:hover, .tab:hover { color: var(--foreground); }
.seg button.active, .tab.active { background: #fff; color: var(--brand-navy); box-shadow: var(--shadow-sm); }
.tab:disabled { opacity: .5; cursor: not-allowed; }

details.pop { position: relative; }
details.pop summary { list-style: none; }
details.pop summary::-webkit-details-marker { display: none; }
.pop-body {
  position: absolute; right: 0; top: 28px; z-index: 10; width: 320px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px; white-space: normal; text-align: left;
  animation: pop-in .14s var(--ease);
}
.pop-wide { width: min(560px, 86vw); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---- Editor ---- */
.editor-card { padding: 0; overflow: hidden; }
.editor-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #FAFBFD; flex-wrap: wrap; }
.merge-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--input); background: #fff; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.chip:hover { border-color: var(--brand-green); background: var(--brand-green-soft); }
#visual-editor { min-height: 420px; font-size: 16px; }
.editor-card .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--border); font-family: var(--font); padding: 10px 14px; }
.editor-card .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: 16px; }
.editor-card .ql-editor { min-height: 420px; padding: 28px 32px; line-height: 1.65; }
.editor-card .ql-snow .ql-stroke { stroke: #475067; }
.editor-card .ql-snow .ql-fill { fill: #475067; }
.editor-card .ql-snow button:hover .ql-stroke, .editor-card .ql-snow button.ql-active .ql-stroke { stroke: var(--brand-navy); }
.editor-card .ql-snow button.ql-active .ql-fill { fill: var(--brand-navy); }
textarea.code { border: 0; border-radius: 0; box-shadow: none; min-height: 460px; font-family: var(--mono); font-size: 13px; padding: 20px; resize: vertical; display: block; }
textarea.code:focus { box-shadow: inset 0 0 0 2px var(--ring); }
.editor-help { padding: 12px 16px; margin: 0; border-top: 1px solid var(--border); background: #FAFBFD; }
.preview-frame { background: var(--muted); border-radius: var(--radius); padding: 0; display: flex; justify-content: center; }
.preview-frame iframe { width: 100%; height: 760px; border: 0; background: var(--muted); transition: width .25s var(--ease); border-radius: var(--radius); }

/* ---- Bare pages (login, install, unsubscribe) ---- */
body.bare {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background-color: var(--brand-navy);
  background-image:
    radial-gradient(60% 50% at 85% 10%, rgba(22, 204, 129, .18) 0%, transparent 60%),
    radial-gradient(50% 50% at 0% 100%, rgba(14, 53, 144, .9) 0%, transparent 70%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}
.bare-wrap { width: 100%; max-width: 420px; }
.bare-brand { display: flex; justify-content: center; margin-bottom: 28px; }
.bare-brand img { width: 240px; height: auto; }
.bare-card { padding: 32px; border: 0; box-shadow: 0 30px 60px -12px rgba(0, 0, 0, .45); margin-bottom: 0; }
.bare-card h1 { font-size: 24px; margin-bottom: 6px; }
.bare-card h1::before { content: ""; display: block; width: 28px; height: 6px; border-radius: 2px; background: var(--brand-green); margin-bottom: 14px; }
.bare-card form { margin-top: 20px; }
.bare-card .btn { height: 44px; }
.bare-foot { text-align: center; color: rgba(255, 255, 255, .55); font-size: 12px; margin: 20px 0 0; }

/* ---- Waitlist ---- */
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; font-size: 13.5px; }
.bars-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-n { font-weight: 600; font-variant-numeric: tabular-nums; }
.bars .meter { grid-column: 1 / -1; margin: 2px 0 0; }
.share-card { border-color: #BDEFD8; background: linear-gradient(180deg, var(--brand-green-soft), #fff 70%); }
.share-card pre.code { white-space: pre-wrap; word-break: break-all; }
.share-actions { display: flex; gap: 8px; }
.share-actions .btn { flex: 1; }
.checks-inline { flex-direction: row; flex-wrap: wrap; gap: 10px 20px; }
.checks-inline legend { width: 100%; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 13px; color: var(--muted-foreground); }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--primary); }

/* ---- Events ---- */
.badge-open { background: var(--success-soft); color: var(--success); }
.badge-closed, .badge-ended { background: var(--muted); color: #475067; border-color: var(--border); }
.event-grid { display: grid; gap: 12px; }
.event-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 18px 22px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); color: inherit; font-weight: 400;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.event-card:hover { text-decoration: none; color: inherit; border-color: #C5CEDF; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.event-card.is-past { opacity: .72; }
.event-date { display: grid; place-items: center; width: 60px; height: 64px; border-radius: 12px; background: var(--brand-navy); color: #fff; line-height: 1; }
.event-date-month { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-green); }
.event-date-day { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: -10px; }
.event-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.event-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.event-card-top .muted { display: inline-flex; align-items: center; gap: 5px; }
.event-card-top .icon { width: 15px; height: 15px; }
.event-card-title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; color: var(--foreground); }
.event-card-count { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.event-card-count strong { font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-value-sm { font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.link-ext { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.link-ext .icon { width: 15px; height: 15px; }
.event-thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--muted); box-shadow: 0 0 0 1px var(--border); }
.poster-preview { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--muted); }
.poster-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster-preview.is-empty { display: grid; place-items: center; border: 1.5px dashed var(--input); background: #FAFBFD; }
.poster-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.poster-empty .icon { width: 28px; height: 28px; opacity: .7; }
.poster-card { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.poster-card > img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.poster-card > a.small { align-self: center; }
.file-label input[type="file"] { margin-top: 2px; }
.poster-field [data-poster-note].warn { color: var(--warning); }

@media (max-width: 760px) {
  .event-card { grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px; }
  .event-card-count { grid-column: 2; flex-direction: row; align-items: baseline; gap: 6px; }
  .event-card-count strong { font-size: 18px; }
}

/* ---- Motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Small screens ---- */
@media (max-width: 1080px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 28px 28px 64px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 23px; overflow-wrap: anywhere; }
  .page-head h1::before { width: 22px; height: 5px; margin-bottom: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 24px; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px 0; gap: 8px; }
  .brand { flex-direction: row; align-items: center; padding: 0; gap: 10px; }
  .brand-logo { width: 116px; }
  .brand-tag { display: none; }
  .nav { flex-direction: row; overflow-x: auto; order: 3; margin: 0 -16px; padding: 0 12px; width: calc(100% + 32px); scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 10px 12px 12px; border-radius: 0; gap: 8px; }
  .nav a .icon { width: 16px; height: 16px; }
  .nav a.active { background: transparent; }
  .nav a.active::before { left: 10px; right: 10px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .who, .avatar { display: none; }
  .main { padding: 22px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card { padding: 18px; }
  .table-wrap { margin: 0 -18px; }
  .table th, .table td { padding: 11px 18px; }
  input, select, textarea { font-size: 16px; } /* stops iOS zooming into fields */
  .preview-frame iframe { height: 600px; }
  .bare-card { padding: 24px; }
}
