/* ============================================================
   PARTNER PORTAL — Mission Control glass design
   Hybrid re-skin of the legacy .gohtml/HTMX partner portal to
   match the new Mission Control look. Tokens are scoped to
   body.partner so other public pages are untouched.
   ============================================================ */

body.partner {
   /* ── New MC glass design tokens ── */
   --bg-base: #131C1A;          /* dark teal base */
   --bg-tint: #18221F;          /* +1 level for nested surfaces */
   --surface-0: rgb(255 255 255 / 4%);
   --surface-1: rgb(255 255 255 / 7%);
   --surface-2: rgb(255 255 255 / 11%);
   --border-soft: rgb(255 255 255 / 8%);
   --border-med: rgb(255 255 255 / 14%);
   --teal: #00b787;
   --teal-glow: rgb(0 183 135 / 35%);
   --teal-soft: rgb(0 183 135 / 10%);
   --coral: #ff6b6b;
   --coral-glow: rgb(255 107 107 / 30%);
   --coral-soft: rgb(255 107 107 / 12%);
   --gold: #f5c53c;
   --gold-soft: rgb(245 197 60 / 14%);
   --glass-text: rgb(255 255 255 / 95%);
   --glass-muted: rgb(255 255 255 / 55%);
   --glass-dim: rgb(255 255 255 / 35%);
   --rail-width: 248px;

   /* Remap legacy tokens so existing partner rules adopt the new palette */
   --color-bg: var(--bg-base);
   --color-surface: var(--surface-0);
   --color-text: var(--glass-text);
   --color-text-muted: var(--glass-muted);
   --color-line: var(--border-soft);
   --color-faint-line: rgb(255 255 255 / 4%);
   --color-even-row: rgb(255 255 255 / 3%);
   --color-accent: var(--teal);

   min-height: 100vh;
   color: var(--glass-text);
   /* Signature MC glow gradient */
   background:
      radial-gradient(1400px 900px at 75% -15%, rgb(0 183 135 / 12%), transparent 60%),
      radial-gradient(1000px 700px at -15% 115%, rgb(0 183 135 / 7%), transparent 55%),
      radial-gradient(800px 600px at 50% 50%, rgb(110 211 184 / 3%), transparent 65%),
      var(--bg-base);
   background-attachment: fixed;
   font-feature-settings: "cv11", "ss01";
   letter-spacing: -0.01em;
   -webkit-font-smoothing: antialiased;
}

/* ── Left rail (desktop glass sidebar) ── */

.partner-rail {
   position: fixed;
   inset: 0 auto 0 0;
   width: var(--rail-width);
   z-index: 40;
   display: flex;
   flex-direction: column;
   gap: 4px;
   padding: 18px 14px;
   background: rgb(255 255 255 / 3%);
   border-right: 1px solid var(--border-soft);
   backdrop-filter: blur(14px);
   -webkit-backdrop-filter: blur(14px);
}

.rail-logo {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 6px 10px 20px;
   text-decoration: none;

   .logo-text {
      display: inline-block;
      width: 84px;
      height: 19px;
      background: var(--glass-text);
      mask-image: url("/web/images/pacer.svg");
      mask-size: contain;
      mask-repeat: no-repeat;
   }
}

.partner-tabs {
   display: flex;
   flex-direction: column;
   gap: 2px;
   flex: 1;
}

.rail-link {
   position: relative;
   display: flex;
   align-items: center;
   gap: 11px;
   padding: 9px 12px;
   border-radius: 9px;
   font-size: var(--font-size-sm);
   font-weight: 500;
   color: var(--glass-muted);
   text-decoration: none;
   transition: background 0.16s ease, color 0.16s ease;

   .icon { width: 18px; height: 18px; opacity: 0.85; }
   .rail-label { line-height: 1; }

   &:hover {
      background: var(--surface-1);
      color: var(--glass-text);
      text-decoration: none;
   }

   &.active {
      background: var(--teal-soft);
      color: var(--teal);

      .icon { opacity: 1; }

      &::before {
         content: "";
         position: absolute;
         left: -2px;
         top: 50%;
         translate: 0 -50%;
         width: 3px;
         height: 18px;
         border-radius: 0 3px 3px 0;
         background: var(--teal);
         box-shadow: 0 0 10px var(--teal-glow);
      }
   }

   &.locked { opacity: 0.5; }
}

