/* ==========================================================================
   SUPPORT & ACCOUNT PAGES — tickets, knowledgebase, announcements, network
   status, notifications, feedback, team, security and KYC.
   Builds on the client portal tokens (--p-*) and dash-* components in portal.css.
   Every class is prefixed "ac-" so it never collides with other pages.
   ========================================================================== */

/* ---------- Page header ---------- */
.ac-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ac-head-main { min-width: 0; flex: 1 1 320px; }
.ac-head .client-page-title { margin: 0; overflow-wrap: anywhere; }
.ac-head .client-page-desc { margin: 4px 0 0; color: var(--p-text-2); }
.ac-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ac-head-actions form { margin: 0; }
.ac-crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--p-text-2); text-decoration: none; }
.ac-crumb a { color: var(--p-text-2); text-decoration: none; }
.ac-crumb a:hover { color: var(--p-primary); }
.ac-crumb span[aria-hidden] { color: var(--p-muted); }
.ac-btn-ico { display: inline-flex; align-items: center; gap: 8px; }
.ac-btn-ico svg { flex: none; }

/* ---------- Layout ---------- */
.ac-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.ac-layout--wide-side { grid-template-columns: minmax(0, 1fr) 380px; }
.ac-layout--narrow-side { grid-template-columns: minmax(0, 1fr) 300px; }
.ac-stack { display: grid; gap: 20px; min-width: 0; align-content: start; }
.ac-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.ac-sticky { position: sticky; top: calc(var(--header-height, 68px) + 16px); }

