/* S9 profile pages (app-code, app-cv-profile, app-card-profile). Needs home.css, sections.css, v4.css, app.css. */
.pv { display: grid; gap: 16px; min-width: 0; }
.pv-pane[hidden], .pv-pop[hidden], .pv-menu[hidden], [data-pv-pane][hidden] { display: none !important; }
[data-pv-passrow][hidden], [data-pv-sharepassrow][hidden], [data-pv-linkrow][hidden], [data-pv-prevrestore][hidden] { display: none !important; }

/* ---------- header ---------- */
.pv-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.pv-thumb { display: grid; place-items: center; width: 76px; height: 76px; flex: none; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); overflow: hidden; }
.pv-thumb .qq-qrsvg { width: 60px; height: 60px; }
.pv-thumb--a4 { background: var(--surface); }
.pv-thumb--av { background: var(--ink); color: var(--on-ink); font-weight: 800; font-size: 1.3rem; border-color: var(--ink); }
.pv-mini { width: 44px; height: 58px; padding: 7px 6px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; align-content: start; }
.pv-mini u { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); }
.pv-mini u:first-child { width: 62%; background: var(--ink); }
.pv-title { display: grid; gap: 8px; min-width: 0; }
.pv-namerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv-name { flex: 1; min-width: 0; border: 0; background: transparent; font: 800 1.35rem var(--font); letter-spacing: -.02em; color: var(--text); padding: 2px 6px; margin-left: -6px; border-radius: 8px; }
.pv-name:hover { background: var(--surface-2); }
.pv-name:focus { outline: 2px solid var(--accent); background: var(--surface); }
.pv-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pv-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--surface); font-size: .78rem; font-weight: 600; color: var(--text-2); }
.pv-chip .qq-ic { width: 14px; height: 14px; }
.pv-chip--auto { border-style: dashed; }
.pv-chip--cur { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pv-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: .82rem; }
.pv-meta span { display: inline-flex; align-items: center; gap: 6px; }
.pv-meta .qq-ic { width: 14px; height: 14px; }
.pv-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pv-menuwrap { position: relative; }
button.qq-toggle { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
button.qq-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.pv-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .84rem; }
.qq-st--expired::before { background: #dc2626; }
.qq-st--revoked::before { background: #a1a1aa; }

/* ---------- tab bar (same underline style as the S8 view tabs) ---------- */
.pv-tabs { position: sticky; top: 73px; z-index: 15; background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(10px); margin: 0 -4px; padding: 4px 4px 0; }
.pv-tabs .ap-view { text-decoration: none; font-family: var(--font); }
.pv-tabs .ap-view:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- overview / statistics cards ---------- */
.pv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pv-span2 { grid-column: span 2; }
.pv-qr { display: grid; justify-items: center; gap: 10px; padding: 18px 14px; border-radius: 16px; background: #fff; color: #0a0a0a; }
.pv-qr .qq-qrsvg { width: 148px; height: 148px; }
.pv-qr b { letter-spacing: .14em; font-size: .8rem; }
.pv-sideqr { display: grid; gap: 12px; align-content: start; }
.pv-copy small, .pv-field > span, .pv-dd > span, .pv-date > span, .pv-chips > span { display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); }
.pv-copy { display: grid; gap: 6px; }
.pv-copy > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv-copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font: 500 .8rem var(--mono); }
.pv-hbargrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.pv-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pv-ctl .ap-spacer { flex: 1; }

/* ---------- kit tables inside profile tabs ---------- */
.pv-tabhead { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pv-tabhead h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.pv-tabhead p { flex: 1; min-width: 200px; color: var(--text-2); font-size: .84rem; margin: 0; }
.ap-table.hide-changes .ap-col-changes, .ap-table.hide-summary .ap-col-summary, .ap-table.hide-expires .ap-col-expires, .ap-table.hide-password .ap-col-password, .ap-table.hide-via .ap-col-via, .ap-table.hide-country .ap-col-country, .ap-table.hide-device .ap-col-device, .ap-table.hide-actor .ap-col-actor, .ap-table.hide-ip .ap-col-ip { display: none; }
.ap-table .ap-col-ip { font-family: var(--mono); font-size: .76rem; color: var(--text-2); }
.pv-file { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .8rem; }
.pv-file .qq-ic { width: 16px; height: 16px; color: var(--text-2); }
.pv-act { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.pv-act--ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.pv-rename { min-height: 34px; width: 100%; padding: 0 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--surface); font: inherit; color: var(--text); }
.pv-dynqr { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; padding: 14px 16px; }
.pv-dynqr > i { flex: none; width: 76px; padding: 6px; border-radius: 12px; background: #fff; color: #0a0a0a; }
.pv-dynqr > i svg { display: block; width: 100%; height: auto; }
.pv-dynqr b { display: flex; align-items: center; gap: 6px; }
.pv-dynqr b .qq-ic { color: var(--accent); }
.pv-dynqr p { margin: 2px 0 8px; color: var(--text-2); font-size: .84rem; }
.pv-dynqr .pv-copy { flex: 1; min-width: 0; }
.pv-dynqr__act { display: grid; gap: 8px; justify-items: end; }

/* ---------- settings form ---------- */
.pv-setgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pv-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.pv-field--wide { grid-column: 1 / -1; }
.pv-input { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.pv-input:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.pv-input .qq-ic { width: 16px; height: 16px; color: var(--text-2); flex: none; }
.pv-input input, .pv-input textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: var(--text); }
.pv-input textarea { padding: 10px 0; resize: vertical; }
.pv-pre { color: var(--text-2); font-size: .86rem; white-space: nowrap; }
.pv-hint { color: var(--text-2); font-size: .8rem; }
.pv-err { display: flex; align-items: center; gap: 6px; color: #b91c1c; font-size: .82rem; font-weight: 600; }
.pv-err[hidden] { display: none; }
.pv-err .qq-ic { width: 15px; height: 15px; }
.pv-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pv-num { width: 130px; flex: none; }
.pv-num input { width: 100%; }
.pv-dd { position: relative; display: grid; gap: 6px; min-width: 0; }
.pv-dd__btn { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.pv-dd__btn span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-dd__btn .qq-ic { width: 15px; height: 15px; color: var(--text-2); }
.pv-dd__btn[aria-expanded="true"] .qq-ic { transform: rotate(180deg); }
.pv-dd__pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; display: grid; gap: 2px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3); animation: ap-in .18s ease; }
.pv-dd__pop button { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.pv-dd__pop button:hover { background: var(--surface-2); }
.pv-dd__pop button[aria-selected="true"] { font-weight: 700; background: var(--surface-2); }
.pv-date { position: relative; display: grid; gap: 6px; min-width: 0; }
.pv-date__btn { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; color: var(--text); cursor: pointer; }
.pv-date__btn span { flex: 1; text-align: left; }
.pv-date__btn .qq-ic { width: 16px; height: 16px; color: var(--text-2); }
.pv-date__pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; width: 264px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3); animation: ap-in .18s ease; }
.pv-date__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pv-date__head b { font-size: .86rem; }
.pv-date__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pv-date__grid em { font-style: normal; text-align: center; font-size: .68rem; font-weight: 700; color: var(--text-2); padding: 4px 0; }
.pv-date__grid button { min-height: 30px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--text); cursor: pointer; }
.pv-date__grid button:hover { background: var(--surface-2); }
.pv-date__grid button.is-on { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.pv-date__grid button.is-dim { color: var(--text-2); opacity: .45; }
.pv-date__foot { display: flex; justify-content: space-between; margin-top: 8px; }
.pv-date__foot button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.pv-chips__box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 42px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.pv-chips__box:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.pv-chips__box input { flex: 1; min-width: 120px; border: 0; outline: 0; background: none; font: inherit; color: var(--text); }
.pv-chip button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; padding: 0; }
.pv-chip button .qq-ic { width: 11px; height: 11px; }
.pv-utm { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pv-danger { border: 1px solid #f0b4b4; border-radius: 14px; padding: 14px; background: color-mix(in srgb, #dc2626 4%, transparent); }
.pv-danger > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pv-danger b { display: block; }
.pv-danger small { color: var(--text-2); }
.pv-danger > div > div { flex: 1; min-width: 200px; }
.pv-setfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.pv-seg { display: inline-flex; }

/* ---------- modals ---------- */
.pv-modal--wide .tl-modal__box { width: min(880px, 100%); text-align: left; }
.pv-modal--wide .tl-modal__box h2 { text-align: center; }
.pv-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pv-compare__col { display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.pv-compare__col > b { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.pv-compare__col ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--text-2); font-size: .84rem; }
.pv-shot { display: grid; place-items: center; min-height: 150px; border-radius: 10px; background: #fff; color: #0a0a0a; border: 1px solid var(--line); }
.pv-shot .qq-qrsvg { width: 120px; height: 120px; }
.pv-shot--doc { padding: 12px; }
.pv-shot--doc .pv-mini { width: 86px; height: 112px; }
.pv-shot--phone { padding: 10px; }
.pv-shot__phone { width: 110px; padding: 10px 8px; border-radius: 18px; background: var(--ink); }
.pv-shot__phone i { display: block; height: 8px; border-radius: 4px; background: var(--surface-3); margin: 5px 6px; }
.pv-shot__phone i:first-child { width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface-2); }
.pv-expchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-modalform { display: grid; gap: 12px; text-align: left; }
.pv-modalform h2 { text-align: center; }
.pv-folders { display: grid; gap: 4px; text-align: left; }
.pv-folders label { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-weight: 600; }
.pv-folders label:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.pv-folders .qq-ic { width: 17px; height: 17px; color: var(--text-2); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .pv-head { grid-template-columns: auto minmax(0, 1fr); }
  .pv-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .pv-grid { grid-template-columns: 1fr 1fr; }
  .pv-span2 { grid-column: 1 / -1; }
  .pv-tabs { top: 69px; }
}
/* ---------- S12: kit chart hover + ranked countries ---------- */

@media (max-width: 640px) {
  .pv-head { grid-template-columns: 1fr; justify-items: start; }
  .pv-grid { grid-template-columns: 1fr; }
  .pv-setgrid { grid-template-columns: 1fr; }
  .pv-utm { grid-template-columns: 1fr; }
  .pv-compare { grid-template-columns: 1fr; }
  .pv-dynqr { flex-wrap: wrap; }
  .pv-dynqr__act { justify-items: start; }
  .pv-hbargrid { grid-template-columns: 1fr; }
  .ap-table[data-table-id$="-history"] .ap-tr { grid-template-columns: 28px 1fr auto auto !important; }
  .ap-table[data-table-id$="-history"] .ap-col-by, .ap-table[data-table-id$="-history"] .ap-col-time, .ap-table[data-table-id$="-history"] .ap-col-changes, .ap-table[data-table-id$="-history"] .ap-col-summary { display: none; }
  .ap-table[data-table-id$="-shares"] .ap-tr { grid-template-columns: 28px 1fr auto auto !important; }
  .ap-table[data-table-id$="-shares"] .ap-col-created, .ap-table[data-table-id$="-shares"] .ap-col-expires, .ap-table[data-table-id$="-shares"] .ap-col-password, .ap-table[data-table-id$="-shares"] .ap-col-views, .ap-table[data-table-id$="-shares"] .ap-col-downloads { display: none; }
  .ap-table[data-table-id$="-downloads"] .ap-tr { grid-template-columns: 28px 1fr auto auto auto !important; }
  .ap-table[data-table-id$="-downloads"] .ap-col-via, .ap-table[data-table-id$="-downloads"] .ap-col-country, .ap-table[data-table-id$="-downloads"] .ap-col-device { display: none; }
  .ap-table[data-table-id$="-logs"] .ap-tr { grid-template-columns: 28px 1fr auto auto !important; }
  .ap-table[data-table-id$="-logs"] .ap-col-actor, .ap-table[data-table-id$="-logs"] .ap-col-ip, .ap-table[data-table-id$="-logs"] .ap-col-details { display: none; }
}