.rail-account {
   display: flex;
   align-items: center;
   gap: 10px;
   margin-top: 6px;
   padding: 9px 11px;
   border-radius: 11px;
   border: 1px solid var(--border-soft);
   background: var(--surface-0);
   text-decoration: none;
   color: var(--glass-text);
   transition: background 0.16s ease, border-color 0.16s ease;

   &:hover, &.active {
      background: var(--surface-1);
      border-color: var(--border-med);
      text-decoration: none;
   }

   .rail-avatar {
      display: grid;
      place-items: center;
      width: 30px;
      height: 30px;
      flex-shrink: 0;
      border-radius: 50%;
      background: var(--teal-soft);
      color: var(--teal);

      .icon { width: 16px; height: 16px; }
   }

   .rail-account-meta {
      display: flex;
      flex-direction: column;
      min-width: 0;
   }

   .rail-account-sub {
      font-size: 0.6875rem;
      color: var(--glass-dim);
   }
}

.partner-name {
   font-size: var(--font-size-sm);
   font-weight: 600;
   color: var(--glass-text);
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

/* ── Content area (offset by the fixed rail) ── */

body.partner > main {
   margin-left: var(--rail-width);
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 28px 36px 64px;
   overflow-x: clip;

   h2 {
      font-size: 1.125rem;
      font-weight: 600;
      margin-bottom: 0.75rem;
      align-self: center;
   }
}

body.partner > footer.site-footer {
   margin-left: var(--rail-width);
   margin-top: 1rem;
   background-color: rgb(0 0 0 / 10%);
}

.subtitle {
   font-size: var(--font-size-sm);
   color: var(--color-text-muted);
}

.empty-state {
   text-align: center;
   color: var(--color-text-muted);
   padding: 3rem 0;
}

/* ── Mobile top bar (shown ≤1024px) ── */

.partner-topbar { display: none; }

.topbar-name {
   font-size: 1rem;
   font-weight: 600;
   color: var(--glass-muted);
   text-decoration: none;
   white-space: nowrap;

   &.active, &:hover { color: var(--glass-text); }
}

/* ── Hamburger menu (mobile) ── */

.hamburger-menu {
   display: none;
   position: relative;
}

.hamburger-btn {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 2.5rem;
   height: 2.5rem;
   cursor: pointer;
   list-style: none;
   color: var(--glass-text);

   &::marker, &::-webkit-details-marker { display: none; }
   .icon { width: 20px; height: 20px; }
}

.hamburger-nav {
   position: absolute;
   top: calc(100% + 6px);
   left: 0;
   z-index: 100;
   display: flex;
   flex-direction: column;
   min-width: 220px;
   padding: 6px;
   gap: 2px;
   background: var(--bg-tint);
   border: 1px solid var(--border-soft);
   border-radius: 12px;
   box-shadow: 0 16px 40px rgb(0 0 0 / 50%);

   a {
      display: flex;
      align-items: center;
      gap: 0.625rem;
      padding: 0.625rem 0.75rem;
      border-radius: 8px;
      font-size: var(--font-size-sm);
      font-weight: 500;
      color: var(--glass-muted);
      text-decoration: none;

      .icon { width: 18px; height: 18px; }

      &:hover { background: var(--surface-1); color: var(--glass-text); }
      &.active { background: var(--teal-soft); color: var(--teal); }
      &.locked { opacity: 0.5; }
   }
}

/* ── Reusable glass component library (for future per-tab use) ── */

body.partner {
   .glass-card {
      background: var(--surface-0);
      border: 1px solid var(--border-soft);
      border-radius: 14px;
      padding: 16px 18px;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
   }

   .stat-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 12px;
      width: 100%;
   }

   .stat {
      background: var(--surface-0);
      border: 1px solid var(--border-soft);
      border-left: 3px solid var(--border-med);
      border-radius: 10px;
      padding: 12px 14px;

      &.teal { border-left-color: var(--teal); }
      &.gold { border-left-color: var(--gold); }
      &.coral { border-left-color: var(--coral); }

      .stat-label {
         font-size: 0.625rem;
         font-weight: 700;
         text-transform: uppercase;
         letter-spacing: 0.08em;
         color: var(--glass-dim);
      }
      .stat-value {
         font-size: 1.625rem;
         font-weight: 700;
         font-variant-numeric: tabular-nums;
         color: var(--glass-text);
      }
      .stat-sub { font-size: 0.75rem; color: var(--glass-muted); }
   }

   .pill {
      display: inline-flex;
      align-items: center;
      gap: 0.375rem;
      padding: 4px 11px;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
      border: 1px solid var(--border-soft);
      background: var(--surface-1);
      color: var(--glass-text);

      &.primary { background: var(--teal); color: #08110f; border-color: var(--teal); }
   }

   .confidence-pill {
      font-size: 0.625rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      padding: 1px 6px;
      border-radius: 3px;

      &.high { color: var(--teal); background: var(--teal-soft); }
      &.med { color: var(--gold); background: var(--gold-soft); }
      &.low { color: var(--coral); background: var(--coral-soft); }
   }
}

/* ── Per-tab hero / stat-strip header ── */

body.partner > main.tab-perf { align-items: stretch; }
body.partner > main.tab-perf > table { align-self: center; }

.tab-hero {
   width: 100%;
   max-width: 1180px;
   margin: 0 auto 20px;
   display: flex;
   flex-direction: column;
   gap: 14px;
}

.tab-hero-head {
   display: flex;
   align-items: baseline;
   justify-content: space-between;
   gap: 1rem;
   flex-wrap: wrap;
}

.tab-title {
   font-size: 1.375rem;
   font-weight: 700;
   letter-spacing: -0.01em;
   line-height: 1.1;
   color: var(--glass-text);
}

.tab-sub { font-size: 0.8125rem; color: var(--glass-muted); }

.tab-asof {
   font-size: 0.75rem;
   color: var(--glass-dim);
   white-space: nowrap;
}

/* ── Portfolio list (index landing — public-layout, not body.partner) ── */

.partner-main {
   /* Glass tokens for the index, which renders outside body.partner */
   --surface-0: rgb(255 255 255 / 4%);
   --surface-1: rgb(255 255 255 / 7%);
   --border-soft: rgb(255 255 255 / 8%);
   --border-med: rgb(255 255 255 / 14%);
   --teal: #00b787;
   --teal-glow: rgb(0 183 135 / 35%);
   --teal-soft: rgb(0 183 135 / 10%);
   --glass-text: rgb(255 255 255 / 95%);
   --glass-muted: rgb(255 255 255 / 55%);
   --glass-dim: rgb(255 255 255 / 35%);

   width: 100%;
   max-width: 1100px;
   margin: 0 auto;
   padding: 48px 32px 64px;
}

.partner-portfolios {
   h1 {
      font-size: 1.75rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: var(--glass-text);
      margin-bottom: 0.35rem;
   }

   .subtitle {
      color: var(--glass-muted);
      margin-bottom: 1.75rem;
   }
}

.portfolio-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
   gap: 1rem;
}

