/* =====================================================================
   WebDonya — round 5 components
   captcha · tab strips · notifications · project picker · task threads ·
   activity log · SMS log · work calendar · to-do · sidebar mini mode
   ===================================================================== */

/* ------------------------------------------------------------ captcha */
.captcha { display: flex; flex-direction: column; gap: 8px; }
.captcha-label { font-size: 14px; font-weight: 700; color: var(--fg-2); }
.captcha-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.captcha-img { position: relative; display: flex; align-items: center; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #f3f6fd; flex: none; }
.captcha-img img { display: block; width: 190px; height: 56px; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.captcha-refresh { position: static; align-self: stretch; width: 40px; flex: none; border: 0; border-inline-start: 1px solid var(--line-2); border-radius: 0; background: #e9eef9; color: #0d1b3d; display: grid; place-items: center; cursor: pointer; transition: .2s; }
.captcha-refresh:hover { background: var(--orange); color: #fff; }
.captcha-refresh .ico { width: 16px; height: 16px; }
.captcha-refresh.spin .ico { animation: spin .6s linear infinite; }
.captcha-input { flex: 1; min-width: 130px; max-width: 220px; text-align: center; font-family: var(--font-en); font-size: 22px !important; letter-spacing: .35em; font-weight: 700; }
.field-hint { font-size: 12px; color: var(--muted); }
.validation-message { color: var(--danger); font-size: 12.5px; }

/* ------------------------------------------------------ scrollable strips */
.a-tabs, .ws-tabs, .pt-seg, .cal-views { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.a-tabs::-webkit-scrollbar, .ws-tabs::-webkit-scrollbar, .pt-seg::-webkit-scrollbar, .cal-views::-webkit-scrollbar { display: none; }
.a-tabs > *, .ws-tabs > *, .pt-seg > *, .cal-views > * { flex: none; white-space: nowrap; }
/* edge fades show there is more to scroll */
.a-tabs.can-end, .ws-tabs.can-end, .pt-seg.can-end, .tabs.can-end { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 44px); mask-image: linear-gradient(to left, transparent 0, #000 44px); }
html[dir="ltr"] .a-tabs.can-end, html[dir="ltr"] .ws-tabs.can-end, html[dir="ltr"] .pt-seg.can-end, html[dir="ltr"] .tabs.can-end { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 44px); mask-image: linear-gradient(to right, transparent 0, #000 44px); }
.a-tabs.can-start.can-end, .ws-tabs.can-start.can-end, .pt-seg.can-start.can-end, .tabs.can-start.can-end { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%); mask-image: linear-gradient(to left, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%); }
.a-tabs.can-start:not(.can-end), .ws-tabs.can-start:not(.can-end), .pt-seg.can-start:not(.can-end), .tabs.can-start:not(.can-end) { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 44px); mask-image: linear-gradient(to right, transparent 0, #000 44px); }
.tabs { max-width: 100%; }

/* --------------------------------------------------------- admin shell */
.a-side-btn { display: grid !important; }
.a-top-title { display: inline-flex; align-items: center; gap: 8px; }
.a-top-title .ico { width: 16px; height: 16px; opacity: .7; }
.a-top-quick { display: inline-grid; }
.a-nav-scrim { display: none; }
.a-badge--blue { background: var(--blue) !important; }
.a-badge--red { background: var(--danger) !important; }
.a-nav a > span:not(.a-badge) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-theme-btn .i-sun, .pt-theme .i-sun, [data-theme-toggle] .i-sun { display: none; }
html[data-theme="light"] [data-theme-toggle] .i-sun { display: block; }
html[data-theme="light"] [data-theme-toggle] .i-moon { display: none; }
html.theme-anim, html.theme-anim * { transition: background-color .35s, color .35s, border-color .35s, box-shadow .35s !important; }
@media (min-width: 961px) {
    html.side-mini .admin { grid-template-columns: 78px minmax(0, 1fr); }
    html.side-mini .a-side { padding-inline: 10px; overflow-x: hidden; }
    html.side-mini .a-side .brand-word, html.side-mini .a-side-label, html.side-mini .a-nav-group, html.side-mini .a-nav a > span:not(.a-badge),
    html.side-mini .a-side-foot .a-ver, html.side-mini .a-side-foot a > span { display: none; }
    html.side-mini .a-nav a, html.side-mini .a-nav-link { justify-content: center; padding-inline: 0; position: relative; }
    html.side-mini .a-nav a .a-badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; height: 18px; font-size: 10.5px; padding-inline: 4px; }
    html.side-mini .a-nav a.active::before { inset-inline-start: -10px; }
    html.side-mini .a-brand { justify-content: center; padding-inline: 0; }
}
@media (max-width: 960px) {
    .a-nav-toggle:checked ~ .a-nav-scrim { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(2, 6, 18, .55); backdrop-filter: blur(2px); }
    .a-top-title { display: none; }
    .a-user-name { display: none; }
}
tr.is-unread td { background: rgba(255, 107, 0, .045); }
tr.is-unread .t-title { font-weight: 800; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-inline-end: 7px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(255, 107, 0, .18); }
.text-danger { color: var(--danger) !important; }
.select--sm { height: 36px !important; min-width: 0 !important; font-size: 13px; padding-block: 0; }

/* ---------------------------------------------- notifications (admin bell) */
.nb-panel { position: fixed !important; top: 74px !important; inset-inline-start: 286px !important; inset-inline-end: auto !important; z-index: 95 !important;
    width: min(430px, calc(100vw - 24px)) !important; max-height: min(78vh, 640px) !important; background: var(--nb-bg, #0b1736) !important; backdrop-filter: none !important;
    border: 1px solid var(--line-2) !important; box-shadow: 0 30px 70px -18px rgba(0, 0, 0, .65) !important; }
html.side-mini .nb-panel { inset-inline-start: 94px !important; }
@media (max-width: 960px) { .nb-panel { inset-inline: 12px !important; width: auto !important; } }
.nb-backdrop { background: rgba(2, 6, 18, .25); z-index: 94 !important; }
.nb-head b { display: flex; align-items: center; gap: 10px; font-size: 15.5px; }
.nb-head b em { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 100px; background: rgba(255, 107, 0, .16); color: var(--orange-400); }
.nb-close { width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.nb-close:hover { background: rgba(147, 179, 255, .1); color: var(--fg); }
.nb-close .ico { width: 17px; height: 17px; }
.nb-tools, .pt-bell-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.nb-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(147, 179, 255, .07); }
.nb-seg button { border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 9px; cursor: pointer; }
.nb-seg button.on { background: var(--card-2, rgba(22, 44, 98, .9)); color: var(--fg); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 12px -6px rgba(0, 0, 0, .5); }
.nb-item { padding: 0 !important; gap: 0 !important; align-items: stretch !important; border-radius: 14px; margin-bottom: 4px; border: 1px solid transparent; }
.nb-item.unread { background: rgba(13, 91, 255, .08) !important; border-color: rgba(13, 91, 255, .2); }
.nb-item.unread::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--orange); }
.nb-item.read { opacity: .78; }
.nb-item.read:hover { opacity: 1; }
.nb-main { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 0; background: none; color: var(--fg); text-align: start; cursor: pointer; border-radius: 14px; }
.nb-main:hover { background: rgba(147, 179, 255, .06); }
.nb-item.unread .nb-body b { color: var(--fg); }
.nb-item.read .nb-body b { font-weight: 600; }
.nb-body span { white-space: normal !important; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb-mark, .pt-note-mark { flex: none; align-self: center; margin-inline-end: 8px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 6px 8px; border-radius: 12px;
    border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 700; cursor: pointer; transition: .2s; }
.nb-mark .ico, .pt-note-mark .ico { width: 17px; height: 17px; }
.nb-mark:hover, .pt-note-mark:hover { color: var(--fg); border-color: var(--blue-400); background: rgba(13, 91, 255, .1); }
.nb-item.unread .nb-mark, .pt-note.unread .pt-note-mark { color: var(--blue-300); }
.nb-ico.k-todo, .pt-note-ico.k-todo { background: rgba(168, 85, 247, .16); color: #c4a6ff; }
.nb-ico.k-action { background: rgba(255, 107, 0, .16); color: var(--orange-400); }

/* ------------------------------------------- notifications (client portal) */
.pt-bell-panel { background: var(--nb-bg, #0b1736) !important; backdrop-filter: none !important; width: min(410px, calc(100vw - 20px)) !important; }
.pt-bell-head b { display: flex; align-items: center; gap: 8px; }
.pt-bell-head b em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 100px; background: rgba(255, 107, 0, .16); color: var(--orange-400); }
.pt-bell-x { width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pt-bell-x .ico { width: 17px; height: 17px; }
.pt-note { position: relative; align-items: stretch !important; border: 1px solid transparent; margin-bottom: 4px; }
.pt-note.unread { background: rgba(13, 91, 255, .08) !important; border-color: rgba(13, 91, 255, .2); }
.pt-note.unread::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--orange); }
.pt-note.read { opacity: .8; }
.pt-note-toggle { display: none !important; }
@media (max-width: 520px) { .pt-bell-panel { position: fixed !important; top: 70px !important; inset-inline: 8px !important; width: auto !important; max-height: calc(100svh - 160px) !important; } }

/* ------------------------------------------------------------- portal bits */
.pt-switch { position: relative; }
.pt-switch .pt-dot { top: 7px; inset-inline-end: 7px; }
.pt-btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--fg-2); }
.pt-fold-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 16px; background: rgba(34, 195, 142, .08); border: 1px solid rgba(34, 195, 142, .22); font-size: 13px; color: var(--fg-2); }
.pt-fold-bar .ico { width: 16px; height: 16px; color: var(--success); vertical-align: -3px; }
.pt-step.folded .pt-step-fold { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(34, 195, 142, .06); color: var(--fg); text-align: start; cursor: pointer; }
.pt-step.folded .pt-step-fold b { flex: 1; font-size: 14px; }
.pt-step.folded .pt-step-fold small { color: var(--muted); font-size: 12px; }
.pt-step.folded .pt-step-fold .ico { width: 16px; height: 16px; color: var(--muted); }
.pt-new { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 100px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 800; margin-inline-start: auto; animation: ptPulseNew 1.6s infinite; }
@keyframes ptPulseNew { 50% { box-shadow: 0 0 0 6px rgba(255, 107, 0, 0); } 0% { box-shadow: 0 0 0 0 rgba(255, 107, 0, .45); } }
.pt-count { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 1px 8px; border-radius: 100px; background: rgba(147, 179, 255, .08); margin-inline-start: auto; }
.pt-thread { border-radius: 16px; border: 1px solid var(--line); background: rgba(147, 179, 255, .03); }
.pt-thread > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--fg-2); }
.pt-thread > summary::-webkit-details-marker { display: none; }
.pt-thread > summary .ico { width: 16px; height: 16px; }
.pt-thread > summary em { font-style: normal; font-size: 11px; color: var(--muted); }
.pt-thread .tt { padding: 0 10px 10px; }
.pt-done-item { border-radius: 16px; border: 1px solid var(--line); background: rgba(147, 179, 255, .03); transition: border-color .2s; }
.pt-done-item + .pt-done-item { margin-top: 8px; }
.pt-done-item.has-new { border-color: rgba(255, 107, 0, .45); box-shadow: 0 10px 30px -18px rgba(255, 107, 0, .6); }
.pt-done-item > summary { list-style: none; cursor: pointer; }
.pt-done-item > summary::-webkit-details-marker { display: none; }
.pt-done-item > summary.pt-done-row { margin: 0; border: 0; background: none; }
.pt-done-item[open] .pt-done-chev { transform: rotate(180deg); }
.pt-done-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .25s; flex: none; }
.pt-done-item .tt { padding: 0 12px 12px; }
.pt-action-btns { flex-wrap: wrap; }

/* ------------------------------------------------- task thread (both sides) */
.tt { display: flex; flex-direction: column; gap: 10px; }
.tt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.tt-msg { display: flex; }
.tt-msg.me { justify-content: flex-start; }
.tt-msg.them { justify-content: flex-end; }
.tt-bubble { max-width: min(560px, 88%); padding: 9px 12px 7px; border-radius: 16px; background: rgba(147, 179, 255, .08); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.tt-msg.agency .tt-bubble { background: rgba(13, 91, 255, .12); border-color: rgba(13, 91, 255, .25); }
.tt-msg.client .tt-bubble { background: rgba(255, 107, 0, .09); border-color: rgba(255, 107, 0, .22); }
.tt-author { font-size: 11.5px; font-weight: 800; color: var(--fg-2); }
.tt-bubble p { margin: 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.tt-bubble small { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.tt-tick { width: 14px; height: 14px; }
.tt-tag { align-self: flex-start; font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 9px; border-radius: 100px; }
.tt-tag.t-ok { background: rgba(34, 195, 142, .16); color: #4fd8a8; }
.tt-tag.t-warn { background: rgba(255, 200, 0, .14); color: #e8b931; }
.tt-tag.t-again { background: rgba(255, 107, 0, .16); color: var(--orange-400); }
.tt-compose { display: flex; align-items: flex-end; gap: 8px; padding: 6px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(4, 10, 26, .25); }
.tt-compose textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 0; background: transparent; color: var(--fg); padding: 9px 8px; font-size: 14px; line-height: 1.7; outline: none; }
.tt-attach, .tt-send { width: 40px; height: 40px; border-radius: 12px; border: 0; display: grid; place-items: center; flex: none; cursor: pointer; }
.tt-attach { background: rgba(147, 179, 255, .08); color: var(--fg-2); }
.tt-send { background: var(--grad-orange); color: #fff; }
.tt-send:disabled { opacity: .35; cursor: default; }
.tt-attach .ico, .tt-send .ico { width: 18px; height: 18px; }
.tt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-action.has-new { border-color: rgba(255, 107, 0, .5) !important; box-shadow: 0 12px 30px -20px rgba(255, 107, 0, .7); }
.ws-action .tt { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ws-phase-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 16px; background: rgba(147, 179, 255, .05); border: 1px solid var(--line); font-size: 13.5px; color: var(--fg-2); }
.ws-phase-bar b { color: var(--fg); }

/* ---------------------------------------------------------- project picker */
.pk-app { min-height: 100svh; display: flex; flex-direction: column; }
.pk-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top));
    background: rgba(4, 10, 26, .78); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid var(--line); }
.pk-top-text { flex: 1; min-width: 0; }
.pk-top-text b { display: block; font-size: 15px; font-weight: 800; }
.pk-top-text small { font-size: 12px; color: var(--muted); }
.pk-main { width: 100%; max-width: 1180px; margin-inline: auto; padding: clamp(20px, 4vw, 44px) 16px 60px; display: flex; flex-direction: column; gap: 22px; }
.pk-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: ptIn .5s var(--ease) both; }
.pk-wave { font-size: 38px; display: inline-block; animation: pkWave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes pkWave { 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } 50% { transform: none; } }
.pk-hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 900; margin: 0; }
.pk-hero p { color: var(--muted); max-width: 620px; font-size: 15px; margin: 0; }
.pk-sum { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.pk-sum span { padding: 6px 14px; border-radius: 100px; background: rgba(147, 179, 255, .07); border: 1px solid var(--line); font-size: 13px; color: var(--fg-2); }
.pk-sum span b { font-family: var(--font-en); color: var(--fg); }
.pk-sum span.hot { background: rgba(255, 107, 0, .12); border-color: rgba(255, 107, 0, .4); color: var(--orange-400); }
.pk-search { position: relative; max-width: 460px; width: 100%; margin-inline: auto; }
.pk-search .ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.pk-search .pt-input { padding-inline-start: 42px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 420px)); justify-content: center; gap: 18px; }
.pk-card { --brand: #ff6b00; position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 26px; color: var(--fg); overflow: hidden; isolation: isolate;
    background: linear-gradient(160deg, rgba(22, 44, 98, .62), rgba(10, 22, 52, .62)); border: 1px solid var(--line); transition: transform .35s var(--ease), border-color .3s, box-shadow .35s;
    animation: ptIn .5s var(--ease) both; }
