/*
 * Gravity Projex Client Portal — Design System
 * Premium SaaS dashboard. Vanilla CSS, no framework.
 * --gpx-accent is injected inline per build (client colour).
 */

:root {
  --gpx-accent: #00c2a8;
  --gpx-accent-ink: #003d35;
  --gpx-sidebar-1: #0f1e21;
  --gpx-sidebar-2: #0a1618;
  --gpx-ink: #16302f;
  --gpx-text: #33413f;
  --gpx-muted: #6a7b79;
  --gpx-bg: #eef4f4;
  --gpx-card: #ffffff;
  --gpx-border: #e0eaea;
  --gpx-danger: #d64545;
  --gpx-radius: 16px;
  --gpx-radius-sm: 10px;
  --gpx-shadow: 0 6px 30px rgba(15, 30, 33, .08);
  --gpx-shadow-lg: 0 20px 60px rgba(15, 30, 33, .18);
  --gpx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- base ---------- */
.gpx-body, .gpx-login-body {
  margin: 0;
  font-family: var(--gpx-font);
  color: var(--gpx-text);
  background: var(--gpx-bg);
  -webkit-font-smoothing: antialiased;
}
.gpx-body *, .gpx-login-body * { box-sizing: border-box; }
.gpx-ico { width: 20px; height: 20px; flex-shrink: 0; }

/* =========================================================
   LOGIN
   ========================================================= */
.gpx-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(0,194,168,.18), transparent 60%),
    linear-gradient(160deg, #0f1e21, #0a1618);
}
.gpx-login__card {
  width: 100%;
  max-width: 420px;
  background: var(--gpx-card);
  border-radius: 22px;
  padding: 2.75rem 2.25rem;
  box-shadow: var(--gpx-shadow-lg);
}
.gpx-login__brand { text-align: center; margin-bottom: 1.75rem; }
.gpx-login__logo { max-height: 56px; width: auto; }
.gpx-login__wordmark {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--gpx-ink);
}
.gpx-login__wordmark span { color: var(--gpx-accent); }
.gpx-login__sub { margin: .5rem 0 0; color: var(--gpx-muted); font-size: .9rem; }
.gpx-login__form { display: flex; flex-direction: column; gap: .35rem; }
.gpx-login__form label { font-size: .82rem; font-weight: 600; color: var(--gpx-ink); margin-top: .75rem; }
.gpx-login__form input[type=text],
.gpx-login__form input[type=password] {
  padding: .8rem .9rem; border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm);
  font-size: 1rem; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.gpx-login__form input:focus {
  outline: none; border-color: var(--gpx-accent);
  box-shadow: 0 0 0 3px rgba(0,194,168,.18);
}
.gpx-login__remember { display: flex; align-items: center; gap: .5rem; font-weight: 500 !important; margin-top: 1rem; color: var(--gpx-muted); }
.gpx-login__submit { margin-top: 1.25rem; width: 100%; justify-content: center; }
.gpx-login__forgot { display: block; text-align: center; margin-top: 1rem; color: var(--gpx-muted); font-size: .85rem; text-decoration: none; }
.gpx-login__forgot:hover { color: var(--gpx-accent); }
.gpx-login__error {
  background: #fff0f0; color: var(--gpx-danger); border: 1px solid #f3c9c9;
  padding: .7rem .9rem; border-radius: var(--gpx-radius-sm); font-size: .88rem; margin-bottom: 1rem;
}
.gpx-login__foot { color: rgba(255,255,255,.6); font-size: .82rem; }
.gpx-login__foot a { color: #fff; text-decoration: none; font-weight: 600; }

/* =========================================================
   SHELL
   ========================================================= */
.gpx-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.gpx-sidebar {
  background: linear-gradient(180deg, var(--gpx-sidebar-1), var(--gpx-sidebar-2));
  color: #cdd9d8;
  display: flex; flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky; top: 0; height: 100vh;
}
.gpx-sidebar__brand { padding: .5rem .75rem 1.5rem; }
.gpx-sidebar__logo { max-height: 42px; width: auto; }
.gpx-sidebar__wordmark { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.gpx-sidebar__wordmark span { color: var(--gpx-accent); }
.gpx-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; overflow-y: auto; }
.gpx-nav__link {
  display: flex; align-items: center; gap: .8rem;
  padding: .72rem .8rem; border-radius: var(--gpx-radius-sm);
  color: #b6c5c3; text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.gpx-nav__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.gpx-nav__link.is-active { background: var(--gpx-accent); color: #04211d; font-weight: 600; }
.gpx-nav__link.is-active .gpx-ico { stroke: #04211d; }
.gpx-sidebar__foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: .75rem; margin-top: .75rem; display: flex; flex-direction: column; gap: .15rem; }
.gpx-nav__logout:hover { background: rgba(214,69,69,.16); color: #ffb4b4; }

/* ---------- main ---------- */
.gpx-main { display: flex; flex-direction: column; min-width: 0; }
.gpx-topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 2rem; background: var(--gpx-card);
  border-bottom: 1px solid var(--gpx-border);
  position: sticky; top: 0; z-index: 20;
}
.gpx-topbar__title { font-size: 1.25rem; margin: 0; color: var(--gpx-ink); font-weight: 700; }
.gpx-topbar__user { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.gpx-topbar__hello { color: var(--gpx-muted); font-size: .9rem; }
.gpx-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gpx-accent); color: #04211d;
  display: grid; place-items: center; font-weight: 800;
}
.gpx-content { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; max-width: 1100px; }

/* ---------- hamburger ---------- */
.gpx-hamburger { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; }
.gpx-hamburger span { width: 22px; height: 2px; background: var(--gpx-ink); border-radius: 2px; transition: .2s; }

/* =========================================================
   CARDS / STATS
   ========================================================= */
.gpx-card { background: var(--gpx-card); border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius); padding: 1.5rem 1.75rem; box-shadow: var(--gpx-shadow); }
.gpx-card--narrow { max-width: 560px; }
.gpx-card h3 { margin: 0 0 1rem; color: var(--gpx-ink); font-size: 1.05rem; }
.gpx-welcome h2 { margin: 0 0 .5rem; color: var(--gpx-ink); }
.gpx-welcome p { margin: 0; color: var(--gpx-muted); }
.gpx-muted { color: var(--gpx-muted); font-size: .88rem; }