.portfolio-card {
   display: flex;
   flex-direction: column;
   gap: 0.4rem;
   padding: 1.25rem 1.35rem;
   background: var(--surface-0);
   border: 1px solid var(--border-soft);
   border-radius: 14px;
   text-decoration: none;
   color: var(--glass-text);
   backdrop-filter: blur(8px);
   -webkit-backdrop-filter: blur(8px);
   transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;

   &:hover {
      border-color: var(--border-med);
      background: var(--surface-1);
      transform: translateY(-2px);
   }

   h2 { font-size: 1.0625rem; font-weight: 600; color: var(--glass-text); }
   .unit-count { font-size: var(--font-size-sm); color: var(--glass-muted); }
}

/* ── Shared table ── */

body.partner main table {
   border-collapse: separate;
   border-spacing: 0;
   font-size: 0.8125rem; /* 13px, standardized */
   white-space: nowrap;
   max-width: 100%;
   background: var(--surface-0);
   border: 1px solid var(--border-soft);
   border-radius: 14px;
   backdrop-filter: blur(8px);
   -webkit-backdrop-filter: blur(8px);
   overflow: hidden; /* clip rounded corners cleanly */
   font-variant-numeric: tabular-nums;
   font-feature-settings: "tnum" 1, "ss01" 1;
   letter-spacing: -0.005em;

   thead {
      tr { margin: 0; }
      th {
         padding: 0.75rem 1rem;
         background: rgb(255 255 255 / 2.5%); /* near-flush wash */
         font-weight: 600;
         font-size: 0.625rem; /* 10px uppercase */
         text-transform: uppercase;
         letter-spacing: 0.08em;
         color: var(--glass-dim);
         text-align: right;
      }

      th:first-child { text-align: left; }

      tr:not(.form) th {
         position: sticky;
         top: 0;
         z-index: 4;
      }

      /* bottom half of headings split into two parts */
      tr:nth-child(3) > th { top: calc(1.25em + 8px); }

      tr:nth-child(2) th[rowspan="2"], tr:last-child th {
         /* hairline under header row */
         border-bottom: 1px solid var(--border-soft);
      }

      /* Sortable column headers */
      th.sortable {
         cursor: pointer;
         user-select: none;
         transition: color 0.16s ease;

         a {
            text-decoration: none;
            color: inherit;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
         }
         &:not(:first-child) a { justify-content: flex-end; }

         .icon { opacity: 0.3; width: 12px; height: 12px; transition: opacity 0.16s ease, color 0.16s ease; }
         &:hover { color: var(--glass-text); }
         &:hover .icon { opacity: 0.75; }

         &.sorted .icon { opacity: 0.9; color: var(--teal); }
         &.sorted:hover .icon { opacity: 1; }
         &[aria-sort="descending"] .icon { color: var(--coral); }
      }
   }

   /* more compact headings when some are grouped */
   thead:has(tr.group-header) tr th { padding: 0.25rem 1rem; }

   tr.group-header th:not(:last-child), tr th.yoy:not(:last-child), th.fav {
      border-right: 1px solid rgb(255 255 255 / 5%);
   }

   td {
      font-weight: 400;
      padding: 0.7rem 1rem;
      border-bottom: 1px solid rgb(255 255 255 / 4%); /* hairline, near-invisible */
      color: var(--glass-text);

      &.unit {
         font-weight: 500; /* light emphasis, no background block */
         color: var(--glass-text);
      }
   }

   tbody {
      td:not(:first-child) {
         text-align: right;
         /* keep sans font + inherit tabular-nums from table */
      }
      td.active, td.fav, td.ota, td.status {
         text-align: center;
         color: var(--glass-muted);
      }

      td.fav, td.yoy, td.active {
         border-right: 1px solid rgb(255 255 255 / 5%);
      }

      tr:last-child td { border-bottom: none; }
      tr { transition: background 0.12s ease; }
      tr:hover td { background: rgb(255 255 255 / 3.5%); }
   }

   /* Total / summary rows */
   tfoot td {
      font-weight: 600;
      color: var(--glass-text);
      border-top: 1px solid var(--border-soft);
      border-bottom: none;
      background: rgb(255 255 255 / 2%);
      padding: 0.85rem 1rem;
   }

   .summary-row th {
      font-size: var(--font-size-sm);
      font-weight: 600;
      color: var(--color-text);
      border-bottom: 1px solid var(--color-line);

      span {
         font-size: 0.6875rem;
         font-weight: 400;
         color: var(--color-text-muted);
         text-transform: lowercase;
         margin-right: 0.25rem;
      }
   }

   /* Delta colors */
   .positive { color: var(--teal); }
   .negative { color: var(--coral); }

   /* Cancelled rows */
   tr.cancelled {
      opacity: 0.5;
      text-decoration: line-through;
   }

   /* Guest Favorite gained */
   tr.gf-gained {
      background: rgb(76 175, 80 / 10%);
   }

   /* Group separator borders */
   [data-group="cur"]:last-of-type, [data-group="prev"]:last-of-type {
      border-right: 2px solid var(--color-line);
   }

   /* Center-aligned columns (reviews) */
   [data-col="delta"], [data-col="gf"] { text-align: center; }

   /* OTA logo column */
   .ota-logo { height: 1.125rem; width: auto; vertical-align: middle; }
}