/* ---------- Cards ---------- */
.ac-card { padding: 20px 22px; }
.ac-card--flush { padding: 0; overflow: hidden; }
.ac-card--flush > .ac-card-head { padding: 18px 22px 0; }
.ac-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ac-card-head > div { min-width: 0; }
.ac-card-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px !important; font-weight: 600 !important; color: var(--p-text) !important; }
.ac-card-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--p-muted); }
.ac-ico { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; }
.ac-ico--sm { width: 32px; height: 32px; border-radius: 9px; }
.ac-ico svg { width: 18px; height: 18px; }
.ac-divider { height: 1px; margin: 16px 0; background: var(--p-border-soft); border: 0; }
.ac-muted { color: var(--p-muted); }
.ac-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .01em; }
.ac-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Badges (extra tones next to dash-badge--*) ---------- */
.ac-badge--violet { background: #ede9fe; color: #6d28d9; }
.ac-badge--dot::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
:root[data-theme="dark"] .ac-badge--violet { background: rgba(139, 92, 246, .16); color: #c4b5fd; }

/* ---------- Alerts ---------- */
.ac-alert { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 16px; border: 1px solid transparent; border-radius: var(--p-radius-sm); font-size: 13.5px; font-weight: 500; line-height: 1.5; }
.ac-alert svg { flex: none; margin-top: 2px; }
.ac-alert--success { background: var(--p-success-soft); border-color: color-mix(in srgb, var(--p-success) 25%, transparent); color: #15803d; }
.ac-alert--danger  { background: var(--p-danger-soft);  border-color: color-mix(in srgb, var(--p-danger) 25%, transparent);  color: var(--p-danger); }
.ac-alert--warning { background: var(--p-warning-soft); border-color: color-mix(in srgb, var(--p-warning) 25%, transparent); color: var(--p-warning); }
.ac-alert--info    { background: var(--p-info-soft);    border-color: color-mix(in srgb, var(--p-info) 25%, transparent);    color: var(--p-info); }
:root[data-theme="dark"] .ac-alert--success { color: #4ade80; }
:root[data-theme="dark"] .ac-alert--warning { color: #fbbf24; }
:root[data-theme="dark"] .ac-alert--danger { color: #f87171; }
:root[data-theme="dark"] .ac-alert--info { color: #93c5fd; }

/* ---------- Stat tiles (dash-stats with a variable column count) ---------- */
.dash-stats.ac-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-stats.ac-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-stats .dash-stat:hover { transform: none; border-color: var(--p-border); }
.ac-stats a.dash-stat:hover { transform: translateY(-2px); border-color: var(--p-primary); }
.ac-stat-sub { margin-top: 6px; font-size: 12px; color: var(--p-muted); }

/* ---------- Tabs + toolbar ---------- */
.ac-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--p-border-soft); }
.ac-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border: 1px solid var(--p-border); border-radius: 999px;
    background: var(--p-card); color: var(--p-text-2);
    font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.ac-tab:hover { border-color: var(--p-primary); color: var(--p-primary); }
.ac-tab.is-active { background: var(--p-primary); border-color: var(--p-primary); color: #fff; }
.ac-tab-count { min-width: 20px; padding: 0 7px; border-radius: 999px; background: var(--p-border-soft); color: var(--p-text-2); font-size: 11.5px; line-height: 18px; text-align: center; }
.ac-tab.is-active .ac-tab-count { background: rgba(255, 255, 255, .22); color: #fff; }
.ac-search { position: relative; display: flex; align-items: center; flex: 0 1 280px; min-width: 0; }
.ac-search > svg { position: absolute; left: 12px; color: var(--p-muted); pointer-events: none; }
.ac-search input {
    width: 100%; height: 38px; padding: 0 12px 0 36px;
    border: 1px solid var(--p-border); border-radius: 10px;
    background: var(--p-bg); color: var(--p-text); font: inherit; font-size: 13.5px;
}
.ac-search input:focus { outline: none; border-color: var(--p-primary); background: var(--p-card); box-shadow: 0 0 0 3px var(--p-primary-soft); }

/* ---------- Tables inside cards ---------- */
.ac-table-wrap { overflow-x: auto; }
.ac-table-wrap .client-table th, .ac-table-wrap .client-table td { padding-left: 12px !important; padding-right: 12px !important; }
.ac-table-wrap .client-table th:first-child, .ac-table-wrap .client-table td:first-child { padding-left: 22px !important; }
.ac-table-wrap .client-table th:last-child, .ac-table-wrap .client-table td:last-child { padding-right: 22px !important; }
.ac-table-wrap .client-table th { background: var(--p-bg) !important; color: var(--p-muted) !important; border-bottom-color: var(--p-border-soft) !important; }
.ac-table-wrap .client-table td { border-bottom-color: var(--p-border-soft) !important; color: var(--p-text-2); }
.ac-table-wrap .client-table tbody tr:hover td { background: color-mix(in srgb, var(--p-primary) 4%, transparent) !important; }
.ac-cell-title { display: block; font-weight: 600; color: var(--p-text); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
a.ac-cell-title { color: var(--p-text) !important; text-decoration: none; }
a.ac-cell-title:hover { color: var(--p-primary) !important; }
.ac-cell-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--p-muted); }
.ac-table-wrap td.ac-time, .ac-time { white-space: nowrap !important; font-size: 12.5px; color: var(--p-text-2); }
.ac-time small { display: block; font-size: 11.5px; color: var(--p-muted); }
.ac-right { text-align: right !important; }

/* ---------- Empty states ---------- */
.ac-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; color: var(--p-text-2); font-size: 13.5px; }
.ac-empty-ico { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 16px; background: var(--p-primary-soft); color: var(--p-primary); }
.ac-empty-ico svg { width: 26px; height: 26px; }
.ac-empty strong { font-size: 15px; color: var(--p-text); }
.ac-empty p { margin: 0; max-width: 420px; }
.ac-empty .btn { margin-top: 10px; }

/* ---------- Forms ---------- */
.ac-form { display: grid; gap: 18px; margin: 0; }
.ac-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ac-field { min-width: 0; margin: 0; }
.ac-label { display: block; margin: 0 0 7px; font-size: 13.5px; font-weight: 600; color: var(--p-text); }
.ac-label em { font-style: normal; font-weight: 400; color: var(--p-muted); font-size: 12.5px; }
.ac-req { color: var(--p-danger); }
.ac-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--p-muted); }
.ac-form .form-control { min-height: 44px; border-radius: 10px !important; }
.ac-form textarea.form-control { min-height: 140px !important; line-height: 1.55; }
.ac-form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.ac-form-actions .ac-actions-end { display: flex; gap: 10px; margin-left: auto; }
.ac-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.ac-fieldset > legend { padding: 0; }

/* Selectable cards (radio / checkbox) */
.ac-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ac-choices--wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ac-choices--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ac-choice {
    position: relative; display: flex; align-items: flex-start; gap: 11px;
    margin: 0; padding: 13px 34px 13px 13px;
    border: 1.5px solid var(--p-border); border-radius: 12px;
    background: var(--p-card); cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.ac-choice > input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ac-choice:hover { border-color: color-mix(in srgb, var(--p-primary) 45%, var(--p-border)); }
.ac-choice-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--p-border-soft); color: var(--p-text-2); transition: background .15s, color .15s; }
.ac-choice-ico svg { width: 18px; height: 18px; }
.ac-choice-text { min-width: 0; }
.ac-choice-text strong { display: block; font-size: 14px; font-weight: 600; color: var(--p-text); line-height: 1.3; }
.ac-choice-text small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--p-text-2); }
.ac-choice::after {
    content: ""; position: absolute; right: 11px; top: 11px;
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid var(--p-border); background: var(--p-card);
}
.ac-choice:has(input[type="checkbox"])::after { border-radius: 6px; }
.ac-choice:has(input:checked) { border-color: var(--p-primary); background: color-mix(in srgb, var(--p-primary) 4%, var(--p-card)); box-shadow: 0 0 0 3px var(--p-primary-soft); }
.ac-choice:has(input:checked) .ac-choice-ico { background: var(--p-primary); color: #fff; }
.ac-choice:has(input:checked)::after {
    border-color: var(--p-primary);
    background: var(--p-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.ac-choice:has(input:focus-visible) { outline: 2px solid var(--p-primary); outline-offset: 2px; }
.ac-choice--compact { align-items: center; padding: 11px 34px 11px 12px; }
.ac-choice--compact::after { top: 50%; transform: translateY(-50%); }

/* Priority segmented control */
.ac-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ac-seg label {
    position: relative; display: flex; flex-direction: column; gap: 2px;
    margin: 0; padding: 10px 12px; border: 1.5px solid var(--p-border); border-radius: 10px;
    background: var(--p-card); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.ac-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ac-seg strong { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--p-text); }
.ac-seg strong::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--p-muted)); }
.ac-seg small { font-size: 11.5px; line-height: 1.35; color: var(--p-muted); }
.ac-seg label:hover { border-color: color-mix(in srgb, var(--p-primary) 45%, var(--p-border)); }
.ac-seg label:has(input:checked) { border-color: var(--dot, var(--p-primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--p-primary)) 16%, transparent); }
.ac-seg label:has(input:focus-visible) { outline: 2px solid var(--p-primary); outline-offset: 2px; }
.ac-dot-low { --dot: #64748b; } .ac-dot-medium { --dot: #2563eb; } .ac-dot-high { --dot: #d97706; } .ac-dot-critical { --dot: #dc2626; }

/* Message box with a toolbar-style footer */
.ac-editor { border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-card); transition: border-color .15s, box-shadow .15s; }
.ac-editor:focus-within { border-color: var(--p-primary); box-shadow: 0 0 0 3px var(--p-primary-soft); }
.ac-form .ac-editor textarea.form-control,
.ac-editor textarea.form-control { display: block; width: 100%; border: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 12px 12px 0 0 !important; padding: 14px 16px !important; resize: vertical; }
.ac-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--p-border-soft); border-radius: 0 0 12px 12px; background: var(--p-bg); font-size: 12px; color: var(--p-muted); }
.ac-editor-foot span { display: inline-flex; align-items: center; gap: 6px; }
.ac-count.is-near { color: var(--p-warning); }
.ac-count.is-over { color: var(--p-danger); font-weight: 600; }

/* File drop zone */
.ac-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 28px 18px; border: 2px dashed var(--p-border); border-radius: 14px;
    background: var(--p-bg); text-align: center; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.ac-drop:hover, .ac-drop.is-over { border-color: var(--p-primary); background: var(--p-primary-soft); }
.ac-drop.has-file { border-style: solid; border-color: var(--p-success); background: var(--p-success-soft); }
.ac-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ac-drop-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--p-card); color: var(--p-primary); box-shadow: var(--p-shadow); }
.ac-drop strong { font-size: 14px; color: var(--p-text); }
.ac-drop strong u { color: var(--p-primary); text-decoration: none; }
.ac-drop small { font-size: 12px; color: var(--p-muted); }
.ac-drop-file { font-size: 12.5px; font-weight: 600; color: #15803d; overflow-wrap: anywhere; }
.ac-drop-file:empty { display: none; }
:root[data-theme="dark"] .ac-drop-file { color: #4ade80; }

/* Key / value list */
.ac-kv { margin: 0; display: grid; }
.ac-kv > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--p-border-soft); font-size: 13px; }
.ac-kv > div:first-child { border-top: 0; padding-top: 0; }
.ac-kv dt { color: var(--p-muted); font-weight: 500; white-space: nowrap; }
.ac-kv dd { margin: 0; min-width: 0; text-align: right; font-weight: 600; color: var(--p-text); overflow-wrap: anywhere; }

