/* Client portal — public brand dashboard.
   Uses the shared public theme variables, while portal-specific tokens are
   overridden at runtime from the brand payload when available. */
:root {
  --portal-primary: #475569;
  --portal-font: var(--font-family);
}

* { box-sizing: border-box; }

/* menu.css (loaded for its theme variables) styles `body` as the centered,
   non-scrolling app shell. Reset that here so the portal is a normal,
   top-aligned, scrollable document. */
html { height: auto; }
body.mydrop-portal-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: none;
  min-height: 100vh;
  max-height: none;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  background: var(--public-page-bg);
  color: var(--font-black);
  font-family: var(--portal-font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.mydrop-portal-root {
  max-width: 1040px;
  margin: 0 auto;
  padding: 44px 40px 80px;
}

/* ---- loader / states ---- */
.mydrop-portal-loader { display: flex; justify-content: center; padding: 120px 0; }
.mydrop-portal-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--border-color); border-top-color: var(--portal-primary);
  animation: portal-spin 0.8s linear infinite;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }

/* ---- password gate / unavailable ----
   Both screens render before the (gated) payload exists, so they brand
   themselves from the server shell's brand name + picture. */
.portal-gate-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px 20px calc(40px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--portal-primary) 20%, transparent), transparent 46%),
    radial-gradient(circle at 84% 86%, color-mix(in srgb, var(--portal-primary) 14%, transparent), transparent 48%),
    var(--bg-black-2);
}
.mydrop-portal-gate {
  width: 100%;
  max-width: 400px;
  padding: 34px 30px 26px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-big);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.portal-gate-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 22px;
}
.portal-gate-logo {
  width: 62px;
  height: 62px;
  margin-bottom: 8px;
  border-radius: var(--radius-big);
  border: 1px solid var(--border-color);
  background: var(--bg-black-2);
  object-fit: cover;
}
.portal-gate-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  background: var(--portal-primary);
  color: #fff;
  font-size: 24px;
  font-weight: 750;
}
.portal-gate-brand strong {
  color: var(--font-black);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.25;
}
.portal-gate-brand span {
  color: var(--font-gray);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.portal-gate-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--portal-primary) 14%, var(--surface));
  color: var(--portal-primary);
}
.portal-gate-lock svg { width: 20px; height: 20px; }
.mydrop-portal-gate h1 {
  margin: 0;
  color: var(--font-black);
  font-size: 19px;
  font-weight: 750;
}
.portal-gate-text {
  margin: 8px 0 20px;
  color: var(--font-gray);
  font-size: 14px;
  line-height: 1.5;
}
.mydrop-portal-gate input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--bg-black-2);
  color: var(--font-black);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast) ease;
}
.mydrop-portal-gate input:focus { border-color: var(--portal-primary); }
.portal-gate-submit {
  width: 100%;
  height: 46px;
  margin-top: 10px;
  justify-content: center;
}
.mydrop-portal-gate .portal-error {
  margin: 0 0 12px;
  color: var(--error);
  font-size: 13px;
}
.portal-gate-powered {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  color: var(--font-gray);
  font-size: 12px;
}
.portal-gate-powered a { color: var(--portal-primary); text-decoration: none; font-weight: 650; }

/* Same line at the bottom of the portal itself. Both are dropped when the brand
   turns "Hide Mydrop branding" on. */
.portal-content-powered {
  margin: 4px 0 0;
  color: var(--font-gray);
  font-size: 12px;
  text-align: center;
}
.portal-content-powered a { color: var(--portal-primary); text-decoration: none; font-weight: 650; }

/* ---- header ---- */
.mydrop-portal-header {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-big); box-shadow: var(--shadow-card);
  padding: 20px 24px; margin-bottom: 18px;
}
.mydrop-portal-logo {
  width: 64px; height: 64px; border-radius: var(--radius-big); object-fit: cover; flex: 0 0 auto;
  background: var(--bg-black-2); border: 1px solid var(--border-color);
}
.mydrop-portal-logo-fallback {
  width: 64px; height: 64px; border-radius: var(--radius-big); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--portal-primary); color: var(--text-on-accent-fill, #fff); font-size: 26px; font-weight: 700;
}
.mydrop-portal-title { font-size: 24px; font-weight: 700; margin: 0; }

/* ---- tabs ---- */
.mydrop-portal-tabs {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    flex-wrap: nowrap;
    width: 100%;
    margin-bottom: -1px;
    padding: 0;
    box-sizing: border-box;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
.mydrop-portal-tabs::after {
  content: '';
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 0;
  height: 1px;
  background: var(--border-color);
  z-index: -1;
}
.mydrop-portal-tabs::-webkit-scrollbar { height: 4px; }
.mydrop-portal-tabs::-webkit-scrollbar-track { background: transparent; }
.mydrop-portal-tabs::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 999px; }
.mydrop-portal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
  height: 40px;
  min-width: max-content;
  padding: 0 14px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  border-bottom-color: transparent;
  border-radius: var(--radius-small) var(--radius-small) 0 0;
  background: var(--bg-blue-dark);
  color: var(--font-gray);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease, background-color var(--transition-fast) ease;
}
.mydrop-portal-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: inherit;
}
.mydrop-portal-tab { position: relative; }
.mydrop-portal-tab svg { width: 16px; height: 16px; flex: 0 0 auto; }
.mydrop-portal-tab .campaign-icon-mask { width: 16px; height: 16px; }
.mydrop-portal-tab:hover {
  color: var(--font-black);
  border-color: color-mix(in srgb, var(--portal-primary) 24%, var(--border-color));
  border-bottom-color: transparent;
  background: color-mix(in srgb, var(--portal-primary) 6%, var(--surface));
}
.mydrop-portal-tab.active {
  height: 44px;
  background: var(--surface);
  color: var(--font-black);
  border-color: var(--border-color);
  border-bottom-color: var(--surface);
  cursor: default;
}
.mydrop-portal-tab .portal-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px;
  font-size: 12px; background: var(--bg-blue-clear); color: var(--font-black); border-radius: 999px;
}
.mydrop-portal-tab.active .portal-tab-count { background: var(--bg-blue-clear); }

/* ---- section card ---- */
.mydrop-portal-section { display: none; }
.mydrop-portal-section.active { display: block; }
.portal-card {
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-big); box-shadow: var(--shadow-card);
  padding: 22px; margin-bottom: 16px;
}
.mydrop-portal-section.active > .portal-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.portal-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.portal-card-head h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 9px; }
.portal-card-head h2 svg { width: 19px; height: 19px; color: var(--portal-primary); }
.portal-card-head h2 .campaign-icon-mask { width: 19px; height: 19px; color: var(--portal-primary); }
.portal-empty { color: var(--font-gray); font-size: 14px; margin: 6px 0; }

