/* per-page polish: share-link
   Scope: main.s, .flip, .face, .sndr, .fb, .tabs2, .tab2, .code, .bfoot, .safe
   All selectors scoped ,  no generic collision risk.
*/

/* ── Centering: main grid ── */
main.s {
  min-height: calc(100vh - 58px - 14px) !important;
}

/* ── Flip card: refine glass ── */
.flip .face {
  background: var(--surface-3) !important;
  backdrop-filter: saturate(1.4) blur(14px) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(14px) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)) !important;
  box-shadow: var(--shadow-pop) !important;
  border-radius: var(--r-xl) !important;
}

/* ── Sender strip ── */
.flip .sndr {
  background: var(--surface-3) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 14px 22px !important;
}
.flip .sndr .av {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  font-weight: 700 !important;
  border: 1px solid var(--accent-line) !important;
  border-radius: 50% !important;
  font-size: 11px !important;
}
.flip .sndr .tx {
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}
.flip .sndr .tx em {
  color: var(--ink-soft) !important;
  font-style: italic !important;
  font-size: 12px !important;
}

/* ── Front face body ── */
.flip .fb {
  padding: 26px 28px 22px !important;
}
/* CANON sec 10  -  auth-card h1 = 28/660/-.025em. */
.flip .fb h1 {
  font-size: 28px !important;
  font-weight: 660 !important;
  letter-spacing: -.025em !important;
  line-height: 1.12 !important;
}
.flip .fb .d {
  font-size: 14px !important;
  line-height: 1.62 !important;
  color: var(--ink-soft) !important;
  margin-top: 4px !important;
}

/* Skill icon box */
.flip .fb .sic {
  background: var(--accent-soft) !important;
  border: 1px solid var(--accent-line) !important;
  border-radius: var(--r-lg) !important;
  color: var(--accent) !important;
  margin-bottom: 16px !important;
}

/* Chips row */
.flip .fb .tr {
  margin-bottom: 18px !important;
}

/* "no account needed" copy */
.flip .nofree {
  color: var(--ink-mute) !important;
  font-size: 11px !important;
}
.flip .nofree b {
  color: var(--ink-soft) !important;
}

/* Flip trigger */
.flip .flipbtn {
  font-size: 11px !important;
  color: var(--ink-mute) !important;
  transition: color .15s, background .15s !important;
}
.flip .flipbtn:hover {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

/* "by @fede" meta */
.flip .ft .by {
  color: var(--ink-faint) !important;
  font-size: 10.5px !important;
}

/* ════════════════════════════════════════════════════════════
   G2 ─ BACK FACE "What's inside / N files" file browser, fully
   brought to the refined system: glass back-face surface, a
   proper steel eyebrow header, file tabs as a clean segmented
   control with an active steel underline + tint, a genuinely
   distinct readable mono code block (real surface in BOTH modes,
   not card-colored), a refined sender row, and the security
   notice as a tasteful accent-soft callout. Tightened radii via
   the --r-* tokens. Scoped under .flip so it cannot collide. ── */

/* the back face itself = the same glass as the front, slightly
   firmer so the file browser reads as a real surface */
.flip .face.bk {
  background: var(--surface-3) !important;
  -webkit-backdrop-filter: saturate(1.5) blur(20px) !important;
  backdrop-filter: saturate(1.5) blur(20px) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)) !important;
  box-shadow: var(--shadow-pop) !important;
  border-radius: var(--r-xl) !important;
  overflow: hidden !important;
}

