/* ==========================================================================
   EventCrate dashboard design system
   Colours and type pulled from the EventCrate marketing site design.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700&family=Archivo+Narrow:wght@500;600&family=Open+Sans:wght@400;500;600&display=swap');

:root {
  /* brand */
  --ec-coral:        #EA4F4F;
  --ec-coral-light:  #EC6262;
  --ec-coral-dark:   #E62A2A;
  --ec-coral-tint:   #F5A5A5;
  --ec-blue:         #649AE2;
  --ec-blue-light:   #9DBFED;
  --ec-blue-dark:    #3F83DB;

  /* neutrals */
  --ec-cream:        #faf9f5;
  --ec-surface:      #FFFFFF;
  --ec-surface-alt:  #F7F8FA;
  --ec-border:       #EAE8E1;
  --ec-dark:         #3A3A3A;
  --ec-text:         #3A3A3A;
  --ec-text-muted:   #7A7873;

  /* tenant-overridable (set by app-shell.js from /ec/v1/me) */
  --ec-accent: var(--ec-coral);

  --ec-radius: 12px;
  --ec-radius-sm: 8px;
  --ec-font-display: 'Archivo', 'Archivo Narrow', sans-serif;
  --ec-font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme="dark"] {
  --ec-cream:        #17171a;
  --ec-surface:      #212124;
  --ec-surface-alt:  #2a2a2e;
  --ec-border:       #38383d;
  --ec-dark:         #f2f1ee;
  --ec-text:         #e5e3de;
  --ec-text-muted:   #9b9a97;
}
/* A couple of components hard-code light-mode-only colours (badges, error
   banners) - nudge those specific tints for readability on a dark surface. */
:root[data-theme="dark"] .ec-badge.limit { background: #3a2323; color: #f5a5a5; }
:root[data-theme="dark"] .ec-badge.ok { background: #23331a; color: #a8d67c; }
:root[data-theme="dark"] .ec-error { background: #3a2323; color: #f5a5a5; }
:root[data-theme="dark"] .ec-note { color: var(--ec-text-muted); }
:root[data-theme="dark"] input[type="color"] { background: var(--ec-surface); border-color: var(--ec-border); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ec-cream);
  color: var(--ec-text);
  font-family: var(--ec-font-body);
  font-size: 15px;
  line-height: 1.5;
  transition: background-color 160ms ease, color 160ms ease;
}
.ec-card, .ec-sidebar, .ec-topbar, .ec-input, .ec-select, table.ec-table th, table.ec-table td, .ec-tool-card, .ec-login-card {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

h1, h2, h3, h4 { font-family: var(--ec-font-display); font-weight: 600; margin: 0 0 8px; color: var(--ec-dark); }
h1 { font-size: 23px; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--ec-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout shell ---------- */
.ec-shell { display: flex; min-height: 100vh; }

/* The sidebar stays put while the page scrolls: always the full window height. It's a rail of
   big section buttons and, inside an event, a panel listing the open section's pages. */
:root { --ec-rail-w: 84px; --ec-panel-w: 212px; --ec-sidebar-w: var(--ec-rail-w); }
:root:has(.ec-sidebar--panel) { --ec-sidebar-w: calc(var(--ec-rail-w) + var(--ec-panel-w)); }
.ec-sidebar {
  width: var(--ec-sidebar-w);
  flex-shrink: 0;
  background: var(--ec-surface);
  border-right: 1px solid var(--ec-border);
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
  view-transition-name: ec-sidebar;
}
.ec-rail {
  width: var(--ec-rail-w); flex-shrink: 0; display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  padding: 14px 8px; overflow-y: auto; background: var(--ec-surface-alt); border-right: 1px solid var(--ec-border);
}
.ec-rail-brand { display: flex; justify-content: center; padding: 2px 0 12px; }
.ec-rail-brand img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.ec-rail-sep { height: 1px; background: var(--ec-border); margin: 6px 10px; }
.ec-rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 4px 8px; border: 0; border-radius: var(--ec-radius-sm); background: none;
  color: var(--ec-text-muted); font: inherit; font-size: 11.5px; font-weight: 500; line-height: 1.2; text-align: center;
  cursor: pointer; text-decoration: none;
}
.ec-rail-btn .ec-nav-icon { width: 22px; height: 22px; }
.ec-rail-btn:hover { background: var(--ec-surface); color: var(--ec-text); text-decoration: none; }
.ec-rail-btn:focus-visible { outline: 2px solid var(--ec-accent); outline-offset: -2px; }
/* Only ever one button selected: the section whose pages the panel is showing (clicking a section
   selects it straight away), or Events / Library / Account when on those pages. */
.ec-rail-btn.open, .ec-rail-btn.active:not([data-nav-section]) { background: color-mix(in srgb, var(--ec-accent) 13%, transparent); color: var(--ec-dark); font-weight: 600; }
.ec-rail-btn.open .ec-nav-icon, .ec-rail-btn.active:not([data-nav-section]) .ec-nav-icon { color: var(--ec-accent); }
.ec-rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--ec-border); }
.ec-rail-foot .ec-rail-btn { padding: 6px 4px; font-size: 11px; }
.ec-rail-foot .ec-rail-btn .ec-nav-icon { width: 18px; height: 18px; }
#ec-theme-icon { display: flex; }

.ec-panel { width: var(--ec-panel-w); flex-shrink: 0; padding: 16px 12px; overflow-y: auto; }
.ec-panel-head { padding: 4px 10px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--ec-border); }
.ec-panel-brand { font-size: 11.5px; color: var(--ec-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-panel-event { font-family: var(--ec-font-display); font-weight: 600; font-size: 15px; color: var(--ec-dark); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ec-panel-group { display: flex; flex-direction: column; gap: 1px; }
.ec-panel-group[hidden] { display: none; }
.ec-panel-title { margin: 6px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ec-text-muted); }

/* Tool picker (New event, Event settings): one row per tool, with an on/off switch. */
.ec-tool-pick-group { margin: 14px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ec-text-muted); }
.ec-tool-pick-group:first-child { margin-top: 2px; }
.ec-tool-pick {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 6px;
  border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); cursor: pointer; font-weight: 400;
}
.ec-tool-pick:hover { background: var(--ec-surface-alt); }
.ec-tool-pick:has(input:checked) { border-color: color-mix(in srgb, var(--ec-accent) 45%, var(--ec-border)); }
.ec-tool-pick-icon .ec-nav-icon { width: 22px; height: 22px; color: var(--ec-accent); display: block; }
.ec-tool-pick-text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ec-tool-pick-text strong { font-size: 14px; color: var(--ec-dark); }
.ec-tool-pick-text span { font-size: 12.5px; color: var(--ec-text-muted); }
.ec-tool-pick input { flex-shrink: 0; }

/* Moving between pages: the sidebar and top bar hold still and only the content cross-fades,
   instead of the whole window flashing (browsers without view transitions just navigate). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
::view-transition-group(ec-sidebar), ::view-transition-group(ec-topbar) { animation: none; }

/* Pop-up forms stay in the window wherever the page is scrolled to (they're written as
   absolute overlays in each page's markup). */
body > div[id$="-modal"] { position: fixed !important; z-index: 1000; overflow-y: auto; min-height: 0 !important; }

.ec-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--ec-radius-sm);
  color: var(--ec-text-muted); font-weight: 500; font-size: 14px;
  cursor: pointer;
}
.ec-nav-item:hover { background: var(--ec-surface-alt); text-decoration: none; color: var(--ec-text); }
/* Active: a quiet tint, not a solid block - the page's own primary button should be the loudest thing on screen. */
.ec-nav-item.active { background: color-mix(in srgb, var(--ec-accent) 11%, transparent); color: var(--ec-dark); font-weight: 600; }
.ec-nav-empty { padding: 10px 12px; font-size: 13px; color: var(--ec-text-muted); }

