:root {
  /* Abhaya palette (from the logo) */
  --brand-violet: #a855aa; --brand-plum: #4a2a5c; --brand-blue: #19a9e1;
  --brand-yellow: #f9c13a; --brand-orange: #f08a2b; --brand-red: #e3524a;
  /* light orchid theme: soft lavender-pink page, white cards, orchid sidebar (the logo's top loop) */
  --bg: #f8f1f9;
  --bg-side: #9b4ca0;
  --bg-hover: #f1e4f4;
  --bg-col: #f0e3f2;
  --card: #ffffff;
  --text: #2a1733;
  --muted: #6e5a79;
  --faint: #a08fab;
  --line: #e7d7eb;
  --accent: #a855aa;
  --accent-hover: #94459a;
  --accent-text: #8c3b91;
  --accent-ink: #ffffff;
  --danger: #d2433b;
  --shadow: 0 1px 2px rgba(74,42,92,.07), 0 0 0 1px rgba(74,42,92,.07);
  --shadow-lg: 0 14px 34px rgba(74,42,92,.18), 0 0 0 1px rgba(74,42,92,.08);
  --wa-bubble: #f3e7f5;
  --p-low: #8a7896; --p-medium: #1288b8; --p-high: #d9731a; --p-urgent: #d2433b;
  --radius: 6px;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
.side { background: var(--bg-side); border-right: 1px solid var(--line); padding: 12px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 18px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand .logo { width: 38px; height: 38px; object-fit: contain; flex: none; }
.nav { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius); cursor: pointer; color: var(--muted); border: 0; background: none; text-align: left; width: 100%; }
.nav:hover { background: var(--bg-hover); }
.nav.on { background: var(--bg-hover); color: var(--text); font-weight: 500; }
.nav .count { margin-left: auto; font-size: 12px; color: var(--faint); }
.nav .count.alert { color: var(--danger); font-weight: 600; }
.side h4 { font-size: 11.5px; color: var(--faint); font-weight: 500; margin: 16px 10px 4px; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }
.side .spacer { flex: 1; }
.side .me { font-size: 12.5px; color: var(--muted); padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.top { padding: 22px 32px 10px; }
.top h1 { margin: 0 0 12px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; }
.content { flex: 1; overflow: auto; padding: 16px 32px 40px; }
.menu-btn { display: none; }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--line); background: var(--card); padding: 5px 10px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 3px 8px; font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: none; padding: 5px 10px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--bg-hover); color: var(--text); font-weight: 500; }
.input, select.input, textarea.input { border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); padding: 5px 8px; outline: none; }
.input:focus { border-color: var(--accent); }
.search { width: 200px; }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; align-items: start; min-height: 100%; }
.col { background: var(--bg-col); border-radius: 8px; padding: 8px; min-height: 120px; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px 10px; font-weight: 500; font-size: 13px; }
.col-head .n { color: var(--faint); font-weight: 400; }
.col-head .add { margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.s-todo { background: rgba(155,154,151,.18); }
.s-in_progress { background: rgba(25,169,225,.16); color: #4cc0ec; }
.s-waiting { background: rgba(240,138,43,.18); color: #f5a55a; }
.s-done { background: rgba(249,193,58,.16); color: #f9c13a; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 10px 8px; margin-bottom: 8px; cursor: pointer; }
.card:hover { box-shadow: var(--shadow-lg); }
.card.dragging { opacity: .4; }
.card .t { font-weight: 500; line-height: 1.35; margin-bottom: 7px; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 4px; background: var(--bg-hover); font-size: 12px; color: var(--text); }
.tag.unknown { background: rgba(212,76,71,.12); color: var(--danger); }
.prio { font-size: 11.5px; font-weight: 600; text-transform: capitalize; }
.prio.low { color: var(--p-low); } .prio.medium { color: var(--p-medium); } .prio.high { color: var(--p-high); } .prio.urgent { color: var(--p-urgent); }
.due.late { color: var(--danger); font-weight: 500; }
.avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: white; font-size: 10.5px; font-weight: 600; display: inline-grid; place-items: center; flex: none; }
.wa-ic { color: var(--accent-text); }

/* ---------- table ---------- */
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tr.row { cursor: pointer; }
.list tr.row:hover td { background: var(--bg-hover); }
.list .title-cell { font-weight: 500; min-width: 240px; }
.list .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }

/* ---------- side peek (task detail) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15,15,15,.25); z-index: 20; }
.peek { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--bg); z-index: 21; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .16s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.peek-top { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.peek-body { overflow-y: auto; padding: 22px 40px 40px; flex: 1; }
.peek h2 { margin: 0; }
.title-edit { font-size: 26px; font-weight: 700; border: 0; outline: 0; width: 100%; background: none; padding: 0; resize: none; line-height: 1.25; }
.props { display: grid; grid-template-columns: 130px 1fr; gap: 4px 8px; margin: 16px 0 18px; align-items: center; }
.props .k { color: var(--muted); font-size: 13px; }
.props select, .props input { border: 1px solid transparent; background: none; padding: 4px 6px; border-radius: 4px; width: fit-content; max-width: 100%; cursor: pointer; }
.props select:hover, .props input:hover { background: var(--bg-hover); }
.desc { width: 100%; min-height: 90px; border: 1px solid transparent; border-radius: var(--radius); padding: 8px; background: none; outline: none; line-height: 1.5; resize: vertical; }
.desc:hover { border-color: var(--line); }
.desc:focus { border-color: var(--accent); }
.section-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 26px 0 10px; display: flex; align-items: center; gap: 6px; }
.bubbles { display: flex; flex-direction: column; gap: 6px; }
.bubble { background: var(--wa-bubble); padding: 7px 10px; border-radius: 8px 8px 8px 2px; max-width: 92%; width: fit-content; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble .when { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bubble img { max-width: 100%; max-height: 280px; border-radius: 5px; display: block; margin-bottom: 4px; }
.bubble audio { max-width: 260px; display: block; margin-bottom: 4px; }
.bubble .tr { font-style: italic; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed .item { display: flex; gap: 8px; align-items: flex-start; }
.feed .item.activity { color: var(--muted); font-size: 12.5px; padding-left: 28px; }
.feed .body { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.feed .who { font-weight: 500; font-size: 13px; }
.feed .ts { color: var(--faint); font-size: 11.5px; margin-left: 6px; font-weight: 400; }
.wa-note { background: var(--wa-bubble); border-radius: 6px; padding: 6px 9px; margin-top: 3px; }
.comment-box { display: flex; gap: 8px; margin-top: 14px; }
.comment-box textarea { flex: 1; min-height: 38px; resize: vertical; }

/* ---------- inbox / clients ---------- */
.msg-row { display: grid; grid-template-columns: 170px 1fr 200px; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.msg-row .from { font-weight: 500; }
.msg-row .from .ph { font-weight: 400; font-size: 12px; color: var(--muted); }
.msg-row .txt { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.msg-row .st { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 12.5px; }
.st-pending, .st-processing { color: var(--p-medium); }
.st-ignored { color: var(--muted); }
.st-failed { color: var(--danger); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--card); }
.panel h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.phone { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.notice { background: rgba(240,138,43,.1); border: 1px solid rgba(240,138,43,.35); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.empty { color: var(--faint); text-align: center; padding: 40px 0; }
.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; z-index: 31; top: 12vh; left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); background: var(--bg); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 20px; }
.modal h3 { margin: 0 0 14px; }
.modal label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
.modal .input { width: 100%; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 40; font-size: 13px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg-side); }
.login form { width: min(360px, 100%); background: var(--bg); padding: 28px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 10px; }
.login h1 { font-size: 22px; margin: 0; text-align: center; }
.login .sub { text-align: center; color: var(--muted); margin: -4px 0 10px; font-size: 13px; }
.login-logo { width: 88px; height: 88px; margin: 0 auto 4px; display: block; }
.login .err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- mobile ---------- */
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 25; inset: 0 auto 0 0; width: 250px; transform: translateX(-100%); transition: transform .18s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .top { padding: 14px 16px 8px; }
  .top h1 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
  .content { padding: 12px 16px 40px; }
  .board { grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory;
           margin: 0 -16px; padding: 0 16px 8px; -webkit-overflow-scrolling: touch; }
  .col { scroll-snap-align: start; min-height: 60vh; }
  .side-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 24; }
  .content { overflow-x: hidden; }
  .search { width: 100%; order: 10; }
  .peek-body { padding: 18px 18px 40px; }
  .props { grid-template-columns: 110px 1fr; }
  .msg-row { grid-template-columns: 1fr; gap: 6px; }
  .list .hide-m { display: none; }
}