/* ---- buttons ---- */
.portal-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 9px 15px; border-radius: var(--radius-small);
  border: 1px solid var(--border-color); background: var(--surface); color: var(--font-black);
  transition: background-color var(--transition-fast) ease, filter var(--transition-fast) ease;
}
.portal-btn svg { width: 16px; height: 16px; }
.portal-btn:hover { background: var(--hover-color); }
.portal-btn.primary { background: var(--portal-primary); color: #fff; border-color: transparent; }
.portal-btn.primary:hover { filter: brightness(1.08); background: var(--portal-primary); }
.portal-btn.sm { padding: 6px 11px; font-size: 13px; }

/* ---- branding: colors ---- */
.portal-colors { display: flex; flex-wrap: wrap; gap: 12px; }
.portal-color {
  position: relative; width: 64px; height: 64px; border-radius: var(--radius-big);
  border: 1px solid var(--border-color);
}
.portal-color .portal-color-remove {
  position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); color: var(--font-black); border: 1px solid var(--border-color); cursor: pointer;  font-size: 12px;
}
.portal-color-add {
  width: 64px; height: 64px; border-radius: var(--radius-big); border: 1px dashed var(--border-color);
  background: var(--bg-black-2); cursor: pointer; font-size: 24px; color: var(--font-gray);
}

/* ---- branding: files ---- */
.portal-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.portal-file {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-big); overflow: hidden;
  border: 1px solid var(--border-color); background: var(--bg-black-2);
  display: flex; align-items: center; justify-content: center;
}
.portal-file img { width: 100%; height: 100%; object-fit: cover; }
.portal-file .portal-file-name { font-size: 11px; color: var(--font-gray); padding: 6px; text-align: center; word-break: break-word; }
.portal-file-open {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: inherit;
}
.portal-file .portal-file-remove {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--overlay); color: var(--bg-white); border: none; cursor: pointer; font-size: 13px;
}
.portal-file-add {
  aspect-ratio: 1; border-radius: var(--radius-big); border: 1px dashed var(--border-color);
  background: var(--bg-black-2); cursor: pointer; color: var(--font-gray); font-size: 30px;
  display: flex; align-items: center; justify-content: center;
}

/* ---- inputs ---- */
.portal-field select, .portal-field input, .portal-field textarea,
.portal-conversation-compose textarea, .mydrop-portal-gate input {
  background: var(--bg-black-2); color: var(--font-black);
}
.portal-field select, .portal-field input, .portal-field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-color);
  border-radius: var(--radius-small); font-size: 14px; font-family: inherit;
}
.portal-field select:focus, .portal-field input:focus, .portal-field textarea:focus { outline: none; border-color: var(--portal-primary); }
.portal-branding-grid { display: grid; gap: 22px; }

/* ---- infos ---- */
.portal-infos-group { margin-bottom: 22px; }
.portal-infos-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--font-gray); margin: 0 0 12px; }
.portal-infos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.portal-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.portal-field.full { grid-column: 1 / -1; }
.portal-field textarea { resize: vertical; min-height: 44px; }

/* ---- link in bio ---- */
.portal-link-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--border-color); border-radius: var(--radius-big); margin-bottom: 10px;
  text-decoration: none; cursor: pointer;
}
.portal-link-row:hover { background: var(--hover-color); }
.portal-link-row svg { width: 18px; height: 18px; color: var(--portal-primary); flex: 0 0 auto; }
.portal-link-thumb {
  flex: 0 0 auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-small); overflow: hidden;
  background: var(--bg-black-2); border: 1px solid var(--border-color);
}
.portal-link-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portal-link-row strong { display: block; font-size: 14px; }
.portal-link-row span { font-size: 13px; color: var(--font-gray); }

/* ---- campaigns ---- */
.campaign-icon-mask {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url('/static/images/ui/campaigns.svg') center / contain no-repeat;
  mask: url('/static/images/ui/campaigns.svg') center / contain no-repeat;
}
.brand-campaigns-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.brand-campaign-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 58px; padding: 8px 10px;
  border: 1px solid var(--border-color); border-radius: var(--radius-small);
  background: var(--bg-blue-dark); color: var(--font-black); box-sizing: border-box;
}
.brand-campaign-open { display: flex; align-items: center; min-width: 0; gap: 10px; }
.brand-campaign-row-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; min-width: 34px; border-radius: var(--radius-small);
  background: var(--bg-blue-clear); color: var(--font-gray); overflow: hidden;
}
.campaign-logo {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
}
.campaign-logo-fallback {
  display: inline-flex; align-items: center; justify-content: center;
}
.campaign-logo-fallback .campaign-logo-icon {
  width: 14px; height: 14px; color: var(--bg-white);
}
.brand-campaign-card-copy {
  display: flex; flex-direction: column; min-width: 0; gap: 4px;
}
.brand-campaign-card-copy strong,
.brand-campaign-card-copy span {
  margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-campaign-card-copy strong { color: var(--font-black); font-size: 13px; font-weight: 650; }
.brand-campaign-card-copy span { color: var(--font-gray); font-size: 12px; }
.brand-campaign-card-copy span:empty { display: none; }
.brand-campaign-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand-campaign-color {
  width: 14px; height: 14px; border: 1px solid var(--border-color);
  border-radius: 999px; box-sizing: border-box;
}
.brand-campaign-count {
  display: inline-flex; min-height: 24px; align-items: center; justify-content: center;
  color: var(--font-gray); font-size: 12px; white-space: nowrap;
}

/* ---- profiles ---- */
.portal-profiles { display: flex; flex-direction: column; gap: 4px; }
.portal-profile {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  min-height: 60px;
  width: 100%;
  border-radius: var(--radius-small);
  padding: 0 10px;
  overflow: hidden;
  background-color: var(--bg-blue-dark);
  border: 1px solid var(--border-color);
}
.portal-profile:hover { background-color: var(--border-color); }
.portal-profile-description {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding-right: 100px;
}
.portal-profile-pic-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  min-width: 35px;
  height: 35px;
}
.portal-profile-pic {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}
.portal-platform-icon {
  position: absolute;
  bottom: -3px;
  left: -2px;
  width: auto;
  height: 60%;
  border-radius: 50%;
  background: var(--surface);
  padding: 1px;
  box-sizing: border-box;
}
.portal-profile .portal-profile-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.portal-profile strong { display: block; width: 100%; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-profile span { font-size: 12px; color: var(--font-gray); }
.portal-profile.expired strong::after { content: ' · expired'; color: var(--error); font-weight: 600; }
.portal-profile-buttons {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}
.portal-profile-refresh {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--height-small);
  padding: 0 10px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border-color);
  background-color: var(--bg-black-2);
  color: var(--font-black);
  font-family: inherit;
  cursor: pointer;
}
.portal-profile:hover .portal-profile-refresh { display: flex; }
.portal-profile-refresh svg { width: 14px; height: 14px; flex-shrink: 0; }
.portal-profile-refresh span { font-size: 12px; color: inherit; }

/* Touch: the control above is hover-only, and this page is read on a phone more
   often than anywhere else in the product — a client could see "· expired" on a
   profile and have no way at all to reconnect it. Drawn icon-only here (the
   label already lives in `title`, so nothing is lost) because a 32px square per
   row is quiet where six labelled 90px buttons are not, and the row reserves
   that width so a long username ellipsises before it rather than sliding under
   it: `.portal-profile-buttons` is absolutely positioned, so the description
   next to it does not account for it on its own. */
@media (hover: none), (max-width: 600px) {
    .portal-profile {
        padding-right: 52px;
    }
    .portal-profile-refresh {
        display: flex;
        width: var(--height-small);
        padding: 0;
        gap: 0;
    }
    .portal-profile-refresh span {
        display: none;
    }
}