.ec-nav-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--ec-text-muted); }
.ec-nav-item:hover .ec-nav-icon { color: var(--ec-text); }
.ec-nav-item.active .ec-nav-icon { color: var(--ec-accent); }

/* Attendee list toolbar, shared by every list: search on the left; count, paging and the
   view options (columns, rows per page) on the right - one line. */
.ec-attendee-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.ec-attendee-controls input[type="search"] { flex: 1; min-width: 200px; max-width: 320px; }
/* A list's toolbar and its page actions (import/export, add) on one line. */
.ec-list-head { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.ec-list-head > div:first-child { flex: 1; min-width: 300px; }
.ec-list-meta { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ec-text-muted); font-variant-numeric: tabular-nums; }
.ec-list-meta .ec-icon-btn { width: 30px; height: 30px; }
.ec-cols-wrap { position: relative; }
.ec-cols-pop {
  position: absolute; right: 0; top: 36px; z-index: 20;
  background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: 10px; width: 210px;
}
.ec-cols-pop-title { font-size: 11px; text-transform: uppercase; color: var(--ec-text-muted); margin-bottom: 6px; letter-spacing: .03em; }
.ec-cols-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 0; font-weight: 400; }
.ec-input.ec-readonly { background: var(--ec-surface-alt); color: var(--ec-text-muted); cursor: default; }
.ec-filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: 12.5px; background: color-mix(in srgb, var(--ec-accent) 11%, transparent); color: var(--ec-dark); }
.ec-filter-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
/* Custom fields in attendee pop-ups (custom-fields.js). */
.ec-cf-form-title { margin: 14px 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ec-text-muted); }

.ec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.ec-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 28px; border-bottom: 1px solid var(--ec-border); background: var(--ec-surface);
  position: sticky; top: 0; z-index: 40; view-transition-name: ec-topbar;
}
.ec-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ec-user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ec-surface-alt);
  display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--ec-text-muted);
}

.ec-content { padding: 24px 28px 40px; flex: 1; max-width: 1480px; width: 100%; }

/* Page header: title (+ one-line subtitle) on the left, the page's actions on the right -
   at most one primary button; everything else goes in a menu. */
.ec-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.ec-page-head h1 { margin: 0; }
.ec-page-sub { margin: 3px 0 0; font-size: 13.5px; color: var(--ec-text-muted); }
.ec-page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Tabs: underlined text, not buttons. The markup stays .ec-btn / .ec-btn.secondary inside
   .ec-tabs so each page's existing tab switching works unchanged (active = not .secondary). */
.ec-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ec-border); margin: 0 0 18px; flex-wrap: wrap; }
.ec-tabs .ec-btn, .ec-tabs .ec-btn.secondary, .ec-tabs a {
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--ec-text-muted); padding: 9px 12px 8px; margin-bottom: -1px; font-weight: 500; filter: none;
}
.ec-tabs .ec-btn:hover, .ec-tabs a:hover { color: var(--ec-text); text-decoration: none; }
.ec-tabs .ec-btn:not(.secondary), .ec-tabs a.active { color: var(--ec-dark); border-bottom-color: var(--ec-accent); font-weight: 600; }
/* A second, smaller level of tabs inside a tab. */
.ec-tabs.ec-tabs--sub { border-bottom: none; gap: 4px; margin-bottom: 14px; }
.ec-tabs.ec-tabs--sub .ec-btn { border: 1px solid transparent; border-radius: 999px; padding: 4px 12px; font-size: 13px; margin: 0; }
.ec-tabs.ec-tabs--sub .ec-btn:not(.secondary) { background: var(--ec-surface); border-color: var(--ec-border); }

/* ---------- cards / tables / buttons ---------- */
.ec-card {
  background: var(--ec-surface); border: 1px solid var(--ec-border);
  border-radius: var(--ec-radius); padding: 18px 20px; margin-bottom: 18px;
}
.ec-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ec-card-header h2 { margin: 0; }

/* Overview page. */
.ec-ov-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ec-ov-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }
.ec-ov-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 14px; align-items: center; padding: 9px 8px; margin: 0 -8px; border-radius: 6px; color: inherit; font-size: 14px; }
.ec-ov-row:hover { background: var(--ec-surface-alt); text-decoration: none; }
.ec-ov-attention .ec-ov-row { grid-template-columns: 22px 1fr auto; }
.ec-ov-flag { color: #b45309; }
.ec-ov-label { color: var(--ec-text); }
.ec-ov-count { font-size: 13px; color: var(--ec-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ec-ov-count strong { color: var(--ec-text); }
.ec-ov-bar { height: 8px; border-radius: 4px; background: var(--viz-track); overflow: hidden; }
.ec-ov-bar span { display: block; height: 100%; background: var(--viz-1); border-radius: 0 4px 4px 0; }
@media (max-width: 1000px) { .ec-ov-grid { grid-template-columns: 1fr; } .ec-ov-charts { grid-template-columns: 1fr; } }

/* Events list: one clickable row per event. */
.ec-event-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 0; border-bottom: 1px solid var(--ec-border); }
.ec-event-row:last-child { border-bottom: none; }
.ec-event-row:hover { background: var(--ec-surface-alt); }
.ec-event-link { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px 14px; color: inherit; border-radius: 6px; }
.ec-event-link:hover { text-decoration: none; }
.ec-event-name { font-family: var(--ec-font-display); font-weight: 600; font-size: 15.5px; color: var(--ec-dark); }
.ec-event-meta { font-size: 13px; color: var(--ec-text-muted); }

/* Settings forms (settings-form.js): each section is a grid of fields. */
.ec-settings-section { margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--ec-border); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ec-text-muted); }
.ec-settings-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.ec-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }
.ec-settings-grid .ec-span-all { grid-column: 1 / -1; }
.ec-settings-grid .ec-field { margin-bottom: 12px; }
.ec-settings-switch .ec-field { margin-bottom: 6px; }
.ec-settings-switch label { font-size: 13.5px !important; padding: 4px 0; cursor: pointer; }

/* On long settings forms the header with the Save button sticks under the top bar. */
.ec-card:has(#ec-settings-form) > .ec-card-header,
.ec-card:has(#ec-board-settings-form) > .ec-card-header,
.ec-card:has(#gb-settings-form) > .ec-card-header {
  position: sticky; top: 53px; z-index: 5; background: var(--ec-surface);
  margin: -18px -20px 12px; padding: 12px 20px; border-bottom: 1px solid var(--ec-border); border-radius: var(--ec-radius) var(--ec-radius) 0 0;
}

/* Every checkbox is drawn as an on/off switch. It's still a real checkbox (same events, form
   values and keyboard behaviour), only its look changes. */
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; margin: 0; flex-shrink: 0; vertical-align: middle;
  position: relative; width: 34px; height: 20px; border-radius: 999px; border: none;
  background: #c9c6bd; cursor: pointer; transition: background-color 150ms ease;
}
input[type="checkbox"]::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 150ms ease;
}
input[type="checkbox"]:checked { background: var(--ec-accent); }
input[type="checkbox"]:checked::before { transform: translateX(14px); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--ec-accent); outline-offset: 2px; }
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }
:root[data-theme="dark"] input[type="checkbox"]:not(:checked) { background: #4a4a50; }

/* Group boards presenter: controls on the left, the spotlight list beside them. */
.gb-presenter-grid { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(340px, 1.1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .gb-presenter-grid { grid-template-columns: 1fr; } }

/* Drop-down menus (.ec-menu): a toggle button and a panel of actions. Wired once for the whole
   app in app-shell.js, so a menu works wherever it's rendered, including inside table rows. */
.ec-menu { position: relative; display: inline-flex; }
.ec-menu-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 210px;
  background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm);
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 5px;
}
.ec-menu.open .ec-menu-pop { display: block; }
.ec-menu.up .ec-menu-pop { top: auto; bottom: calc(100% + 4px); }
.ec-menu-pop > button, .ec-menu-pop > a {
  display: block; width: 100%; text-align: left; background: none; border: none; border-radius: 6px;
  padding: 7px 10px; font: inherit; font-size: 13.5px; color: var(--ec-text); cursor: pointer; white-space: nowrap;
}
.ec-menu-pop > button:hover, .ec-menu-pop > a:hover, .ec-menu-pop > button:focus-visible { background: var(--ec-surface-alt); text-decoration: none; outline: none; }
.ec-menu-pop > button:disabled { opacity: .45; cursor: default; background: none; }
.ec-menu-pop .danger { color: var(--ec-coral-dark); }
.ec-menu-pop hr { border: none; border-top: 1px solid var(--ec-border); margin: 5px 2px; }
.ec-menu-pop .ec-menu-label { padding: 6px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ec-text-muted); }