/* Tips list */
.ac-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ac-tips li { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--p-text-2); }
.ac-tips li svg { flex: none; margin-top: 2px; color: var(--p-success); }

/* ==========================================================================
   TICKETS
   ========================================================================== */
.ac-tk-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 700; color: var(--p-primary) !important; text-decoration: none; white-space: nowrap; }
.ac-tk-dept { display: inline-flex; white-space: normal; min-width: 110px; align-items: center; gap: 6px; font-size: 12.5px; color: var(--p-text-2); white-space: nowrap; }
.ac-tk-dept svg { color: var(--p-muted); }
.ac-tk-row[hidden] { display: none !important; }
.ac-tk-table { table-layout: fixed; min-width: 640px; }
.ac-tk-table th:nth-child(1) { width: 112px; }
.ac-tk-table th:nth-child(3) { width: 19%; }
.ac-tk-table th:nth-child(4) { width: 150px; }
.ac-tk-table th:nth-child(5) { width: 104px; }
.ac-tk-table th:nth-child(6) { width: 84px; }
.ac-tk-table td { overflow: hidden; }
.ac-tk-subject .ac-cell-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-tk-meta { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-tk-table .dash-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ac-tk-table th:last-child, .ac-tk-table td:last-child { position: sticky; right: 0; background: var(--p-card) !important; }
.ac-tk-table tbody tr:hover td:last-child { background: color-mix(in srgb, var(--p-primary) 4%, var(--p-card)) !important; }
.ac-tk-noresults { display: none; }
.ac-tk-noresults.is-shown { display: flex; }

/* Search + per-page bar, pager, manager card, quick tips */
.ac-filterbar { display: flex; gap: 12px; align-items: stretch; }
.ac-search--lg { flex: 1 1 auto; }
.ac-search--lg input { height: 44px; background: var(--p-card); font-size: 14px; }
.ac-perpage.form-control { flex: 0 0 140px; width: 140px; min-height: 44px; border-radius: 10px !important; background-color: var(--p-card) !important; }
.ac-pagebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--p-border-soft); font-size: 12.5px; }
.ac-pagebar[hidden] { display: none; }
.ac-pagebar-btns { display: flex; gap: 6px; }
.ac-empty-row td { padding: 0 !important; }
.ac-empty-row:hover td { background: transparent !important; }
.ac-eyebrow { margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--p-border-soft); font-size: 11.5px !important; font-weight: 700 !important; letter-spacing: .08em; text-transform: uppercase; color: var(--p-muted) !important; }
.ac-mgr { display: flex; align-items: center; gap: 12px; }
.ac-mgr .ac-avatar { width: 44px; height: 44px; font-size: 14px; background: linear-gradient(145deg, var(--p-primary), #7c5cff); }
.ac-mgr-main { min-width: 0; }
.ac-mgr-main strong { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--p-text); }
.ac-mgr-main small { display: block; font-size: 12px; color: var(--p-muted); }
.ac-verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #7c3aed; color: #fff; }
.ac-mgr-mail { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--p-border-soft); font-size: 13px; font-weight: 500; color: var(--p-primary); text-decoration: none; overflow-wrap: anywhere; }
.ac-mgr-mail svg { flex: none; color: var(--p-muted); }
.ac-tips--icons li { align-items: flex-start; }
.ac-tips--icons strong { color: var(--p-text); font-weight: 600; }
.ac-tip-ico { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; }
.ac-tips li .ac-tip-ico svg { margin: 0; color: currentColor; }
.ac-tip-ico.is-blue { background: var(--p-info-soft); color: var(--p-info); }
.ac-tip-ico.is-green { background: var(--p-success-soft); color: var(--p-success); }
.ac-tip-ico.is-muted { background: var(--p-border-soft); color: var(--p-text-2); }
.ac-toolbar .ac-card-title { margin-right: auto; }

/* Conversation */
/* Helpdesk Ticket Thread */
.ac-chat { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.ac-chat-day { display: flex; align-items: center; gap: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--p-muted); margin: 4px 0; }
.ac-chat-day::before, .ac-chat-day::after { content: ""; flex: 1; height: 1px; background: var(--p-border-soft); }

.ac-msg {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    border: 1px solid var(--p-border);
    border-radius: 12px;
    background: var(--p-card);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.ac-msg--staff {
    border-left: 4px solid var(--p-primary);
}
.ac-msg--me {
    border-left: 4px solid #10b981;
}
.ac-msg--ai {
    border-left: 4px solid #8b5cf6;
}

.ac-msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
    background: var(--p-bg);
    border-bottom: 1px solid var(--p-border-soft);
}
.ac-msg-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ac-avatar {
    display: grid; place-items: center; flex: none; overflow: hidden;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--p-primary-soft); color: var(--p-primary);
    font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.ac-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.ac-avatar--me { background: #ecfdf5; color: #047857; }
.ac-avatar--ai { background: #ede9fe; color: #6d28d9; }
:root[data-theme="dark"] .ac-avatar--me { background: rgba(16, 185, 129, 0.2); color: #34d399; }
:root[data-theme="dark"] .ac-avatar--ai { background: rgba(139, 92, 246, .18); color: #c4b5fd; }

.ac-msg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-msg-meta strong { font-size: 13.5px; color: var(--p-text); font-weight: 600; }
.ac-msg-time { font-size: 12px; color: var(--p-muted); }

.ac-msg-body {
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--p-text);
}
.ac-msg-bubble {
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    color: var(--p-text) !important;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.ac-msg--me .ac-msg-bubble {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--p-text) !important;
}
.ac-msg--ai .ac-msg-bubble {
    background: transparent !important;
    border-color: transparent !important;
}
.ac-attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ac-msg--me .ac-attach-list { justify-content: flex-end; }
.ac-attach { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 5px 10px; border: 1px solid var(--p-border); border-radius: 999px; background: var(--p-card); color: var(--p-text); font-size: 12.5px; text-decoration: none; }
.ac-attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-attach small { color: var(--p-muted); flex: none; }
.ac-attach:hover { border-color: var(--p-primary); color: var(--p-primary); }
.ac-attach-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--p-primary); font-weight: 600; max-width: 220px; }
.ac-attach-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-attach-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ac-attach-pick:focus-within { outline: 2px solid var(--p-primary); outline-offset: 2px; border-radius: 6px; }
.ac-composer { padding: 18px 22px 20px; border-top: 1px solid var(--p-border); background: var(--p-card); }
.ac-composer-title { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--p-text); }
.ac-composer .ac-editor textarea.form-control { min-height: 110px !important; }
.ac-closed-note { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 22px; border-top: 1px solid var(--p-border); background: var(--p-bg); font-size: 13.5px; color: var(--p-text-2); }
.ac-closed-note form { margin: 0; }
.ac-side-actions { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--p-border-soft); }
.ac-side-actions form { margin: 0; }
.ac-side-actions .btn { width: 100%; justify-content: center; }
.ac-btn-danger-soft { color: var(--p-danger) !important; }
.ac-btn-danger-soft:hover { border-color: var(--p-danger) !important; background: var(--p-danger-soft) !important; }
.ac-related { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--p-bg); border: 1px solid var(--p-border-soft); font-size: 12.5px; color: var(--p-text-2); overflow-wrap: anywhere; }
.ac-related svg { flex: none; margin-top: 1px; color: var(--p-primary); }

