/* per-page polish: settings
   All selectors scoped to structures unique to settings.html.
   Never fights space-ds.css ,  only adds specificity for settings-specific gaps.
*/

/* -- TOC sidebar: CANON sec 10 eyebrow (.12em / 500). -- */
.lay .toc .te {
  color: var(--ink-mute);
  letter-spacing: .12em;
  font-weight: 500;
}

/* CANON sec 12.1  -  content-TOC active = paper bg + shadow-sm (same as sec 12 rail). */
.lay .toc a.on {
  color: var(--ink) !important;
  background: var(--paper) !important;
  box-shadow: var(--shadow-sm) !important;
  font-weight: 560;
}
.lay .toc a.on svg {
  opacity: 1;
  color: var(--accent);
}

/* Danger TOC link keeps the negative colour */
.lay .toc a.dgr {
  color: var(--negative) !important;
}
.lay .toc a.dgr:hover {
  background: color-mix(in srgb, var(--negative) 8%, transparent) !important;
}

/* -- Form rows: the inline .fr input:focus { border-color:var(--ink) }
   is in the <style> block ,  override here with steel focus -- */
.fr input:focus,
.fr select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
  outline: none !important;
}

/* Scoped steel border for form inputs in settings only (in case global doesn't reach) */
.fr input,
.fr select {
  border: 1px solid var(--line-strong) !important;
  background: var(--paper) !important;
  color: var(--ink) !important;
  border-radius: var(--r-md) !important;
}

/* -- API tokens table: Revoke is a semantic destructive action, style as
   a proper small ghost-danger button, not a bare red span -- */
.tok .rv {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--negative) 24%, transparent);
  color: var(--negative) !important;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.tok .rv:hover {
  background: color-mix(in srgb, var(--negative) 8%, transparent);
  border-color: color-mix(in srgb, var(--negative) 36%, transparent);
}

/* -- Danger zone card: left accent border to distinguish from normal cards -- */
.sct.dz {
  border-color: color-mix(in srgb, var(--negative) 28%, var(--line)) !important;
}
.sct.dz .sh h2 {
  color: var(--negative) !important;
}

/* R7  -  `.db` bespoke retired; mapped to CANON sec 5 ghost (40h / r-md). */
.da .db {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  background: var(--paper) !important;
  color: var(--negative) !important;
  border: 1px solid color-mix(in srgb, var(--negative) 28%, transparent) !important;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.da .db:hover {
  background: color-mix(in srgb, var(--negative) 7%, var(--paper)) !important;
  border-color: color-mix(in srgb, var(--negative) 44%, transparent) !important;
}

/* CANON sec 10  -  app h1 = 28 (proto inline ships 30, override here). */
.ph .h1 {
  font-size: 28px !important;
  font-weight: 660 !important;
  letter-spacing: -.025em !important;
  line-height: 1.12 !important;
}
.ph p {
  color: var(--ink-soft);
}

/* -- Tokens table: CANON sec 10 eyebrow. -- */
.tok th {
  font-size: 10.5px;
  letter-spacing: .12em;
  font-weight: 500;
  color: var(--ink-mute);
}
.tok .tn {
  color: var(--ink);
  font-weight: 560;
}

/* CANON sec 10  -  section h2 = 22 / 640 / -.02em. Override proto's larger sizes. */
.lay .sct .sh h2 {
  font-size: 22px !important;
  font-weight: 640 !important;
  letter-spacing: -.02em !important;
}
.sct .sh .hp {
  color: var(--ink-mute);
  line-height: 1.45;
}

/* -- Mobile: stack form rows and TOC -- */
@media (max-width: 820px) {
  .fr {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .fr .fl {
    font-size: 12px;
  }
  .tok {
    font-size: 12px;
  }
  /* Token table: hide less important columns on mobile */
  .tok th:nth-child(3),
  .tok td:nth-child(3),
  .tok th:nth-child(5),
  .tok td:nth-child(5) {
    display: none !important;
  }
  /* No data-l in the proto, so the shared E4 table->block rule would
     leave each token cell unlabelled + right-aligned. Override for
     .tok only: each token is a readable left-aligned card (name as
     the title, scopes + last-used + revoke stacked under it). Scoped
     to .tok so other tables are unaffected. */
  /* GAP-D: the prior block left each token cell on its own line, so a
     token (name + scopes + last-used + Revoke) became a ~290px tall,
     sparse card -- raw / unfinished. Rebuild as a compact card: token
     name on line 1, then an inline meta row (scopes + last-used) with
     Revoke pushed to the right. Visible columns are 1 (name), 2
     (scopes), 4 (last used), 6 (revoke); 3 and 5 are hidden above.
     Scoped to .tok only. */
  .tok tbody tr {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 12px !important;
    padding: 12px 14px !important;
  }
  .tok td {
    display: block !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 0 !important;
    width: auto !important;
  }
  .tok td.tn {
    flex: 1 0 100% !important;
    font-size: 13px !important;
    font-weight: 560 !important;
    margin-bottom: 2px !important;
    overflow-wrap: anywhere !important;
  }
  .tok td.tm {
    font-size: 12px !important;
    color: var(--ink-mute) !important;
  }
  .tok td:last-child {
    margin-left: auto !important;
  }
  .tok td:last-child .rv {
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
  }
  .da {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .da .db {
    align-self: flex-start;
  }
}