/* Square icon buttons: row "⋯" menus, paging arrows. */
.ec-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ec-text-muted); cursor: pointer; font-size: 16px; line-height: 1;
}
.ec-icon-btn:hover { background: var(--ec-surface-alt); color: var(--ec-text); border-color: var(--ec-border); }
.ec-icon-btn:disabled { opacity: .35; cursor: default; background: none; border-color: transparent; }

/* Row actions: one quiet text action plus a "⋯" menu, kept to the right of the row. */
td.ec-row-actions { width: 1%; white-space: nowrap; text-align: right; }
td.ec-row-actions > * { vertical-align: middle; }
table.ec-table tbody tr:hover td { background: color-mix(in srgb, var(--ec-surface-alt) 70%, transparent); }

.ec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.ec-tool-card {
  background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius);
  padding: 18px; display: block;
}
.ec-tool-card h3 { margin-bottom: 4px; }
.ec-tool-card p { color: var(--ec-text-muted); font-size: 13px; margin-bottom: 0; }
.ec-tool-card.locked { opacity: 0.55; }

.ec-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--ec-accent); color: #fff; border: 1px solid transparent; border-radius: var(--ec-radius-sm);
  padding: 7px 14px; font-family: var(--ec-font-body); font-weight: 600; font-size: 13.5px; line-height: 1.4; cursor: pointer;
}
.ec-btn:hover { filter: brightness(0.94); text-decoration: none; }
.ec-btn.secondary { background: var(--ec-surface); color: var(--ec-text); border: 1px solid var(--ec-border); font-weight: 500; }
.ec-btn.secondary:hover { filter: none; background: var(--ec-surface-alt); }
/* Ghost: text-only, for the quiet per-row action. */
.ec-btn.ghost { background: none; color: var(--ec-text); border-color: transparent; font-weight: 500; padding: 4px 8px; }
.ec-btn.ghost:hover { filter: none; background: var(--ec-surface-alt); }
.ec-btn.small { padding: 4px 10px; font-size: 12.5px; }
.ec-btn.danger { background: var(--ec-surface); color: var(--ec-coral-dark); border: 1px solid var(--ec-coral-tint); }
.ec-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ec-btn .ec-caret { font-size: 10px; opacity: .7; margin-left: 2px; }

.ec-input, .ec-select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm);
  font-family: var(--ec-font-body); font-size: 14px; background: var(--ec-surface); color: var(--ec-text);
}
.ec-field { margin-bottom: 14px; }
.ec-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ec-text-muted); }
/* Plain, unboxed hint text for use INSIDE a label (e.g. "Personal display
   URL <hint>explain what this does</hint>") - .ec-note below is a filled
   callout box (background+padding), meant for a standalone paragraph.
   Nesting .ec-note inline in a label was wrapping its own background/
   padding box mid-sentence inside the label, overlapping the input
   underneath once the hint text got longer than a few words. */
.ec-field-hint { font-weight: 400; color: var(--ec-text-muted); }
.ec-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

table.ec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ec-table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ec-text-muted); padding: 7px 10px; border-bottom: 1px solid var(--ec-border); white-space: nowrap; }
table.ec-table td { padding: 8px 10px; border-bottom: 1px solid var(--ec-border); }
table.ec-table tr:last-child td { border-bottom: none; }

/* Denser rows for long working lists (one line per person). */
table.ec-table--compact td { padding: 6px 10px; white-space: nowrap; }
table.ec-table--compact td .ec-btn { padding: 4px 10px; font-size: 12px; }
.ec-muted { color: var(--ec-text-muted); }

/* Quick filters above a list: "Flight 98", "Train 15"... */
.ec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.ec-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--ec-border); background: var(--ec-surface); color: var(--ec-text); font: inherit; font-size: 13px; cursor: pointer; }
.ec-chip:hover { border-color: var(--ec-text-muted); }
.ec-chip.active { background: var(--ec-dark); border-color: var(--ec-dark); color: var(--ec-surface); }
.ec-chip-count { font-size: 12px; font-weight: 700; opacity: .75; }

.ec-chip--warn { border-color: var(--ec-coral-dark, #b42318); color: var(--ec-coral-dark, #b42318); text-decoration: none; }

/* Transfer runs: one block per pickup slot. */
.ec-tr-day { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ec-text-muted); border-bottom: 1px solid var(--ec-border); padding-bottom: 4px; }
.ec-run { border: 1px solid var(--ec-border); border-left: 4px solid var(--ec-accent); border-radius: var(--ec-radius-sm); margin-bottom: 10px; padding: 0 10px 8px; background: var(--ec-surface); }
.ec-run-head { display: flex; align-items: center; gap: 14px; padding: 10px 0; cursor: pointer; list-style: none; }
.ec-run-head::-webkit-details-marker { display: none; }
.ec-run-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; }
.ec-run-what { flex: 1; min-width: 0; }
.ec-run-sub { display: block; font-size: 13px; color: var(--ec-text-muted); }
.ec-run-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ec-run-meta .ec-btn { padding: 5px 10px; font-size: 12px; }

/* Report charts (viz.js). One blue for single measures; plane/train/bus colours were checked
   together for colour-blind separation. Dark mode has its own steps, not an inversion. */