/* ==========================================================================
   KNOWLEDGE BASE
   ========================================================================== */
.ac-hero {
    position: relative; overflow: hidden;
    margin-bottom: 22px; padding: 34px 32px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4361ee 0%, #6d4fe0 100%);
    color: #fff;
}
.ac-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.ac-hero h1 { margin: 0; font-size: 26px; font-weight: 700; color: #fff !important; }
.ac-hero p { margin: 6px 0 18px; font-size: 14px; color: rgba(255, 255, 255, .85); }
.ac-hero-search { position: relative; z-index: 1; display: flex; gap: 8px; max-width: 620px; margin: 0; padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .18); }
.ac-hero-search > svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.ac-hero-search input { flex: 1; min-width: 0; height: 46px; padding: 0 12px 0 42px; border: 0; outline: 0; background: transparent; color: #0f172a; font: inherit; font-size: 15px; }
.ac-hero-search .btn { min-height: 46px; padding: 0 22px; border-radius: 10px !important; }
:root[data-theme="dark"] .ac-hero { background: linear-gradient(135deg, #2c3fa8 0%, #4a2f9e 100%); }
:root[data-theme="dark"] .ac-hero-search { background: var(--p-card); }
:root[data-theme="dark"] .ac-hero-search input { color: var(--p-text); }
.ac-hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 12.5px; color: rgba(255, 255, 255, .85); }

.ac-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ac-cat {
    display: flex; flex-direction: column; gap: 8px; padding: 16px;
    border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-card);
    color: var(--p-text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ac-cat:hover { border-color: var(--p-primary); transform: translateY(-2px); box-shadow: var(--p-shadow); color: var(--p-text); }
.ac-cat.is-active { border-color: var(--p-primary); box-shadow: 0 0 0 3px var(--p-primary-soft); }
.ac-cat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ac-cat strong { font-size: 14.5px; font-weight: 600; }
.ac-cat p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--p-text-2); }
.ac-cat-count { font-size: 12px; font-weight: 600; color: var(--p-muted); }

.ac-article-list { list-style: none; margin: 0; padding: 0; }
.ac-article-list li + li { border-top: 1px solid var(--p-border-soft); }
.ac-article-link { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; color: var(--p-text); text-decoration: none; }
.ac-article-link:hover .ac-article-title { color: var(--p-primary); }
.ac-article-link > svg { flex: none; margin-top: 3px; color: var(--p-muted); }
.ac-article-main { flex: 1; min-width: 0; }
.ac-article-title { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.ac-article-ex { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--p-text-2); }
.ac-article-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 11.5px; color: var(--p-muted); }
.ac-article-meta span { display: inline-flex; align-items: center; gap: 4px; }

.ac-prose { max-width: 760px; font-size: 15.5px; line-height: 1.75; color: var(--p-text-2); overflow-wrap: anywhere; }
.ac-prose > :first-child { margin-top: 0; }
.ac-prose p { margin: 0 0 16px; }
.ac-prose h3 { margin: 28px 0 10px; font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--p-text); }
.ac-prose ul { margin: 0 0 16px; padding-left: 22px; }
.ac-prose li { margin: 6px 0; }
.ac-prose li::marker { color: var(--p-primary); }
.ac-prose a { color: var(--p-primary); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.ac-prose code { padding: 2px 6px; border-radius: 6px; background: var(--p-border-soft); color: var(--p-text); font-size: .88em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ac-article-card { padding: 32px 36px; }
.ac-article-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--p-border-soft); }
.ac-article-head h1 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.25; color: var(--p-text) !important; overflow-wrap: anywhere; }
.ac-help-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.ac-help-cta p { margin: 2px 0 0; font-size: 13px; color: var(--p-text-2); }
.ac-link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ac-link-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 0 -10px; border-radius: 8px; color: var(--p-text); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.ac-link-list a:hover { background: var(--p-bg); color: var(--p-primary); }
.ac-link-list svg { flex: none; color: var(--p-muted); }

/* ==========================================================================
   ANNOUNCEMENTS (restyles the shared .news-card markup only inside .ac-news)
   ========================================================================== */
.ac-news .news-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.ac-news .news-card { background: var(--p-card) !important; border: 1px solid var(--p-border) !important; border-radius: var(--p-radius) !important; box-shadow: var(--p-shadow) !important; }
.ac-news .news-card:hover { border-color: color-mix(in srgb, var(--p-primary) 40%, var(--p-border)) !important; }
.ac-news .news-media { aspect-ratio: 16 / 8; background: var(--p-border-soft); }
.ac-news .news-body { padding: 18px 20px 20px; gap: 8px; }
.ac-news .news-date { display: inline-flex; align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--p-primary-soft); color: var(--p-primary); font-size: 11.5px; font-weight: 600; }
.ac-news .news-title { font-size: 17px !important; font-weight: 700 !important; line-height: 1.4; }
.ac-news .news-title a { color: var(--p-text) !important; }
.ac-news .news-title a:hover { color: var(--p-primary) !important; }
.ac-news .news-excerpt { margin: 0; flex: 1; font-size: 13.5px; line-height: 1.6; color: var(--p-text-2); }
.ac-news .news-more { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--p-primary); text-decoration: none; }
.ac-news .news-card:not(.has-image) .news-body { border-top: 3px solid var(--p-primary); }
.ac-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; }
.ac-ann-hero { display: block; width: 100%; max-height: 420px; object-fit: cover; margin: 0 0 26px; border-radius: 12px; }
.ac-ann-date { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 11px; border-radius: 999px; background: var(--p-primary-soft); color: var(--p-primary); font-size: 12px; font-weight: 600; }

/* ==========================================================================
   NETWORK STATUS
   ========================================================================== */