/* ── Buttons ── */

body.partner button,
body.partner input[type="submit"],
body.partner a.button {
   background: var(--surface-1);
   color: var(--glass-text);
   font-size: 0.8rem;
   height: 2rem;
   padding: 0 0.9em;
   font-weight: 500;
   line-height: 2rem;
   border: 1px solid var(--border-soft);
   border-radius: 8px;
   cursor: pointer;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.375rem;
   text-align: center;
   text-decoration: none;
   user-select: none;
   white-space: nowrap;
   vertical-align: baseline;
   transition: background 0.16s ease, border-color 0.16s ease;

   &:hover, &:focus { background: var(--surface-2); border-color: var(--border-med); }

   &:focus {
      box-shadow: 0 0 0 4px var(--teal-soft);
      outline: none;
   }

   &:active { background: var(--surface-0); }
}

/* Primary action (Apply / submit) */
body.partner button[type="submit"],
body.partner input[type="submit"] {
   background: var(--teal);
   color: #08110f;
   border-color: var(--teal);
   font-weight: 600;

   &:hover, &:focus { background: var(--teal); border-color: var(--teal); filter: brightness(1.06); }
   &:active { background: var(--teal); filter: brightness(0.95); }
}

body.partner input[type="date"],
body.partner select {
   background: var(--surface-1);
   color: var(--glass-text);
   font-size: 0.8rem;
   height: 2rem;
   padding: 0 0.7em;
   font-weight: 500;
   line-height: 1;
   border: 1px solid var(--border-soft);
   border-radius: 8px;

   &:focus {
      border-color: var(--teal);
      box-shadow: 0 0 0 3px var(--teal-soft);
      outline: none;
   }
}