:root {
  --viz-1: #2a78d6; --viz-track: #cde2fb;
  --viz-plane: #2a78d6; --viz-train: #eb6834; --viz-bus: #1baf7a;
  --viz-grid: #e1e0d9; --viz-axis: #c3c2b7; --viz-ink: #52514e;
}
:root[data-theme="dark"] {
  --viz-1: #3987e5; --viz-track: #1f3350;
  --viz-plane: #3987e5; --viz-train: #d95926; --viz-bus: #199e70;
  --viz-grid: #2c2c2a; --viz-axis: #38383d; --viz-ink: #c3c2b7;
}
.ec-viz { overflow-x: auto; margin: 6px 0 12px; }
.ec-viz svg { display: block; }
.ec-viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.ec-viz-axis { stroke: var(--viz-axis); stroke-width: 1; }
.ec-viz-tick { fill: var(--viz-ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.ec-viz-s1 { fill: var(--viz-1); }
.ec-viz-track { fill: var(--viz-track); }
.ec-viz-plane { fill: var(--viz-plane); background: var(--viz-plane); }
.ec-viz-train { fill: var(--viz-train); background: var(--viz-train); }
.ec-viz-bus { fill: var(--viz-bus); background: var(--viz-bus); }
.ec-viz-hit { fill: transparent; cursor: default; outline: none; }
.ec-viz-hit:hover, .ec-viz-hit:focus { fill: var(--viz-ink); fill-opacity: .06; }
.ec-viz-legend { display: flex; gap: 14px; font-size: 12px; color: var(--viz-ink); margin-bottom: 4px; }
.ec-viz-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ec-viz-bars { display: grid; gap: 4px; max-width: 760px; }
.ec-viz-bar-row { display: grid; grid-template-columns: minmax(90px, 220px) 1fr; gap: 10px; align-items: center; font-size: 13px; padding: 1px 0; border-radius: 4px; outline: none; }
.ec-viz-bar-row:hover, .ec-viz-bar-row:focus { background: var(--ec-surface-alt); }
.ec-viz-bar-label { text-align: right; color: var(--viz-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-viz-bar-track { display: flex; align-items: center; gap: 6px; }
.ec-viz-bar { display: block; height: 14px; background: var(--viz-1); border-radius: 0 4px 4px 0; }
.ec-viz-bar-value { font-size: 12px; color: var(--ec-text); font-variant-numeric: tabular-nums; }
.ec-viz-tip { display: none; position: fixed; z-index: 1000; max-width: 320px; padding: 6px 10px; border-radius: 6px; background: var(--ec-dark); color: var(--ec-surface); font-size: 12px; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

/* Reports page: the report list on the left, one report open on the right. */
.ec-an-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
/* The list sticks under the top bar; the search stays at its top, the sections scroll. */
.ec-an-nav { position: sticky; top: 68px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 84px); }
.ec-an-nav > #ec-an-search { flex-shrink: 0; }
.ec-an-nav > #ec-an-nav { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
/* Each tool is its own boxed section with a clear header. */
.ec-an-nav-section { flex-shrink: 0; background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); overflow: hidden; }
.ec-an-nav-group {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  font-family: var(--ec-font-display); font-size: 14px; font-weight: 600; color: var(--ec-dark);
  background: var(--ec-surface-alt); border-bottom: 1px solid var(--ec-border);
}
.ec-an-nav-group .ec-nav-icon { color: var(--ec-accent); width: 16px; height: 16px; }
.ec-an-nav-section--checks .ec-an-nav-group .ec-nav-icon { color: #b45309; }
.ec-an-nav-count { margin-left: auto; font-family: var(--ec-font-body); font-size: 12px; font-weight: 500; color: var(--ec-text-muted); }
.ec-an-nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; color: var(--ec-text); font-size: 13.5px; border-top: 1px solid color-mix(in srgb, var(--ec-border) 60%, transparent); }
.ec-an-nav-group + .ec-an-nav-item { border-top: none; }
.ec-an-nav-item:hover { background: var(--ec-surface-alt); text-decoration: none; }
.ec-an-nav-item.active { background: color-mix(in srgb, var(--ec-accent) 10%, transparent); color: var(--ec-dark); font-weight: 600; box-shadow: inset 3px 0 0 var(--ec-accent); }
.ec-an-nav-item mark, .ec-an-nav-group mark { background: color-mix(in srgb, var(--ec-accent) 25%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.ec-an-nav-empty { padding: 16px 12px; color: var(--ec-text-muted); font-size: 13px; text-align: center; }
/* Which tool the open report belongs to. */
.ec-an-tool-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--ec-surface-alt); border: 1px solid var(--ec-border); font-size: 12px; font-weight: 600; color: var(--ec-text); margin-bottom: 6px; }
.ec-an-tool-tag .ec-nav-icon { width: 14px; height: 14px; color: var(--ec-accent); }
.ec-an-tool-tag--checks .ec-nav-icon { color: #b45309; }
.ec-an-nav-title { flex: 1; min-width: 0; }
.ec-an-nav-flag { font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: #fdf0d5; color: #8a4b08; }
:root[data-theme="dark"] .ec-an-nav-flag { background: #3d2e12; color: #f3c477; }
.ec-an-choose { padding: 10px; margin-bottom: 6px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); background: var(--ec-surface); font-size: 13px; }
@media (max-width: 900px) { .ec-an-layout { grid-template-columns: 1fr; } .ec-an-nav { position: static; max-height: none; } }

/* Analytics page. */
.ec-an-report { scroll-margin-top: 16px; }
.ec-an-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ec-an-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ec-text-muted); }
.ec-an-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.ec-an-actions label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ec-text-muted); cursor: pointer; }
.ec-an-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.ec-an-stat { border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); padding: 8px 14px; min-width: 130px; }
.ec-an-stat-label { font-size: 12px; color: var(--ec-text-muted); }
.ec-an-stat-value { font-size: 24px; font-weight: 600; line-height: 1.2; }
.ec-an-stat-note { font-size: 12px; color: var(--ec-text-muted); }
.ec-an-caption { font-size: 12px; color: var(--ec-text-muted); margin-top: 4px; }
.ec-an-table { overflow-x: auto; }
.ec-an-table table.ec-table--compact td { white-space: normal; min-width: 70px; }
.ec-an-table td.num, .ec-an-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ec-an-checks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); background: var(--ec-surface); }