.gpx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.gpx-stat {
  background: var(--gpx-card); border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius);
  padding: 1.25rem 1.4rem; text-decoration: none; box-shadow: var(--gpx-shadow);
  display: flex; flex-direction: column; gap: .35rem; transition: transform .15s, box-shadow .15s;
}
.gpx-stat:hover { transform: translateY(-3px); box-shadow: var(--gpx-shadow-lg); }
.gpx-stat__value { font-size: 1.9rem; font-weight: 800; color: var(--gpx-ink); line-height: 1; }
.gpx-stat__label { color: var(--gpx-muted); font-size: .82rem; }
.gpx-quick { display: flex; flex-wrap: wrap; gap: .75rem; }

/* =========================================================
   BUTTONS
   ========================================================= */
.gpx-btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  padding: .62rem 1.1rem; border-radius: var(--gpx-radius-sm); border: 1px solid transparent;
  font-size: .9rem; font-weight: 600; font-family: inherit; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s, border-color .15s; line-height: 1.2;
}
.gpx-btn:active { transform: translateY(1px); }
.gpx-btn--primary { background: var(--gpx-accent); color: #04211d; }
.gpx-btn--primary:hover { box-shadow: 0 6px 18px rgba(0,194,168,.35); }
.gpx-btn--ghost { background: #fff; color: var(--gpx-ink); border-color: var(--gpx-border); }
.gpx-btn--ghost:hover { border-color: var(--gpx-accent); color: var(--gpx-accent-ink); }
.gpx-btn--danger { background: #fff; color: var(--gpx-danger); border-color: #f0d2d2; }
.gpx-btn--danger:hover { background: var(--gpx-danger); color: #fff; }
.gpx-btn--sm { padding: .4rem .7rem; font-size: .8rem; }
.gpx-btn[disabled] { opacity: .6; cursor: default; }
.gpx-btn .gpx-ico { width: 16px; height: 16px; }

/* =========================================================
   TOOLBAR + LIST
   ========================================================= */
.gpx-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gpx-toolbar__count { margin: 0; color: var(--gpx-muted); font-size: .9rem; }
.gpx-list { display: flex; flex-direction: column; gap: .6rem; }
.gpx-list__row {
  display: flex; align-items: center; gap: 1rem;
  background: var(--gpx-card); border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm);
  padding: .7rem .9rem; box-shadow: var(--gpx-shadow); transition: border-color .15s;
}
.gpx-list__row:hover { border-color: #cde6e3; }
.gpx-list__thumb { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--gpx-bg); flex-shrink: 0; display: grid; place-items: center; }
.gpx-list__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gpx-list__thumb-ph { color: var(--gpx-muted); }
.gpx-list__thumb-ph .gpx-ico { width: 18px; height: 18px; }
.gpx-list__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .75rem; }
.gpx-list__title { color: var(--gpx-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpx-list__actions { display: flex; align-items: center; gap: .4rem; }
.gpx-list__actions .gpx-ico { width: 16px; height: 16px; }

/* badges */
.gpx-badge { font-size: .7rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.gpx-badge--publish, .gpx-badge--paid, .gpx-badge--confirmed { background: #dff5ef; color: #067a63; }
.gpx-badge--draft, .gpx-badge--pending { background: #fff2d9; color: #9a6b00; }
.gpx-badge--failed, .gpx-badge--cancelled, .gpx-badge--refunded, .gpx-badge--unsubscribed { background: #fde3e3; color: #b13030; }

.gpx-empty { padding: 2.5rem; text-align: center; color: var(--gpx-muted); background: var(--gpx-card); border: 1px dashed var(--gpx-border); border-radius: var(--gpx-radius); }

/* =========================================================
   TABLES
   ========================================================= */
.gpx-table-wrap { overflow-x: auto; }
.gpx-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.gpx-table th { text-align: left; padding: .7rem .8rem; border-bottom: 2px solid var(--gpx-border); color: var(--gpx-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.gpx-table td { padding: .8rem; border-bottom: 1px solid var(--gpx-border); vertical-align: top; }
.gpx-table td small { color: var(--gpx-muted); }

/* =========================================================
   MEDIA GRID
   ========================================================= */
.gpx-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.gpx-media-item { margin: 0; background: var(--gpx-card); border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm); overflow: hidden; box-shadow: var(--gpx-shadow); }
.gpx-media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gpx-media-item figcaption { display: flex; gap: .4rem; padding: .5rem; }
.gpx-media-item figcaption .gpx-btn { flex: 1; }
.gpx-media-item .gpx-ico { width: 14px; height: 14px; }

/* =========================================================
   FORMS / DRAWER
   ========================================================= */
.gpx-drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.gpx-drawer.is-open { visibility: visible; }
.gpx-drawer__overlay { position: absolute; inset: 0; background: rgba(10,22,24,.5); opacity: 0; transition: opacity .25s; }
.gpx-drawer.is-open .gpx-drawer__overlay { opacity: 1; }
.gpx-drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(560px, 100%);
  background: var(--gpx-bg); box-shadow: var(--gpx-shadow-lg);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.gpx-drawer.is-open .gpx-drawer__panel { transform: translateX(0); }
.gpx-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; background: var(--gpx-card); border-bottom: 1px solid var(--gpx-border); }
.gpx-drawer__head h2 { margin: 0; font-size: 1.1rem; color: var(--gpx-ink); }
.gpx-drawer__close { background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--gpx-muted); cursor: pointer; }
.gpx-drawer__body { padding: 1.5rem; overflow-y: auto; }

.gpx-form { display: flex; flex-direction: column; gap: 1rem; }
.gpx-field { display: flex; flex-direction: column; gap: .35rem; }
.gpx-field > span { font-size: .82rem; font-weight: 600; color: var(--gpx-ink); }
.gpx-field small { color: var(--gpx-muted); font-size: .78rem; }
.gpx-field input[type=text],
.gpx-field input[type=email],
.gpx-field input[type=password],
.gpx-field input[type=number],
.gpx-field select,
.gpx-field textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm);
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--gpx-text); transition: border-color .15s, box-shadow .15s;
}
.gpx-field textarea { resize: vertical; }
.gpx-field input:focus, .gpx-field select:focus, .gpx-field textarea:focus {
  outline: none; border-color: var(--gpx-accent); box-shadow: 0 0 0 3px rgba(0,194,168,.16);
}
.gpx-field--check { flex-direction: row; align-items: center; gap: .6rem; }
.gpx-field--check span { font-weight: 500; }
.gpx-form__grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gpx-form__meta { display: grid; gap: 1rem; padding: 1rem; background: #fff; border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm); }
.gpx-form__actions { display: flex; gap: .75rem; padding-top: .5rem; }
.gpx-image-picker { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.gpx-image-preview { width: 84px; height: 84px; border-radius: var(--gpx-radius-sm); overflow: hidden; background: #fff; border: 1px solid var(--gpx-border); flex-shrink: 0; }
.gpx-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.gpx-image-picker label { position: relative; }
.gpx-account__meta { margin-top: 1rem; }

/* =========================================================
   MENUS
   ========================================================= */
.gpx-menu__items { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.gpx-menu__item {
  display: flex; align-items: center; gap: .75rem;
  background: #fff; border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm);
  padding: .6rem .8rem; cursor: grab;
}
.gpx-menu__item.is-dragging { opacity: .5; }
.gpx-menu__handle { color: var(--gpx-muted); cursor: grab; }
.gpx-menu__label { flex: 1; color: var(--gpx-ink); font-weight: 500; }
.gpx-menu__add { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.gpx-menu__add select { padding: .55rem .7rem; border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm); font-family: inherit; }

/* =========================================================
   TOASTS + CONFIRM
   ========================================================= */
.gpx-toasts { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 80; display: flex; flex-direction: column; gap: .6rem; }
.gpx-toast {
  padding: .85rem 1.1rem; border-radius: var(--gpx-radius-sm); background: var(--gpx-ink); color: #fff;
  box-shadow: var(--gpx-shadow-lg); font-size: .9rem; max-width: 360px;
  transform: translateY(12px); opacity: 0; transition: transform .25s, opacity .25s;
}
.gpx-toast.is-in { transform: translateY(0); opacity: 1; }
.gpx-toast--success { background: #0c7a63; }
.gpx-toast--error { background: var(--gpx-danger); }
.gpx-toast--info { background: #245b63; }

.gpx-confirm { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10,22,24,.5); opacity: 0; transition: opacity .18s; }
.gpx-confirm.is-in { opacity: 1; }
.gpx-confirm__box { background: #fff; border-radius: var(--gpx-radius); padding: 1.75rem; max-width: 400px; width: 90%; box-shadow: var(--gpx-shadow-lg); }
.gpx-confirm__box p { margin: 0 0 1.25rem; color: var(--gpx-ink); }
.gpx-confirm__actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .gpx-shell { grid-template-columns: 1fr; }
  .gpx-sidebar {
    position: fixed; top: 0; left: 0; z-index: 50; width: 264px;
    transform: translateX(-100%); transition: transform .25s;
  }
  .gpx-sidebar.is-open { transform: translateX(0); box-shadow: var(--gpx-shadow-lg); }
  .gpx-hamburger { display: inline-flex; }
  .gpx-topbar__hello { display: none; }
  .gpx-content { padding: 1.25rem; }
}
@media (max-width: 540px) {
  .gpx-form__grid2 { grid-template-columns: 1fr; }
  .gpx-list__actions .gpx-btn span { display: none; }
  .gpx-toasts { left: 1rem; right: 1rem; bottom: 1rem; }
}

/* ---------- FAQ module ---------- */
.gpx-faq-cats .gpx-muted { margin-top: -.25rem; margin-bottom: 1rem; }
.gpx-cat-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.gpx-cat-row {
  display: flex; align-items: center; gap: .6rem;
  background: #fff; border: 1px solid var(--gpx-border); border-radius: var(--gpx-radius-sm);
  padding: .5rem .7rem;
}
.gpx-cat-row.is-dragging { opacity: .5; }
.gpx-cat-name {
  flex: 1; min-width: 0; padding: .45rem .6rem;
  border: 1px solid transparent; border-radius: 8px; font-size: .95rem; font-family: inherit;
  background: transparent; color: var(--gpx-ink);
}
.gpx-cat-name:focus { outline: none; border-color: var(--gpx-accent); background: #fff; box-shadow: 0 0 0 3px rgba(0,194,168,.14); }
.gpx-faq-group__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.gpx-faq-group__head h3 { margin: 0; }
.gpx-faq-group .gpx-list__row { cursor: grab; }
.gpx-faq-group .gpx-list__row.is-dragging { opacity: .5; }

/* Neutral (non-error) login notice — password reset, signed out, etc. */
.gpx-login__notice {
  background: rgba(0, 194, 168, .1);
  border: 1px solid rgba(0, 194, 168, .35);
  color: #035159;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

/* =========================================================
   GALLERY MODULE
   ========================================================= */
.gpx-gallery-grid {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .85rem;
}
.gpx-gallery-grid--video { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.gpx-gallery-item {
  position: relative;
  border: 1px solid var(--gpx-border);
  border-radius: var(--gpx-radius-sm);
  background: #fff;
  overflow: hidden;
  cursor: grab;
  transition: box-shadow .15s, transform .15s, opacity .15s;
}
.gpx-gallery-item:focus-visible { outline: 2px solid var(--gpx-accent); outline-offset: 2px; }
.gpx-gallery-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.gpx-gallery-item.is-dragging { opacity: .4; transform: scale(.97); cursor: grabbing; }

.gpx-gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.gpx-gallery-item--video img { aspect-ratio: 9 / 16; }

.gpx-gallery-item__videoicon {
  aspect-ratio: 9 / 16;
  display: grid;
  place-items: center;
  background: var(--gpx-bg-alt, #f2f6f6);
  color: var(--gpx-accent);
  font-size: 1.6rem;
}

.gpx-gallery-item__handle {
  position: absolute;
  top: .35rem;
  left: .35rem;
  z-index: 2;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 4px;
  padding: .05rem .3rem;
  font-size: .8rem;
  line-height: 1.3;
  letter-spacing: -1px;
}

.gpx-gallery-item__remove {
  position: absolute;
  top: .35rem;
  right: .35rem;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}
.gpx-gallery-item__remove:hover { background: var(--gpx-danger, #b32d2e); }

.gpx-gallery-item__alt { display: block; padding: .4rem; }
.gpx-gallery-item__alt input {
  width: 100%;
  border: 1px solid var(--gpx-border);
  border-radius: 4px;
  padding: .3rem .4rem;
  font-size: .76rem;
  transition: border-color .2s, background .4s;
}
.gpx-gallery-item__alt input:focus { border-color: var(--gpx-accent); outline: none; }
.gpx-gallery-item__alt input.is-saved { background: #e8f8f4; border-color: var(--gpx-accent); }

.gpx-gallery-item__name {
  display: block;
  padding: .4rem;
  font-size: .74rem;
  color: var(--gpx-muted);
  word-break: break-word;
}

.gpx-toolbar__actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- library picker ---------- */
.gpx-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.5);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.gpx-modal[hidden] { display: none; }
.gpx-modal__box {
  background: #fff;
  border-radius: var(--gpx-radius);
  padding: 1.25rem;
  width: min(880px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.gpx-modal__head { display: flex; justify-content: space-between; align-items: center; }
.gpx-modal__head h3 { margin: 0; }
.gpx-modal__close {
  border: 0; background: none; font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: var(--gpx-muted);
}
.gpx-modal__close:hover { color: var(--gpx-danger, #b32d2e); }
.gpx-modal__foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

.gpx-picker-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .6rem;
  padding: .25rem;
}
.gpx-picker-item {
  border: 2px solid transparent;
  border-radius: var(--gpx-radius-sm);
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.gpx-picker-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gpx-picker-item.is-picked { border-color: var(--gpx-accent); }
.gpx-picker-item.is-picked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 194, 168, .25);
}

@media (prefers-reduced-motion: reduce) {
  .gpx-gallery-item { transition: none; }
}

/* ---------- client logo strip ---------- */
.gpx-logo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.gpx-logo-item img {
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #fff;
  padding: .5rem;
}
.gpx-logo-item.is-on-teams { border-color: var(--gpx-accent); }

.gpx-logo-item__badge {
  position: absolute;
  top: .35rem;
  left: 2.1rem;
  z-index: 2;
  background: var(--gpx-accent);
  color: #062f33;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: .1rem .32rem;
}

/* =========================================================
   RICH TEXT EDITOR
   ========================================================= */
.gpx-field--editor { display: block; margin-bottom: 1.1rem; }
.gpx-field__label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gpx-muted);
  margin-bottom: .35rem;
}

.gpx-rte {
  border: 1px solid var(--gpx-border);
  border-radius: var(--gpx-radius-sm);
  background: #fff;
  overflow: hidden;
}
.gpx-rte:focus-within { border-color: var(--gpx-accent); }

.gpx-rte__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem;
  padding: .3rem .35rem;
  border-bottom: 1px solid var(--gpx-border);
  background: var(--gpx-bg-alt, #f7fafa);
  position: sticky;
  top: 0;
  z-index: 2;
}
.gpx-rte__bar button {
  min-width: 30px;
  height: 28px;
  padding: 0 .45rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--gpx-text, #2d3838);
  font-size: .82rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.gpx-rte__bar button:hover { background: #fff; border-color: var(--gpx-border); }
.gpx-rte__bar button.is-active {
  background: var(--gpx-accent);
  border-color: var(--gpx-accent);
  color: #062f33;
  font-weight: 600;
}
.gpx-rte__bar button:focus-visible { outline: 2px solid var(--gpx-accent); outline-offset: 1px; }
.gpx-rte__sep {
  width: 1px;
  height: 18px;
  background: var(--gpx-border);
  margin: 0 .2rem;
}
.gpx-rte__source { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.gpx-rte__surface {
  min-height: 260px;
  max-height: 60vh;
  overflow-y: auto;
  padding: .9rem 1rem;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--gpx-text, #2d3838);
}
.gpx-rte__surface:focus { outline: none; }
.gpx-rte__surface > *:first-child { margin-top: 0; }
.gpx-rte__surface > *:last-child  { margin-bottom: 0; }
.gpx-rte__surface p { margin: 0 0 .85rem; }
.gpx-rte__surface h2 { font-size: 1.25rem; margin: 1.3rem 0 .5rem; line-height: 1.25; }
.gpx-rte__surface h3 { font-size: 1.08rem; margin: 1.1rem 0 .45rem; line-height: 1.3; }
.gpx-rte__surface ul,
.gpx-rte__surface ol { margin: 0 0 .85rem; padding-left: 1.4rem; }
.gpx-rte__surface li { margin: .2rem 0; }
.gpx-rte__surface a { color: var(--gpx-accent); text-decoration: underline; }
.gpx-rte__surface blockquote {
  margin: 0 0 .85rem;
  padding: .4rem 0 .4rem 1rem;
  border-left: 3px solid var(--gpx-accent);
  color: var(--gpx-muted);
  font-style: italic;
}
.gpx-rte__surface:empty::before {
  content: attr(data-placeholder);
  color: var(--gpx-muted);
}

.gpx-rte__code {
  width: 100%;
  min-height: 260px;
  max-height: 60vh;
  border: 0;
  padding: .9rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  line-height: 1.5;
  resize: vertical;
}
.gpx-rte__code:focus { outline: none; }

.gpx-rte__notice {
  margin-top: .5rem;
  padding: .6rem .75rem;
  border-radius: var(--gpx-radius-sm);
  background: #fff8e6;
  border: 1px solid #f3dda0;
  color: #6b5200;
  font-size: .82rem;
  line-height: 1.45;
}

/* =========================================================
   IMAGES MODULE
   ========================================================= */
.gpx-imgset { display: grid; gap: .85rem; margin-top: 1rem; }

.gpx-imgset__item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: start;
  padding: .85rem;
  border: 1px solid var(--gpx-border);
  border-radius: var(--gpx-radius-sm);
  background: #fff;
}
.gpx-imgset__item.is-set { border-left: 3px solid var(--gpx-accent); }

.gpx-imgset__thumb {
  width: 120px;
  aspect-ratio: 4 / 3;
  border-radius: var(--gpx-radius-sm);
  overflow: hidden;
  background: var(--gpx-bg-alt, #f2f6f6);
}
.gpx-imgset__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gpx-imgset__empty {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--gpx-muted);
  font-size: 1.5rem;
  border: 1px dashed var(--gpx-border);
  border-radius: var(--gpx-radius-sm);
}

.gpx-imgset__body { display: flex; flex-direction: column; gap: .2rem; }
.gpx-imgset__body strong { font-size: .95rem; }
.gpx-imgset__where { font-size: .82rem; color: var(--gpx-muted); line-height: 1.45; }
.gpx-imgset__size  { font-size: .74rem; color: var(--gpx-muted); opacity: .8; }
.gpx-imgset__warn  { font-size: .78rem; color: #b45309; margin-top: .2rem; }
.gpx-imgset__actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.gpx-imgset__clear:hover { color: var(--gpx-danger, #b32d2e); }

@media (max-width: 560px) {
  .gpx-imgset__item { grid-template-columns: 1fr; }
  .gpx-imgset__thumb { width: 100%; max-width: 220px; }
}
