/* The person's own pages: profile, notifications and support tickets. Same graphite tokens as style.css. */

/* ---------- Profile ---------- */
.profile-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
/* «Обновить из Telegram» under the name: why it is rarely needed, then the button. */
.profile-refresh { display: grid; justify-items: start; gap: 8px; margin: -6px 0 18px; }
.profile-refresh .field-hint { margin: 0; }
.profile-avatar { width: 64px; height: 64px; flex: none; border: 1px solid var(--line-2); border-radius: 50%; background: var(--panel-3); object-fit: cover; }
.profile-initials { display: inline-flex; align-items: center; justify-content: center; color: var(--text); font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.profile-name { display: grid; gap: 2px; min-width: 0; }
.profile-name strong { font-size: 18px; white-space: normal; overflow-wrap: anywhere; }
.profile-name .muted { font-size: 14px; overflow-wrap: anywhere; }
.profile-sections { display: grid; gap: var(--space-grid); margin-top: var(--space-grid); }
.profile-section > p.muted { margin-bottom: 14px; font-size: 14px; }
.profile-section .section-title { margin-bottom: 8px; }
.profile-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-deep); }
.profile-status p { flex: 1 1 220px; margin: 0; font-size: 14px; line-height: 1.5; }
.profile-status.is-warn { border-color: rgb(228 174 79 / .35); }
.profile-actions { margin-top: 14px; }
.profile-language h3 { margin-bottom: 10px; }
.profile-language .field-hint { margin-top: 8px; }
.language-choice { gap: 8px; }
.language-choice button { flex: 1 1 0; min-width: 0; min-height: 44px; }
.language-choice button.active { border-color: var(--primary); }

.device-list { display: grid; margin: 0; padding: 0; list-style: none; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.device-row:first-child { border-top: 0; }
.device-icon { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text-2); }
.device-main { display: grid; flex: 1; gap: 3px; min-width: 0; }
.device-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.device-main small { overflow-wrap: anywhere; }
.device-row > button { flex: none; }

.links-recover { margin-top: var(--space-section); }
.links-recover p { color: var(--text-2); font-size: 15px; }
.links-recover .note { margin-top: 16px; }

@media (max-width: 540px) {
  .device-row { align-items: flex-start; }
  .device-row > button { min-height: 40px; padding: 0 10px; }
  .profile-actions button { width: 100%; }
}