/* ---- posts ---- */
.portal-posts-bulk { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.calendar-period-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendar-period-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--font-gray);
}
.calendar-period-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--font-black);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}
.calendar-period-select:focus {
  border-color: var(--portal-primary);
}
.portal-posts-period-filter {
  margin-bottom: 14px;
}
.portal-posts-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background: var(--surface);
}
.portal-posts-footer.is-empty {
  display: none;
}
.calendar-list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-big);
  flex-wrap: wrap;
  width: 100%;
}
.calendar-list-pagination-size,
.calendar-list-pagination-nav {
  display: flex;
  align-items: center;
  gap: var(--gap-small);
}
.calendar-list-pagination-hint {
  font-size: 12px;
  color: var(--font-gray-clair);
}
.calendar-list-pagination-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--font-gray);
  min-width: 96px;
  text-align: center;
}
.calendar-list-pagination-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--bg-blue-clear);
  color: var(--font-black);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}
.calendar-list-pagination-select:focus {
  border-color: var(--portal-primary);
}
.calendar-list-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--font-gray);
  font-size: 11px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.calendar-list-page-btn:hover:not(:disabled) {
  border-color: var(--portal-primary);
  color: var(--font-black);
  background: var(--hover-color);
}
.calendar-list-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.portal-post {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border-color); border-radius: var(--radius-big); margin-bottom: 10px;
}
.portal-post input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--portal-primary); }
.portal-post-avatars { display: flex; }
.portal-post-avatars img {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); margin-left: -10px;
}
.portal-post-avatars img:first-child { margin-left: 0; }
.portal-post-main { flex: 1; min-width: 0; }
.portal-post-main strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-post-main .portal-post-sub { font-size: 12px; color: var(--font-gray); display: flex; gap: 10px; flex-wrap: wrap; }
.portal-post-status { font-weight: 600; }
.portal-post-status.pending { color: var(--pending); }
.portal-post-status.posted { color: var(--success); }
.portal-post-status.scheduled, .portal-post-status.waiting { color: var(--waiting); }
.portal-post-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* Post thumbnail: the post's own cover (custom video thumbnail, Instagram cover)
   or the first media's thumbnail, on the review cards, the grid and the list. */
.portal-post-thumb {
  position: relative; flex: 0 0 auto; width: 46px; height: 46px;
  border-radius: var(--radius-small); overflow: hidden;
  background: var(--bg-black-2); border: 1px solid var(--border-color);
}
.portal-post-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portal-post-thumb.is-pending { background: linear-gradient(90deg, var(--bg-black-2), var(--hover-color), var(--bg-black-2)); }
.portal-post-thumb-play {
  position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); pointer-events: none;
}
.portal-post-thumb-play::after {
  content: ''; position: absolute; left: 7px; top: 5px;
  border-left: 6px solid #fff; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}

/* ---- conversation ----
   Markup + look come from the shared conversations.css (same as the in-app
   embed). We only give the embed a bounded, scrollable height and style the
   "replying to" banner. Mentions render as @Name via the library's class. */
.portal-conversation-embed { height: 560px; max-width: 100%; }
.portal-reply-banner {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--font-gray);
  padding: 6px 4px 8px; border-bottom: 1px solid var(--border-color); margin-bottom: 8px;
}
.portal-reply-cancel {
  margin-left: auto; border: none; background: transparent; color: var(--font-gray);
  font-size: 18px;  cursor: pointer;
}
.portal-reply-cancel:hover { color: var(--font-black); }

/* ---- reports ---- */
.portal-report {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border-color); border-radius: var(--radius-big); margin-bottom: 10px;
}
.portal-report-meta { flex: 1; }
.portal-report-meta strong { display: block; font-size: 14px; }
.portal-report-meta span { font-size: 12px; color: var(--font-gray); }
.portal-report-actions { display: flex; gap: 8px; }

/* ---- automations ---- */
.portal-automation {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border-color); border-radius: var(--radius-big); margin-bottom: 10px;
}
.portal-automation-main { flex: 1; min-width: 0; }
.portal-automation-main strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-automation-main span { display: block; margin-top: 3px; font-size: 12px; color: var(--font-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-automation-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.portal-btn.danger { color: var(--error); }
.portal-btn.danger:hover { background: color-mix(in srgb, var(--error) 10%, transparent); border-color: color-mix(in srgb, var(--error) 22%, transparent); }
.portal-btn.danger svg { width: 14px; height: 14px; }

/* ---- inbox rules ---- */
.portal-rule {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border-color); border-radius: var(--radius-big); margin-bottom: 10px;
}
.portal-rule-main { flex: 1; min-width: 0; }
.portal-rule-main strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-rule-main span { display: block; margin-top: 3px; font-size: 12px; color: var(--font-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-rule-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; color: var(--font-gray); font-size: 12px; }
.portal-rule-status {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px;
  border-radius: 999px; background: var(--bg-blue-clear); color: var(--font-black); font-weight: 600;
}
.portal-rule-status.paused { color: var(--font-gray); }

/* ---- modal ---- */
.portal-modal-overlay {
  position: fixed; inset: 0; background: var(--overlay-blur); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.portal-modal {
  background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius-big); width: 100%; max-width: 440px;
  max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-lg); padding: 24px;
}
.portal-modal h3 { margin: 0 0 4px; font-size: 18px; }
.portal-modal p.portal-modal-sub { margin: 0 0 18px; color: var(--font-gray); font-size: 14px; }
.portal-platform-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.portal-platform-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--height-small);
    padding: 0 12px;
    cursor: pointer;
    border: none;
    border-radius: var(--radius-small);
    color: var(--bg-white);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    box-shadow: var(--shadow-sm);
}
.portal-platform-btn:hover { filter: brightness(1.08); }
.portal-platform-btn img:not(.portal-platform-more) { width: 15px; height: 15px; object-fit: contain; flex: 0 0 auto; }
/* Direct child only: the label still truncates on one line, but the value and
   requirement lines nested inside it must be free to wrap. */
.portal-platform-btn > span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.portal-platform-more { width: 15px; height: 15px; flex: 0 0 auto; opacity: 0.9; }

/* Value + requirement copy, revealed on hover. Mirrors the app's connect
   buttons: grid-template-rows 0fr -> 1fr so the row resolves to the real
   content height instead of easing against a guessed max-height. */
.portal-platform-btn.has-copy { height: auto; align-items: flex-start; padding-top: 8px; padding-bottom: 8px; }
.portal-platform-btn.has-copy img { margin-top: 1px; }
.portal-platform-text { display: flex; flex-direction: column; }
.portal-platform-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.portal-platform-copy {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows 260ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 160ms ease-out,
    margin-top 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
/* The single row the 0fr/1fr transition resolves against; both copy lines live
   inside it, and it must be allowed to collapse to zero. */
.portal-platform-copy-inner { min-height: 0; overflow: hidden; }
.portal-platform-btn.has-copy:hover .portal-platform-copy,
.portal-platform-btn.has-copy:focus-visible .portal-platform-copy {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 3px;
}
.portal-platform-value,
.portal-platform-requires {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 400;
  white-space: normal;
}
.portal-platform-value { opacity: 0.85; }
.portal-platform-requires { margin-top: 2px; opacity: 0.65; font-style: italic; }
@media (prefers-reduced-motion: reduce) {
  .portal-platform-copy { transition: none; }
}
.portal-candidate {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border: 1px solid var(--border-color); border-radius: var(--radius-big); margin-bottom: 9px; cursor: pointer;
}
.portal-candidate input { width: 18px; height: 18px; accent-color: var(--portal-primary); }
.portal-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---- toast ---- */
.portal-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--font-black); color: var(--bg-black-2); padding: 12px 20px; border-radius: var(--radius-big); font-size: 14px;
  box-shadow: var(--shadow-lg); z-index: 1100; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.portal-toast.show { opacity: 1; }