.ac-status-banner { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 20px 22px; border-radius: 14px; border: 1px solid; }
.ac-status-banner h2 { margin: 0; font-size: 18px !important; font-weight: 700 !important; color: inherit !important; }
.ac-status-banner p { margin: 3px 0 0; font-size: 13px; opacity: .9; }
.ac-status-banner .ac-pulse { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ac-status-banner .ac-pulse svg { width: 22px; height: 22px; }
.ac-status-banner--ok { background: var(--p-success-soft); border-color: color-mix(in srgb, var(--p-success) 30%, transparent); color: #166534; }
.ac-status-banner--ok .ac-pulse { background: var(--p-success); box-shadow: 0 0 0 6px color-mix(in srgb, var(--p-success) 18%, transparent); }
.ac-status-banner--warn { background: var(--p-warning-soft); border-color: color-mix(in srgb, var(--p-warning) 30%, transparent); color: #92400e; }
.ac-status-banner--warn .ac-pulse { background: #d97706; box-shadow: 0 0 0 6px rgba(217, 119, 6, .18); }
.ac-status-banner--down { background: var(--p-danger-soft); border-color: color-mix(in srgb, var(--p-danger) 30%, transparent); color: #991b1b; }
.ac-status-banner--down .ac-pulse { background: var(--p-danger); box-shadow: 0 0 0 6px color-mix(in srgb, var(--p-danger) 18%, transparent); }
:root[data-theme="dark"] .ac-status-banner--ok { color: #86efac; }
:root[data-theme="dark"] .ac-status-banner--warn { color: #fcd34d; }
:root[data-theme="dark"] .ac-status-banner--down { color: #fca5a5; }
.ac-status-time { margin-left: auto; font-size: 12px; opacity: .8; white-space: nowrap; }

.ac-svc-list { list-style: none; margin: 0; padding: 0; }
.ac-svc { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--p-border-soft); }
.ac-svc:first-child { border-top: 0; padding-top: 2px; }
.ac-svc-main { flex: 1; min-width: 0; }
.ac-svc-main strong { display: block; font-size: 14px; font-weight: 600; color: var(--p-text); overflow-wrap: anywhere; }
.ac-svc-main small { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--p-muted); }
.ac-svc-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--p-success); box-shadow: 0 0 0 4px var(--p-success-soft); }
.ac-svc-dot.is-warn { background: #d97706; box-shadow: 0 0 0 4px var(--p-warning-soft); }
.ac-svc-dot.is-down { background: var(--p-danger); box-shadow: 0 0 0 4px var(--p-danger-soft); }

.ac-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.ac-timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--p-border-soft); }
.ac-tl-item { position: relative; display: flex; gap: 14px; padding: 0 0 22px; }
.ac-tl-item:last-child { padding-bottom: 0; }
.ac-tl-dot { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--p-card); border: 2px solid var(--p-border); color: var(--p-muted); }
.ac-tl-dot svg { width: 15px; height: 15px; }
.ac-tl-dot.is-ok { border-color: var(--p-success); color: var(--p-success); }
.ac-tl-dot.is-warn { border-color: #d97706; color: #d97706; }
.ac-tl-dot.is-down { border-color: var(--p-danger); color: var(--p-danger); }
.ac-tl-dot.is-info { border-color: var(--p-info); color: var(--p-info); }
.ac-tl-body { flex: 1; min-width: 0; padding-top: 4px; }
.ac-tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ac-tl-head h3 { margin: 0; font-size: 15px !important; font-weight: 600 !important; color: var(--p-text) !important; overflow-wrap: anywhere; }
.ac-tl-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 12px; color: var(--p-muted); }
.ac-tl-meta strong { color: var(--p-text-2); font-weight: 600; }
.ac-tl-desc { margin-top: 8px; font-size: 13.5px; line-height: 1.6; color: var(--p-text-2); }
.ac-tl-desc p { margin: 0 0 8px; }
.ac-tl-desc ul { margin: 0 0 8px; padding-left: 18px; }
.ac-tl-desc h3 { margin: 10px 0 6px; font-size: 14px; color: var(--p-text); }

/* ==========================================================================
   NOTIFICATIONS
   ========================================================================== */
.ac-title-ico { display: flex; align-items: center; gap: 10px; }
.ac-title-ico svg { flex: none; color: var(--p-primary); }
.ac-notif-wrap { max-width: 900px; margin: 0 auto; }
.ac-notif-group + .ac-notif-group { margin-top: 22px; }
.ac-notif-day { margin: 0 0 10px; font-size: 11.5px !important; font-weight: 700 !important; letter-spacing: .07em; text-transform: uppercase; color: var(--p-muted) !important; }
.ac-notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ac-notif { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; background: var(--p-card); border: 1px solid var(--p-border); border-radius: var(--p-radius); box-shadow: var(--p-shadow); }
.ac-notif.is-unread { border-color: color-mix(in srgb, var(--p-primary) 55%, var(--p-border)); background: color-mix(in srgb, var(--p-primary) 4%, var(--p-card)); }
.ac-notif-main { flex: 1; min-width: 0; }
.ac-notif-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-notif-title { font-size: 14.5px; font-weight: 600; color: var(--p-text) !important; text-decoration: none; overflow-wrap: anywhere; }
a.ac-notif-title:hover { color: var(--p-primary) !important; }
.ac-src { display: inline-flex; padding: 2px 8px; border: 1px solid var(--p-border); border-radius: 6px; background: var(--p-bg); color: var(--p-text-2); font-size: 11px; font-weight: 600; }
.ac-notif-body { margin: 5px 0 0; font-size: 13px; line-height: 1.55; color: var(--p-text-2); overflow-wrap: anywhere; }
.ac-notif-time { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; color: var(--p-muted); }
.ac-notif-thumb { flex: none; width: 84px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--p-border); }
.ac-notif-view { flex: none; }
.ac-new { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--p-primary); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }

/* ==========================================================================
   FEEDBACK
   ========================================================================== */
