:root {
  --primary: #1e7fd0; --primary-d: #1766aa; --accent: #e8334f; --text: #1f2937; --muted: #6b7280; --line: #e5e7eb; --bg: #f6f7f9; --card: #fff;
  --green: #c6f7d8; --grey: #e9ebee; --ok: #16a34a; --warn: #f59e0b; --err: #dc2626; --radius: 8px;
  --font: 'Rubik', 'Assistant', 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; font-weight: 500; }
button { font-family: inherit; cursor: pointer; }
.ico { width: 22px; height: 22px; vertical-align: middle; }
small, .muted { color: var(--muted); }
.hide { display: none !important; }

/* ===== top nav ===== */
.topbar { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: stretch; height: 62px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.brand { direction: ltr; display: flex; align-items: center; padding: 0 18px; font-size: 26px; letter-spacing: 1px; color: #222; font-weight: 300; min-width: 120px; }
.brand b { font-weight: 500; }
.brand .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin: 0 2px; }
.nav { display: flex; align-items: stretch; flex: 1; }
.nav a, .nav .navbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0 14px; min-width: 76px; color: #666; font-size: 12px; border-bottom: 3px solid transparent; background: none; border-top: 0; border-left: 0; border-right: 0; text-decoration: none; position: relative; }
.nav a:hover, .nav .navbtn:hover { color: var(--primary); background: #fafcff; text-decoration: none; }
.nav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.menu { position: absolute; top: 62px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 200px; padding: 6px 0; z-index: 50; text-align: right; }
.menu a { display: block !important; padding: 9px 18px !important; font-size: 14px !important; color: var(--text) !important; text-align: right; border: 0 !important; }
.menu a:hover { background: #f1f6fc; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.userbox { display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-right: 1px solid var(--line); cursor: pointer; min-width: 170px; position: relative; }
.userbox .nm { font-size: 14px; }
.userbox small { font-size: 11px; }

.page { padding: 22px 28px 60px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 400; margin: 0; }
.page-head .sub { color: var(--muted); font-size: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card > h2 { font-size: 20px; margin-bottom: 2px; }
.card .desc { color: var(--muted); margin-bottom: 14px; font-size: 14px; }

/* ===== buttons / forms ===== */
.btn { border: 1px solid var(--primary); background: #fff; color: var(--primary); border-radius: 6px; padding: 7px 16px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: #f1f7fd; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.danger.fill, .btn.danger:hover { background: var(--err); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.sm { padding: 3px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.link-red { color: var(--accent); font-size: 15px; background: none; border: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field .lbl { font-size: 13px; color: #374151; font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #bcdcf7; border-color: var(--primary); }
input:disabled { background: #f3f4f6; }
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 800px) { .grid2, .grid3 { grid-template-columns: 1fr; } .page { padding: 14px; } .nav a, .nav .navbtn { min-width: 56px; padding: 0 6px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid #cfd4da; border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 22px; border-left: 1px solid #cfd4da; color: #555; }
.seg button:last-child { border-left: 0; }
.seg button.on { background: #6b7280; color: #fff; }

/* ===== tables ===== */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-weight: 500; color: #4b5563; border-bottom: 2px solid var(--line); padding: 8px 10px; background: #fafbfc; position: sticky; top: 62px; }
table.t td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
table.t tbody tr:hover { background: #f9fbfe; }
.tablewrap { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; color: #fff; background: #9ca3af; }
.empty { text-align: center; color: var(--muted); padding: 28px; background: #eaf6fb; border-radius: 8px; }

/* ===== modal / toast ===== */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; z-index: 100; overflow: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head .x { border: 0; background: none; font-size: 26px; line-height: 1; color: #888; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; }
#toasts { position: fixed; bottom: 20px; left: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: opacity .4s; max-width: 380px; }
.toast.err { background: var(--err); } .toast.hide { opacity: 0; }

/* ===== login ===== */
.login { max-width: 380px; margin: 12vh auto; }
.login .brand { justify-content: center; font-size: 44px; padding: 0 0 20px; }

/* ===== calendar ===== */
.cal-bar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-title { font-size: 28px; color: var(--primary); cursor: pointer; display: flex; align-items: center; gap: 10px; }
.cal-title .arr { font-size: 26px; padding: 0 6px; user-select: none; }
.cal-bar .tool { display: flex; flex-direction: column; align-items: center; padding: 4px 14px; border-left: 1px solid var(--line); color: #555; font-size: 14px; cursor: pointer; background: none; border-top: 0; border-bottom: 0; border-right: 0; }
.cal-bar .tool.blue { color: var(--primary); } .cal-bar .tool.red { color: var(--accent); }
.cal-wrap { overflow: auto; background: #fff; max-height: calc(100vh - 150px); position: relative; }
.cal-grid { display: grid; position: relative; min-width: max-content; }
.cal-head { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); display: grid; }
.cal-head > div { padding: 8px 6px; text-align: center; font-size: 14px; border-left: 1px solid var(--line); min-height: 58px; display: flex; align-items: center; justify-content: center; }
.cal-body { display: grid; position: relative; }
.col { position: relative; border-left: 1px solid #dfe5e1; background: var(--grey); }
.col .win { position: absolute; left: 0; right: 0; background: var(--green); border-top: 1px solid #d3e8da; border-bottom: 1px solid #d3e8da; }
.col .win span { display: block; text-align: center; font-size: 11px; color: #9aa; padding-top: 2px; }
.hours { position: relative; background: #fff; border-left: 1px solid var(--line); }
.hours div { position: absolute; right: 6px; font-size: 13px; color: #555; transform: translateY(-50%); }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(0,0,0,.05); pointer-events: none; }
.gridline.h { border-top-color: rgba(0,0,0,.09); }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 3px; padding: 2px 4px; font-size: 12px; line-height: 1.25; overflow: hidden; color: #1a1a1a; cursor: pointer; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.15); border: 1px solid rgba(0,0,0,.08); }
.ev:hover { filter: brightness(.96); z-index: 4; }
.ev.cancelled { opacity: .45; text-decoration: line-through; }
.ev.pending { outline: 2px dashed #f59e0b; outline-offset: -2px; }
.ev .tm { font-weight: 500; }
.nowline { position: absolute; left: 0; right: 0; border-top: 1px dashed #e0707e; z-index: 3; pointer-events: none; }
.nowline i { position: absolute; left: 2px; top: -9px; font-size: 10px; color: #e0707e; font-style: normal; }
.popup { position: absolute; z-index: 60; width: 340px; background: #fff; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.28); overflow: hidden; }
.popup .ph { padding: 8px 12px; color: #fff; display: flex; justify-content: space-between; font-size: 16px; }
.popup .ph .x { cursor: pointer; background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; }
.popup .pb { padding: 10px 14px; font-size: 13px; }
.popup .pb .r { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }
.popup .pb .r b { min-width: 62px; color: #555; font-weight: 500; }
.popup .go { display: block; text-align: center; padding: 12px; background: #1c8a97; color: #fff; text-decoration: none; font-size: 16px; }
.dropdown { position: relative; }
.dd-panel { position: absolute; top: 100%; inset-inline-start: 0; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px 14px; min-width: 260px; max-height: 60vh; overflow: auto; text-align: right; }
.fab { position: fixed; bottom: 24px; left: 24px; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 30px; border: 0; box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 20; }

/* ===== agenda ===== */
.agenda-item { display: flex; border-bottom: 1px solid #c9457a55; background: #fff; }
.agenda-item .tm { width: 86px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; padding: 10px 0; }
.agenda-item .bd { flex: 1; padding: 8px 16px; }
.agenda-item .bd .ti { font-size: 16px; } .agenda-item .bd small { display: block; }

/* ===== dashboard ===== */
.stat-row { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; margin: 12px 0 20px; }
.stat b { font-size: 34px; font-weight: 400; display: block; line-height: 1; } .stat span { color: var(--muted); }
.dash-table th, .dash-table td { text-align: center; }
.dash-table td.rname { text-align: right; min-width: 200px; }
.dcell { display: inline-flex; flex-direction: column; align-items: center; min-width: 54px; padding: 4px 6px; border-radius: 6px; }
.dcell b { font-weight: 500; font-size: 15px; } .dcell small { font-size: 12px; }
.grp-row td { background: #f3f4f6; font-weight: 500; text-align: right !important; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; }

/* ===== add event ===== */
.svc-pick { display: flex; align-items: center; gap: 22px; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.svc-pick:hover { background: #fafcff; } .svc-pick.on { background: #eef6fe; }
.svc-pick .sw { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.svc-pick h3 { font-size: 22px; margin: 0; font-weight: 400; } .svc-pick small { display: block; max-width: 900px; }
.dayswipe { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.dayswipe button { flex: 1; min-width: 84px; padding: 8px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; }
.dayswipe button.on { border-color: var(--accent); color: var(--accent); }
.slot-room { display: flex; align-items: flex-start; gap: 26px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.slot-room .nm { width: 190px; font-size: 16px; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.slots button { min-width: 82px; padding: 7px 0; border: 1px solid #9ca3af; border-radius: 5px; background: #fff; }
.slots button:hover { border-color: var(--primary); color: var(--primary); }
.slots button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.slots button.dis { color: #bbb; border-color: #e5e7eb; background: #fafafa; }
.slots .lab { width: 100%; font-size: 12px; color: var(--muted); }

/* ===== event page ===== */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; background: #f1f1f1; padding: 14px; border-radius: 6px; }
.act { display: flex; flex-direction: column; align-items: center; width: 88px; gap: 6px; font-size: 12px; background: none; border: 0; color: inherit; }
.act .c { width: 40px; height: 40px; border-radius: 50%; border: 2px solid currentColor; display: flex; align-items: center; justify-content: center; }
.act:hover { opacity: .75; }
.sect { padding: 14px 0; border-bottom: 1px solid var(--line); }
.sect .k { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.sect .v { font-size: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f7; border-radius: 14px; padding: 3px 12px; font-size: 13px; margin: 2px; }

/* ===== misc ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.appcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; text-align: center; }
.appcard h3 { color: var(--primary); font-size: 20px; margin-bottom: 4px; }
.appcard.off { background: #f7f7f8; } .appcard.off h3 { color: #6b7280; }
.appcard .st { font-size: 12px; margin-top: 8px; color: var(--ok); } .appcard.off .st { color: var(--accent); }
.repcard { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; color: inherit; }
.repcard:hover { border-color: var(--primary); text-decoration: none; box-shadow: 0 2px 8px rgba(30,127,208,.15); }
.repcard small { color: var(--muted); } .repcard h3 { font-size: 17px; margin: 4px 0; } .repcard.off { opacity: .55; }
.cat-title { color: #6b7280; margin: 26px 0 10px; font-size: 16px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.group-title { font-size: 26px; margin: 26px 0 12px; font-weight: 400; }
.res-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: pointer; }
.res-card h3 { color: var(--primary); font-weight: 400; font-size: 22px; } .res-card small { color: var(--primary); }
.res-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 10px 18px; color: #555; border-bottom: 3px solid transparent; font-size: 15px; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.sticky-save { position: sticky; top: 70px; z-index: 10; }
.pill-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.avrow { display: grid; grid-template-columns: 110px 120px 120px 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
@media print { .topbar, .no-print, .fab, #toasts { display: none !important; } body { background: #fff; } .page { padding: 0; } .card { border: 0; box-shadow: none; } }

.banner { padding: 7px 18px; text-align: center; font-size: 14px; } .banner.red { background: #fee2e2; color: #991b1b; } .banner.yellow { background: #fef3c7; color: #92400e; } .banner a { text-decoration: underline; margin-inline-start: 8px; }
.bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--primary); } .bar.warn > i { background: var(--warn); } .bar.full > i { background: var(--err); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; } .steps span { padding: 6px 14px; border-radius: 16px; background: #eef2f7; color: #6b7280; font-size: 13px; } .steps span.on { background: var(--primary); color: #fff; } .steps span.done { background: #d1fae5; color: #065f46; }
.branch-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: #fff; } .branch-card h3 { margin: 0 0 4px; font-size: 20px; }
.tgt { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fafbfc; }
.dateinput { cursor: pointer; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M4 6h16v14H4zM4 10h16M8 3v5M16 3v5'/%3E%3C/svg%3E") no-repeat 10px center / 18px; padding-inline-start: 36px; min-width: 130px; }
.dp { position: absolute; z-index: 300; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 10px; direction: rtl; user-select: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-head button { border: 0; background: #f3f4f6; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; }
.dp-title { text-align: center; display: flex; flex-direction: column; line-height: 1.2; } .dp-title small { color: var(--muted); font-size: 12px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-dow span { font-size: 12px; color: var(--muted); padding: 4px 0; } .dp-dow .sat { color: #9ca3af; }
.dp-c { position: relative; border: 0; background: none; height: 34px; border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer; }
.dp-c:hover:not(:disabled) { background: #e8f2fc; } .dp-c:disabled { color: #ccc; cursor: default; }
.dp-c.sat { color: #9ca3af; } .dp-c.today { outline: 1px solid var(--primary); } .dp-c.sel { background: var(--primary); color: #fff; }
.dp-c.hol { color: #b45309; font-weight: 600; } .dp-c.hol2 { color: #0e7490; }
.dp-c i { position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 6px; } .dp-foot button { border: 0; background: none; color: var(--primary); cursor: pointer; }
.cellmenu { position: absolute; z-index: 60; width: 240px; background: #fff; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.28); overflow: hidden; font-size: 14px; }
.cellmenu .cm-head { background: var(--primary); color: #fff; padding: 8px 12px; line-height: 1.3; } .cellmenu .cm-head div { font-size: 12px; opacity: .9; }
.cm-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; border-top: 1px solid #f0f0f0; color: var(--text); text-decoration: none; }
.cm-item:hover { background: #f1f6fc; text-decoration: none; } .cm-item.dis { color: #bbb; cursor: default; } .cm-item.dis:hover { background: none; } .cm-item .g { width: 18px; text-align: center; color: #666; }

.ev.dragsrc { opacity: .3; } .dragghost { z-index: 20; opacity: .92; outline: 2px solid var(--primary); box-shadow: 0 6px 18px rgba(0,0,0,.3); } .cal-wrap.dragging { user-select: none; cursor: grabbing; }

.cal-head > div { position: relative; }
.colresize { position: absolute; left: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 6; } .colresize:hover, .colresize:active { background: rgba(30,127,208,.35); }
.cal-grid[data-mode=fit] .cal-head > div { padding: 8px 2px; font-size: 12px; } .cal-grid[data-mode=fit] .ev { font-size: 11px; padding: 1px 2px; }
.seg button.on { background: var(--primary); color: #fff; }

.cal-head > div, .col { min-width: 0; } .cal-head > div { overflow: hidden; word-break: break-word; line-height: 1.15; }
.cal-grid[data-mode=scroll] .cal-head > div { font-size: 13px; padding: 8px 3px; }
.cal-grid { display: block !important; }

.mbar { display: flex; gap: 6px; overflow-x: auto; padding: 8px 6px; position: sticky; right: 0; background: var(--bg, #fff); }
.mchip { flex: none; border: 1px solid var(--line, #d6d3d1); background: transparent; border-radius: 16px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.mchip.on { background: var(--primary, #2563eb); color: #fff; border-color: transparent; }
.cal-grid[data-narrow=true] .cal-head > div { writing-mode: vertical-rl; padding: 4px 0; font-size: 11px; min-height: 96px; }
.cal-grid[data-narrow=true] .ev { font-size: 9px; padding: 0 1px; overflow: hidden; }

.chatb { position: fixed; bottom: 18px; left: 18px; z-index: 900; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--primary, #2563eb); color: #fff; font-size: 24px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.chatp { position: fixed; bottom: 82px; left: 18px; z-index: 901; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 110px)); background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 14px; display: flex; flex-direction: column; box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.chatp[hidden], .chatb[hidden] { display: none !important; }
.chead { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line, #e5e7eb); }
.chead small { margin-inline-start: auto; }
.cx { border: 0; background: transparent; font-size: 22px; cursor: pointer; line-height: 1; }
.clist { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cb { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.cb.me { align-self: flex-start; background: var(--primary, #2563eb); color: #fff; }
.cb.bot { align-self: flex-end; background: #f1f5f9; color: #111827; }
.cb.err { background: #fef2f2; color: #b91c1c; }
.cb.card { align-self: stretch; max-width: 100%; background: #fff; border: 1px solid #c7d2fe; }
.cwarn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: 8px; padding: 6px 8px; font-size: 13px; margin: 6px 0; }
.cchk { display: block; margin: 6px 0; font-size: 13px; }
.crow { display: flex; gap: 8px; margin-top: 8px; }
.cin { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line, #e5e7eb); }
.cin input { flex: 1; }