.portal-toast.error { background: var(--error); color: var(--bg-white); }

.mydrop-portal-footer { text-align: center; color: var(--font-gray); font-size: 12px; padding: 28px; }
.mydrop-portal-footer a { color: var(--portal-primary); text-decoration: none; }

/* ---- dashboard shell refresh ---- */
body.mydrop-portal-body {
  background: var(--bg-black-2);
}

body.mydrop-portal-body > .mydrop-approval-topbar,
body.mydrop-portal-body > .mydrop-approval-footer {
  display: none;
}

.mydrop-portal-root {
  width: 100%;
  max-width: none;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.mydrop-portal-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  background: var(--surface);
}

.mydrop-portal-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--surface) 96%, var(--bg-black-2));
}

.mydrop-portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 26px;
  color: var(--font-black);
}

.mydrop-portal-brand .mydrop-portal-logo,
.mydrop-portal-brand .mydrop-portal-logo-fallback {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-small);
}

.mydrop-portal-brand strong {
  min-width: 0;
  overflow: hidden;
  color: var(--font-black);
  font-size: 16px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mydrop-portal-tabs {
  position: static;
  z-index: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  overflow: visible;
}

/* Nav + theme live in one panel: a sidebar column on desktop, the burger drawer
   on mobile. The toggle, the drawer head and the backdrop only exist on mobile. */
.portal-nav-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.portal-nav-toggle,
.portal-nav-panel-head,
.portal-nav-backdrop {
  display: none;
}

.portal-sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
}

.portal-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--font-gray);
  font-size: 12px;
}

.portal-theme-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 650;
}

.portal-theme-label svg {
  width: 16px;
  height: 16px;
  color: var(--font-gray);
}

.portal-theme-state {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--bg-black-2);
}

.portal-theme-option {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-mini);
  background: transparent;
  color: var(--font-gray);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.portal-theme-option:hover,
.portal-theme-option.is-active {
  background: var(--surface);
  color: var(--font-black);
}

.mydrop-portal-tabs::after,
.mydrop-portal-tab::after {
  display: none;
}

.mydrop-portal-tab {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--font-gray);
  font-size: 14px;
  font-weight: 650;
}

.mydrop-portal-tab:hover {
  border-color: var(--border-color);
  background: var(--hover-color);
  color: var(--font-black);
}

.mydrop-portal-tab.active {
  height: 44px;
  border-color: color-mix(in srgb, var(--portal-primary) 16%, var(--border-color));
  background: color-mix(in srgb, var(--portal-primary) 10%, var(--surface));
  color: var(--font-black);
}

.mydrop-portal-tab svg,
.mydrop-portal-tab .campaign-icon-mask {
  width: 18px;
  height: 18px;
  color: var(--portal-primary);
}

.mydrop-portal-main-panel {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-black-2);
}

.mydrop-portal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 28px 40px 22px;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: none;
  background: color-mix(in srgb, var(--bg-black-2) 92%, transparent);
  backdrop-filter: blur(14px);
}

.mydrop-portal-title {
  margin: 0;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0;
}

.mydrop-portal-header p {
  margin: 7px 0 0;
  color: var(--font-gray);
  font-size: 14px;
}

.mydrop-portal-content {
  padding: 28px 40px 56px;
}

.mydrop-portal-section.active > .portal-card {
  border-top-left-radius: var(--radius-big);
  border-top-right-radius: var(--radius-big);
}

.portal-card,
.portal-dashboard-block,
.portal-metric {
  box-shadow: none;
}

.portal-profile-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.portal-profile-selector-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--bg-black-2);
  color: var(--font-black);
  font-size: 12px;
  font-weight: 750;
}

.portal-profile-selector-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-profile-selector-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.portal-profile-selector-copy span {
  color: var(--font-gray);
  font-size: 11px;
  font-weight: 650;
}

.portal-profile-select {
  max-width: 160px;
  border: 0;
  background: transparent;
  color: var(--font-black);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.portal-dashboard {
  display: grid;
  gap: 22px;
}

.portal-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.portal-metric {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-big);
  background: var(--surface);
  color: var(--font-black);
  text-align: left;
  cursor: pointer;
}

.portal-metric:hover {
  border-color: color-mix(in srgb, var(--portal-primary) 28%, var(--border-color));
  background: color-mix(in srgb, var(--portal-primary) 5%, var(--surface));
}

.portal-metric-icon {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-small);
  background: color-mix(in srgb, var(--portal-primary) 12%, var(--surface));
  color: var(--portal-primary);
}

.portal-metric-icon svg,
.portal-metric-icon .campaign-icon-mask {
  width: 19px;
  height: 19px;
}

.portal-metric strong {
  align-self: end;
  font-size: 24px;
  
}

.portal-metric span:last-child {
  color: var(--font-gray);
  font-size: 12px;
  font-weight: 650;
}

.portal-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
  gap: 18px;
}

.portal-dashboard-block {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-big);
  background: var(--surface);
}

.portal-dashboard-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.portal-dashboard-block-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
}

.portal-dashboard-card-list {
  display: grid;
  gap: 10px;
}

/* Latest conversation preview — mirror the real in-app message layout
   (avatar + name + inline body with glowing mention tags). */
