/*
 * My profile at /profile. The palette comes from css/app.css and the parts
 * (app bar, groups, rows, segmented buttons, fields) from css/ui.css, the same
 * ones the timetable pages use. This file adds what only the profile needs: the
 * menu, its sub-pages, room and saved-pick cards, and the friends lists that
 * js/friends-page.js renders.
 */

.pf { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.pf .page h2 { font-family: var(--display); font-weight: 800; font-size: 28px; text-transform: uppercase; margin: 8px 0 4px; line-height: 1; }
.pf .page .lede { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 60ch; }
.pf-bar {
  position: sticky; top: 0; z-index: 10;
  background: var(--app);
  border-bottom: 1px solid var(--line-strong);
}
.pf-bar .appbar { padding-bottom: 8px; }
.pf-bar .title-block { padding: 2px 0; margin: 0; }
.pf-bar .title-block:hover { background: none; }

.pf-body {
  flex: 1; width: 100%;
  padding: 8px 16px calc(40px + env(safe-area-inset-bottom, 0px));
}
.pf-menu, .pf-pages { max-width: 640px; margin: 0 auto; }
.pf .page { flex: none; overflow: visible; padding: 0; }
.pf .page h2 { outline: none; }
.pf .group { overflow: hidden; }
.pf .group-row { flex-wrap: wrap; }
.pf .group-row > :first-child { flex: 1 1 8rem; min-width: 0; }

/* Phone and tablet: the menu is the start page and a sub-page replaces it. */
.pf[data-view="home"] .pf-pages { display: none; }
.pf:not([data-view="home"]) .pf-menu { display: none; }
.pf[data-auth="loading"] .pf-body,
.pf[data-auth="signed-out"] .pf-body,
.pf[data-auth="offline"] .pf-body { display: none; }

/* Desktop: the menu stays on the left, the open page sits next to it. */
@media (min-width: 960px) {
  .pf-body {
    display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: start;
    padding-top: 22px; padding-inline: clamp(24px, 3vw, 48px);
  }
  .pf[data-view] .pf-menu, .pf[data-view] .pf-pages { display: block; margin: 0; }
  .pf-menu { position: sticky; top: 92px; }
  .pf-pages { max-width: none; }
  .pf-bar .appbar { padding-inline: clamp(24px, 3vw, 48px); }
  /* Form buttons size to their text instead of running across the page. */
  #profile-form > .primary,
  .pf-fields > .primary { width: auto; min-width: 240px; padding-inline: 32px; justify-self: start; align-self: flex-start; }
}
/* Wide screens: cards in columns, and form fields side by side. */
@media (min-width: 1280px) {
  .pf .pf-items, .pf .event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; }
  .pf-fields:has(> .field + .field) { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
  .pf-fields:has(> .field + .field) > :not(.field) { grid-column: 1 / -1; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.pf-loading { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); line-height: 1.5; }
.pf-note { margin: -6px 2px 14px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.page-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.page-h .count { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pf-h-action { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.pf-quiet-btn { display: block; margin: 14px auto 0; padding: 10px 14px; color: var(--accent); font-weight: 600; font-size: 13px; }
.pf-quiet-btn:disabled { opacity: .5; cursor: default; }

/* ---------- avatars ---------- */
.pf-av {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; overflow: hidden;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 19px; letter-spacing: .02em; line-height: 1;
}
.pf-av img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pf-av.lg { width: 72px; height: 72px; font-size: 24px; }

/* ---------- menu ---------- */
.pf-me {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 14px; gap: 14px; align-items: center;
  margin: 4px 0 4px; padding: 14px; border-radius: 16px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  color: inherit; text-decoration: none;
}
.pf-me b {
  display: block; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1;
  text-transform: uppercase; overflow-wrap: anywhere;
}
.pf-me small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.pf-me:hover { box-shadow: inset 0 0 0 1px var(--accent); }

.pf-link {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center;
  width: 100%; padding: 12px 14px; text-align: left;
  color: inherit; text-decoration: none; cursor: pointer;
}
.group .pf-link + .pf-link { border-top: 1px solid var(--line-strong); }
.pf-link:hover { background: var(--chip); }
.pf-link:focus-visible { outline-offset: -2px; }
.pf-link svg, .pf-me svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pf-link > svg:first-child { color: var(--accent); }
.pf-link b { display: block; font-weight: 600; font-size: 14px; }
.pf-link small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.pf-chev { width: 14px !important; height: 14px !important; opacity: .45; transition: transform .15s; }
.pf-value { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pf-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700;
}
.pf-link[aria-current="page"] { background: var(--chip); }
.pf-link[aria-current="page"] b { color: var(--accent); }
.pf-link--danger, .pf-link--danger > svg:first-child { color: var(--warn); }
.pf-menu .danger-link { margin-top: 6px; }

/* ---------- switches and colour swatches ---------- */
.toggle-row { cursor: pointer; }
.toggle-row > span { font-weight: 600; }
.switch {
  -webkit-appearance: none; appearance: none;
  flex: none; position: relative; width: 44px; height: 26px; margin: 0;
  border-radius: 13px; background: color-mix(in srgb, var(--ink) 22%, transparent);
  cursor: pointer; transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .15s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

.pf-swatch {
  -webkit-appearance: none; appearance: none;
  flex: none; width: 46px; height: 32px; padding: 0; border: 0; border-radius: 9px;
  background: none; cursor: pointer;
}
.pf-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.pf-swatch::-webkit-color-swatch { border: 0; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.pf-swatch::-moz-color-swatch { border: 0; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- forms ---------- */
.pf-fields { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.pf-fields .field .seg { align-self: flex-start; }
.pf-fields textarea {
  width: 100%; min-height: 160px; resize: vertical;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
.field input[readonly] { background: var(--chip); color: var(--muted); }
.field select:disabled { opacity: .7; cursor: wait; }
.pf-linkbox { display: flex; gap: 6px; align-items: center; }
.pf-linkbox input { flex: 1; min-width: 0; }
.pf-linkbox .chip { height: 46px; border-radius: 12px; color: inherit; text-decoration: none; }
.pf .primary { margin-bottom: 14px; }
.pf .pf-fields .primary, .pf .form .primary { margin-bottom: 0; }
.primary:disabled { opacity: .55; cursor: default; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
.pf-actions .chip { color: inherit; }
.pf-file { position: relative; cursor: pointer; }
.pf-file input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.pf-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-photo { display: flex; align-items: center; gap: 14px; padding: 14px 14px 0; }
.pf-photo p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pf-example summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.pf-example pre {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--chip);
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Public profile look */
.pf-banner {
  margin: 14px 14px 0; aspect-ratio: 16 / 5; min-height: 96px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--chip); color: var(--muted); font-size: 13px; font-weight: 600; text-align: center;
}
.pf-banner img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pf-theme-preview {
  margin: 14px 14px 0; padding: 16px; border-radius: 12px;
  display: grid; gap: 4px;
  background: var(--profile-preview-bg, #17313a); color: var(--profile-preview-text, #ffffff);
  border: 1px solid var(--profile-preview-border, #8fdce7);
}
.pf-theme-preview strong { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.pf-theme-preview span { color: var(--profile-preview-muted, #d1dfe1); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.pf-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 6px; padding: 14px 14px 4px; }
.pf-color { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; font-weight: 600; cursor: pointer; }
.pf-color .pf-swatch { width: 38px; height: 30px; }

/* ---------- status lines and the toast ---------- */
/* Status lines themselves come from css/ui.css. */
.pf-page > .status.is-visible { margin-bottom: 14px; }
.status.is-toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  transform: translateX(-50%);
  width: max-content; max-width: min(440px, calc(100% - 32px));
  padding: 10px 14px; border-radius: 12px;
  background: var(--ink); color: var(--app);
  font-weight: 600; box-shadow: var(--shadow);
}
.status.is-toast[data-tone="error"] { background: var(--warn); color: #fff; }
.status.is-toast:not(.is-visible) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); box-shadow: none; }
.pf:not([data-auth="signed-in"]) .status.is-toast { display: none; }

/* ---------- rooms and saved picks ---------- */
.pf-items { display: flex; flex-direction: column; gap: 8px; }
.pf-item {
  --stage: var(--accent);
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--panel-2);
  box-shadow: inset 3px 0 0 var(--stage), inset 0 0 0 1px var(--line-strong);
}
.pf-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pf-item-head > div { min-width: 0; }
.pf-item-head b {
  display: block; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.05;
  text-transform: uppercase; overflow-wrap: anywhere;
}
.pf-item-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.pf-item-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.pf-item-tags .pill { margin: 0; white-space: nowrap; }
.pf-item-tags .pill.on { background: var(--accent); color: var(--accent-ink); }
.pf-facts { margin: 0; display: flex; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
/* The dot ends a line rather than starting the next one when the facts wrap. */
.pf-facts span { white-space: nowrap; }
.pf-facts span:not(:last-child)::after { content: "·"; margin: 0 6px; }
.pf-facts b { color: var(--ink); font-weight: 600; }
.pf-facts + .pf-facts { margin-top: -6px; }
.pf-avs { display: flex; align-items: center; }
.pf-avs .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--panel-2); }
.pf-item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-manage > summary {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.pf-manage > summary::-webkit-details-marker { display: none; }
.pf-manage > summary::after { content: "▸"; font-size: 10px; }
.pf-manage[open] > summary::after { content: "▾"; }
.pf-manage-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-strong); }
.pf-rename { display: flex; gap: 6px; align-items: flex-end; }
.pf-rename .field { flex: 1; min-width: 0; }
.pf-rename .btn { height: 46px; border-radius: 12px; }
.pf-manage-body > .btn { align-self: flex-start; }
.pf-archive { margin-top: 8px; }
.pf-archive > summary { cursor: pointer; padding: 10px 2px; list-style: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.pf-archive > summary::-webkit-details-marker { display: none; }
.pf-archive > summary::before { content: "▸ "; }
.pf-archive[open] > summary::before { content: "▾ "; }
.pf-list .empty { padding: 18px 16px; font-size: 13px; }
.pf-list .empty a { color: var(--accent); font-weight: 600; }

/* ---------- emails we sent you ---------- */
.pf-email + .pf-email { border-top: 1px solid var(--line-strong); }
.pf-email > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.pf-email > summary::-webkit-details-marker { display: none; }
.pf-email[open] .pf-chev { transform: rotate(90deg); }
.pf-email-main { flex: 1 1 auto; min-width: 0; }
.pf-email-main b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.pf-email-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.pf-email-state { flex: none; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.pf-email-state[data-state="failed"] { color: var(--warn); }
.pf-email-note { margin: 0 14px 10px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.pf-email-body {
  margin: 0 14px 14px; padding: 12px 14px; border-radius: 12px; background: var(--chip);
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.pf-email-body a { color: var(--accent); font-weight: 600; }
.pf-email-more { margin-top: 2px; }

.pf-new > summary { list-style: none; }
.pf-new > summary::-webkit-details-marker { display: none; }
.pf-new[open] > summary { border-bottom: 1px solid var(--line-strong); }
.pf-new[open] .pf-chev { transform: rotate(90deg); }
.pf-new { margin-bottom: 14px; }

/* Small buttons in cards and lists */
.pf .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 17px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.pf .btn-secondary { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.pf .btn-secondary:hover { background: var(--chip); }
.pf .btn-danger { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: transparent; color: var(--warn); }
.pf .btn:disabled { opacity: .55; cursor: default; }
.pf .btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }

/* ---------- friends (markup from js/friends-page.js) ---------- */
.friends-list:empty { display: none; }
.friends-list > * + * { border-top: 1px solid var(--line-strong); }
.friend-item, .request-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px;
}
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person > div { min-width: 0; }
.person strong, .person-profile-link { display: block; color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.person-profile-link:hover, .person-profile-link:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.person-detail { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.avatar, .chip-avatar {
  flex: none; border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 800; line-height: 1;
}
.avatar { width: 36px; height: 36px; font-size: 13px; }
.chip-avatar { width: 20px; height: 20px; font-size: 9px; }
.avatar img, .chip-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.group .empty { border: 0; border-radius: 0; padding: 13px 14px; text-align: left; font-size: 13px; }
.friends-list:not(:empty) + #outgoing-requests-section { border-top: 1px solid var(--line-strong); }
.pf-sub-h { margin: 0; padding: 10px 14px 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.account-search { display: flex; flex-direction: column; gap: 8px; }
.account-search input {
  width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); font: inherit; font-size: 16px;
}
.account-suggestions {
  display: flex; flex-direction: column; max-height: 280px; overflow: auto;
  border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.account-suggestion {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  width: 100%; padding: 8px 12px; text-align: left;
}
.account-suggestion + .account-suggestion { border-top: 1px solid var(--line-strong); }
.account-suggestion:hover:not(:disabled) { background: var(--chip); }
.account-suggestion:disabled { opacity: .6; cursor: not-allowed; }
.account-suggestion strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.account-suggestion small { display: block; color: var(--muted); font-size: 12px; }
.account-suggestion > span:last-child { color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.account-suggestions__message { padding: 10px 12px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.event-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.event-grid:empty { display: none; }
.event-card {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px;
  padding: 10px; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.event-card:not(:has(.event-media)) { grid-template-columns: minmax(0, 1fr); padding-left: 14px; }
.event-media { display: block; align-self: start; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--chip); }
.event-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.event-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.event-card h3 {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.05;
  text-transform: uppercase; overflow-wrap: anywhere;
}
.event-meta { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.friend-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.friend-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 26px; padding: 0 10px 0 4px; border-radius: 13px;
  background: var(--chip); color: inherit; font-size: 12px; font-weight: 600; text-decoration: none;
}
.friend-chip i { width: 10px; height: 10px; margin-left: 4px; border-radius: 50%; flex: none; background: var(--friend-color, var(--accent)); }
.friend-chip--link:hover, .friend-chip--link:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- sign in ---------- */
.pf .pf-gate { width: 100%; max-width: 440px; margin: 0 auto; padding: 16px 16px 40px; }
.pf-gate .lede { margin-bottom: 16px; }
.pf-gate .infonote { margin-top: 4px; }
.pf-gate .form-links button { padding: 0; }

/* ---------- your festival year (markup from js/profile-year.js) ---------- */
.pf-years { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.pf-year #pf-year-label { margin-top: 0; }
.pf-year .empty a { color: var(--accent); font-weight: 600; }
.pf-year-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.pf-year-stats p {
  min-width: 0; margin: 0; padding: 14px 12px 12px; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.pf-year-stats b {
  display: block; color: var(--accent);
  font-family: var(--display); font-weight: 800; font-size: clamp(34px, 9vw, 54px); line-height: 1;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.pf-year-stats span {
  display: block; margin-top: 6px; color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase;
}
.pf-year-fun { margin: 0 0 4px; font-size: 14px; line-height: 1.5; max-width: 60ch; }
.pf-year-top { margin: 0 0 14px; padding: 0; list-style: none; }
.pf-year-top li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 11px 14px; }
.pf-year-top li + li { border-top: 1px solid var(--line-strong); }
.pf-year-rank { color: var(--muted); font-family: var(--display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.pf-year-top b { min-width: 0; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.1; text-transform: uppercase; overflow-wrap: anywhere; }
.pf-year-event { grid-template-columns: minmax(0, 1fr) auto 14px; }
.pf-year-event b { overflow-wrap: anywhere; }
.pf-year-save svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-year-save:disabled { opacity: .6; cursor: default; }
.pf-year-note { margin: 8px 2px 0; }
@media (max-width: 959px) {
  .pf-year-save { width: 100%; }
}
@media (min-width: 1280px) {
  .pf-year-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
}

/* Security: two-step sign-in (js/profile-security.js). The QR code stays dark
   on white in both themes, because scanners need that. */
.tf-hint { margin: 10px 2px 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 60ch; }
.tf-setup { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; }
.tf-qr { width: 200px; max-width: 100%; border-radius: 10px; overflow: hidden; background: #ffffff; line-height: 0; }
.tf-qr svg { display: block; width: 100%; height: auto; }
.tf-setup-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.tf-setup-text p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tf-secret {
  display: block; max-width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--chip);
  font: 600 15px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em;
  overflow-wrap: anywhere; user-select: all;
}
.tf-codes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px;
  margin: 0 0 12px; padding: 14px 14px 14px 38px; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  font-variant-numeric: tabular-nums;
}
.tf-codes li { color: var(--muted); font-size: 12px; }
.tf-codes code { color: var(--ink); font: 600 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.tf-badge { padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.tf-count { font-size: 17px; font-variant-numeric: tabular-nums; }
.tf-count.is-low { color: var(--warn); }
@media (min-width: 960px) {
  #tf-root > .primary { width: auto; min-width: 240px; padding-inline: 32px; }
}
@media (max-width: 559px) {
  .tf-setup { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .tf-setup-text { align-items: stretch; }
  .tf-codes { grid-template-columns: minmax(0, 1fr); }
}