/* header: a steel eyebrow + the file count, not a weak grey label */
.flip .bh {
  background: var(--surface-3) !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 14px 20px !important;
}
/* CANON sec 10  -  eyebrow: 10.5px / 500 / .12em. */
.flip .bh .t {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--accent) !important;
  font-weight: 500 !important;
  font-size: 10.5px !important;
  letter-spacing: .12em !important;
}
.flip .bh .t::before {
  content: "" !important;
  width: 16px !important;
  height: 1.5px !important;
  border-radius: 1px !important;
  background: var(--accent) !important;
  flex: none !important;
}
.flip .bh .flipbtn {
  font-size: 11px !important;
  color: var(--ink-mute) !important;
  border-radius: var(--r-sm) !important;
  padding: 5px 10px !important;
  transition: color .15s, background .15s !important;
}
.flip .bh .flipbtn:hover {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

/* file tabs = a clean segmented control: a tinted track, each tab
   a quiet button, the active one with a steel underline + soft
   tint (not a hard box) */
.flip .tabs2 {
  background: var(--surface-3) !important;
  padding: 8px 14px 0 !important;
  gap: 4px !important;
  border-bottom: 1px solid var(--line) !important;
  scrollbar-width: none !important;
}
.flip .tabs2::-webkit-scrollbar { display: none !important; }
.flip .tab2 {
  color: var(--ink-mute) !important;
  font-size: 10.5px !important;
  font-weight: 550 !important;
  padding: 8px 12px !important;
  border-radius: var(--r-sm) var(--r-sm) 0 0 !important;
  border-bottom: 2px solid transparent !important;
  transition: color .15s, background .15s, border-color .15s !important;
}
.flip .tab2:hover {
  color: var(--ink) !important;
  background: color-mix(in srgb, var(--accent) 6%, transparent) !important;
}
/* CANON sec 13  -  active tab = solid bg/solid-fg (no accent-soft variant). */
.flip .tab2.on {
  color: var(--solid-fg) !important;
  border-bottom-color: var(--solid) !important;
  background: var(--solid) !important;
  font-weight: 600 !important;
}
.flip .tab2 .fz {
  color: var(--ink-faint) !important;
  margin-left: 6px !important;
  font-size: 9.5px !important;
}

/* code area: a genuinely distinct readable surface in BOTH modes
   (--bg-3 is ~paper in light, so it read flat). A firm tinted
   slab + comfortable padding + a styled thin scrollbar. */
.flip .code-wrap {
  background: color-mix(in srgb, var(--ink) 4%, var(--paper)) !important;
}
html.dark .flip .code-wrap {
  background: color-mix(in srgb, #000 30%, var(--paper)) !important;
}
/* CANON sec 9  -  code block: 12.5px / 1.7 / 14px 16px padding. */
.flip .code {
  font-size: 12.5px !important;
  line-height: 1.7 !important;
  background: transparent !important;
  color: var(--ink) !important;
  padding: 14px 16px !important;
}
.flip .code .cm {
  color: var(--ink-mute) !important;
}
.flip .code::-webkit-scrollbar { width: 9px !important; }
.flip .code::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 18%, transparent) !important;
  border-radius: var(--r-pill) !important;
  border: 2px solid transparent !important;
  background-clip: padding-box !important;
}
.flip .code::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 45%, transparent) !important;
  background-clip: padding-box !important;
}
.flip .code::-webkit-scrollbar-track { background: transparent !important; }

/* ── Back face footer: refined sender row ── */
.flip .bfoot {
  background: var(--surface-3) !important;
  border-top: 1px solid var(--line) !important;
  padding: 14px 18px !important;
  gap: 12px !important;
}
.flip .pr2 .av {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  font-weight: 700 !important;
  border: 1px solid var(--accent-line) !important;
  border-radius: 50% !important;
}
.flip .pr2 .nm {
  font-size: 13px !important;
  font-weight: 620 !important;
  color: var(--ink) !important;
  letter-spacing: -.01em !important;
}
.flip .pr2 .hd {
  color: var(--ink-mute) !important;
  font-size: 10.5px !important;
}
.flip .bfoot .btn-ghost {
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--r-md) !important;
  transition: border-color .15s, color .15s, background .15s !important;
}
.flip .bfoot .btn-ghost:hover {
  border-color: var(--accent-line) !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

/* Security notice: tasteful accent-soft callout */
.flip .safe {
  background: var(--accent-soft) !important;
  border: 1px solid var(--accent-line) !important;
  border-radius: var(--r-md) !important;
  font-size: 11.5px !important;
  line-height: 1.55 !important;
  padding: 11px 13px !important;
  gap: 10px !important;
}
.flip .safe svg {
  color: var(--accent) !important;
  flex-shrink: 0 !important;
  margin-top: 1px !important;
}
.flip .safe strong {
  color: var(--ink) !important;
  font-weight: 650 !important;
}

/* ── Mobile: card fills width, no 3D flip ── */
@media (max-width: 480px) {
  /* The proto's grid cell sizes to the card's max-content, so
     .flip{width:min(452px,100%)} still computed ~421px and overflowed
     a 390 viewport. Pin the card to the viewport-constrained width. */
  main.s {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .flip {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .flip .face {
    border-radius: var(--r-xl) !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .flip .fb {
    padding: 22px 20px 18px !important;
  }
  /* Two nowrap action labels ("Save to library" + "Copy for your
     agent") cannot sit side by side in the narrow mobile card --
     "Copy for your agent" clipped past the card edge. Stack them. */
  .fb .acts2 {
    flex-direction: column !important;
    gap: 9px !important;
  }
  .fb .acts2 .btn {
    width: 100% !important;
    flex: none !important;
  }
  /* E4: the flip-card toggle is a real control -- give it a
     comfortable mobile tap target (was a cramped 27px). */
  .flip .flipbtn {
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 12px !important;
  }
}