.portal-dashboard-conversation {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portal-dashboard-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.portal-dashboard-message .conversation-message-avatar {
  flex: 0 0 auto;
}

.portal-dashboard-message-content {
  min-width: 0;
  flex: 1 1 auto;
}

.portal-dashboard-message-content strong {
  display: block;
  color: var(--font-black);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-dashboard-message-body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  color: var(--font-gray);
  font-size: 12px;
  line-height: 1.45;
}

.portal-dashboard-card-list .portal-post,
.portal-dashboard-card-list .portal-report,
.portal-dashboard-card-list .portal-profile {
  margin: 0;
  border-radius: var(--radius-small);
  background: var(--bg-black-2);
}

.portal-dashboard-card-list .portal-post {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  max-width: 100%;
  box-sizing: border-box;
}
.portal-dashboard-card-list .portal-post.has-thumb {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.portal-dashboard-card-list .portal-post-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.portal-profiles-block {
  grid-column: 1 / -1;
}

.portal-social-connect-block {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 26px;
}

/* The flower: a square box whose nodes are placed in percentages (JS writes the
   polar coordinates) so the whole figure scales with its container, and an SVG
   overlay drawing one spoke from each node back to the hub. */
.portal-social-orbit {
  position: relative;
  width: min(260px, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
}

.portal-social-orbit-web {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.portal-social-orbit-web line {
  stroke: var(--border-color);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.portal-social-orbit-center,
.portal-social-orbit-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--surface);
  transform: translate(-50%, -50%);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  cursor: pointer;
}

.portal-social-orbit-center {
  z-index: 2;
  width: 28.5%;
  height: 28.5%;
  border-color: transparent;
  background: var(--portal-primary);
  color: #fff;
}

.portal-social-orbit-center svg {
  width: 42%;
  height: 42%;
}

.portal-social-orbit-center:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: var(--shadow-sm);
}

.portal-social-orbit-icon {
  width: 17.7%;
  height: 17.7%;
  box-shadow: var(--shadow-sm);
}

.portal-social-orbit-icon img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  border-radius: 50%;
  pointer-events: none;
}

.portal-social-orbit-icon:hover,
.portal-social-orbit-icon:focus-visible {
  z-index: 3;
  border-color: var(--portal-primary);
  transform: translate(-50%, -50%) scale(1.16);
}

@media (prefers-reduced-motion: reduce) {
  .portal-social-orbit-center,
  .portal-social-orbit-icon {
    transition: none;
  }
}

.portal-social-connect-copy {
  min-width: 0;
}

.portal-social-connect-copy h2 {
  margin: 0 0 10px;
  color: var(--font-black);
  font-size: 22px;
  line-height: 1.2;
}

.portal-social-connect-copy p {
  max-width: 520px;
  margin: 0 0 18px;
  color: var(--font-gray);
  font-size: 15px;
  line-height: 1.5;
}

.portal-social-connect-copy > span {
  display: block;
  margin-top: 12px;
  color: var(--font-gray);
  font-size: 12px;
}

.portal-social-connect-btn {
  min-height: 42px;
  padding: 0 18px;
}

/* Already-connected profiles hang off the same block as the flower, so the
   dashboard shows one Profiles section instead of two. */
.portal-profiles-connected {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.portal-profiles-connected h3 {
  margin: 0 0 12px;
  color: var(--font-gray);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.portal-dashboard-row.compact {
  align-items: flex-start;
}

@media (max-width: 1100px) {
  .mydrop-portal-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .portal-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .portal-social-connect-block {
    grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  }
}

/* Les lignes "Posts à relire" gardaient leurs 3 colonnes de bureau : la
   colonne centrale tombait à ~90px, le titre du post se réduisait à
   "Soci..." et le statut passait sur trois lignes. On fait passer les actions
   sur leur propre ligne, exactement comme le bloc 760px le fait déjà, mais un
   palier plus tôt. */
@media (max-width: 900px) {
  .portal-dashboard-card-list .portal-post {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .portal-dashboard-card-list .portal-post.has-thumb {
    grid-template-columns: auto auto minmax(0, 1fr);
  }
  .portal-dashboard-card-list .portal-post-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
  }
  .portal-post-thumb { width: 40px; height: 40px; }
}

@media (max-width: 760px) {
  .mydrop-portal-root {
    height: 100%;
    overflow-y: auto;
  }
  .mydrop-portal-shell {
    display: block;
    min-height: 100%;
  }

  /* ---- top bar + burger drawer ---- */
  .mydrop-portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: block;
    min-height: 0;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface);
  }
  .mydrop-portal-brand {
    gap: 10px;
    min-height: 44px;
    margin: 0;
  }
  .mydrop-portal-brand .mydrop-portal-logo,
  .mydrop-portal-brand .mydrop-portal-logo-fallback {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
  .mydrop-portal-brand strong {
    flex: 1 1 auto;
    font-size: 15px;
  }
  .portal-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    background: var(--surface);
    color: var(--font-black);
    cursor: pointer;
  }
  .portal-nav-toggle svg { width: 20px; height: 20px; }

  .portal-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(320px, 86vw);
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
    border-left: 1px solid var(--border-color);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(101%);
    transition: transform 0.24s ease;
  }
  .mydrop-portal-shell.nav-open .portal-nav-panel { transform: none; }

  .portal-nav-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--font-black);
  }
  .portal-nav-panel-head .mydrop-portal-logo,
  .portal-nav-panel-head .mydrop-portal-logo-fallback {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-small);
    font-size: 14px;
    flex: 0 0 auto;
  }
  .portal-nav-panel-head strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .portal-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-small);
    background: transparent;
    color: var(--font-gray);
    cursor: pointer;
  }
  .portal-nav-close:hover { background: var(--hover-color); color: var(--font-black); }
  .portal-nav-close svg { width: 18px; height: 18px; }

  .portal-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }
  .mydrop-portal-shell.nav-open .portal-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mydrop-portal-tabs {
    flex-direction: column;
    gap: 4px;
    overflow: visible;
  }
  .mydrop-portal-tab {
    width: 100%;
    flex: 0 0 auto;
    height: 46px;
  }
  .portal-sidebar-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
  }
  .portal-theme-options { max-width: none; }

  /* ---- header + content ---- */
  .mydrop-portal-main-panel {
    height: auto;
    overflow: visible;
  }
  .mydrop-portal-header {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px 16px 16px;
    backdrop-filter: none;
  }
  .mydrop-portal-title {
    font-size: 21px;
    line-height: 1.2;
  }
  .mydrop-portal-header p { font-size: 13px; }
  .mydrop-portal-content {
    padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
  }
  .portal-card {
    padding: 16px 14px;
    margin-bottom: 12px;
  }
  .portal-card-head { margin-bottom: 14px; }
  .portal-card-head h2 { font-size: 16px; }
  .portal-dashboard { gap: 16px; }
  .portal-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .portal-metric { min-height: 78px; padding: 12px; }
  .portal-profile-selector { width: 100%; }
  .portal-profile-select { max-width: none; }

  /* ---- rows: stack instead of squeezing three columns ---- */
  .portal-post,
  .portal-report,
  .portal-automation,
  .portal-rule {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 13px;
  }
  .portal-dashboard-card-list .portal-post {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .portal-dashboard-card-list .portal-post.has-thumb {
    grid-template-columns: auto auto minmax(0, 1fr);
  }
  .portal-dashboard-card-list .portal-post-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
  }
  .portal-post-thumb { width: 40px; height: 40px; }
  .portal-post-actions,
  .portal-report-actions,
  .portal-automation-meta,
  .portal-rule-meta {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .portal-infos-grid,
  .portal-platform-list {
    grid-template-columns: 1fr;
  }
  .portal-files { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .portal-branding-grid { gap: 16px; }
  .portal-conversation-embed { height: min(70vh, 520px); }
  .portal-profile { flex-wrap: wrap; }
  .portal-link-row { align-items: flex-start; }

  /* No hover on touch, and the list is one column here anyway, so the copy is
     simply always open. */
  .portal-platform-copy {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 3px;
    transition: none;
  }
  .portal-social-connect-block {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .portal-social-orbit {
    width: min(230px, 100%);
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .portal-nav-panel,
  .portal-nav-backdrop { transition: none; }
}

/* ---------------------------------------------------------------------------
   CONNECT BUBBLE CLUSTER
   Mirrors .connect-bubbles in static/css/supp/general.css so a connect CTA looks
   the same in the portal as it does in the app's post state selector. The portal
   is a standalone public page and does not load the app's stylesheet, so the
   rules are duplicated here on purpose. Keep the two in sync.
   --------------------------------------------------------------------------- */
.connect-bubbles-icon {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  overflow: visible;
}
.connect-bubbles {
  position: relative;
  display: inline-block;
  width: 41px;
  height: 14px;
  pointer-events: none;
  animation: connect-cluster-in 1.3s cubic-bezier(0.3, 0.75, 0.3, 1) both;
}
.connect-bubble {
  position: absolute;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  /* Cut out of the button it sits on, so the stack reads as one object. */
  box-shadow: 0 0 0 1.5px var(--portal-primary);
  overflow: hidden;
  animation: connect-bubble-in 1.05s cubic-bezier(0.3, 0.75, 0.3, 1) both;
}
.connect-bubble img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.connect-bubble:nth-child(1) { left: 0;    z-index: 4; --cin: 13.5px;  --fx: -11px; --fy: -8px;  animation-delay: 0s; }
.connect-bubble:nth-child(2) { left: 9px;  z-index: 3; --cin: 4.5px;   --fx: -4px;  --fy: 10px;  animation-delay: 0.06s; }
.connect-bubble:nth-child(3) { left: 18px; z-index: 2; --cin: -4.5px;  --fx: 4px;   --fy: -10px; animation-delay: 0.12s; }
.connect-bubble:nth-child(4) { left: 27px; z-index: 1; --cin: -13.5px; --fx: 11px;  --fy: 8px;   animation-delay: 0.18s; }
@keyframes connect-cluster-in {
  0%   { transform: rotate(-680deg) scale(0.2); opacity: 0; }
  14%  { opacity: 1; }
  42%  { transform: rotate(-120deg) scale(2.05); }
  66%  { transform: rotate(16deg) scale(1.28); }
  84%  { transform: rotate(-6deg) scale(0.95); }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}
@keyframes connect-bubble-in {
  0%   { transform: translate(var(--cin), 0) scale(0.3); }
  38%  { transform: translate(var(--fx), var(--fy)) scale(1.35); }
  70%  { transform: translate(calc(var(--fx) * 0.18), calc(var(--fy) * 0.18)) scale(0.92); }
  100% { transform: translate(0, 0) scale(1); }
}
/* The small "Connect" button in the profiles card header is tighter than the
   hero CTA, so the cluster needs its own gap rather than the button's icon gap. */
.portal-btn.sm.has-connect-bubbles .connect-bubbles-icon { margin-right: 4px; }
@media (prefers-reduced-motion: reduce) {
  .connect-bubbles,
  .connect-bubble { animation: none; }
}

/* ---- posts calendar ----
   The app's calendar (week / month / grid / list) rebuilt for the public
   portal. The rules mirror static/css/calendar/calendar.css but are scoped to
   .portal-calendar so nothing leaks into the rest of the page — keep the two in
   sync. The app sizes the grid from the page height; here the calendar lives
   inside a scrolling card, so the body height is fixed (and mirrored by
   CALENDAR_BODY_HEIGHT in portal.js, which converts the week overlap
   threshold from pixels to minutes). */
.portal-calendar {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.portal-calendar-body {
  height: 660px;
  min-height: 660px;
  width: 100%;
  display: flex;
  min-width: 0;
  overflow: auto;
}

/* toolbar */
.portal-calendar .calendar-tools-bar {
  display: flex;
  width: 100%;
  min-height: 52px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  box-sizing: border-box;
  row-gap: 8px;
  gap: 8px;
}
.portal-calendar-tools {
  position: relative;
  display: flex;
  flex-direction: row;
  width: auto;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}
.portal-calendar .portal-posts-period-filter { margin-bottom: 0; }
.portal-calendar .calendar_arrows {
  cursor: pointer;
  user-select: none;
  width: var(--height-small);
  height: var(--height-small);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-clear);
  border-radius: var(--radius-small);
  transition: background-color var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.portal-calendar .calendar_arrows:hover { background-color: var(--hover-color); }
.portal-calendar .calendar_arrows:active { transform: scale(0.95); }
#portal-calendar-title {
  width: auto;
  height: var(--height-small);
  display: flex;
  align-items: center;
  justify-content: center;
}
#portal-calendar-title p {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-clear);
  white-space: nowrap;
}
#portal-calendar-today {
  width: auto;
  padding: 0 var(--padding-small);
  height: var(--height-small);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  cursor: pointer;
}
#portal-calendar-today:hover { background-color: var(--hover-color); }
#portal-calendar-today p {
  margin: 0;
  color: var(--gray-clear);
  font-size: 13px;
  font-weight: 400;
}
.portal-calendar .calendar_selector {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  width: auto;
  height: var(--height-small);
  overflow: hidden;
  box-sizing: border-box;
}
.portal-calendar .calendar_selector div {
  width: auto;
  padding: 0 15px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.portal-calendar .calendar_selector p {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  user-select: none;
  white-space: nowrap;
  color: var(--gray-clear);
}
.portal-calendar .calendar_selector div:hover { background-color: var(--hover-color); }
.portal-calendar .calendar_selector div.selected { background-color: var(--gray-clear-3); }
.portal-calendar .calendar_selector div.selected p { color: var(--font-black); }

/* timezone selector */
#portal-calendar-timezone-wrapper {
  display: flex;
  align-items: center;
  min-height: 32px;
}
#portal-calendar-timezone-wrapper .timezone-selector {
  position: relative;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: min(300px, calc(100vw - 24px));
}
#portal-calendar-timezone-wrapper .timezone-selector-trigger {
  width: auto;
  min-width: 75px;
  max-width: 300px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-small);
  border: 1px solid transparent;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  color: var(--gray-clear);
}
#portal-calendar-timezone-wrapper .timezone-selector-trigger:hover { background-color: var(--hover-color); }
#portal-calendar-timezone-wrapper .timezone-selector-selected-value {
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-clear);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-calendar .timezone-selector-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  max-height: 300px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background-color: var(--surface);
  z-index: 12;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.portal-calendar .timezone-selector.is-open .timezone-selector-menu { display: flex; }