/* ---------- WhatsApp groups additions ---------- */
.bubble .who { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.bubble.team { background: var(--bg-hover); margin-left: auto; border-radius: 8px 8px 2px 8px; }
.bubble .quote { border-left: 3px solid var(--accent); padding: 2px 8px; margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.badge { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 8px; background: rgba(168,85,170,.22); color: var(--accent-text); vertical-align: 1px; }
.media { display: flex; gap: 10px; align-items: center; margin: 4px 0 6px; font-size: 13px; }
.thumb { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex: none; background: var(--bg-hover); }
.thumb.ph { display: grid; place-items: center; font-size: 22px; }
.switch { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.bubble { white-space: normal; }
.bubble .bt, .bubble .tr { white-space: pre-wrap; }

/* ---------- Abhaya theme touches ---------- */
a { color: var(--accent-text); }
.nav { position: relative; }
.nav.on { background: rgba(168,85,170,.18); color: var(--text); }
.nav.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--accent); }
.seg button.on { background: rgba(168,85,170,.22); }
.input:focus, .desc:focus { border-color: var(--accent); }
.login { background: radial-gradient(1200px 600px at 20% 0%, #2c1840 0%, var(--bg-side) 60%); }
.st-pending, .st-processing { color: var(--brand-blue); }
.side { background: linear-gradient(180deg, #1a1021 0%, var(--bg-side) 100%); }
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; vertical-align: middle; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: background .15s; }
.toggle span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::before { transform: translateX(16px); }
tr.chat-off td:not(:first-child) { opacity: .6; }

/* ---------- calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { font-size: 18px; margin: 0 6px; min-width: 150px; text-align: center; }
.cal-head [data-mv] { font-size: 18px; padding: 2px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-wd { background: var(--bg-col); color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; }
.cal-day { background: var(--bg); min-height: 108px; padding: 5px 6px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:hover { background: #20162a; }
.cal-day.other { background: #170f1d; }
.cal-day.other .cal-num { color: var(--faint); opacity: .6; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.drop, .cal-undated.drop { background: rgba(168,85,170,.16); }
.cal-num { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.cal-day.today .cal-num > span:first-child { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-weight: 600; }
.cal-dot { display: none; font-size: 10.5px; font-weight: 600; min-width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 9px; background: rgba(168,85,170,.3); color: var(--accent-text); }
.cal-dot.late { background: rgba(227,82,74,.25); color: #ff8b84; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 4px; background: var(--card); border-left: 3px solid var(--faint);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip:hover { background: var(--bg-hover); }
.cal-chip.done { opacity: .5; text-decoration: line-through; }
.cal-chip.late { color: #ff8b84; }
.cal-chip.dragging, .cal-row.dragging { opacity: .4; }
.cal-more { font-size: 11.5px; color: var(--faint); padding-left: 4px; }
.cal-side { display: flex; flex-direction: column; gap: 14px; }
.cal-side h3 { margin: 0 0 8px; font-size: 14.5px; }
.cal-row { background: var(--bg); border-radius: var(--radius); padding: 8px 9px 6px; margin-top: 7px; cursor: pointer; box-shadow: var(--shadow); }
.cal-row:hover { background: var(--bg-hover); }
.cal-row .pill { font-size: 11px; }
.cal-row-t { display: block; font-weight: 500; margin: 5px 0 6px; line-height: 1.35; word-break: break-word; }
.cal-row-t.done { text-decoration: line-through; opacity: .6; }
.cal-undated { max-height: 60vh; overflow-y: auto; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .cal-head h2 { font-size: 16px; min-width: 0; flex: 1; }
  .cal-day { min-height: 52px; padding: 4px; }
  .cal-chips { display: none; }
  .cal-dot { display: inline-block; }
  .cal-num { flex-direction: column; gap: 3px; align-items: center; }
  .cal-wd { padding: 5px 2px; text-align: center; font-size: 10.5px; }
  .cal-undated { max-height: none; }
}

/* ---------- light orchid theme ---------- */
.s-todo { background: #efe6f1; color: #5e4a69; }
.s-in_progress { background: rgba(25,169,225,.14); color: #0d7fae; }
.s-waiting { background: rgba(240,138,43,.16); color: #b85f12; }
.s-done { background: rgba(47,191,155,.16); color: #17866b; }
.input, select.input, textarea.input { background: #fff; }
.peek, .modal, .login form { background: #fff; }
.card { border: 0; }
.col { background: var(--bg-col); }
.list tr.row:hover td { background: #fbf6fc; }
.scrim { background: rgba(42,23,51,.28); }
.login { background: radial-gradient(1100px 620px at 15% 0%, #c27fc4 0%, #a855aa 38%, #7d3a85 100%); }
.notice { background: #fff6ec; }

/* sidebar in the logo's orchid, white text */
.side { background: linear-gradient(180deg, #ae5fb2 0%, #9b4ca0 55%, #8a4190 100%); border-right: 0; color: #fff; }
.side .nav { color: rgba(255,255,255,.86); }
.side .nav:hover { background: rgba(255,255,255,.13); }
.side .nav.on { background: rgba(255,255,255,.22); color: #fff; }
.side .nav.on::before { background: #fff; }
.side h4 { color: rgba(255,255,255,.66); }
.side .nav .count { color: rgba(255,255,255,.75); }
.side .nav .count.alert { color: #fff; background: #e3524a; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.side .dot { box-shadow: 0 0 0 1.5px rgba(255,255,255,.75); }
.side .me { color: rgba(255,255,255,.85); }
.side .btn.ghost { color: rgba(255,255,255,.85); }
.side .btn.ghost:hover { background: rgba(255,255,255,.15); color: #fff; }
.brand { color: #fff; }
.brand .logo { background: #fff; border-radius: 11px; padding: 4px; box-shadow: 0 2px 8px rgba(60,20,70,.25); }

/* calendar on light */
.cal-grid { background: var(--line); }
.cal-wd { background: #f6ecf8; color: var(--muted); }
.cal-day { background: #fff; }
.cal-day:hover { background: #fcf7fd; }
.cal-day.other { background: #faf5fb; }
.cal-chip { background: var(--bg-hover); }
.cal-chip:hover { background: #e9d6ee; }
.cal-chip.late { color: var(--danger); }
.cal-dot { background: rgba(168,85,170,.16); color: var(--accent-text); }
.cal-dot.late { background: rgba(210,67,59,.14); color: var(--danger); }
.cal-row { background: var(--bg); }
.cal-row:hover { background: var(--bg-hover); }
.nav .wa-dot { font-size: 13px; }
.nav .wa-dot.on { color: #2fbf9b; }
.nav .wa-dot.off { color: #e3524a; }
.side .nav .wa-dot.on { color: #8af5d6; }
.side .nav .wa-dot.off { color: #ffd34d; }

/* ---------- AI image edits (computer only) ---------- */
.ai-box { margin-top: 6px; }
.ai-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 9px;
           background: linear-gradient(90deg, rgba(168,85,170,.18), rgba(25,169,225,.16)); color: var(--accent-text); text-transform: none; letter-spacing: 0; }
.ai-imgs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.ai-img { width: 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; cursor: pointer; background: var(--bg-hover); display: grid; place-items: center; }
.ai-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-img.on { border-color: var(--accent); }
.ai-instr { width: 100%; resize: vertical; line-height: 1.45; }
.ai-actions { margin-top: 8px; }
.ai-drafts { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ai-draft { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; background: var(--bg); border-radius: 8px; padding: 8px; }
.ai-draft img { width: 150px; max-height: 190px; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: var(--shadow); display: block; }
.ai-draft-meta { font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-wait { width: 150px; height: 110px; border-radius: 6px; background: var(--bg-hover); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 12.5px; color: var(--muted); gap: 4px; padding: 6px; }
.ai-wait.err { color: var(--danger); background: rgba(210,67,59,.08); }
.ai-wait small { font-size: 11px; color: var(--muted); }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 800px) { .ai-box { display: none !important; } }
a.btn { text-decoration: none; color: inherit; }

/* ---------- client groups ---------- */
.nav.grp .caret { width: 14px; display: inline-flex; justify-content: center; font-size: 11px; opacity: .85; border-radius: 3px; }
.nav.grp .caret:hover { background: rgba(255,255,255,.2); }
.nav.grp { font-weight: 500; }
.nav.sub { padding-left: 30px; }
.grp-sec { margin-bottom: 18px; }
.grp-head { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.grp-head h3 { margin: 0; font-size: 15px; flex: 1; display: flex; gap: 8px; align-items: baseline; }
.grp-head h3 .muted { font-weight: 400; font-size: 12.5px; }

/* ---------- linked calendars ---------- */
.cal-chip.evt { color: var(--text); }
.cal-chip.evt b { font-weight: 600; font-size: 11px; color: var(--muted); }
.cal-dots { display: inline-flex; gap: 3px; }
.cal-dot.evt { color: var(--text); }
.cal-cals h3 { margin: 0; }
.cal-cal { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.cal-cal:hover { background: var(--bg-hover); }
.cal-cal input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.cal-cal .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-cal .btn.sm { padding: 0 6px; }
.cal-row.evt { cursor: pointer; }
.evt-desc { white-space: pre-wrap; line-height: 1.5; max-height: 50vh; overflow-y: auto; font-size: 13.5px; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.cal-help { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.cal-help summary { cursor: pointer; color: var(--accent-text); }
.cal-help p { margin: 6px 0; }
.modal { max-height: 86vh; overflow-y: auto; }
@media (max-width: 800px) { .cal-chips { display: none; } }