.pk-card::before { content: ""; position: absolute; z-index: -1; width: 240px; height: 240px; inset-inline-end: -80px; top: -110px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%); opacity: .55; transition: opacity .35s; }
.pk-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--brand) 70%, transparent); }
.pk-card:hover::before { opacity: .85; }
.pk-card.is-from { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 107, 0, .18), 0 30px 60px -30px rgba(255, 107, 0, .6); }
.pk-card.is-archived, .pk-card.s-cancelled { opacity: .72; }
.pk-flag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px; background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 800; }
.pk-flag .ico { width: 13px; height: 13px; }
.pk-card-head { display: flex; align-items: center; gap: 12px; }
.pk-logo { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; overflow: hidden; background: #fff; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }
.pk-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pk-logo b { font-size: 24px; font-weight: 900; color: var(--brand); }
.pk-title { flex: 1; min-width: 0; }
.pk-title b { display: block; font-size: 17px; font-weight: 850; line-height: 1.45; }
.pk-title small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-card .pt-status { flex: none; height: 26px; font-size: 11.5px; padding-inline: 10px; }
.pk-progress { display: flex; align-items: center; gap: 16px; }
.pk-ring { position: relative; width: 86px; height: 86px; flex: none; }
.pk-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pk-ring circle { fill: none; stroke-width: 10; }
.pk-ring .t { stroke: rgba(147, 179, 255, .12); }
.pk-ring .v { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: var(--v) 100; transition: stroke-dasharray 1s var(--ease); }
.pk-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 900; font-family: var(--font-en); }
.pk-ring b small { font-size: 12px; }
.pk-facts { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: var(--fg-2); }
.pk-facts span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pk-facts .ico { width: 15px; height: 15px; flex: none; color: var(--muted); }
.pk-facts b { color: var(--fg); font-weight: 700; }
.pk-facts em { font-style: normal; color: var(--muted); }
.pk-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-badges span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; }
.pk-badges .ico { width: 14px; height: 14px; }
.b-hot { background: rgba(255, 107, 0, .15); color: var(--orange-400); }
.b-blue { background: rgba(13, 91, 255, .16); color: var(--blue-300); }
.b-warn { background: rgba(255, 200, 0, .14); color: #e8b931; }
.b-ok { background: rgba(34, 195, 142, .12); color: #4fd8a8; }
.pk-go { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 16px; font-weight: 800; font-size: 14.5px;
    background: color-mix(in srgb, var(--brand) 16%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); transition: .25s; }
.pk-card:hover .pk-go { background: var(--brand); color: #fff; }
.pk-go .ico { width: 18px; height: 18px; }
.pk-foot { text-align: center; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ activity log */
.act-list { display: flex; flex-direction: column; }
.act-day { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 8px; font-weight: 800; font-size: 13.5px; position: sticky; top: 0; }
.act-day small { color: var(--muted); font-weight: 600; font-size: 12px; }
.act-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 6px; border-bottom: 1px dashed var(--line); }
.act-time { width: 44px; flex: none; font-family: var(--font-en); font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.act-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(13, 91, 255, .12); color: var(--blue-300); }
.act-ico .ico { width: 16px; height: 16px; }
.act-row.a-auth .act-ico { background: rgba(34, 195, 142, .13); color: #4fd8a8; }
.act-row.a-bad .act-ico { background: rgba(255, 90, 95, .14); color: #ff8a8d; }
.act-row.a-file .act-ico { background: rgba(255, 200, 0, .12); color: #e8b931; }
.act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-body b { font-size: 14px; }
.act-detail { font-size: 13px; color: var(--fg-2); overflow-wrap: anywhere; }
.act-body small { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.act-body small a { color: var(--blue-300); }
.act-body small i { font-style: normal; opacity: .5; }
.act-dev { display: inline-flex; align-items: center; gap: 4px; }
.act-dev .ico { width: 13px; height: 13px; }
.act-seen { display: flex; flex-direction: column; gap: 4px; }
.act-seen-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--fg); text-align: start; cursor: pointer; }
.act-seen-row:hover, .act-seen-row.on { background: rgba(147, 179, 255, .07); border-color: var(--line); }
.act-seen-row .t-avatar { width: 34px; height: 38px; font-size: 14px; }
.act-seen-row span { flex: 1; min-width: 0; }
.act-seen-row b { display: block; font-size: 13.5px; }
.act-seen-row small { font-size: 11.5px; color: var(--muted); }
.act-seen-row .online, i.online { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(34, 195, 142, .2); display: inline-block; }
.act-bar { display: grid; grid-template-columns: minmax(0, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.act-bar i { height: 8px; border-radius: 8px; background: var(--grad-brand); min-width: 4px; }
.act-bar b { font-family: var(--font-en); font-size: 12.5px; }

/* --------------------------------------------------------------- SMS log */
.sms-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
@media (max-width: 900px) { .sms-strip { grid-template-columns: 1fr; } }
.sms-credit { display: flex; align-items: center; gap: 14px; }
.sms-credit > div { flex: 1; min-width: 0; }
.sms-credit small { display: block; font-size: 12.5px; color: var(--muted); }
.sms-credit b { font-size: 24px; font-weight: 850; font-family: var(--font-en); }
.sms-month { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .sms-month { grid-template-columns: repeat(2, 1fr); } }
.sms-month div { padding: 8px 12px; border-radius: 14px; background: rgba(147, 179, 255, .05); }
.sms-month b { display: block; font-size: 20px; font-weight: 850; font-family: var(--font-en); }
.sms-month span { font-size: 12px; color: var(--muted); }
.dlv { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.dlv i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dlv--ok { background: rgba(34, 195, 142, .13); color: #4fd8a8; }
.dlv--wait { background: rgba(255, 200, 0, .12); color: #e8b931; }
.dlv--wait i { animation: r5Blink 1.4s infinite; }
@keyframes r5Blink { 50% { opacity: .25; } }
.dlv--fail { background: rgba(255, 90, 95, .13); color: #ff8a8d; }
.dlv--lg { font-size: 14px; padding: 6px 14px; }
.sms-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sms-detail-head .num { font-size: 18px; font-weight: 800; }
.sms-text { white-space: pre-wrap; line-height: 2; font-size: 14.5px; }
.sms-raw { margin: 10px 0 0; padding: 12px; border-radius: 12px; background: rgba(4, 10, 26, .45); font-size: 12px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.sms-table .a-msg-body { max-width: 340px; }

/* ----------------------------------------------------------- work calendar */
.cal-quick { display: flex; align-items: center; gap: 10px; padding: 10px 14px !important; }
.cal-quick > .ico { width: 20px; height: 20px; color: var(--orange-400); flex: none; }
.cal-quick .input { flex: 1; border: 0 !important; background: transparent !important; height: 44px; font-size: 15px; padding-inline: 4px; box-shadow: none !important; }
.cal-quick-preview { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 100px; background: rgba(13, 91, 255, .14); color: var(--blue-300); white-space: nowrap; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-main { min-width: 0; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-nav h2 { font-size: 19px; font-weight: 850; margin-inline-start: 8px; white-space: nowrap; }
.cal-views { border: 0 !important; padding: 3px !important; border-radius: 12px; background: rgba(147, 179, 255, .07); }
.cal-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 100px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; user-select: none; }
.chip-toggle input { display: none; }
.chip-toggle.on { color: var(--fg); border-color: rgba(255, 107, 0, .5); background: rgba(255, 107, 0, .1); }
.cal-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-inline-start: auto; font-size: 11.5px; color: var(--muted); }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--kc); display: inline-block; margin-inline-end: -6px; }

/* kind colours */
.k-todo { --kc: #a855f7; } .k-projectdeadline { --kc: #ff6b00; } .k-phase { --kc: #0d5bff; } .k-milestone { --kc: #eab308; }
.k-clientaction { --kc: #14b8a6; } .k-work { --kc: #5b8cff; } .k-payment { --kc: #22c38e; } .k-renewal { --kc: #ef4444; } .k-invoice { --kc: #64748b; } .k-lead { --kc: #ec4899; }

.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 112px; padding: 6px; border-radius: 14px; background: rgba(147, 179, 255, .035); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; transition: border-color .2s, background .2s; }
.cal-cell:hover { border-color: var(--line-2); background: rgba(147, 179, 255, .06); }
.cal-cell.out { opacity: .42; }
.cal-cell.fri { background: rgba(255, 90, 95, .035); }
.cal-cell.today { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); background: rgba(255, 107, 0, .06); }
.cal-cell.has-late .cal-cell-head small { background: var(--danger); color: #fff; }
.cal-cell-head { display: flex; align-items: center; gap: 6px; }
.cal-cell-head b { font-size: 15px; font-weight: 850; font-family: var(--font-en); }
.cal-cell.today .cal-cell-head b { color: var(--orange-400); }
.cal-cell-head small { font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 100px; background: rgba(147, 179, 255, .12); color: var(--fg-2); }
.cal-add { margin-inline-start: auto; width: 22px; height: 22px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; opacity: 0; transition: .2s; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--orange); color: #fff; }
.cal-add .ico { width: 14px; height: 14px; }
.cal-chip { font-size: 11.5px; line-height: 1.5; padding: 2px 6px; border-radius: 7px; border-inline-start: 3px solid var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip em { font-style: normal; font-family: var(--font-en); font-weight: 700; margin-inline-end: 4px; opacity: .8; }
.cal-chip.done { opacity: .5; text-decoration: line-through; }
.cal-chip.late { background: rgba(255, 90, 95, .16); border-inline-start-color: var(--danger); }
.cal-more { font-size: 11px; color: var(--muted); font-weight: 700; }
@media (max-width: 700px) {
    .cal-month { gap: 3px; }
    .cal-cell { min-height: 64px; padding: 4px; border-radius: 10px; }
    .cal-chip { font-size: 0; height: 6px; padding: 0; border: 0; background: var(--kc); }
    .cal-chip em { display: none; }
    .cal-wd { font-size: 10px; }
}
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.cal-wcol { border-radius: 16px; background: rgba(147, 179, 255, .035); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 320px; min-width: 0; }
.cal-wcol.today { border-color: var(--orange); }
.cal-wcol.fri { background: rgba(255, 90, 95, .03); }
.cal-wcol-head { display: flex; align-items: baseline; gap: 6px; justify-content: center; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--fg); cursor: pointer; }
.cal-wcol-head span { font-size: 12px; color: var(--muted); font-weight: 700; }
.cal-wcol-head b { font-size: 18px; font-weight: 900; font-family: var(--font-en); }
.cal-wcol.today .cal-wcol-head b { color: var(--orange-400); }
.cal-wcol-head small { font-size: 11px; color: var(--muted); }
.cal-wcol-body { padding: 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cal-add-row { margin-top: auto; border: 1px dashed var(--line-2); background: none; color: var(--muted); border-radius: 10px; font-size: 12px; padding: 6px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.cal-add-row:hover { color: var(--fg); border-color: var(--orange); }
.cal-add-row .ico { width: 14px; height: 14px; }
.cal-list { display: flex; flex-direction: column; gap: 6px; }
.cal-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; background: rgba(147, 179, 255, .045); border: 1px solid var(--line); border-inline-start: 3px solid var(--kc); min-width: 0; }
.cal-row.done { opacity: .55; }
.cal-row.done .cal-row-main b { text-decoration: line-through; }
.cal-row.late { background: rgba(255, 90, 95, .07); border-color: rgba(255, 90, 95, .25); border-inline-start-color: var(--danger); }
.cal-row.prio-3 .cal-row-main b::before { content: "!! "; color: var(--danger); font-weight: 900; }
.cal-row.prio-2 .cal-row-main b::before { content: "! "; color: var(--orange-400); font-weight: 900; }
.cal-row .ws-check { width: 24px; height: 24px; border-radius: 7px; }
.cal-row.done .ws-check { background: var(--success); border-color: var(--success); color: #fff; }
.cal-row-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--kc) 18%, transparent); color: var(--kc); }
.cal-row-ico .ico { width: 14px; height: 14px; }
.cal-row-main { flex: 1; min-width: 0; border: 0; background: none; color: var(--fg); text-align: start; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.cal-row-main b { font-size: 13px; font-weight: 700; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-row-main small { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 3px; }
.cal-kind { color: var(--kc); font-weight: 700; }
.cal-proj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.cal-mini { width: 12px !important; height: 12px !important; opacity: .7; vertical-align: -1px; }
.cal-row .a-icon-btn { width: 28px; height: 28px; }
.cal-row .a-icon-btn svg { width: 14px; height: 14px; }
.cal-sub { font-size: 13px; color: var(--muted); margin: 8px 2px; }
.cal-hours { display: flex; flex-direction: column; gap: 10px; }
.cal-hour { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: start; }
.cal-hour > span { font-family: var(--font-en); font-weight: 700; color: var(--muted); padding-top: 8px; font-size: 13px; }
.cal-agenda { display: flex; flex-direction: column; gap: 10px; }
.cal-agenda-day { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); }
.cal-agenda-day.today { border-color: var(--orange); background: rgba(255, 107, 0, .04); }
.cal-agenda-date { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border-radius: 12px; background: rgba(147, 179, 255, .06); padding: 6px; align-self: start; }
.cal-agenda-date b { font-size: 24px; font-weight: 900; font-family: var(--font-en); line-height: 1.2; }
.cal-agenda-date span { font-size: 12px; font-weight: 700; }
.cal-agenda-date small { font-size: 11px; color: var(--muted); }
.cal-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 82px; }
@media (max-width: 1200px) { .cal-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
.cal-today-card { display: flex; align-items: center; gap: 14px; }
.cal-today-card > div:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-today-card small { font-size: 12px; color: var(--muted); }
.cal-today-card b { font-size: 15px; }
.cal-today-ring { position: relative; width: 74px; height: 74px; flex: none; }
.cal-today-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cal-today-ring circle { fill: none; stroke-width: 11; }
.cal-today-ring .t { stroke: rgba(147, 179, 255, .12); }
.cal-today-ring .v { stroke: var(--success); stroke-linecap: round; stroke-dasharray: var(--v) 100; }
.cal-today-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 900; }
.cal-late.has { border-color: rgba(255, 90, 95, .35); }
.cal-late h3 span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.cal-late h3 .ico { width: 17px; height: 17px; }

/* ------------------------------------------------------------------ to-do */
.todo-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .todo-layout { grid-template-columns: 1fr; } }
.todo-side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 82px; }
@media (max-width: 960px) { .todo-side { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .todo-side .todo-side-label, .todo-side .todo-tags, .todo-side select { display: none; } }
.todo-list-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding-inline: 10px; border-radius: 12px; border: 0; background: none; color: var(--fg-2); font-weight: 700; font-size: 13.5px; text-align: start; cursor: pointer; flex: none; white-space: nowrap; }
.todo-list-btn .ico { width: 17px; height: 17px; opacity: .8; }
.todo-list-btn span { flex: 1; }
.todo-list-btn em { font-style: normal; font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 100px; background: rgba(147, 179, 255, .1); color: var(--fg-2); }
.todo-list-btn em.red { background: var(--danger); color: #fff; }
.todo-list-btn:hover { background: rgba(147, 179, 255, .06); }
.todo-list-btn.on { background: rgba(255, 107, 0, .12); color: var(--fg); }
.todo-side-label { font-size: 11.5px; color: var(--muted); padding: 14px 10px 4px; }
.todo-tags { display: flex; flex-wrap: wrap; gap: 6px; padding-inline: 6px; }
.todo-tags .chip { cursor: pointer; font-size: 12px; }
.todo-main { min-width: 0; }
.todo-group + .todo-group { margin-top: 16px; }
.todo-group-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; }
.todo-group-head b { font-size: 14px; }
.todo-group-head small { font-size: 11.5px; color: var(--muted); padding: 0 8px; border-radius: 100px; background: rgba(147, 179, 255, .08); }
.todo-group.late .todo-group-head b { color: #ff8a8d; }
.todo-group.today .todo-group-head b { color: var(--orange-400); }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(147, 179, 255, .03); margin-bottom: 6px; position: relative; transition: border-color .2s, background .2s; }
.todo-row::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: -1px; width: 3px; border-radius: 3px; background: var(--kc, transparent); }
.todo-row:hover { border-color: var(--line-2); background: rgba(147, 179, 255, .06); }
.todo-row.prio-3 { border-color: rgba(255, 90, 95, .3); }
.todo-row.prio-2 { border-color: rgba(255, 107, 0, .25); }
.todo-row.done { opacity: .55; }
.todo-row.done .todo-row-main b { text-decoration: line-through; }
.todo-row.done .ws-check { background: var(--success); border-color: var(--success); color: #fff; }
.todo-row.cancelled { opacity: .45; }
.todo-row.late { background: rgba(255, 90, 95, .05); }
.todo-row-main { flex: 1; min-width: 0; border: 0; background: none; color: var(--fg); text-align: start; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.todo-row-main b { font-size: 14.5px; font-weight: 700; line-height: 1.6; }
.todo-row-main small { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--muted); align-items: center; }
.todo-row-main small span { display: inline-flex; align-items: center; gap: 4px; }
.todo-row-main small .ico { width: 13px; height: 13px; }
.todo-due.late { color: #ff8a8d; font-weight: 800; }
.todo-prio.p3 { color: #ff8a8d; font-weight: 800; }
.todo-prio.p2 { color: var(--orange-400); font-weight: 800; }
.todo-proj { color: var(--blue-300); }
.todo-tag { color: #c4a6ff; }
.todo-st { padding: 0 8px; border-radius: 100px; font-weight: 700; }
.todo-st.doing { background: rgba(13, 91, 255, .15); color: var(--blue-300); }
.todo-st.waiting { background: rgba(255, 200, 0, .13); color: #e8b931; }
.todo-bar { display: block; height: 4px; border-radius: 4px; background: rgba(147, 179, 255, .1); overflow: hidden; max-width: 260px; }
.todo-bar i { display: block; height: 100%; background: var(--success); border-radius: 4px; }
.todo-row-actions { display: flex; gap: 4px; opacity: .25; transition: opacity .2s; }
.todo-row:hover .todo-row-actions { opacity: 1; }
@media (hover: none) { .todo-row-actions { opacity: 1; } }
.todo-row-actions .a-icon-btn { width: 32px; height: 32px; }
.todo-row-actions .a-icon-btn svg { width: 15px; height: 15px; }
.todo-row-actions .a-icon-btn.on { color: var(--orange-400); border-color: var(--orange); }

/* work-item editor */
.input--lg { height: 52px !important; font-size: 16px; font-weight: 700; }
.prio-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.prio-pick button { height: 40px; padding-inline: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--fg-2); font-weight: 700; font-size: 13px; }
.prio-pick button.on.prio-0 { background: rgba(147, 179, 255, .14); color: var(--fg); }
.prio-pick button.on.prio-1 { background: rgba(13, 91, 255, .2); color: var(--fg); border-color: var(--blue); }
.prio-pick button.on.prio-2 { background: rgba(255, 107, 0, .2); color: var(--fg); border-color: var(--orange); }
.prio-pick button.on.prio-3 { background: rgba(255, 90, 95, .22); color: var(--fg); border-color: var(--danger); }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick button { width: 32px; height: 32px; border-radius: 10px; border: 2px solid var(--line-2); background: var(--c); color: var(--muted); display: grid; place-items: center; }
.color-pick button.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #999) 40%, transparent); border-color: var(--fg); }
.color-pick button .ico { width: 14px; height: 14px; }
.steps-edit { display: flex; flex-direction: column; gap: 6px; }
.step-row { display: flex; align-items: center; gap: 8px; }
.step-row .input { height: 40px; }
.step-row.done .input { text-decoration: line-through; opacity: .6; }
.step-row.done .ws-check { background: var(--success); border-color: var(--success); color: #fff; }

/* ------------------------------------------------------------ agent page */
.ag-full { border-color: rgba(140, 90, 255, .35) !important; }
.ag-prompt { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.ag-prompt small { color: var(--muted); font-size: 12.5px; }
.ag-prompt pre { margin: 0; padding: 14px; border-radius: 14px; background: rgba(4, 10, 26, .55); font-size: 12.5px; line-height: 1.9; white-space: pre-wrap; direction: rtl; text-align: right; }
.ag-prompt .btn { align-self: flex-start; }
.ag-md { max-height: 620px; overflow: auto; padding: 14px; border-radius: 14px; background: rgba(4, 10, 26, .4); font-size: 12.5px; text-align: left; }
.ag-md table { border-collapse: collapse; width: 100%; font-size: 12px; }
.ag-md th, .ag-md td { border: 1px solid var(--line); padding: 5px 8px; vertical-align: top; }
.ag-md code { font-size: 11.5px; }
.ag-md h1 { font-size: 18px; } .ag-md h2 { font-size: 15.5px; margin-top: 18px; } .ag-md h3 { font-size: 13px; margin-top: 12px; }

/* programmatic focus after navigation (FocusOnNavigate) must not draw a ring */
h1:focus:not(:focus-visible), h1[tabindex="-1"]:focus { outline: none; }

/* ------------------------------------------------ contract — Rawaq print format */
.ct-rq { --gold: #b08a3e; --ink: #13261d; max-width: 1180px; padding: 54px 58px 34px; overflow: hidden; isolation: isolate; outline: 1.5px solid var(--gold); outline-offset: -18px;
    box-shadow: inset 0 0 0 9px #fff, inset 0 0 0 10.5px var(--ink), 0 40px 90px -30px rgba(0, 0, 0, .55); }
.ct-rq .ct-corner { border-color: var(--gold); width: 30px; height: 30px; }
.ct-rq .ct-corner.tl { top: 2px; left: 2px; } .ct-rq .ct-corner.tr { top: 2px; right: 2px; } .ct-rq .ct-corner.bl { bottom: 2px; left: 2px; } .ct-rq .ct-corner.br { bottom: 2px; right: 2px; }
.ct-watermark { position: absolute; z-index: -1; inset: 0; margin: auto; width: 46%; max-width: 460px; opacity: .045; pointer-events: none; filter: grayscale(.2); }
.ct-rq .ct-head { border-bottom: 0; padding-bottom: 14px; }
.ct-rq .ct-head + .ct-facts { border-top: 3px double var(--ink); }
.ct-rq .ct-eyebrow { color: var(--gold); letter-spacing: .55em; }
.ct-rq .ct-title h1 { color: var(--ink); font-size: clamp(20px, 2.5vw, 30px); line-height: 1.55; font-weight: 900; }
.ct-rq .ct-title p { color: var(--gold); }
.ct-rq .ct-party small { color: var(--gold); }
.ct-facts--6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; margin-top: 2px; }
.ct-facts--6 > div { padding: 12px 8px !important; }
.ct-facts--6 b { font-size: 14px !important; font-weight: 800; color: var(--ink); }
.ct-rq .ct-body { column-count: 3; column-gap: 26px; column-rule: 1px solid #e3dccb; font-size: 12.6px; line-height: 2; text-align: justify; padding-top: 16px; }
.ct-rq .ct-body h2 { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--ink); border-bottom: 0; padding: 0; margin: 16px 0 6px; break-after: avoid; }
.ct-rq .ct-body h2:first-child { margin-top: 0; }
.ct-no { flex: none; font-size: 11.5px; font-weight: 800; color: var(--gold); padding: 1px 8px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 4px; background: #fbf7ee; }
.ct-h { font-weight: 900; }
.ct-rq .ct-body ul { list-style: none; padding-inline-start: 0; }
.ct-rq .ct-body ul > li { position: relative; padding-inline-start: 16px; margin: 3px 0; }
.ct-rq .ct-body ul > li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .8em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.ct-rq .ct-body strong { color: var(--ink); }
.ct-rq .ct-body table { font-size: 11.5px; }
.ct-rq .ct-body th { background: #f7f2e6; color: var(--ink); }
.ct-rq .ct-body td, .ct-rq .ct-body th { border-color: #ddd4bf; padding: 4px 6px; }
.ct-rq .ct-body blockquote { background: #f7f2e6; color: #6b5420; }
.ct-closing { text-align: center; font-size: 14.5px; font-weight: 700; color: var(--ink, #13261d); margin: 22px 0 4px; column-span: all; }
.ct-attach { text-align: center; font-size: 12.5px; color: #6b7280; margin: 0 0 6px; column-span: all; }
.ct-rq .ct-sign { border-top: 0; gap: 54px; margin-top: 18px; padding-top: 0; }
.ct-rq .ct-sign > div { border-top: 2.5px solid var(--ink); padding-top: 12px; }
.ct-rq .ct-sign h3 { font-size: 17px; font-weight: 900; color: var(--ink); }
.ct-rq .ct-sign h3 small { color: var(--gold); }
.ct-rq .ct-line { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; border-bottom: 1px solid #d6cfbd; padding: 14px 0 4px; color: #8a8f99; font-size: 12px; min-height: 40px; }
.ct-rq .ct-line b { color: var(--ink); font-size: 13px; font-weight: 700; }
.ct-rq .ct-stamp-line { min-height: 92px; border-bottom: 2px solid var(--ink); align-items: flex-end; justify-content: center; }
.ct-rq .ct-stamp { max-height: 80px; margin-inline-start: auto; }
.ct-rq .ct-esign { margin-bottom: 6px; }
.ct-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 10px; border-top: 1px solid #d6cfbd; font-size: 11.5px; color: #6b7280; }
.ct-foot b { color: var(--ink, #13261d); font-size: 12px; }
.ct-foot i { display: inline-block; width: 90px; border-bottom: 1px solid #9aa0a8; vertical-align: -2px; margin-inline: 6px; }
.ct-builder .ct-b-sub { font-size: 13.5px; color: var(--orange-400); margin: 6px 0 -4px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ct-pays { display: flex; flex-direction: column; gap: 8px; }
.ct-pay-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto 38px; gap: 8px; align-items: center; }
.ct-pay-row span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ct-signers summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.ct-signers[open] summary { margin-bottom: 12px; }
@media (max-width: 1000px) { .ct-rq .ct-body { column-count: 2; } .ct-facts--6 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 700px) {
    .ct-rq { padding: 34px 18px 22px; outline-offset: -10px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5); }
    .ct-rq .ct-body { column-count: 1; }
    .ct-facts--6 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .ct-rq .ct-sign { grid-template-columns: 1fr; gap: 26px; }
    .ct-pay-row { grid-template-columns: 1fr 80px 38px; } .ct-pay-row span { display: none; }
}
@media print {
    .ct-rq { box-shadow: none !important; max-width: none; padding: 26px 30px 10px; outline-offset: -12px; }
    .ct-rq .ct-body { column-count: 3 !important; font-size: 9.6pt; line-height: 1.85; }
    .ct-facts--6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
    .ct-rq .ct-sign { grid-template-columns: 1fr 1fr !important; break-inside: avoid; }
    .ct-foot { display: none; }
    .ct-watermark { opacity: .05; }
}

/* ------------------------------------------------------- accounting report */
.acc-pl { margin-bottom: 16px; }
.acc-pl-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.acc-periods { border: 0 !important; padding: 3px !important; border-radius: 12px; background: rgba(147, 179, 255, .07); }
.acc-periods button { height: 34px !important; font-size: 12.5px !important; }
.acc-pl-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .acc-pl-grid { grid-template-columns: 1fr; } }
.acc-statement { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.acc-st-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.acc-st-row:last-child { border-bottom: 0; }
.acc-st-row b { font-family: var(--font-fa); font-weight: 800; white-space: nowrap; }
.acc-st-row.head { background: rgba(147, 179, 255, .05); font-weight: 800; }
.acc-st-row.sub { padding-inline-start: 30px; color: var(--fg-2); font-size: 12.5px; }
.acc-st-row.sub b { font-weight: 600; }
.acc-st-row.sub i { position: absolute; inset-inline-start: 0; bottom: 0; height: 2px; background: rgba(255, 90, 95, .5); }
.acc-st-row.total { border-top: 2px solid var(--line-2); font-weight: 900; }
.acc-st-row.net { font-size: 15px; font-weight: 900; background: rgba(34, 195, 142, .07); }
.acc-st-row.net.neg { background: rgba(255, 90, 95, .07); }
.acc-st-row .pos, .acc-st-row.pos b { color: var(--success); }
.acc-st-row .neg, .acc-st-row.neg b { color: var(--danger); }
.acc-mini { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; }
.acc-mini h4 { font-size: 13.5px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.acc-mini h4 small { font-size: 11px; font-weight: 600; }
.acc-mini .acc-st-row { padding: 7px 4px; border-bottom: 1px dashed var(--line); background: none; }
.acc-age { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.acc-age > div { height: 8px; border-radius: 8px; background: rgba(147, 179, 255, .1); overflow: hidden; }
.acc-age i { display: block; height: 100%; border-radius: 8px; background: var(--success); }
.acc-age.w1 i { background: #eab308; } .acc-age.w2 i { background: var(--orange); } .acc-age.w3 i, .acc-age.w4 i { background: var(--danger); }
.acc-age b { font-weight: 800; white-space: nowrap; }
.acc-age small { color: var(--muted); font-size: 11px; white-space: nowrap; }
html[data-theme="light"] .acc-st-row.head { background: #f6f8fc; }
html[data-theme="light"] .acc-periods { background: #eef2f9; }

/* ------------------------------------------------------- dashboard today */
.db-today { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .db-today { grid-template-columns: 1fr; } }
.db-today .cal-list { max-height: 360px; overflow-y: auto; }

/* AJAX zones */
[data-ajax-zone] { transition: opacity .2s; }
.ajax-loading { opacity: .45; pointer-events: none; }

/* ===================================================== v1.6 — scope, approvals, deliverables, releases, module bank */
.chip--ok { color: #6ee7a8; background: rgba(46, 204, 113, .12); border-color: rgba(46, 204, 113, .35); }
.a-hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* scope chips (portal + admin) */
.pt-scope { display: inline-flex; align-items: center; height: 20px; padding-inline: 8px; margin-inline-start: 8px; border-radius: 100px; font-size: 11px; font-weight: 800; vertical-align: middle; border: 1px solid transparent; white-space: nowrap; }
.pt-scope.extra { color: #ffd479; background: rgba(255, 196, 61, .12); border-color: rgba(255, 196, 61, .35); }
.pt-scope.support { color: #9cc0ff; background: rgba(13, 91, 255, .14); border-color: rgba(13, 91, 255, .35); }
.pt-scope.implied { color: var(--muted); background: rgba(147, 179, 255, .08); border-color: var(--line); }
.pt-scope.state { color: var(--fg); background: rgba(147, 179, 255, .08); border-color: var(--line); }

/* portal: offers, deliverables, releases */
.pt-offers, .pt-deliv-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-bottom: 22px; }
.pt-offer { border-color: rgba(255, 196, 61, .35); display: flex; flex-direction: column; gap: 10px; }
.pt-offer.accepted { opacity: .85; }
.pt-offer-price { font-size: 20px; font-weight: 900; color: #ffd479; }
.pt-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pt-deliv { display: flex; flex-direction: column; gap: 10px; }
.pt-deliv.s-inreview { border-color: rgba(255, 107, 0, .45); box-shadow: 0 0 0 1px rgba(255, 107, 0, .15); }
.pt-deliv.s-approved { border-color: rgba(46, 204, 113, .35); }
.pt-deliv-status { font-size: 12px; font-weight: 800; color: var(--orange-300); }
.pt-deliv.s-approved .pt-deliv-status { color: #6ee7a8; }
.pt-deliv-media { width: 100%; max-height: 420px; object-fit: contain; border-radius: 14px; background: rgba(0, 0, 0, .25); display: block; }
.pt-deliv-comment { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(147, 179, 255, .06); font-size: 13px; display: flex; gap: 8px; }
.pt-release-notes { font-size: 13.5px; }

/* admin: approvals */
.ap-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 10px; margin-bottom: 16px; }
.ap-step { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--fg); }
.ap-step small { color: var(--muted); font-size: 11.5px; }
.ap-step.on { background: rgba(255, 107, 0, .12); border-color: rgba(255, 107, 0, .4); }
.ap-step .a-badge { position: absolute; top: 8px; inset-inline-end: 8px; }
.ap-list { display: grid; gap: 14px; }
.ap-item { display: flex; flex-direction: column; gap: 10px; }
.ap-item h3 { margin: 0; font-size: 16px; }
.ap-item-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ap-item-head small { margin-inline-start: auto; color: var(--muted); }
.ap-details { margin: 0; white-space: pre-wrap; color: var(--fg-2, var(--fg)); font-size: 13.5px; }
.ap-reason { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.ap-price { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ap-price label { font-size: 12.5px; color: var(--muted); }
.ap-price .input { max-width: 200px; }
.ap-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ap-wait { color: var(--muted); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.ap-sms { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 800px) { .ap-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ap-sms { margin-inline-start: 0; } }

/* admin: module bank */
.mb-filter { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.mb-filter .input { flex: 1; min-width: 180px; }
.mb-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.mb-card { text-align: start; display: flex; flex-direction: column; gap: 6px; color: var(--fg); cursor: pointer; }
.mb-card.on { border-color: rgba(255, 107, 0, .45); }
.mb-card p { margin: 0; font-size: 13px; color: var(--muted); }
.mb-card small { color: var(--muted); font-size: 12px; }
.mb-card-head { display: flex; gap: 6px; flex-wrap: wrap; }
.mb-detail { display: flex; flex-direction: column; gap: 10px; }
.mb-detail h4 { margin: 10px 0 0; }
.mb-status { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.mb-docs { padding: 12px; border-radius: 12px; background: rgba(147, 179, 255, .05); font-size: 13.5px; }
.mb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mb-list li { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.mb-list li p { margin: 0; width: 100%; font-size: 12.5px; color: var(--muted); }
.mb-form { display: flex; gap: 8px; flex-wrap: wrap; }
.mb-form .input { flex: 1; min-width: 160px; }

/* admin workspace: scope / approval state on task rows */
.ws-scope-row { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.a-tabs .a-badge { margin-inline-start: 6px; display: inline-grid; vertical-align: middle; }
.mb-card code { font-size: 12px; opacity: .85; }
/* nested cards: no second backdrop blur (Chromium drops the text of blurred buttons inside two blurred layers) */
.ws-deliv { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: rgba(147, 179, 255, .03); }
.a-card textarea.input { height: auto; min-height: 150px; padding-block: 10px; line-height: 1.8; resize: vertical; }
/* v1.8 fix propagation */
.fx-targets { display: grid; gap: 8px; }
.fx-target { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.fx-target.custom { border-color: rgba(255, 107, 0, .35); }
.fx-target.decided { opacity: .75; cursor: default; }
.fx-target input { width: 18px; height: 18px; accent-color: var(--orange); }
.fx-state { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); }
.fx-target small { width: 100%; color: var(--muted); font-size: 12px; }

/* ===== v1.9 — project team (portal «اعضا» tab) ===== */
.pt-team { display: grid; gap: 10px; }
.pt-member { flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.pt-member.sms { border-color: rgba(34, 195, 142, .45); box-shadow: inset 0 0 0 1px rgba(34, 195, 142, .15); }
.pt-member-av { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--brand, #0D5BFF), #FF6B00); }
.pt-member-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.pt-member-main b { font-size: 15px; font-weight: 800; }
.pt-member-main b em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.pt-member-main small { color: var(--muted); font-size: 12.5px; }
.pt-member-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pt-role { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 30px; background: rgba(147, 179, 255, .1); border: 1px solid var(--line); color: var(--fg-2, #c9d6f5); }
.pt-role .ico { width: 13px; height: 13px; }
.pt-role.r0 { background: rgba(255, 107, 0, .12); border-color: rgba(255, 107, 0, .4); color: #ffb37a; }
.pt-role.r1 { background: rgba(13, 91, 255, .14); border-color: rgba(13, 91, 255, .45); color: #9dbbff; }
.pt-role.main { background: rgba(255, 200, 0, .1); border-color: rgba(255, 200, 0, .35); color: #ffd66b; }
.pt-role.sms { background: rgba(34, 195, 142, .12); border-color: rgba(34, 195, 142, .45); color: #8ff0cf; }
.pt-member-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pt-mini { min-height: 36px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2, var(--line)); background: rgba(147, 179, 255, .06); color: var(--fg); font-size: 12.5px; font-weight: 800; }
.pt-mini:hover { filter: brightness(1.15); }
.pt-mini.danger { border-color: rgba(240, 80, 110, .5); color: #ff9bb0; background: rgba(240, 80, 110, .1); }
.pt-mini-select { min-height: 36px !important; width: auto !important; padding: 0 10px !important; font-size: 12.5px !important; }
@media (max-width: 560px) { .pt-member-acts { width: 100%; } }

/* ---------- messages log: compact rows + exact preview (v1.9.3) ---------- */
.ml-list { display: flex; flex-direction: column; gap: 8px; }
.ml-row { display: grid; grid-template-columns: 42px minmax(140px, 190px) minmax(0, 1fr) auto 104px; gap: 14px; align-items: center; width: 100%;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--fg); font: inherit; text-align: start; cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s; }
.ml-row:hover { border-color: var(--line-2); background: var(--card-2); }
.ml-row:focus-visible { outline: 2px solid #4d8dff; outline-offset: 2px; }
.ml-row.is-fail { border-color: rgba(255, 90, 95, .35); }
.ml-ch { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
.ml-ch svg { width: 20px; height: 20px; }
.ml-ch--sms { background: rgba(255, 122, 26, .14); color: #ff9a4d; }
.ml-ch--mail { background: rgba(77, 141, 255, .15); color: #7fb0ff; }
.ml-who { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.ml-who b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-who small { font-size: 12px; color: var(--fg-3, #8ea0c8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; direction: ltr; }
.ml-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ml-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ml-tag { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 100px; background: rgba(77, 141, 255, .13); color: #9cc0ff; white-space: nowrap; }
.ml-tag--soft { background: rgba(147, 179, 255, .08); color: var(--fg-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.ml-subj { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-snippet { font-size: 13px; line-height: 1.8; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ml-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ml-state small { font-size: 11.5px; color: var(--fg-3, #8ea0c8); }
.ml-time { font-size: 12px; color: var(--fg-3, #8ea0c8); white-space: nowrap; text-align: end; }
@media (max-width: 1100px) {
    .ml-row { grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-areas: "ch who state" "text text text" "time time time"; row-gap: 8px; }
    .ml-ch { grid-area: ch; } .ml-who { grid-area: who; } .ml-state { grid-area: state; } .ml-text { grid-area: text; }
    .ml-time { grid-area: time; text-align: start; }
}
@media (max-width: 640px) {
    .ml-tools .select, .ml-tools .a-search { flex: 1 1 100%; width: 100%; }
    .ml-row { padding: 12px; gap: 10px; }
    .ml-tag--soft { max-width: 100%; }
}

.mp-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(147, 179, 255, .07); border: 1px solid var(--line); }
.mp-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: 0; border-radius: 10px;
    background: transparent; color: var(--fg-2); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.mp-tabs button.on { background: var(--card-2); color: var(--fg); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.mp-tabs svg { width: 16px; height: 16px; }

/* SMS — a phone-style message screen */
.mp-phone { width: min(390px, 100%); margin-inline: auto; border-radius: 34px; padding: 10px; background: #0b1124; border: 1px solid rgba(147, 179, 255, .22); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.mp-phone-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; background: #f7f8fb; border-radius: 26px 26px 0 0; color: #111827; border-bottom: 1px solid #e5e8ef; }
.mp-phone-top b { display: block; font-size: 15px; }
.mp-phone-top small { font-size: 12px; color: #6b7280; }
.mp-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #ff8a2b, #ff6b00); color: #fff; font-weight: 800; flex: none; }
.mp-avatar svg { width: 18px; height: 18px; }
.mp-avatar--mail { background: linear-gradient(135deg, #0d5bff, #0d1b3d); }
.mp-phone-body { background: #ffffff; min-height: 300px; max-height: 62vh; overflow-y: auto; padding: 16px 14px 22px; display: flex; flex-direction: column; gap: 10px; }
.mp-day { align-self: center; font-size: 11.5px; color: #6b7280; background: #f1f3f7; padding: 3px 12px; border-radius: 100px; }
.mp-bubble { align-self: flex-start; max-width: 86%; background: #e9ebf0; color: #111827; padding: 10px 14px 8px; border-radius: 20px 20px 20px 6px;
    white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.9; }
html[dir="rtl"] .mp-bubble { border-radius: 20px 20px 6px 20px; }
.mp-bubble-time { display: block; text-align: end; font-size: 11px; color: #6b7280; margin-top: 4px; }
.mp-phone-foot { background: #f7f8fb; color: #6b7280; font-size: 12px; text-align: center; padding: 10px; border-radius: 0 0 26px 26px; border-top: 1px solid #e5e8ef; }

/* E-mail — an inbox-style header + the exact HTML */
.mp-mail { border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); background: #ffffff; }
.mp-mail-head { padding: 16px 18px 14px; background: #ffffff; color: #1f2937; border-bottom: 1px solid #e5e8ef; display: flex; flex-direction: column; gap: 12px; }
.mp-mail-subj { font-size: 18px; font-weight: 800; line-height: 1.6; }
.mp-mail-meta { display: flex; align-items: center; gap: 10px; }
.mp-mail-meta b { font-size: 14px; }
.mp-mail-meta small { display: block; font-size: 12px; color: #6b7280; }
.mp-mail-meta small.ltr { display: inline; }
.mp-mail-frame { display: block; width: 100%; height: 72vh; min-height: 520px; border: 0; background: #EEF2F8; }
@media (max-width: 640px) { .mp-mail-frame { height: 70vh; min-height: 420px; } .mp-tabs button { font-size: 12.5px; padding: 9px 8px; } }