.portal-calendar .timezone-selector-search-row {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
}
.portal-calendar .timezone-selector-search-input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background-color: var(--bg-gray);
  color: var(--font-black);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  padding: 0 10px;
  outline: none;
}
.portal-calendar .timezone-selector-search-input:focus { border-color: var(--portal-primary); }
.portal-calendar .timezone-selector-workspace-shortcut {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
}
.portal-calendar .timezone-selector-workspace-shortcut-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-small);
  background-color: transparent;
  color: var(--font-black);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  padding: 6px 8px;
}
.portal-calendar .timezone-selector-workspace-shortcut-button:hover { background-color: var(--bg-blue-dark); }
.portal-calendar .timezone-selector-workspace-shortcut-checkbox {
  margin: 0;
  width: 14px;
  height: 14px;
  pointer-events: none;
  accent-color: var(--portal-primary);
}
.portal-calendar .timezone-selector-workspace-shortcut-label {
  font-size: 13px;
  color: var(--font-black);
}
.portal-calendar .timezone-selector-workspace-shortcut-value {
  margin-left: auto;
  max-width: 50%;
  font-size: 11px;
  color: var(--font-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-calendar .timezone-selector-options {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 240px;
}
.portal-calendar .timezone-selector-option {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--font-black);
  font-family: inherit;
  font-size: 13px;
}
.portal-calendar .timezone-selector-option:hover { background-color: var(--bg-blue-dark); }
.portal-calendar .timezone-selector-option.is-selected {
  color: var(--portal-primary);
  background-color: var(--bg-blue-dark);
}
.portal-calendar .timezone-selector-empty {
  display: none;
  margin: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--border-color);
  color: var(--font-gray);
  font-size: 12px;
}
.portal-calendar .timezone-selector-empty.is-visible { display: block; }