/* Travel type tags, same colours as the departures board. */
.ec-travel-mode { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; }
.ec-travel-mode--plane { background: #2563eb; }
.ec-travel-mode--train { background: #ea580c; }
.ec-travel-mode--bus { background: #0f8a5f; }

/* Big segmented picker, e.g. Plane / Train / Bus. */
.ec-segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.ec-segmented button { flex: 1 1 0; min-width: 90px; padding: 10px 8px; border-radius: var(--ec-radius-sm); border: 2px solid var(--ec-border); background: var(--ec-surface); color: var(--ec-text); font: inherit; font-weight: 600; cursor: pointer; }
.ec-segmented button:hover { border-color: var(--ec-text-muted); }
.ec-segmented button.active { border-color: var(--ec-accent); background: var(--ec-surface-alt); }
.ec-segmented button .ec-seg-icon { display: block; font-size: 20px; line-height: 1.2; }

.ec-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ec-badge.limit { background: #FDEDED; color: var(--ec-coral-dark); }
.ec-badge.ok { background: #EAF3DE; color: #3B6D11; }

.ec-empty { text-align: center; padding: 40px 20px; color: var(--ec-text-muted); }

.ec-error { background: #FDEDED; color: var(--ec-coral-dark); padding: 10px 14px; border-radius: var(--ec-radius-sm); font-size: 13px; margin-bottom: 14px; }
/* Notes are plain muted text, not grey boxes - help should read as help, not as more panels. */
.ec-note { font-size: 13px; color: var(--ec-text-muted); }
/* A banner that genuinely needs noticing (e.g. close to the plan's attendee limit). */
.ec-banner { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--ec-border); border-left: 3px solid #d97706; border-radius: var(--ec-radius-sm); background: var(--ec-surface); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- loading skeletons ---------- */
/* Pages draw their frame (headings, buttons, cards) at once. Anything still loading shows as soft
   placeholder rows with a shimmer sweeping left to right, and the real content appears in their
   place: .ec-skeleton marks a slot whose content is on its way (replaced when it arrives), and
   while html.ec-loading (ecStartLoading() until ecHideLoader()) any card without its own
   skeleton is drawn as one, for pages that fill a form from their data. */
:root { --ec-skel: #ebe9e3; --ec-skel-hi: #f7f6f2; }
:root[data-theme="dark"] { --ec-skel: #2b2b2f; --ec-skel-hi: #3a3a3f; }
.ec-skeleton, html.ec-loading .ec-content .ec-card:not(:has(.ec-skeleton))::after {
  background: linear-gradient(90deg, var(--ec-skel) 0%, var(--ec-skel) 35%, var(--ec-skel-hi) 50%, var(--ec-skel) 65%, var(--ec-skel) 100%) 0 0 / 300% 100%;
  /* A heading bar, then rows. */
  -webkit-mask: linear-gradient(#000 0 0) 0 0 / 36% 14px no-repeat, repeating-linear-gradient(#000 0 12px, transparent 12px 34px) 0 36px / 100% calc(100% - 36px) no-repeat;
          mask: linear-gradient(#000 0 0) 0 0 / 36% 14px no-repeat, repeating-linear-gradient(#000 0 12px, transparent 12px 34px) 0 36px / 100% calc(100% - 36px) no-repeat;
  opacity: 0; animation: ec-skel-in 220ms ease 100ms forwards, ec-shimmer 1.5s linear infinite;
}
.ec-skeleton { min-height: 214px; margin: 6px 0; }
.ec-skeleton--tiles {
  min-height: 300px;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(25% - 12px), transparent calc(25% - 12px) 25%), repeating-linear-gradient(#000 0 136px, transparent 136px 150px);
  -webkit-mask-composite: source-in;
          mask: repeating-linear-gradient(90deg, #000 0 calc(25% - 12px), transparent calc(25% - 12px) 25%) intersect, repeating-linear-gradient(#000 0 136px, transparent 136px 150px);
}
html.ec-loading .ec-content .ec-card:not(:has(.ec-skeleton)) { position: relative; min-height: 150px; }
html.ec-loading .ec-content .ec-card:not(:has(.ec-skeleton)) > * { opacity: 0; pointer-events: none; }
html.ec-loading .ec-content .ec-card:not(:has(.ec-skeleton))::after { content: ''; position: absolute; inset: 20px; max-height: 420px; }
.ec-content .ec-card > * { transition: opacity 220ms ease; }
/* Content arriving in a slot that held a skeleton (early.js adds .ec-reveal). */
/* "backwards", not "both": once done, the fade leaves nothing on the elements (a held transform would
   give every row its own layer and slide ⋯ menus underneath the next row). */
.ec-reveal > * { animation: ec-reveal 260ms ease backwards; }
@keyframes ec-skel-in { to { opacity: 1; } }
@keyframes ec-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes ec-reveal { from { opacity: 0; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) {
  .ec-skeleton, html.ec-loading .ec-content .ec-card:not(:has(.ec-skeleton))::after { animation: ec-skel-in 1ms 100ms forwards; }
  .ec-reveal > * { animation: none; }
}
.ec-inline-spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block; vertical-align: middle;
  border: 2px solid var(--ec-border); border-top-color: var(--ec-accent);
  animation: ec-spin 0.7s linear infinite;
}
@keyframes ec-spin { to { transform: rotate(360deg); } }

/* ---------- toast notifications ---------- */
.ec-toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 5000;
  display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.ec-toast {
  background: var(--ec-surface); border: 1px solid var(--ec-border); border-left: 4px solid var(--ec-accent);
  border-radius: var(--ec-radius-sm); padding: 12px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  font-size: 14px; color: var(--ec-text); opacity: 0; transform: translateX(16px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.ec-toast.ec-toast-show { opacity: 1; transform: translateX(0); }
.ec-toast.ec-toast-error { border-left-color: var(--ec-coral-dark); }
.ec-toast.ec-toast-success { border-left-color: #3B6D11; }

/* ---------- login screen ---------- */
.ec-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ec-cream); padding: 20px; }
.ec-login-card { width: 100%; max-width: 380px; background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius); padding: 34px 30px; }
.ec-login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.ec-login-title { font-family: var(--ec-font-display); font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.ec-login-sub { color: var(--ec-text-muted); font-size: 13px; margin-bottom: 22px; }

@media (max-width: 760px) {
  .ec-sidebar { display: none; }
  .ec-content { padding: 18px; }
  .ec-form-row { grid-template-columns: 1fr; }
}

/* ---------- People > Groups ---------- */
.ec-gr-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .ec-gr-layout { grid-template-columns: 1fr; } }
.ec-gr-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.ec-gr-list-empty { padding: 14px 10px; color: var(--ec-text-muted); font-size: 13.5px; }
.ec-gr-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--ec-radius-sm); background: none; color: var(--ec-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ec-gr-item:hover { background: var(--ec-surface-alt); }
.ec-gr-item.active { background: color-mix(in srgb, var(--ec-accent) 11%, transparent); font-weight: 600; color: var(--ec-dark); }
.ec-gr-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-gr-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ec-gr-dot--lg { width: 14px; height: 14px; }
.ec-gr-count { font-size: 12px; color: var(--ec-text-muted); background: var(--ec-surface-alt); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.ec-gr-panel { min-height: 420px; }
.ec-gr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ec-gr-transfer { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: stretch; }
@media (max-width: 760px) { .ec-gr-transfer { grid-template-columns: 1fr; } .ec-gr-mid { flex-direction: row !important; justify-content: center; } }
.ec-gr-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius); background: var(--ec-surface); }
.ec-gr-col--in { border-color: color-mix(in srgb, var(--ec-accent) 35%, var(--ec-border)); background: color-mix(in srgb, var(--ec-accent) 3%, var(--ec-surface)); }
.ec-gr-col-head { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.ec-gr-col-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-gr-link { margin-left: auto; border: 0; background: none; color: var(--ec-accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; white-space: nowrap; }
.ec-gr-link:hover { text-decoration: underline; }
.ec-gr-people { display: flex; flex-direction: column; gap: 2px; height: 52vh; min-height: 260px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.ec-gr-people-empty { margin: auto; padding: 20px; text-align: center; color: var(--ec-text-muted); font-size: 13.5px; max-width: 240px; }
.ec-gr-person { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--ec-radius-sm); cursor: pointer; user-select: none; border: 1px solid transparent; transition: background-color 120ms ease, border-color 120ms ease; }
.ec-gr-person:hover { background: var(--ec-surface-alt); }
.ec-gr-person.selected { background: color-mix(in srgb, var(--ec-accent) 12%, transparent); border-color: color-mix(in srgb, var(--ec-accent) 40%, transparent); }
.ec-gr-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--ec-text-muted); background: var(--ec-surface-alt); border: 1px solid var(--ec-border); }
.ec-gr-person.selected .ec-gr-avatar { background: var(--ec-accent); border-color: var(--ec-accent); color: #fff; }
.ec-gr-person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ec-gr-person-name { font-size: 13.5px; color: var(--ec-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-gr-person-sub { font-size: 12px; color: var(--ec-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-gr-quick { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--ec-border); background: var(--ec-surface); color: var(--ec-text-muted); font-size: 17px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 120ms ease; }
.ec-gr-person:hover .ec-gr-quick, .ec-gr-quick:focus-visible { opacity: 1; }
.ec-gr-quick:hover { border-color: var(--ec-accent); color: var(--ec-accent); }
@media (hover: none) { .ec-gr-quick { opacity: 1; } }
.ec-gr-mid { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.ec-gr-mid .ec-btn { white-space: nowrap; }
.ec-gr-mid .ec-btn:disabled { opacity: .45; cursor: default; }
.ec-gr-hint { margin: 12px 0 0; }
.ec-gr-welcome { max-width: 420px; margin: 60px auto; text-align: center; }
.ec-gr-welcome-icon .ec-nav-icon { width: 40px; height: 40px; color: var(--ec-accent); margin-bottom: 8px; }
.ec-gr-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.ec-gr-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px var(--ec-surface); }
.ec-gr-swatch.active { border-color: var(--ec-dark); }
.ec-gr-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px 1px 6px; border-radius: 999px; background: var(--ec-surface-alt); border: 1px solid var(--ec-border); margin: 1px 4px 1px 0; white-space: nowrap; }

/* ---------- Communications: email list, status, send pop-up ---------- */
.ec-em-name { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.ec-em-name:hover strong { text-decoration: underline; }
.ec-em-icon { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ec-accent) 10%, transparent); }
.ec-em-icon .ec-nav-icon { width: 18px; height: 18px; color: var(--ec-accent); }
.ec-em-subject { display: block; font-size: 12.5px; color: var(--ec-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.ec-email-frame-wrap { background: #f3f4f6; border-radius: var(--ec-radius-sm); margin-top: 14px; padding: 8px; }
.ec-email-frame { width: 100%; height: 420px; border: 0; display: block; background: #f3f4f6; }

.ec-es-row td { vertical-align: middle; }
.ec-es-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--ec-surface-alt); }
.ec-es-seg { height: 100%; }
.ec-es-seg--sent { background: #2E9E6A; }
.ec-es-seg--queued { background: #9DBFED; }
.ec-es-seg--failed { background: #D64545; }
.ec-es-seg--skipped { background: #c9c7c1; }
.ec-es-counts { font-size: 12.5px; color: var(--ec-text-muted); margin-top: 4px; }
.ec-es-n--failed { color: #C23B3B; font-weight: 600; }

.ec-send-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ec-text-muted); margin-bottom: 8px; }
.ec-send-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ec-send-mode { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); background: var(--ec-surface); color: var(--ec-text); font: inherit; cursor: pointer; }
.ec-send-mode span { font-size: 12.5px; color: var(--ec-text-muted); }
.ec-send-mode.active { border-color: var(--ec-accent); box-shadow: 0 0 0 1px var(--ec-accent) inset; background: color-mix(in srgb, var(--ec-accent) 6%, var(--ec-surface)); }
.ec-send-mode:disabled { opacity: .55; cursor: default; }
.ec-send-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ec-send-group { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 10px; border-radius: 999px; border: 1px solid var(--ec-border); background: var(--ec-surface); color: var(--ec-text); font: inherit; font-size: 13px; cursor: pointer; }
.ec-send-group.active { border-color: var(--ec-accent); background: color-mix(in srgb, var(--ec-accent) 10%, var(--ec-surface)); font-weight: 600; }
.ec-send-switch { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-weight: 400; font-size: 14px; }
.ec-send-summary { margin-top: 16px; padding: 12px 14px; border-radius: var(--ec-radius-sm); background: var(--ec-surface-alt); min-height: 48px; font-size: 13.5px; }
.ec-send-count { font-size: 15px; color: var(--ec-dark); }
.ec-send-count strong { font-size: 20px; }
.ec-send-sample, .ec-send-left { color: var(--ec-text-muted); margin-top: 4px; }

/* ---------- the email editor ---------- */
.ee-content { padding-bottom: 0; }
.ee-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ee-title { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.ee-name { font-family: var(--ec-font-display); font-size: 21px; font-weight: 600; color: var(--ec-dark); border: 1px solid transparent; background: transparent; border-radius: var(--ec-radius-sm); padding: 3px 8px; margin-left: -8px; width: 100%; max-width: 520px; }
.ee-name:hover:not([readonly]) { border-color: var(--ec-border); }
.ee-name:focus { outline: none; border-color: var(--ec-accent); background: var(--ec-surface); }
.ee-title .ec-note { font-size: 12.5px; margin: 0; }
.ee-saved { font-size: 12.5px; color: var(--ec-text-muted); }
.ee-actions { display: flex; gap: 8px; align-items: center; }

.ee-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .ee-layout { grid-template-columns: 170px minmax(0, 1fr) 260px; } }
@media (max-width: 960px) { .ee-layout { grid-template-columns: 1fr; } .ee-palette, .ee-props { position: static !important; max-height: none !important; } }
.ee-palette, .ee-props { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius); padding: 14px; }
.ee-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--ec-font-display); font-weight: 600; font-size: 15px; color: var(--ec-dark); margin-bottom: 12px; }
.ee-subhead { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ec-text-muted); margin: 14px 0 6px; }
.ee-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ee-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); background: var(--ec-surface); color: var(--ec-text); font: inherit; font-size: 12px; cursor: grab; transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease; }
.ee-tile:hover { border-color: var(--ec-accent); box-shadow: 0 3px 10px rgba(0,0,0,.06); transform: translateY(-1px); }
.ee-tile:active { cursor: grabbing; }
.ee-tile-icon { font-size: 18px; line-height: 1; color: var(--ec-accent); font-weight: 700; }
.ee-palette-hint { font-size: 12px; margin: 12px 0 0; }

.ee-canvas-wrap { background: #e9eaee; border-radius: var(--ec-radius); padding: 28px 16px 40px; min-height: calc(100vh - 200px); }
.ee-paper { --ee-accent: #EA4F4F; width: 100%; max-width: 600px; margin: 0 auto; background: #ffffff; border-radius: 8px; box-shadow: 0 2px 14px rgba(15,23,42,.08); color: #1f2937; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.55; padding: 8px 0 16px; }
.ee-zone { position: relative; padding: 6px 0; }
.ee-zone--editable { min-height: 60px; }
.ee-zone--header { border-bottom: 1px dashed transparent; }
.ee-zone--footer { border-top: 1px solid #e5e7eb; margin-top: 8px; padding-top: 12px; font-size: 13px; color: #6b7280; }
.ee-zone--footer .ee-h { font-size: 16px; color: #6b7280; }
.ee-zone--static { opacity: .75; }
.ee-zone-label { font-family: var(--ec-font-body); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #9ca3af; padding: 0 32px 4px; }
.ee-zone-label span { color: #d1d5db; }
.ee-zone-none { font-family: var(--ec-font-body); font-size: 12px; color: #9ca3af; text-align: center; padding: 8px; margin: 4px 32px; border: 1px dashed #e5e7eb; border-radius: 6px; }
.ee-link { border: 0; background: none; padding: 0; font: inherit; color: var(--ec-accent); cursor: pointer; text-decoration: none; font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.ee-link:hover { text-decoration: underline; }
.ee-placeholder { text-align: center; color: #9ca3af; font-style: italic; padding: 28px 32px; font-size: 14px; }
.ee-empty-zone { margin: 6px 32px; padding: 22px; text-align: center; border: 2px dashed #d1d5db; border-radius: 8px; color: #9ca3af; font-family: var(--ec-font-body); font-size: 13.5px; }

.ee-block { position: relative; padding: 4px 32px 10px; border: 1px solid transparent; border-radius: 4px; margin: 0 4px; }
.ee-block:not(.ee-block--static):hover { border-color: color-mix(in srgb, var(--ee-accent) 35%, transparent); }
.ee-block.selected { border-color: var(--ee-accent); box-shadow: 0 0 0 1px var(--ee-accent); }
.ee-block.dragging { opacity: .4; }
.ee-tools { position: absolute; top: -15px; right: 8px; z-index: 5; display: none; align-items: center; gap: 1px; padding: 2px; background: #1f2937; border-radius: 7px; box-shadow: 0 4px 14px rgba(0,0,0,.18); font-family: var(--ec-font-body); }
.ee-block:hover .ee-tools, .ee-block.selected .ee-tools { display: flex; }
.ee-tools button, .ee-handle { min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: 5px; background: none; color: #f9fafb; font-size: 13px; line-height: 26px; text-align: center; cursor: pointer; }
.ee-tools button:hover:not(:disabled), .ee-handle:hover { background: rgba(255,255,255,.14); }
.ee-tools button:disabled { opacity: .35; cursor: default; }
.ee-handle { cursor: grab; user-select: none; }
.ee-sep { width: 1px; height: 16px; background: rgba(255,255,255,.2); margin: 0 3px; }
.ee-drop-line { height: 3px; margin: 2px 32px; border-radius: 2px; background: var(--ee-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ee-accent) 20%, transparent); }

.ee-h { margin: 0; font-size: 24px; line-height: 1.3; font-weight: bold; color: #111827; font-family: Arial, Helvetica, sans-serif; outline: none; }
.ee-text { outline: none; min-height: 1.5em; }
.ee-text p { margin: 0 0 12px; }
.ee-text ul, .ee-text ol { margin: 0 0 12px; padding-left: 22px; }
.ee-text a { color: var(--ee-accent); }
[contenteditable="true"]:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ee-accent) 18%, transparent); border-radius: 3px; }
.ee-img { display: inline-block; max-width: 100%; height: auto; border-radius: 2px; }
.ee-img-empty { display: inline-flex; align-items: center; justify-content: center; height: 130px; max-width: 100%; border: 2px dashed #d1d5db; border-radius: 6px; color: #9ca3af; font-size: 13px; font-family: var(--ec-font-body); background: #f9fafb; }
.ee-btn { display: inline-block; padding: 12px 22px; border-radius: 6px; background: var(--ee-accent); color: #ffffff; font-weight: bold; font-size: 15px; }
.ee-caption { font-family: var(--ec-font-body); font-size: 11.5px; color: #9ca3af; margin-top: 4px; }
.ee-warn { color: #C4841B; }
.ee-hr { border: 0; border-top: 1px solid #e5e7eb; margin: 8px 0; }
.ee-spacer { background: repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(156,163,175,.12) 6px, rgba(156,163,175,.12) 12px); border-radius: 3px; }
.ee-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ee-col .ee-img { margin-bottom: 8px; }

.ee-seg { display: inline-flex; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); overflow: hidden; }
.ee-seg button { border: 0; background: var(--ec-surface); color: var(--ec-text); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ee-seg button + button { border-left: 1px solid var(--ec-border); }
.ee-seg button.active { background: color-mix(in srgb, var(--ec-accent) 12%, var(--ec-surface)); font-weight: 600; color: var(--ec-dark); }
.ee-color { display: flex; align-items: center; gap: 10px; }
.ee-check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13.5px; margin: 0; }
.ee-thumb { display: block; max-width: 100%; max-height: 120px; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--ec-border); }
.ee-with-tag { display: flex; gap: 6px; }
.ee-block-actions { display: flex; gap: 6px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ec-border); }
.ee-danger { color: #C23B3B !important; }
.ee-props input[type="range"] { width: 100%; }

.ee-tag-menu { position: fixed; z-index: 3000; max-height: 320px; overflow-y: auto; min-width: 240px; background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; }
.ee-tag-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 13.5px; color: var(--ec-text); cursor: pointer; }
.ee-tag-menu button:hover { background: var(--ec-surface-alt); }

.ee-preview-card { width: 760px; max-width: calc(100vw - 32px); max-height: 92vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ee-preview-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--ec-border); flex-wrap: wrap; }
.ee-device { display: inline-flex; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); overflow: hidden; }
.ee-device button { border: 0; background: var(--ec-surface); color: var(--ec-text); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ee-device button.active { background: color-mix(in srgb, var(--ec-accent) 12%, var(--ec-surface)); font-weight: 600; }
.ee-preview-stage { background: #f3f4f6; flex: 1; overflow: auto; display: flex; justify-content: center; padding: 0; }
.ee-preview-frame { width: 100%; max-width: 700px; height: 70vh; border: 0; background: #f3f4f6; transition: max-width 200ms ease; }
.ee-preview-frame.phone { max-width: 375px; }

/* ---------- Branding: colour chips, the colour picker and live previews ---------- */
.ec-settings-color { min-width: 0; }
.ec-colorchip-row { display: flex; gap: 6px; align-items: stretch; }
.ec-colorchip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); background: var(--ec-surface); color: var(--ec-text); font: inherit; text-align: left; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease; }
.ec-colorchip:hover { border-color: color-mix(in srgb, var(--ec-accent) 50%, var(--ec-border)); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.ec-colorchip:focus-visible { outline: 2px solid var(--ec-accent); outline-offset: 1px; }
.ec-colorchip-swatch { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.ec-colorchip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ec-colorchip-label { font-weight: 600; font-size: 13.5px; color: var(--ec-dark); }
.ec-colorchip-affects { font-size: 12px; color: var(--ec-text-muted); }
.ec-colorchip-hex { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ec-text-muted); }
.ec-colorchip-locate { width: 34px; flex-shrink: 0; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); background: var(--ec-surface); color: var(--ec-text-muted); font-size: 16px; cursor: pointer; }
.ec-colorchip-locate:hover { color: #D9078F; border-color: #F472B6; background: #FDF2F8; }
.ec-colorfield-warn { margin-top: 6px; font-size: 12px; color: #B45309; }
.ec-colorfield-warn::before { content: '⚠ '; }
.ec-settings-details { margin-top: 18px; }
.ec-settings-details summary { cursor: pointer; list-style: none; }
.ec-settings-details summary::-webkit-details-marker { display: none; }
.ec-settings-details summary::after { content: ' ▸'; color: var(--ec-text-muted); }
.ec-settings-details[open] summary::after { content: ' ▾'; }
.ec-settings-note { margin: -4px 0 10px; }

.ec-cp { position: fixed; z-index: 4000; width: 316px; padding: 14px; background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.22); }
.ec-cp-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.ec-cp-big { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: background 120ms ease; }
.ec-cp-name { font-weight: 600; color: var(--ec-dark); font-size: 14px; }
.ec-cp-affects { font-size: 12px; color: var(--ec-text-muted); line-height: 1.35; }
.ec-cp-title { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ec-text-muted); margin: 10px 0 6px; }
.ec-cp-swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.ec-cp-swatch { width: 24px; height: 24px; border-radius: 6px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: transform 100ms ease; padding: 0; }
.ec-cp-swatch:hover { transform: scale(1.15); }
.ec-cp-swatch:focus-visible { outline: 2px solid var(--ec-accent); outline-offset: 2px; }
.ec-cp-swatch.active { box-shadow: 0 0 0 2px var(--ec-surface), 0 0 0 4px var(--ec-dark); }
.ec-cp-custom { display: flex; gap: 6px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ec-border); }
.ec-cp-wheel { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); font-size: 12.5px; font-weight: 500; cursor: pointer; margin: 0; white-space: nowrap; background: conic-gradient(from 0deg, #f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f472b6, #f87171) left 8px center / 14px 14px no-repeat, var(--ec-surface); padding-left: 28px; border-radius: 8px; }
.ec-cp-wheel input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ec-cp-eye { padding: 6px 10px; border: 1px solid var(--ec-border); border-radius: 8px; background: var(--ec-surface); color: var(--ec-text); font: inherit; font-size: 12.5px; cursor: pointer; }
.ec-cp-hex { width: 92px !important; padding: 6px 8px !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; margin-left: auto; }
.ec-cp-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }

.ec-brand-layout { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.3fr); gap: 22px; align-items: start; }
.ec-brand-layout--phone { grid-template-columns: minmax(340px, 1fr) 380px; }
@media (max-width: 1100px) { .ec-brand-layout, .ec-brand-layout--phone { grid-template-columns: 1fr; } }
.ec-brand-layout > .ec-pv { position: sticky; top: 76px; }
.ec-pv { background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: var(--ec-radius); padding: 14px; }
.ec-pv + .ec-pv { margin-top: 16px; }
.ec-pv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ec-pv-title { font-family: var(--ec-font-display); font-weight: 600; font-size: 15px; color: var(--ec-dark); }
.ec-pv-note { font-size: 12px; color: var(--ec-text-muted); }
.ec-pv-tools { display: flex; align-items: center; gap: 8px; }
.ec-pv-status { font-size: 12px; color: var(--ec-text-muted); }
.ec-pv-stage { position: relative; display: flex; justify-content: center; }
.ec-pv-stage--screen .ec-pv-device, .ec-pv-stage--tablet .ec-pv-device { padding: 8px; background: #111827; border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.18); }
.ec-pv-stage--tablet .ec-pv-device { border-radius: 22px; padding: 14px; }
.ec-pv-stage--phone .ec-pv-device { padding: 10px; background: #111827; border-radius: 34px; box-shadow: 0 12px 34px rgba(15,23,42,.2); }
.ec-pv-stage--phone .ec-pv-screen { border-radius: 24px; }
.ec-pv-screen { position: relative; overflow: hidden; background: #fff; border-radius: 4px; }
.ec-pv-frame { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; pointer-events: auto; }
.ec-pv-flash { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: #D9078F; color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; box-shadow: 0 6px 18px rgba(217,7,143,.35); white-space: nowrap; }
.ec-pv-switch { display: inline-flex; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); overflow: hidden; }
.ec-pv-switch button { border: 0; background: var(--ec-surface); color: var(--ec-text); padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ec-pv-switch button.active { background: color-mix(in srgb, var(--ec-accent) 12%, var(--ec-surface)); font-weight: 600; color: var(--ec-dark); }

/* ---------- fonts and event branding ---------- */
.ec-fontpick { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); background: var(--ec-surface); color: var(--ec-text); font: inherit; text-align: left; cursor: pointer; }
.ec-fontpick:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ec-accent) 50%, var(--ec-border)); }
.ec-fontpick-name { font-size: 16px; font-weight: 600; color: var(--ec-dark); }
.ec-fontpick-sample { flex: 1; font-size: 14px; color: var(--ec-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-fp { position: fixed; z-index: 4000; width: 340px; max-height: 440px; display: flex; flex-direction: column; background: var(--ec-surface); border: 1px solid var(--ec-border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.22); padding: 10px; }
.ec-fp-search { margin-bottom: 8px; }
.ec-fp-list { overflow-y: auto; }
.ec-fp-group { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ec-text-muted); margin: 10px 8px 4px; }
.ec-fp-item { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ec-text); text-align: left; cursor: pointer; }
.ec-fp-item:hover { background: var(--ec-surface-alt); }
.ec-fp-item.active { background: color-mix(in srgb, var(--ec-accent) 12%, transparent); }
.ec-fp-name { font-size: 17px; color: var(--ec-dark); white-space: nowrap; }
.ec-fp-sample { font-size: 13px; color: var(--ec-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ec-colorfield--empty .ec-colorchip-swatch { background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 12px 12px !important; }
.ec-inherit { margin-top: 6px; font-size: 12px; color: var(--ec-text-muted); }
.ec-inherit-tag { display: inline-flex; align-items: center; gap: 4px; color: #4338CA; font-weight: 600; }
.ec-inherit-tag::before { content: '⛓'; font-size: 11px; }
:root[data-theme="dark"] .ec-inherit-tag { color: #A5B4FC; }
.ec-inherit-own { font-weight: 600; color: var(--ec-text); }
.ec-link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--ec-accent); cursor: pointer; }
.ec-link-btn:hover { text-decoration: underline; }
.ec-inherited .ec-colorchip, .ec-inherited .ec-fontpick, .ec-inherited .ec-colorchip-locate { opacity: .7; cursor: default; }
.ec-inherited .ec-colorchip { border-style: dashed; }

.ec-brand-sample { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .ec-brand-sample { grid-template-columns: 1fr; } }
.ec-bs-phone { border-radius: 26px; padding: 8px; background: #111827; }
.ec-bs-phone-screen { border-radius: 19px; overflow: hidden; min-height: 330px; }
.ec-bs-head { padding: 18px 14px 26px; text-align: center; }
.ec-bs-head img { max-height: 26px; max-width: 70%; object-fit: contain; display: block; margin: 0 auto 8px; }
.ec-bs-card { margin: -14px 12px 10px; border-radius: 12px; padding: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.ec-bs-label { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.ec-bs-big { font-size: 30px; font-weight: 800; line-height: 1.1; }
.ec-bs-btn { display: inline-block; margin-top: 8px; padding: 6px 12px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.ec-bs-screen { aspect-ratio: 16 / 9; border-radius: 10px; padding: 7%; box-shadow: 0 0 0 6px #111827; display: flex; flex-direction: column; gap: 6%; overflow: hidden; }
.ec-bs-screen-title { font-size: clamp(14px, 2.4vw, 26px); font-weight: 800; display: flex; align-items: center; gap: 10px; }
.ec-bs-screen-title img { max-height: 1.4em; }
.ec-bs-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ec-bs-row { border-radius: 8px; padding: 8px 10px; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.ec-bs-badge { border-radius: 999px; padding: 0 8px; font-weight: 800; }
.ec-bs-tools { margin-top: 18px; }
.ec-bs-tool { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ec-border); font-size: 13.5px; }
.ec-bs-tool:last-child { border-bottom: 0; }
.ec-bs-tool strong { flex: 1; }

/* ---------- Help link (top bar) ---------- */
.ec-topbar-right { display: flex; align-items: center; gap: 18px; }
.ec-help-link {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600;
  color: var(--ec-text-muted); padding: 5px 10px 5px 6px; border-radius: 999px; text-decoration: none;
}
.ec-help-link:hover { color: var(--ec-text); background: var(--ec-surface-alt); text-decoration: none; }
.ec-help-q {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}

/* ---------- Knowledge base (help.html) ---------- */
.kb-hero { text-align: center; padding: 18px 0 26px; }
.kb-hero h1 { margin: 0 0 6px; font-size: 30px; }
.kb-search-wrap { max-width: 620px; margin: 18px auto 0; }
.kb-search { font-size: 16px; padding: 13px 18px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.kb-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 26px; align-items: start; max-width: 1180px; margin: 0 auto; }
.kb-toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 4px; }
.kb-toc-section { margin-bottom: 16px; }
.kb-toc-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ec-text-muted); margin: 0 0 5px 10px; }
.kb-toc a { display: block; padding: 5px 10px; border-radius: var(--ec-radius-sm); font-size: 13.5px; color: var(--ec-text); text-decoration: none; line-height: 1.35; }
.kb-toc a:hover { background: var(--ec-surface-alt); }
.kb-toc a.active { background: var(--ec-surface); box-shadow: inset 3px 0 0 var(--ec-accent); font-weight: 600; }
.kb-article { padding: 30px 38px 26px; margin: 0; min-height: 420px; }
.kb-crumb { font-size: 12.5px; color: var(--ec-text-muted); margin-bottom: 4px; }
.kb-title { font-size: 25px; margin: 0 0 16px; }
.kb-body { font-size: 15px; line-height: 1.7; max-width: 720px; }
.kb-body h3 { font-size: 16.5px; margin: 26px 0 6px; }
.kb-body p { margin: 0 0 12px; }
.kb-body ul, .kb-body ol { margin: 0 0 14px; padding-left: 22px; }
.kb-body li { margin-bottom: 5px; }
.kb-body code { background: var(--ec-surface-alt); padding: 1px 6px; border-radius: 5px; font-size: 13.5px; }
.kb-table { border-collapse: collapse; width: 100%; margin: 6px 0 16px; font-size: 14px; }
.kb-table th, .kb-table td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--ec-border); }
.kb-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ec-text-muted); }
.kb-article mark { background: #FDE68A; color: inherit; border-radius: 3px; padding: 0 1px; }
:root[data-theme="dark"] .kb-article mark { background: #7A5B12; }
.kb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--ec-border); }
.kb-pager a { display: block; padding: 10px 14px; border: 1px solid var(--ec-border); border-radius: var(--ec-radius-sm); color: var(--ec-text); font-weight: 600; font-size: 14px; text-decoration: none; }
.kb-pager a:hover { border-color: var(--ec-accent); }
.kb-pager a span { display: block; font-size: 11.5px; font-weight: 500; color: var(--ec-text-muted); margin-bottom: 2px; }
.kb-pager-next { text-align: right; }
.kb-result { display: block; padding: 14px 16px; margin: 0 -16px; border-radius: var(--ec-radius-sm); color: var(--ec-text); text-decoration: none; }
.kb-result:hover { background: var(--ec-surface-alt); text-decoration: none; }
.kb-result strong { display: block; font-size: 16px; margin: 1px 0 3px; }
.kb-result-section { font-size: 11.5px; color: var(--ec-text-muted); text-transform: uppercase; letter-spacing: .06em; }
.kb-result-snippet { display: block; font-size: 13.5px; color: var(--ec-text-muted); line-height: 1.55; }
@media (max-width: 860px) {
  .kb-layout { grid-template-columns: 1fr; }
  .kb-toc { position: static; max-height: none; }
  .kb-article { padding: 22px 18px; }
  .ec-help-link { padding-right: 6px; }
}