.ac-review-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; padding: 20px 22px; border-radius: 14px; background: linear-gradient(135deg, #4361ee 0%, #7c3aed 100%); color: #fff; }
.ac-review-cta-ico { display: grid; place-items: center; flex: none; width: 50px; height: 50px; border-radius: 14px; background: rgba(255, 255, 255, .18); color: #fde047; }
.ac-review-cta-text { flex: 1; min-width: 200px; }
.ac-review-cta h2 { margin: 0; font-size: 18px !important; font-weight: 700 !important; color: #fff !important; }
.ac-review-cta p { margin: 3px 0 0; font-size: 13px; color: rgba(255, 255, 255, .88); }
.ac-review-cta-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-btn-on-dark { background: #fff !important; border-color: #fff !important; color: #4361ee !important; font-weight: 700; }
.ac-btn-on-dark:hover { background: rgba(255, 255, 255, .9) !important; }
.ac-btn-ghost-dark { background: rgba(255, 255, 255, .14) !important; border: 1px solid rgba(255, 255, 255, .35) !important; color: #fff !important; }
.ac-btn-ghost-dark:hover { background: rgba(255, 255, 255, .22) !important; }
.ac-idea-list, .ac-bug-list { list-style: none; margin: 0; padding: 0; }
.ac-idea { display: flex; align-items: flex-start; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--p-border-soft); }
.ac-idea:first-child { border-top: 0; }
.ac-vote { margin: 0; }
.ac-vote button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    width: 52px; height: 56px; padding: 0; border: 1.5px solid var(--p-border); border-radius: 12px;
    background: var(--p-card); color: var(--p-text-2); cursor: pointer; font: inherit;
    transition: border-color .15s, color .15s, background .15s;
}
.ac-vote button:hover { border-color: var(--p-primary); color: var(--p-primary); background: var(--p-primary-soft); }
.ac-vote button svg { width: 16px; height: 16px; }
.ac-vote strong { font-size: 15px; font-weight: 700; line-height: 1.1; }
.ac-idea-main { flex: 1; min-width: 0; }
.ac-idea-main h3 { margin: 0; font-size: 14.5px !important; font-weight: 600 !important; color: var(--p-text) !important; overflow-wrap: anywhere; }
.ac-idea-main p { margin: 4px 0 8px; font-size: 13px; line-height: 1.55; color: var(--p-text-2); overflow-wrap: anywhere; }
.ac-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-bug { padding: 16px 22px; border-top: 1px solid var(--p-border-soft); }
.ac-bug:first-child { border-top: 0; }
.ac-bug-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ac-bug-head strong { font-size: 14px; font-weight: 600; color: var(--p-text); overflow-wrap: anywhere; }
.ac-bug p { margin: 4px 0 8px; font-size: 13px; line-height: 1.55; color: var(--p-text-2); overflow-wrap: anywhere; }
.ac-bug-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--p-muted); }
.ac-bug-meta strong { color: var(--p-text-2); font-weight: 600; }
.ac-steps { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.ac-steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--p-border); }
.ac-steps span.is-on { background: var(--p-primary); }
.ac-steps.is-done span { background: var(--p-success); }

/* Feedback page's own dialogs (modal-overlay / modal-box from core.js) */
.ac-modal .modal-box { border-radius: 16px !important; background: var(--p-card) !important; border: 1px solid var(--p-border) !important; }
.ac-modal .modal-header { padding-bottom: 12px; border-bottom: 1px solid var(--p-border-soft); }
.ac-modal .modal-title { font-size: 18px; font-weight: 700; color: var(--p-text); }
.ac-modal .ac-form { margin-top: 16px; }

/* ==========================================================================
   TEAM
   ========================================================================== */
.ac-member { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.ac-member .ac-avatar { background: var(--p-primary-soft); color: var(--p-primary); }
.ac-chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 360px; }
.ac-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--p-border); border-radius: 7px; background: var(--p-bg); color: var(--p-text-2); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.ac-chip svg { width: 12px; height: 12px; color: var(--p-primary); }
.ac-role { font-size: 13px; font-weight: 500; color: var(--p-text); }
.ac-invite-card { scroll-margin-top: calc(var(--header-height, 68px) + 16px); }
.ac-invite-card.is-flash { box-shadow: 0 0 0 3px var(--p-primary-soft), var(--p-shadow) !important; border-color: var(--p-primary) !important; }
.ac-perm-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }

.ac-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; padding: 24px 26px; border: 1px solid color-mix(in srgb, var(--p-primary) 18%, var(--p-border)); border-radius: 16px; background: linear-gradient(135deg, var(--p-primary-soft), var(--p-card) 75%); }
.ac-banner-main { min-width: 0; flex: 1 1 320px; }
.ac-banner .client-page-title { margin: 8px 0 0; }
.ac-banner .client-page-desc { margin: 4px 0 0; color: var(--p-text-2); }
.ac-eyebrow-pill { display: inline-flex; padding: 3px 10px; border-radius: 6px; background: color-mix(in srgb, var(--p-primary) 14%, transparent); color: var(--p-primary); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ac-settings-row { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 28px; }
.ac-settings-intro .ac-card-sub { margin-top: 8px; }
@media (max-width: 960px) { .ac-settings-row { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* ==========================================================================
   SECURITY
   ========================================================================== */
.ac-sec-score { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 18px 22px; }
.ac-sec-score-main { flex: 1; min-width: 0; }
.ac-sec-score h2 { margin: 0; font-size: 16px !important; font-weight: 600 !important; color: var(--p-text) !important; }
.ac-sec-score p { margin: 3px 0 0; font-size: 13px; color: var(--p-text-2); }
.ac-sec-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ac-check.is-ok { background: var(--p-success-soft); color: #15803d; }
.ac-check.is-off { background: var(--p-warning-soft); color: var(--p-warning); }
:root[data-theme="dark"] .ac-check.is-ok { color: #4ade80; }
.ac-strength { display: flex; gap: 4px; height: 5px; margin-top: 8px; }
.ac-strength span { flex: 1; border-radius: 99px; background: var(--p-border); transition: background .2s; }
.ac-strength-label { display: block; margin-top: 6px; font-size: 12px; color: var(--p-muted); }
.ac-setting { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-top: 1px solid var(--p-border-soft); }
.ac-setting:first-child { border-top: 0; padding-top: 0; }
.ac-setting-main { flex: 1; min-width: 0; }
.ac-setting-main strong { display: block; font-size: 14px; font-weight: 600; color: var(--p-text); }
.ac-setting-main p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--p-text-2); }
.ac-setting-side { flex: none; display: flex; align-items: center; gap: 8px; }
.ac-setting-side form { margin: 0; }
.ac-totp { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 14px; padding: 18px; border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-bg); }
.ac-qr { display: grid; place-items: center; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--p-border); }
.ac-qr svg { display: block; width: 168px; height: 168px; }
.ac-totp-steps { display: grid; gap: 12px; min-width: 0; font-size: 13px; color: var(--p-text-2); }
.ac-totp-steps p { margin: 0; }
.ac-totp-key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed color-mix(in srgb, var(--p-primary) 40%, var(--p-border)); border-radius: 10px; background: var(--p-card); }
.ac-totp-key code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14.5px; font-weight: 700; letter-spacing: .08em; color: var(--p-text); word-break: break-all; }
.ac-copy-btn { border: 0; background: none; color: var(--p-primary); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ac-copy-btn.is-copied { color: var(--p-success); }
.ac-otp-input { max-width: 190px; letter-spacing: .32em; font-weight: 700; font-size: 17px !important; text-align: center; }
.ac-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.ac-details summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--p-text-2); list-style: none; }
.ac-details summary::-webkit-details-marker { display: none; }
.ac-details summary::after { content: "›"; font-size: 16px; transition: transform .15s; }
.ac-details[open] summary::after { transform: rotate(90deg); }
.ac-details-body { margin-top: 12px; padding: 16px; border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-bg); }
.ac-device { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.ac-device .ac-ico { background: var(--p-border-soft); color: var(--p-text-2); }
.ac-device.is-current .ac-ico { background: var(--p-success-soft); color: var(--p-success); }
.ac-device-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--p-text); }
.ac-device-ua { display: block; max-width: 380px; font-size: 11.5px; color: var(--p-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-ip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--p-text-2); }