/* ── Form row (toolbar inside thead) ── */

body.partner main table tr.form td {
   background: transparent;
   border-bottom: none;
   padding: 0;

   > div {
      display: flex;
      gap: 0.5rem;
      justify-content: space-between;
      align-items: flex-end;
      padding-bottom: 0.5rem;
   }

   form {
      display: flex;
      gap: 0.5rem;
      align-items: flex-end;
   }

   .export-buttons { padding: 0; }

   label {
      display: inline-flex;
      flex-direction: column;
      gap: 0.25rem;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--color-text-muted);
      text-align: start;
      margin-right: auto;
   }

   button, a.button {
      display: inline-flex;
      align-items: center;
      gap: 0.375rem;

      .icon { width: 14px; height: 14px; }
   }
}

.footnote {
   font-size: var(--font-size-sm);
   color: var(--color-text-muted);
   text-align: center;
   margin-top: 1rem;
}

/* ── Login / Auth ── */

#partner-login {
   display: grid;
   grid-template-columns: 1fr 1fr;
   min-height: 100dvh;
   flex: 1;
}

.partner-hero {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   padding: 3rem 3rem 8rem;
   background: rgb(255 255 255 / 3%);
   border-right: 1px solid var(--color-faint-line);

   > .logo-particles {
      width: 33%;
      aspect-ratio: 1.0563;
   }
}

#login-page, #login-error-page {
   display: grid;
   place-items: center;
   min-height: 100dvh;
}

#login-page > section {
   background: var(--color-surface);
   padding: 1.5rem 2.5rem;
   border-radius: var(--radius);
   box-shadow: var(--shadow);
   width: 100%;
   max-width: 400px;
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 1rem;
   margin-top: -25%;

   > h1 {
      font-size: 1.875rem;
      font-weight: 700;
   }

   > a {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      width: 100%;
      padding: 0.75rem 1rem;
      font-size: 1rem;
      font-weight: 500;
      color: var(--color-text);
      background: var(--color-surface);
      border: 1px solid var(--color-line);
      border-radius: var(--radius);
      text-decoration: none;
      cursor: pointer;

      &:hover {
         background: var(--color-bg);
      }
   }

   > .hint {
      text-align: center;
      color: var(--color-text-muted);
      font-size: var(--font-size-sm);
      margin-top: 1rem;
   }
}