/* day names bar */
.portal-calendar .calendar_days {
  display: flex;
  align-items: center;
  width: 100%;
  height: 30px;
  min-height: 30px;
}
.portal-calendar .calendar_days.is-week { gap: 6px; }
.portal-calendar .calendar_days .spacer { flex: 0 0 40px; }
.portal-calendar .calendar_days > div:not(.spacer) {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-calendar .calendar_days p {
  margin: 0;
  font-size: 11px;
  color: var(--font-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-calendar .calendar-day-name-short { display: none; }
.portal-calendar .calendar-day-name-date { margin-left: 4px; }

/* month grid */
.portal-calendar .calendar_columns {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  height: 100%;
  width: 100%;
  min-width: 0;
}
.portal-calendar .calendar_columns.is-month .column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}
.portal-calendar .day {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  height: 16.6667%;
  min-height: 16.6667%;
  border-radius: var(--radius-small);
  padding: 4px;
  gap: 3px;
  box-sizing: border-box;
}
.portal-calendar .day::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  border-top: 1px solid var(--border-color);
}
.portal-calendar .day_date_text {
  color: var(--font-black);
  font-size: 11px;
  font-weight: bold;
  margin: 0;
  min-height: 15px;
}
.portal-calendar .day.past .day_date_text { color: var(--border-color); }
.portal-calendar .day[data-current-month="false"] .day_date_text { opacity: 0.55; }
.portal-calendar .day.actual { background-color: var(--purple-clear); }
.portal-calendar .preview_box {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  flex: 1 1 auto;
  min-height: 0;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

/* week grid */
.portal-calendar .calendar_columns.is-week { gap: 6px; }
.portal-calendar .column_hours {
  flex: 0 0 40px;
  width: 40px;
  height: 100%;
}
.portal-calendar .column_week {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.portal-calendar .hour {
  position: relative;
  width: 100%;
  height: 4.1667%;
  border-top: 1px solid var(--border-color);
  box-sizing: border-box;
}
.portal-calendar .column_hours .hour p {
  font-size: 10px;
  font-weight: bold;
  position: absolute;
  top: 2px;
  right: 4px;
  margin: 0;
  color: var(--font-gray);
}
.portal-calendar .hour .dotted_line {
  position: absolute;
  width: 100%;
  height: 1px;
  top: 50%;
  border-top: 1px dotted var(--border-color);
}
.portal-calendar .week_actual,
.portal-calendar .week_future { border-bottom: 1px solid var(--border-color); }
.portal-calendar .week_actual { background-color: var(--purple-clear); }
.portal-calendar .current_hour_line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--purple-dark);
  border-radius: 3px;
  z-index: 4;
}

/* post cards */
.portal-calendar .new-post {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 150px;
  height: 35px;
  min-height: 35px;
  border-radius: 6px;
  z-index: 3;
  background-color: var(--bg-blue-dark);
  border: 1px solid var(--border-color);
  transition: box-shadow var(--transition-flash) ease-in-out, border-color var(--transition-flash) ease;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
}
.portal-calendar .new-post:hover {
  border-color: rgb(var(--amb-sheen) / 0.35);
  box-shadow: var(--shadow-md);
}
.portal-calendar .month_preview {
  max-width: none;
  flex: 0 0 auto;
}
.portal-calendar .week_preview { position: absolute; max-width: none; }
.portal-calendar .new-post.overlapping { padding-right: 4px; }
.portal-calendar .post-preview-left {
  display: flex;
  height: 100%;
  width: 5px;
  min-width: 5px;
  background-color: var(--font-gray-clair);
}
.portal-calendar .post-preview-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  width: calc(100% - 5px);
  padding: 2px;
  box-sizing: border-box;
}
.portal-calendar .post-preview-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 20px;
  min-height: 20px;
  width: 100%;
}
.portal-calendar .post-preview-header-right {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  width: auto;
  gap: 2px;
}
.portal-calendar .post-preview-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  width: 100%;
  overflow: hidden;
}
.portal-calendar .post-profiles {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
  width: auto;
  padding-right: 13px;
}
.portal-calendar .group-profile-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 100%;
  margin-right: -13px;
}
.portal-calendar .profile-pic-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: auto;
}
.portal-calendar .profile-pic {
  width: auto;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  background-color: var(--surface);
}
.portal-calendar .platform-icon {
  position: absolute;
  bottom: -3px;
  left: -2px;
  width: auto;
  height: 60%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--surface);
  padding: 1px;
  box-sizing: border-box;
}
.portal-calendar .post-time {
  color: var(--font-black);
  font-size: 11px;
  font-weight: 500;
  margin: 0;
  padding: 0;
}
.portal-calendar .app-inline-icon { display: inline-flex; }
.portal-calendar .app-inline-icon svg { width: 100%; height: 100%; }
.portal-calendar .post-status-img { width: 13px; height: 13px; }
.portal-calendar .post-caption {
  color: var(--font-gray);
  font-size: 10px;
  line-height: 11px;
  font-weight: 400;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* grid view */
.portal-calendar-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.portal-calendar-grid-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  padding: 14px 0;
  box-sizing: border-box;
  align-content: start;
  width: 100%;
}
.portal-calendar-grid-content > #nothing-to-see-div {
  grid-column: 1 / -1;
  margin-top: 30px;
}
.portal-calendar .new-post[data-type='grid'] {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: var(--height-large);
}
.portal-calendar .new-post[data-type='grid'] .post-preview-right { gap: 5px; }
.portal-calendar .new-post[data-type='grid'] .post-preview-content {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}
.portal-calendar .new-post[data-type='grid'] .post-preview-content .portal-post-thumb { width: 44px; height: 44px; }
.portal-calendar .post-list-caption-cell .portal-post-thumb { width: 34px; height: 34px; }
.portal-calendar .post-list-caption-cell .portal-post-thumb-play { width: 14px; height: 14px; }
.portal-calendar .post-list-caption-cell .portal-post-thumb-play::after { left: 5px; top: 3.5px; border-left-width: 5px; border-top-width: 3.5px; border-bottom-width: 3.5px; }