/* Security page layout */
.ac-sec-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; }
.ac-sec-split-side { display: grid; gap: 16px; align-content: start; padding-left: 28px; border-left: 1px solid var(--p-border-soft); }
.ac-input { position: relative; }
.ac-input > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--p-muted); pointer-events: none; z-index: 1; }
.ac-form .ac-input > .form-control { padding-inline-start: 40px; }
.ac-form .ac-input--tools > .form-control { padding-inline-end: 140px; }
.ac-input-tools { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 4px; }
.ac-chip-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border: 0; border-radius: 7px; background: var(--p-primary-soft); color: var(--p-primary); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ac-eye-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--p-muted); cursor: pointer; }
.ac-eye-btn:hover { color: var(--p-text); background: var(--p-border-soft); }
.ac-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ac-checklist li { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.5; color: var(--p-text-2); }
.ac-checklist li > svg { flex: none; margin-top: 2px; }
.ac-checklist li.is-ok > svg { color: var(--p-success); }
.ac-checklist li.is-off > svg { color: var(--p-warning); }
.ac-checklist strong { display: block; font-size: 13.5px; color: var(--p-text); font-weight: 600; }
.ac-method-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ac-method { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--p-border); border-radius: 12px; background: var(--p-card); }
.ac-method.is-on { border-color: color-mix(in srgb, var(--p-success) 40%, var(--p-border)); }
.ac-method-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ac-method > strong { font-size: 14.5px; font-weight: 600; color: var(--p-text); }
.ac-method > p { flex: 1; margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--p-text-2); }
.ac-method form { margin: 0; }
.ac-method.is-soon > strong, .ac-method.is-soon > p { opacity: .75; }
.ac-method .btn[disabled] { opacity: .6; cursor: not-allowed; }
.ac-method .ac-details summary.btn { display: flex; justify-content: center; width: 100%; }
.ac-method .ac-details summary.btn::after { content: none; }
.ac-method .ac-details summary.btn-primary { color: #fff; }
.ac-method .ac-details summary.btn-secondary { color: var(--p-text); }
.ac-session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ac-session { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--p-border); border-radius: 12px; }
.ac-session .ac-ico { background: var(--p-border-soft); color: var(--p-text-2); }
.ac-session.is-current { border-color: color-mix(in srgb, var(--p-primary) 55%, var(--p-border)); background: color-mix(in srgb, var(--p-primary) 4%, var(--p-card)); }
.ac-session.is-current .ac-ico { background: var(--p-primary); color: #fff; }
.ac-session-main { flex: 1; min-width: 0; }
.ac-session-main > strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; color: var(--p-text); }
.ac-session-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 3px; font-size: 12px; color: var(--p-muted); }
.ac-session-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ac-session .ac-device-ua { margin-top: 2px; max-width: 100%; }
@media (max-width: 1180px) { .ac-method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
    .ac-sec-split { grid-template-columns: minmax(0, 1fr); }
    .ac-sec-split-side { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--p-border-soft); }
}
@media (max-width: 520px) { .ac-method-grid { grid-template-columns: minmax(0, 1fr); } .ac-session { align-items: flex-start; } }

/* ==========================================================================
   KYC
   ========================================================================== */