.login-card {
   background: var(--color-surface);
   padding: 2.5rem;
   border-radius: var(--radius);
   box-shadow: var(--shadow);
   width: 100%;
   max-width: 400px;

   > p, > h1 { text-align: center; }

   & > h1 {
      font-size: 1.875rem;
      font-weight: 700;
      margin-bottom: 0.25rem;
   }

   & .primary {
      width: 100%;
      padding: 0.75rem 1rem;
      font-size: 1rem;
   }
}

.error-message {
   color: var(--color-error);
   text-align: center;
   margin-bottom: 1rem;
}

.error-detail {
   text-align: center;
   color: var(--color-text-muted);
   margin-bottom: 1.5rem;
}

.partner-hero-content {
   max-width: 420px;

   h2 {
      font-size: 2rem;
      font-weight: 700;
      line-height: 1.2;
      margin-bottom: 1rem;
   }
}

.hero-subtitle {
   color: var(--color-text-muted);
   font-size: 1rem;
   line-height: 1.5;
   margin-bottom: 2rem;
}

.hero-features {
   list-style: none;
   padding: 0;
   display: flex;
   flex-direction: column;
   gap: 1.25rem;

   li {
      display: flex;
      gap: 0.75rem;
      align-items: flex-start;
   }

   strong {
      display: block;
      font-size: 0.9375rem;
      font-weight: 600;
   }

   span {
      font-size: 0.8125rem;
      color: var(--color-text-muted);
      line-height: 1.4;
   }
}

.hero-icon {
   display: inline-block;
   width: 24px;
   height: 24px;
   flex-shrink: 0;
   margin-top: 2px;
   background: var(--brand-teal);
   mask-size: contain;
   mask-repeat: no-repeat;
   mask-position: center;
}

.partner-form-panel {
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 2rem 2rem 8rem;
}

.google-sso {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 0.75rem;
   width: 100%;
   padding: 0.75rem 1rem;
   font-size: 1rem;
   font-weight: 500;
   color: var(--color-text);
   background: var(--color-surface);
   border: 1px solid var(--color-line);
   border-radius: var(--radius);
   text-decoration: none;
   cursor: pointer;

   &:hover {
      background: var(--color-bg);
      text-decoration: none;
   }
}

#partner-login .login-card {
   margin-top: 0;
   padding: 3rem;
   border: 1px solid var(--color-faint-line);

   & form {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      margin-top: 1rem;
   }

   label {
      font-size: var(--font-size-sm);
      font-weight: 500;
      color: var(--color-text-muted);
   }

   input[type="email"],
   input[type="password"],
   input[type="text"] {
      width: 100%;
      padding: 0.625rem 0.75rem;
      border: 1px solid var(--color-line);
      border-radius: var(--radius);
      background: var(--input-bg);
      color: var(--color-text);
      font-size: 1rem;
   }

   input[inputmode="numeric"] {
      width: 100%;
      padding: 0.75rem;
      border: 1px solid var(--color-line);
      border-radius: var(--radius);
      background: var(--input-bg);
      color: var(--color-text);
      font-size: 1.5rem;
      text-align: center;
      letter-spacing: 0.5em;
      font-family: monospace;
   }

   .secondary {
      width: 100%;
      padding: 0.625rem 1rem;
      font-size: var(--font-size-sm);
      background: var(--color-bg);
      border: 1px solid var(--color-line);
      border-radius: var(--radius);
      box-shadow: none;

      &:hover { background: var(--color-surface); }
   }

   .primary {
      width: 100%;
      padding: 0.75rem 1rem;
      font-size: 1rem;
      font-weight: 500;
   }
}

.forgot-password {
   display: block;
   text-align: right;
   font-size: 0.8125rem;
   color: var(--color-text-muted);
   text-decoration: none;
   margin-top: 0.25rem;

   &:hover { color: var(--color-text); }
}

.divider {
   display: flex;
   align-items: center;
   gap: 1rem;
   margin: 1rem 0;
   color: var(--color-text-muted);
   font-size: var(--font-size-sm);

   &::before, &::after {
      content: "";
      flex: 1;
      border-top: 1px solid var(--color-line);
   }
}

