/* ===================== Settings - immersive ===================== */

/* Uncapped: the rows below lay out as a grid, so the width is used rather than
   stretching each row's label away from its button. */
.settings-page { min-width: 0; }

/* A run of setting rows. The section headings and the account-history table are
   siblings of these groups, so they keep the full width to themselves. */

/* A floor as well as the shared row height: without it a section whose rows all
   hold one short line would sit noticeably squatter than the rest of the page. */

.set-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--text);
  border: 1px solid var(--hero-line);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 750;
  color: #fff;
  flex: none;
}
/* With a brand logo the tile is just a frame for it - drop the green fill so a
   transparent PNG doesn't sit on a colour it wasn't designed for. */
.set-avatar.has-logo { background: #fff; border-color: var(--line); padding: 6px; }
.set-avatar.has-logo img { width: 100%; height: 100%; object-fit: contain; }

/* Full-width configuration rows. */
.set-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  scroll-margin-top: 20px;
}

.set-ico {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-weak);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.set-ico svg { width: 19px; height: 19px; }
.set-ico.is-gray { background: var(--panel-subtle); color: var(--muted); }

.set-row-txt { flex: 1; min-width: 0; }
.set-row-txt strong { font-size: 14px; font-weight: 700; display: block; }
.set-row-txt p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.set-row .button-sm { white-space: nowrap; }
.set-ico.is-danger { background: var(--red-weak); color: var(--red); }

/* Settings -> Diagnostics -> Background jobs: a set-row that opens in place to
   list the failed jobs. The card is the frame, so the row inside drops its own. */
.set-jobs { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.set-jobs.has-failures { border-color: #f1c9c3; }
.set-jobs > .set-row { border: 0; background: none; }
.set-jobs-body { display: grid; gap: 8px; padding: 0 18px 16px 71px; }
/* The Review toggle is a .button-ghost, whose display beats the UA [hidden] rule. */
.set-jobs [hidden] { display: none; }
.set-jobs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-jobs-head strong { display: block; font-size: 13px; font-weight: 700; }
.set-jobs-head span { color: var(--muted); font-size: 12px; }
.set-jobs-list { display: grid; gap: 8px; }
.set-jobs-empty { margin: 0; padding: 16px 12px; text-align: center; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.set-jobs-empty strong { display: block; color: var(--text); }

@media (max-width: 640px) {
  .set-row { flex-wrap: wrap; }
  .set-jobs-body { padding: 0 14px 14px; }
  
}

/* ============ Notifications: the order-event matrix ============ */

.brnd-sec-label { font-size: 12px; color: var(--faint); font-weight: 700; margin: 0 0 10px; }
/* ---- Order-event matrix -----------------------------------------------------
   Events down, audiences across. This replaced two separate per-audience checkbox
   grids: the same six events rendered twice, 11 boxes across two cards of unequal
   height, so "who gets told when an order is refunded?" meant comparing two grids.
   A table because the data genuinely has two axes - the row and column headers are
   what let a screen reader announce "Refund issued, You, checkbox". */

/* A section label that follows content needs to read as a break, not as a caption for
   the card above it. */

.evt-matrix { width: 100%; border-collapse: collapse; }

.evt-matrix th,
.evt-matrix td {
  text-align: left;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.evt-matrix thead th {
  vertical-align: bottom;
  background: var(--panel-subtle);
  border-bottom: 1px solid var(--line);
}

/* The audience columns are equal and narrow; the event name takes the rest, so the
   checkboxes line up as a column the eye can run down. */
.evt-matrix thead th + th { width: 170px; }
.evt-matrix tbody tr:last-child th,
.evt-matrix tbody tr:last-child td { border-bottom: 0; }
.evt-matrix tbody tr:hover th,
.evt-matrix tbody tr:hover td { background: var(--hover); }

.evt-matrix tbody th { font-size: 13px; font-weight: 600; }

.evt-col-name { display: block; font-size: 12.5px; font-weight: 700; }
.evt-col-sub { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.evt-col-sub--warn { color: var(--amber); font-weight: 600; }

/* An empty cell reads as a rendering bug, so the one event vendors aren't told about
   says so. */
.evt-na { font-size: 11.5px; color: var(--faint); }
.evt-lock-inline { display: none; }

/* Per-event wording, in a second row spanning the table. The divider moves onto that
   row so the pair reads as one block: a rule between an event and its own editor would
   split them apart. Hover stays on the event row - highlighting a form while typing in
   it is noise. */
.evt-matrix tbody tr:not(.evt-copy-row) th,
.evt-matrix tbody tr:not(.evt-copy-row) td { border-bottom: 0; }
.evt-matrix tbody tr.evt-copy-row td { padding-top: 0; padding-bottom: 0; }
.evt-matrix tbody tr.evt-copy-row:hover td { background: transparent; }
.evt-matrix tbody tr.evt-copy-row:last-child td { border-bottom: 0; }

.evt-copy > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
}
.evt-copy > summary::-webkit-details-marker { display: none; }
.evt-copy > summary:hover,
.evt-copy[open] > summary { color: var(--text); }
.evt-copy-panel { display: grid; gap: 16px; padding: 2px 0 18px; }

.evt-copy-hint .mono { margin-right: 6px; white-space: nowrap; }

/* Audiences side by side once there's room; the hint runs under them all. */
@media (min-width: 760px) {
  .evt-copy-panel { grid-template-columns: 1fr 1fr; gap: 16px 22px; }
  .evt-copy-hint { grid-column: 1 / -1; }
  /* One audience - a single column capped so the fields don't stretch the width of
     the table. */
  .evt-copy-panel--1 { grid-template-columns: minmax(0, 520px); }
}
@media (min-width: 1000px) {
  .evt-copy-panel--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Below sm a four-column matrix stops being readable, so each event becomes its own
   block with its audience labels shown inline (the same shape .table-cards uses). */
@media (max-width: 639px) {
  .evt-matrix thead { display: none; }
  .evt-lock-inline { display: inline-flex; margin-left: auto; }
  .evt-matrix,
  .evt-matrix tbody,
  .evt-matrix tr,
  .evt-matrix th,
  .evt-matrix td { display: block; width: auto; }
  .evt-matrix tbody tr {
    padding: 4px 0 10px;
    border-bottom: 1px solid var(--line-soft);
  }
  .evt-matrix tbody tr:last-child { border-bottom: 0; }
  .evt-matrix tbody th { padding-bottom: 4px; border-bottom: 0; }
  .evt-matrix tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 18px;
    border-bottom: 0;
  }
  .evt-matrix tbody td::before {
    content: attr(data-label);
    font-size: 12px;
    color: var(--muted);
  }
}

/* ============ Brand (settings sub-page) ============ */
.brnd-page { min-width: 0; }
.brnd-page .back-link { margin-bottom: 16px; }
.brnd-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* Taller now the cards are full width - a bigger logo/signature preview is more
   useful than a wider band of empty card. */
.brnd-preview {
  margin: 13px 0 11px; height: 150px; border-radius: 12px; border: 1px dashed var(--line);
  background: #f7faf8; display: grid; place-items: center; padding: 12px; overflow: hidden;
}
.brnd-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brnd-initials {
  width: 56px; height: 56px; border-radius: 13px; background: var(--accent); color: #d8fdec;
  display: grid; place-items: center; font-size: 19px; font-weight: 700; letter-spacing: .02em;
}
.brnd-empty { font-size: 12.5px; color: var(--faint); }