.ac-kyc-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; padding: 24px; border-radius: 16px; border: 1px solid var(--p-border); background: var(--p-card); box-shadow: var(--p-shadow); }
.ac-kyc-ico { display: grid; place-items: center; flex: none; width: 60px; height: 60px; border-radius: 16px; }
.ac-kyc-ico svg { width: 28px; height: 28px; }
.ac-kyc-main { flex: 1; min-width: 220px; }
.ac-kyc-main h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 20px !important; font-weight: 700 !important; color: var(--p-text) !important; }
.ac-kyc-main p { margin: 5px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--p-text-2); max-width: 640px; }
.ac-kyc-hero.is-verified { background: linear-gradient(135deg, var(--p-success-soft), var(--p-card) 70%); border-color: color-mix(in srgb, var(--p-success) 30%, var(--p-border)); }
.ac-kyc-hero.is-review { background: linear-gradient(135deg, var(--p-warning-soft), var(--p-card) 70%); border-color: color-mix(in srgb, var(--p-warning) 30%, var(--p-border)); }
.ac-kyc-hero.is-rejected { background: linear-gradient(135deg, var(--p-danger-soft), var(--p-card) 70%); border-color: color-mix(in srgb, var(--p-danger) 30%, var(--p-border)); }
.ac-kyc-hero.is-none { background: linear-gradient(135deg, var(--p-primary-soft), var(--p-card) 70%); }
.ac-kyc-progress { display: flex; align-items: flex-start; gap: 0; width: 100%; margin: 0; padding: 0; list-style: none; }
.ac-step-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 -6px; font-size: 14.5px; font-weight: 700; color: var(--p-text); }
.ac-step-title b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--p-primary-soft); color: var(--p-primary); font-size: 12px; }
.ac-secure-card { background: color-mix(in srgb, var(--p-success) 6%, var(--p-card)) !important; }
.ac-kyc-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--p-muted); }
.ac-kyc-step::after { content: ""; position: absolute; top: 12px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--p-border); border-radius: 2px; }
.ac-kyc-step:last-child::after { display: none; }
.ac-kyc-step b { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--p-border); background: var(--p-card); font-size: 11.5px; }
.ac-kyc-step.is-done { color: var(--p-text); }
.ac-kyc-step.is-done b { border-color: var(--p-success); background: var(--p-success); color: #fff; }
.ac-kyc-step.is-done::after { background: var(--p-success); }
.ac-kyc-step.is-current { color: var(--p-text); }
.ac-kyc-step.is-current b { border-color: var(--p-primary); color: var(--p-primary); }
.ac-kyc-step.is-failed b { border-color: var(--p-danger); background: var(--p-danger); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .ac-layout, .ac-layout--wide-side, .ac-layout--narrow-side { grid-template-columns: minmax(0, 1fr); }
    .ac-sticky { position: static; }
}
@media (max-width: 1100px) {
    .dash-stats.ac-stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .ac-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .ac-choices--4, .ac-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ac-msg { max-width: 94%; }
    .ac-article-card { padding: 22px 20px; }
    .ac-article-head h1 { font-size: 23px; }
}
@media (max-width: 720px) {
    .ac-head { margin-bottom: 16px; }
    .ac-head-actions { width: 100%; }
    .ac-head-actions > .btn, .ac-head-actions > form, .ac-head-actions > form .btn { flex: 1 1 auto; justify-content: center; }
    .dash-stats.ac-stats-3 { grid-template-columns: minmax(0, 1fr); }
    .ac-form-grid { grid-template-columns: minmax(0, 1fr); }
    .ac-toolbar { padding: 14px 16px; }
    .ac-search { flex: 1 1 100%; }
    .ac-filterbar { flex-wrap: wrap; }
    .ac-perpage.form-control { flex: 1 1 100%; width: 100%; }
    .ac-pagebar { padding: 12px 16px; }
    .ac-card { padding: 16px; }
    .ac-card--flush { padding: 0; }
    .ac-card--flush > .ac-card-head { padding: 16px 16px 0; }
    .ac-table-wrap .client-table th:first-child, .ac-table-wrap .client-table td:first-child { padding-left: 16px !important; }
    .ac-table-wrap .client-table th:last-child, .ac-table-wrap .client-table td:last-child { padding-right: 16px !important; }
    .ac-chat { padding: 16px; }
    .ac-composer, .ac-closed-note { padding: 16px; }
    .ac-hero { padding: 24px 18px; }
    .ac-hero h1 { font-size: 21px; }
    .ac-hero-search .btn { padding: 0 14px; }
    .ac-idea, .ac-bug { padding-left: 16px; padding-right: 16px; }
    .ac-notif { flex-wrap: wrap; padding: 14px; }
    .ac-notif-thumb { display: none; }
    .ac-notif-view { margin-left: 52px; }
    .ac-totp { grid-template-columns: minmax(0, 1fr); }
    .ac-qr { justify-self: start; }
    .ac-status-banner { flex-wrap: wrap; }
    .ac-status-time { margin-left: 0; width: 100%; }
    .ac-setting { flex-wrap: wrap; }
    .ac-setting-side { width: 100%; }
    .ac-sec-score { flex-wrap: wrap; }
    .ac-form-actions .ac-actions-end { width: 100%; }
    .ac-form-actions .ac-actions-end .btn { flex: 1; justify-content: center; }
}
@media (max-width: 480px) {
    .dash-stats.ac-stats-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ac-choices--4, .ac-seg, .ac-choices { grid-template-columns: minmax(0, 1fr); }
    .ac-msg { max-width: 100%; }
    .ac-msg .ac-avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ac-cat, .ac-choice, .ac-seg label, .ac-vote button { transition: none; }
    .ac-cat:hover { transform: none; }
}
@media (max-width: 720px) {
    .ac-tk-table { table-layout: auto; min-width: 0; }
    .ac-tk-table th:last-child, .ac-tk-table td:last-child { position: static; }
    .ac-tk-subject .ac-cell-title { white-space: normal; }
}
.ac-stack > .ac-kyc-hero, .ac-stack > .ac-status-banner { margin: 0; }

/* ==========================================================================
   TO-DO + EMAIL HISTORY alignment (markup in TodoController / EmailHistoryController)
   ========================================================================== */
.ac-accent-stats .dash-stat { border-left: 4px solid var(--accent, var(--p-primary)); }
.ac-accent-stats .dash-stat:nth-child(1) { --accent: var(--p-primary); }
.ac-accent-stats .dash-stat:nth-child(2) { --accent: #ef4444; }
.ac-accent-stats .dash-stat:nth-child(3) { --accent: var(--p-success); }
.ac-addbar { display: grid; grid-template-columns: minmax(0, 1fr) 130px 160px auto; gap: 10px; align-items: center; }
.ac-addbar .ac-input > .form-control { padding-inline-start: 42px; background-color: var(--p-bg) !important; }
.ac-addbar .form-control { min-height: 46px; border-radius: 10px !important; }
.ac-addbar .btn { min-height: 46px; padding-inline: 20px; }
.ac-addbar .ac-input > svg { left: 14px; }
.ac-mail-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--p-border-soft); }
.ac-mail-head svg { flex: none; margin-top: 3px; color: var(--p-primary); }
.ac-joined { display: flex; max-width: 460px; margin: 0 0 16px; }
.ac-joined .form-control { flex: 1; min-width: 0; min-height: 42px; border-radius: 10px 0 0 10px !important; }
.ac-joined .btn { border-radius: 0 10px 10px 0 !important; min-height: 42px; }
.ac-joined .ac-clear { margin-left: 8px; align-self: center; }
.ac-view-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid color-mix(in srgb, var(--p-primary) 30%, var(--p-border)); border-radius: 8px; background: var(--p-primary-soft); color: var(--p-primary); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ac-view-btn:hover { background: var(--p-primary); color: #fff; }
.ac-mail-id { font-weight: 700; color: var(--p-text-2); white-space: nowrap; }
@media (max-width: 760px) {
    .ac-addbar { grid-template-columns: 1fr 1fr; }
    .ac-addbar > :first-child, .ac-addbar .btn { grid-column: 1 / -1; }
}
.ac-vote button.is-voted { border-color: var(--p-primary); background: var(--p-primary-soft); color: var(--p-primary); }
.ac-card--flush > .ac-card-head + .ac-idea-list .ac-idea:first-child, .ac-card--flush > .ac-card-head + .ac-bug-list .ac-bug:first-child { border-top: 0; }

/* ---------- Security → Sign-in methods (Google / GitHub / passkeys) ---------- */
.ac-signin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ac-signin-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--cl-line, #e3e8ef); border-radius: 14px; background: var(--cl-card, #fff); }
.ac-signin-row form { margin: 0; }
.ac-signin-logo { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--cl-ink, #0f172a);
  background: color-mix(in srgb, var(--cl-accent, #2563eb) 8%, transparent); border: 1px solid var(--cl-line, #e3e8ef); }
.ac-signin-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.ac-signin-main strong { font-size: 14.5px; }
.ac-signin-main .ac-cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-passkeys { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--cl-line, #e3e8ef); }
.ac-passkeys:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ac-passkeys .ac-inline-form .form-control { flex: 1 1 220px; max-width: 320px; }
.ac-passkeys [hidden] { display: none !important; }
@media (max-width: 560px) {
  .ac-signin-row { flex-wrap: wrap; }
  .ac-signin-row form, .ac-signin-row > .btn { margin-left: 54px; }
}