.message {
   text-align: center;
   color: var(--color-text-muted);
   margin-bottom: 0.5rem;
}

/* ── Responsive: tablet landscape ── */

@media (width <= 1024px) {
   .partner-rail { display: none; }

   .partner-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      height: 56px;
      padding: 0 1rem;
      position: sticky;
      top: 0;
      z-index: 30;
      background: rgb(255 255 255 / 4%);
      border-bottom: 1px solid var(--border-soft);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);

      .logo { display: flex; align-items: center; gap: 0.5rem; }
      .logo-text {
         display: inline-block;
         width: 84px;
         height: 19px;
         background: var(--glass-text);
         mask-image: url("/web/images/pacer.svg");
         mask-size: contain;
         mask-repeat: no-repeat;
      }
   }

   .hamburger-menu { display: block; }

   body.partner > main {
      margin-left: 0;
      padding: 0;
      align-items: start;
   }

   body.partner > footer.site-footer { margin-left: 0; }

   body.partner main table tr.form { display: none; }
   body.partner main table th { background: var(--bg-tint); }

   body.partner main table th:first-child,
   body.partner main table td:first-child {
      position: sticky;
      left: 0;
      z-index: 2;
   }

   body.partner main table th:first-child { z-index: 3; }
}

/* ── Responsive: tablet portrait ── */

@media (width <= 768px) {
   body > header { padding: 0 1rem 0 0.5rem; }

   body.partner > header {
      flex-wrap: wrap;

      .logo { order: 0; }
      .partner-name { order: 1; }
   }

   body.partner main table {
      th { padding: 0.375rem 0.5rem; }
      td { padding: 0.375rem 0.5rem; }
   }

   #partner-login { grid-template-columns: 1fr; }

   .partner-hero {
      padding: 2rem 1.5rem;
      border-right: none;
      border-bottom: 1px solid var(--color-faint-line);
   }

   .partner-form-panel { padding: 2rem 1.5rem; }
}

/* ── Responsive: phone ── */

@media (width <= 480px) {
   body.partner > header .partner-name { font-size: 1rem; }

   body.partner main table {
      font-size: 0.75rem;
      th { padding: 0.25rem 0.375rem; }
      td { padding: 0.25rem 0.375rem; }
   }

   .partner-hero { padding: 1.5rem 1rem; }
   .partner-form-panel { padding: 1.5rem 1rem; }
   #partner-login .login-card { padding: 1.5rem; }
}

/* ── Internal tool banner ── */

.internal-banner {
   background: #fef3c7;
   color: #92400e;
   font-size: 0.75rem;
   font-weight: 600;
   text-align: center;
   padding: 0.375rem 0.75rem;
   border-radius: 4px;
   margin-bottom: 1rem;
   border: 1px solid #fcd34d;
}

/* ── Account page ── */

.account-card {
   background: var(--color-surface);
   padding: 2.5rem;
   border-radius: var(--radius);
   border: 1px solid var(--color-line);
   width: 100%;
   max-width: 400px;
   margin-top: 2rem;

   h2 {
      font-size: 1.25rem;
      font-weight: 600;
      margin-bottom: 1rem;
      align-self: start;
   }

   form {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
   }

   label {
      font-size: var(--font-size-sm);
      font-weight: 500;
      color: var(--color-text-muted);
   }

   input[type="password"] {
      width: 100%;
      padding: 0.625rem 0.75rem;
      border: 1px solid var(--color-line);
      border-radius: var(--radius);
      background: var(--input-bg);
      color: var(--color-text);
      font-size: 1rem;
   }

   .primary {
      margin-top: 0.5rem;
      width: 100%;
      padding: 0.75rem 1rem;
      font-size: 1rem;
   }

   hr {
      border: none;
      border-top: 1px solid var(--color-line);
      margin: 1.5rem 0;
   }

   .sign-out-btn {
      width: 100%;
      background: var(--color-bg);
      border: 1px solid var(--color-line);
      box-shadow: none;

      &:hover { background: var(--color-surface); }
   }
}

.success-message {
   color: #4caf50;
   text-align: center;
   margin-bottom: 1rem;
}

/* Caption CSS now in captions.css */