/* ---------- The bell ---------- */
.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.bell { position: relative; width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border-color: var(--line-2); border-radius: 50%; background: transparent; color: var(--text); }
.bell:hover, .bell.active { background: var(--panel-2); }
.bell .ui-icon { width: 20px; height: 20px; }
.bell-count { min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.bell .bell-count { position: absolute; top: -3px; right: -4px; box-shadow: 0 0 0 2px var(--bg-deep); }
.side-bell { display: none; }
.side-bell .bell-count { margin-left: auto; }
.side-link.active { color: var(--text); }
@media (min-width: 960px) {
  .header-tools .bell { display: none; }
  .side-bell { display: flex; }
  .side-bell + .side-link { margin-top: 0; border-top: 0; }
}

/* ---------- Notifications page ---------- */
.ntf-filters { margin-bottom: var(--space-grid); }
.ntf-list { margin: 0; padding: 0 var(--space-card); list-style: none; }
.ntf-item { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.ntf-item:first-child { border-top: 0; }
.ntf-icon { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text-2); }
.sev-success .ntf-icon { color: var(--ok); }
.sev-warning .ntf-icon { color: var(--warn); }
.sev-critical .ntf-icon { color: var(--danger); }
.ntf-main { display: grid; flex: 1; gap: 4px; min-width: 0; }
.ntf-head { display: flex; align-items: center; gap: 8px; }
.ntf-head strong { font-weight: 550; overflow-wrap: anywhere; }
.is-unread .ntf-head strong { font-weight: 700; }
.ntf-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--primary); }
.ntf-main p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.ntf-actions { display: flex; flex: none; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ntf-item:not(.is-unread) { opacity: .82; }
@media (max-width: 619px) {
  .ntf-item { flex-wrap: wrap; }
  .ntf-actions { width: 100%; padding-left: 48px; justify-content: flex-start; }
  .ntf-actions button { min-height: 40px; }
}

/* ---------- Telegram switches in the profile ---------- */
.ntf-telegram { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ntf-telegram h3 { margin-bottom: 4px; }
.ntf-group { margin: 16px 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.ntf-choices { display: grid; margin: 0; padding: 0; list-style: none; }
.ntf-choice { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ntf-choice:first-child { border-top: 0; }
.ntf-choice > div { display: grid; gap: 2px; min-width: 0; }
.ntf-choice small { font-size: 13px; line-height: 1.45; }
.notice-line { margin: 12px 0 0; padding: 10px 12px; border: 1px solid rgb(228 174 79 / .35); border-radius: var(--radius-sm); background: rgb(228 174 79 / .06); font-size: 14px; }
.switch { position: relative; width: 48px; min-width: 48px; height: 28px; min-height: 28px; flex: none; padding: 0; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-3); }
.switch:hover { background: var(--panel-3); }
.switch .switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform .18s var(--ease), background-color .18s var(--ease); }
.switch[aria-checked="true"] { border-color: var(--primary); background: var(--primary); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); background: var(--primary-ink); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
/* A 44 px touch target around the small switch. */
.switch::after { content: ""; position: absolute; inset: -9px -4px; }

/* ---------- Support tickets ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tkt-list { margin: 0; padding: 0; list-style: none; overflow: hidden; }
.tkt-row + .tkt-row { border-top: 1px solid var(--line); }
.tkt-row-button { width: 100%; min-height: 64px; justify-content: space-between; gap: 14px; padding: 14px var(--space-card); border: 0; border-radius: 0; background: transparent; color: var(--text); font-weight: 500; text-align: left; }
.tkt-row-button:hover { background: var(--panel-2); }
.tkt-row-main { display: grid; gap: 3px; min-width: 0; }
.tkt-row-main strong { font-weight: 550; white-space: normal; overflow-wrap: anywhere; }
.tkt-row.is-unread .tkt-row-main strong { font-weight: 700; }
.tkt-row-main small { font-weight: 400; overflow-wrap: anywhere; }
.tkt-row-side { display: inline-flex; flex: none; align-items: center; gap: 8px; }
/* Every support state is a visibly enclosed badge, including waiting and closed. */
.tkt-status { border: 1px solid var(--line-2); padding: 4px 10px; line-height: 1.4; }
.tkt-status.is-open { background: rgb(228 174 79 / .12); color: var(--warn); }
.tkt-status.is-answered { background: rgb(90 196 143 / .12); color: var(--ok); }
.tkt-status.is-waiting { background: var(--panel-3); color: var(--text); }
.tkt-status.is-closed { color: var(--muted); }
.tkt-chips { margin-bottom: 10px; }
.tkt-back { margin: -8px 0 10px -10px; }
.tkt-back button { min-height: 36px; padding: 0 10px; color: var(--muted); }
.tkt-filter { align-items: stretch; margin-bottom: var(--space-grid); }
.tkt-filter select, .tkt-filter input { flex: 1 1 180px; width: auto; min-height: 44px; }
.tkt-author { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: var(--space-grid); }
.tkt-author p { margin: 2px 0 0; overflow-wrap: anywhere; }
/* «Откуда»: where a ticket comes from — a website's visitor (site, visitor, payments) or an owner (bots, sites). */
.tkt-source.is-site { background: rgb(106 168 255 / .14); color: #9cc2ff; }
.tkt-origin { display: grid; gap: 10px; margin-bottom: var(--space-grid); }
.tkt-origin h2 { margin: 0; font-size: 17px; }
.tkt-origin h3 { margin: 6px 0 0; font-size: 15px; }
.tkt-origin-facts { display: grid; gap: 8px; margin: 0; }
.tkt-origin-facts > div { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 12px; }
.tkt-origin-facts dt { color: var(--muted); }
.tkt-origin-facts dd { margin: 0; overflow-wrap: anywhere; }
.tkt-origin a { text-decoration: underline; text-underline-offset: 3px; }
.tkt-origin-about { margin: 0; padding: 8px 12px; border-radius: 10px; background: rgb(228 174 79 / .1); }
.tkt-origin-pays { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tkt-origin-pays li { overflow-wrap: anywhere; }
.tkt-origin-pays li.is-about { padding: 6px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--warn); }
.tkt-pay.is-paid { background: rgb(90 196 143 / .12); color: var(--ok); }
.tkt-pay.is-pending { background: rgb(228 174 79 / .12); color: var(--warn); }
@media (max-width: 560px) { .tkt-origin-facts > div { grid-template-columns: 1fr; gap: 2px; } }

.tkt-thread { display: grid; gap: 12px; margin: 0 0 var(--space-grid); padding: 0; list-style: none; }
.tkt-msg { display: flex; }
.tkt-msg.is-mine { justify-content: flex-end; }
.tkt-bubble { max-width: min(680px, 88%); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.tkt-msg.is-mine .tkt-bubble { border-color: var(--line-2); background: var(--panel-2); }
.tkt-msg.is-note .tkt-bubble { border-style: dashed; border-color: rgb(228 174 79 / .5); background: rgb(228 174 79 / .05); }
.tkt-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.tkt-meta strong { font-size: 14px; }
.tkt-meta small { color: var(--muted); }
.tkt-text { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tkt-text a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.tkt-pictures { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tkt-pictures a { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.tkt-pictures img { display: block; width: auto; max-width: 220px; height: auto; max-height: 180px; object-fit: cover; background: var(--bg-deep); }
.tkt-event { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.tkt-composer textarea { min-height: 110px; }
.tkt-composer > label:first-child, .tkt-composer > p + label { margin-top: 0; }
.nav-count { min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--warn); color: var(--primary-ink); font-size: 12px; font-weight: 700; line-height: 1; }
@media (max-width: 619px) {
  .tkt-bubble { max-width: 94%; }
  .tkt-row-button { flex-direction: column; align-items: flex-start; }
  .tkt-pictures img { max-width: 140px; max-height: 140px; }
}