/* list view */
.portal-calendar-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.portal-calendar-list-table {
  --portal-list-cols:
    44px                    /* checkbox  */
    minmax(120px, 1.5fr)    /* accounts  */
    minmax(116px, 1.1fr)    /* date+time */
    minmax(76px, 0.8fr)     /* post type */
    minmax(140px, 2fr)      /* caption   */
    minmax(88px, 0.9fr)     /* status    */
    116px;                  /* actions   */
  min-width: 780px;
  width: 100%;
}
.portal-calendar-list-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: var(--portal-list-cols);
  align-items: center;
  column-gap: 12px;
  box-sizing: border-box;
  padding: 0 14px;
  height: 50px;
  min-height: 50px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
}
.portal-calendar-list-head h2 {
  margin: 0;
  color: var(--font-black);
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
#portal-calendar-list-all {
  cursor: pointer;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--portal-primary);
}
.portal-calendar .post-list-preview {
  display: grid;
  grid-template-columns: var(--portal-list-cols);
  align-items: center;
  column-gap: 12px;
  box-sizing: border-box;
  padding: 0 14px;
  width: 100%;
  height: 70px;
  cursor: pointer;
  background-color: var(--surface);
  border-top: 1px solid var(--border-color);
  transition: background-color var(--transition-flash) ease;
}
.portal-calendar .post-list-preview:hover { background-color: var(--hover-color); }
.portal-calendar .post-list-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.portal-calendar .post-list-cell > p {
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.portal-calendar .post-list-checkbox-cell {
  justify-content: center;
  overflow: visible;
}
.portal-calendar .post-list-preview-checkbox {
  display: flex;
  height: 34px;
  width: 34px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color var(--transition-flash) ease;
}
.portal-calendar .post-list-preview-checkbox:hover { background-color: var(--border-color); }
.portal-calendar .selection-checkbox {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--portal-primary);
}
.portal-calendar .post-list-accounts-cell { height: var(--height-small); }
.portal-calendar .post-list-accounts-cell .post-profiles,
.portal-calendar .post-list-accounts-cell .group-profile-container { flex-shrink: 0; }
.portal-calendar .post-list-accounts {
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.portal-calendar .status-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.portal-calendar .post-list-status-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.portal-calendar .post-list-status-cell p {
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.portal-calendar .post-list-actions-cell {
  justify-content: flex-end;
  gap: 6px;
  overflow: visible;
}
.portal-calendar-row-action {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--surface);
  color: var(--font-gray);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-flash) ease;
}
.portal-calendar-row-action:hover {
  color: var(--font-black);
  background-color: var(--hover-color);
  transform: scale(1.1);
}
.portal-calendar-row-action.approve { color: var(--posted); }

/* empty state (same as the app's "nothing to see") */
.portal-calendar #nothing-to-see-div {
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 30px 0;
}
.portal-calendar #nothing-to-see-div h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--font-gray-clair);
  text-align: center;
}
.portal-calendar #nothing-to-see-div img {
  width: 30%;
  max-width: 220px;
  height: auto;
}

.portal-calendar .portal-posts-footer { margin-top: 0; }

@media (max-width: 900px) {
  .portal-calendar .calendar-tools-bar {
    justify-content: flex-start;
  }
  .portal-calendar-tools {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .portal-calendar-body {
    height: 520px;
    min-height: 520px;
  }
  .portal-calendar .calendar-day-name-full { display: none; }
  .portal-calendar .calendar-day-name-short { display: inline; }
  .portal-calendar .calendar_selector div { padding: 0 10px; }
}

/* Phones: the toolbar becomes three full-width rows (timezone / navigation /
   view selector) instead of wrapping mid-group, month & week tiles shrink to a
   time chip, and the list drops its two widest columns so it stops scrolling
   sideways. */
@media (max-width: 620px) {
  .portal-calendar-tools {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    width: 100%;
    gap: 6px;
  }
  #portal-calendar-timezone-wrapper,
  .portal-calendar .calendar_selector,
  .portal-calendar .portal-posts-period-filter {
    grid-column: 1 / -1;
  }
  #portal-calendar-timezone-wrapper .timezone-selector { width: 100%; max-width: none; }
  #portal-calendar-timezone-wrapper .timezone-selector-trigger {
    width: 100%;
    max-width: none;
    justify-content: space-between;
    border-color: var(--border-color);
  }
  .portal-calendar .timezone-selector-menu { width: 100%; max-width: none; }
  #portal-calendar-title { justify-content: flex-start; }
  .portal-calendar .calendar_selector div { flex: 1 1 0; padding: 0 4px; }
  .portal-calendar .portal-posts-period-select { flex: 1 1 auto; min-width: 0; }

  .portal-calendar-body {
    height: 440px;
    min-height: 440px;
  }
  .portal-calendar .calendar_days { height: 24px; min-height: 24px; }
  .portal-calendar .calendar_days p { font-size: 9px; }
  .portal-calendar .calendar-day-name-date { margin-left: 2px; }
  .portal-calendar .calendar_days.is-week { gap: 3px; }
  .portal-calendar .calendar_columns.is-week { gap: 3px; }
  .portal-calendar .calendar_days .spacer { flex: 0 0 28px; }
  .portal-calendar .column_hours { flex: 0 0 28px; width: 28px; }
  .portal-calendar .column_hours .hour p { font-size: 8px; right: 2px; }
  .portal-calendar .day { padding: 2px; gap: 1px; }
  .portal-calendar .day_date_text { font-size: 10px; min-height: 12px; }
  .portal-calendar .preview_box { gap: 2px; padding-right: 0; scrollbar-gutter: auto; }

  .portal-calendar .new-post[data-type='calendar'] {
    height: 20px;
    min-height: 20px;
    border-radius: 4px;
  }
  .portal-calendar .new-post[data-type='calendar'] .post-preview-left { width: 3px; min-width: 3px; }
  .portal-calendar .new-post[data-type='calendar'] .post-preview-right { width: calc(100% - 3px); padding: 0 2px; }
  .portal-calendar .new-post[data-type='calendar'] .post-preview-header { height: 100%; min-height: 0; justify-content: center; gap: 2px; }
  .portal-calendar .new-post[data-type='calendar'] .post-profiles,
  .portal-calendar .new-post[data-type='calendar'] .post-preview-content { display: none; }
  .portal-calendar .new-post[data-type='calendar'] .post-time { font-size: 9px; }
  .portal-calendar .new-post[data-type='calendar'] .post-status-img { width: 10px; height: 10px; }

  .portal-calendar-list-table {
    --portal-list-cols: 28px minmax(0, 1fr) 66px 54px 56px;
    min-width: 0;
  }
  .portal-calendar .post-list-type-cell,
  .portal-calendar .post-list-caption-cell,
  .portal-calendar .post-list-accounts,
  .portal-calendar .post-list-status-cell p,
  .portal-calendar-list-head h2:nth-of-type(3),
  .portal-calendar-list-head h2:nth-of-type(4) { display: none; }
  .portal-calendar-list-head,
  .portal-calendar .post-list-preview { padding: 0 6px; column-gap: 6px; }
  .portal-calendar-list-head h2 { font-size: 10px; }
  .portal-calendar .post-list-preview { height: 62px; }
  .portal-calendar .post-list-date-cell > p {
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
  }
  .portal-calendar .post-list-status-cell { justify-content: center; }
  .portal-calendar .post-list-preview-checkbox { width: 26px; height: 26px; }
  .portal-calendar .selection-checkbox { width: 16px; height: 16px; }
  .portal-calendar .post-list-accounts-cell .group-profile-container { margin-right: -14px; }
  .portal-calendar-row-action { width: 26px; min-width: 26px; height: 26px; font-size: 11px; }
  .portal-calendar-grid-content { grid-template-columns: 1fr; gap: 10px; padding: 12px 0; }
  .portal-calendar #nothing-to-see-div img { width: 45%; }
  .portal-calendar .portal-posts-footer { padding: 10px 0; }
  .portal-calendar .calendar-list-pagination { justify-content: center; gap: 10px; }
}

/* ---- Touch sizes (2026-09-03) ----------------------------------------------
   Clients approve posts from this page on their phones. Measured at 343px:
   Approve / Hold / Details / View all 29px tall, the active-profile select
   17px tall with 13px type (iOS zooms on focus below 16px), theme segments
   30px. Width OR coarse pointer, same reasoning as the app's touch layer. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .portal-btn.sm {
    min-height: 44px;
    padding: 0 14px;
  }
  .portal-profile-select {
    font-size: 16px;
    min-height: 44px;
  }
  .portal-theme-option {
    height: 40px;
  }
}
