body { background: var(--ground-2); }
.shell { min-height: 100vh; display: flex; flex-direction: column; }

/* top bar */
.bar { background: var(--deep); color: #fff; padding: 0 20px; min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand b { font-size: 16px; font-weight: 600; }
.brand span { font-size: 14px; color: var(--on-dark-muted); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { color: var(--on-dark-muted); text-decoration: none; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; background: var(--navy); font-weight: 500; }
.nav .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--teal); color: var(--deep); font-size: 11px; font-weight: 700; text-align: center; }
.me { display: flex; align-items: center; gap: 10px; }
.avail { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 10px; border-radius: 16px; background: var(--navy-2); color: #CFF3EE; border: 0; cursor: pointer; }
.avail i { width: 8px; height: 8px; border-radius: 50%; background: #40C7B6; }
.avail.away { color: var(--on-dark-muted); }
.avail.away i { background: var(--faint); }
.initials { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-tint); color: var(--teal-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 0; cursor: pointer; }

/* chats layout */
.chats { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; min-height: 0; }
.queue { flex: 1 1 290px; max-width: 340px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: calc(100vh - 60px); }
.tabs { padding: 14px 14px 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { flex: 1; min-height: 38px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-3); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.qlist { overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.qitem { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 11px 12px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; width: 100%; }
.qitem:hover { background: var(--ground); }
.qitem.on { background: var(--teal-tint); border-color: #A9DCD4; }
.qitem .r1 { display: flex; justify-content: space-between; gap: 8px; }
.qitem .co { font-size: 14px; font-weight: 600; }
.qitem .age { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.qitem .age.late { color: var(--warn); font-weight: 600; }
.qitem .l2 { font-size: 12px; color: var(--ink-3); }
.qitem .l3 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }

.convo { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; background: #F6F8FA; min-height: calc(100vh - 60px); }
.chead { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chead .t { flex: 1; min-width: 220px; }
.chead h2 { margin: 0; font-size: 18px; font-weight: 600; }
.chead .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 280px; max-height: calc(100vh - 330px); }
.summary { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; }
.summary .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--ground-2); color: var(--ink-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.summary b { font-size: 13px; }
.summary p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.m { max-width: 640px; display: flex; flex-direction: column; gap: 4px; }
.m .who { font-size: 12px; color: var(--muted); }
.m .b { padding: 9px 13px; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; border-radius: 4px 14px 14px 14px; background: #fff; border: 1px solid var(--line); }
.m.supplier { align-self: flex-start; }
.m.consultant { align-self: flex-end; align-items: flex-end; }
.m.consultant .b { background: var(--teal-dark); color: #fff; border: 0; border-radius: 14px 4px 14px 14px; }
.m.bot .b { background: var(--ground-2); border: 0; color: var(--ink-2); font-size: 13px; }
.m img { max-width: 260px; border-radius: 10px; display: block; }
.sys { align-self: center; font-size: 12px; color: var(--muted); }
.botgroup { align-self: stretch; }
.botgroup summary { cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.botgroup[open] summary { margin-bottom: 8px; }
.botgroup .m { margin-bottom: 8px; }

.compose { background: #fff; border-top: 1px solid var(--line); padding: 12px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.saved { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.saved > span { font-size: 12px; color: var(--muted); margin-right: 2px; }
.saved select { min-height: 32px; border-radius: 16px; border: 1px solid var(--line-2); padding: 0 10px; font-size: 12.5px; background: #fff; max-width: 280px; }
.guard { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--warn-ink); }
.crow { display: flex; gap: 10px; align-items: flex-end; }
.crow textarea { flex: 1; min-width: 0; resize: vertical; min-height: 64px; border-radius: 10px; border: 1px solid var(--line-2); padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.crow textarea.bad { border-color: var(--warn-line); }
.crow .btn { min-height: 44px; padding: 0 20px; }

.side { flex: 1 1 290px; max-width: 360px; background: #fff; border-left: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 18px; min-height: calc(100vh - 60px); }
.side h3 { margin: 0; font-size: 15px; font-weight: 600; }
.lockline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 9px 12px; font-size: 13px; line-height: 1.4; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.steps { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.steps div { display: flex; gap: 8px; align-items: flex-start; }
.steps .warn { color: var(--warn); font-weight: 500; }
.acts { display: flex; flex-direction: column; gap: 8px; }
.acts .btn { justify-content: flex-start; min-height: 44px; }
.tk { font-size: 13px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 3px; }

/* pages */
.page { padding: 22px 24px 40px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page h1 { margin: 0; font-size: 24px; font-weight: 600; }
.page .lead { margin: 4px 0 18px; font-size: 14px; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.split { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.split > .listcol { flex: 1 1 280px; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
.split > .main { flex: 999 1 520px; min-width: 0; }
.kitem { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; width: 100%; }
.kitem.on { border: 2px solid var(--teal); padding: 11px 13px; }
.kitem .r1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.kitem .tt { font-size: 14.5px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.rowacts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.checks { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.checks .bad { color: var(--warn); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
.tablebox { overflow-x: auto; }

.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subtabs button { min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; }
.subtabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.formrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.formrow .field { flex: 1 1 180px; }

/* report preview */
.rep { max-width: 1000px; margin: 0 auto; background: #fff; border-radius: 6px; box-shadow: 0 6px 24px rgba(13,20,38,.08); padding: 36px 44px; display: flex; flex-direction: column; gap: 28px; }
.rep header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding-bottom: 18px; border-bottom: 3px solid var(--navy); }
.rep header img { width: 50px; height: 50px; border-radius: 12px; }
.rep header h2 { margin: 0; font-size: 24px; color: var(--navy); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rep { padding: 22px; } }
.kpi { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 30px; font-weight: 700; color: var(--navy); }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.warn { border-color: var(--warn-line); background: #FFFAF2; }
.kpi.warn .v, .kpi.warn .l { color: var(--warn); }
.bars { display: grid; grid-template-columns: 180px minmax(0, 1fr) 40px; gap: 9px 12px; align-items: center; font-size: 14px; }
.bars .fill { height: 14px; border-radius: 3px; background: var(--teal); }
.stack { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: var(--ground-2); }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(13,20,38,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0; font-size: 18px; }

/* sign in */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--deep); }
.auth form { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth img { width: 44px; height: 44px; border-radius: 10px; }
.auth h1 { margin: 0; font-size: 21px; }
.auth p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth .btn { min-height: 44px; }

/* guides: screenshots for steps and answers */
.guides { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; }
.glist { flex: 1 1 250px; max-width: 290px; background: #fff; border-right: 1px solid var(--line); padding: 16px 0 24px; display: flex; flex-direction: column; gap: 2px; min-height: calc(100vh - 60px); overflow-y: auto; }
.ghead { padding: 14px 16px 4px; font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.gitem { margin: 0 8px; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.gitem:hover { background: var(--ground); }
.gitem.on { background: var(--teal-tint); font-weight: 600; }
.gitem .mono { font-size: 12px; color: var(--teal-ink); flex-shrink: 0; }
.gitem .mono.none { color: var(--warn); }
.ggrid { flex: 1 1 420px; min-width: 0; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.ggrid h1 { margin: 0; font-size: 20px; font-weight: 600; }
.gtop { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.gcard { padding: 0; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.gcard.on { border: 2px solid var(--teal); box-shadow: 0 4px 14px rgba(29,116,104,.18); }
.gcard img { width: 100%; height: 92px; object-fit: cover; object-position: top; display: block; border-bottom: 1px solid var(--line); background: #fff; }
.gcard .ph { height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); background: #F6F8FA; border-bottom: 1px dashed var(--line-2); }
.gcard .gc { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.gcard .n { font-size: 11px; color: var(--muted); }
.gcard .tt { font-size: 13px; font-weight: 500; line-height: 1.3; }
.gcard .bdg { display: flex; flex-wrap: wrap; gap: 4px; }
.gcard .badge { font-size: 10px; padding: 1px 6px; }
.gedit { flex: 1 1 440px; max-width: 540px; background: #fff; border-left: 1px solid var(--line); padding: 20px; min-height: calc(100vh - 60px); }
.ed { display: flex; flex-direction: column; gap: 12px; }
.ed .eh { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.etext { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); background: var(--ground); border-radius: 8px; padding: 8px 10px; }
.etext span { color: var(--muted); }
.enote { font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 8px; background: #F6F8FA; border: 1px solid var(--line); }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; background: #F6F8FA; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; cursor: pointer; color: var(--ink-3); font-size: 13px; }
.drop:hover, .drop:focus-within { border-color: var(--teal); background: var(--teal-tint-2); }
.drop b { font-size: 14px; color: var(--ink); }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tools .btn.on { border-color: #D9480F; background: #FFF1E8; color: #8A3204; font-weight: 600; }
.tools label.btn.disabled { pointer-events: none; opacity: .5; }
.estage { position: relative; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; touch-action: none; user-select: none; }
.estage.mode-highlight, .estage.mode-blur, .estage.mode-crop { cursor: crosshair; }
.ecanvas { display: block; width: 100%; height: auto; }
.estage .hl, .eshot .hl { position: absolute; border: 2.5px solid #D9480F; border-radius: 6px; pointer-events: none; }
.hn { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #D9480F; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; box-shadow: 0 0 0 2px #fff; }
.hn.static { position: static; flex-shrink: 0; box-shadow: none; }
.drag { position: absolute; pointer-events: none; border: 2px dashed #D9480F; background: rgba(217,72,15,.08); }
.drag.blur { border-color: var(--navy); background: rgba(27,42,74,.15); }
.drag.crop { border-color: var(--teal-dark); background: rgba(29,116,104,.1); box-shadow: 0 0 0 2000px rgba(13,20,38,.35); }
.caps { display: flex; flex-direction: column; gap: 8px; }
.capl { font-size: 12px; font-weight: 600; color: var(--muted); }
.caprow { display: flex; gap: 8px; align-items: center; }
.caprow input { flex: 1; min-width: 0; min-height: 38px; border-radius: 8px; border: 1px solid var(--line-2); padding: 0 10px; font-size: 13px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.chk input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--teal-dark); flex-shrink: 0; }
.chk.warnbox { padding: 10px 12px; border-radius: 8px; background: #FFF8E6; border: 1px solid #F0D79A; color: #5C4108; }
.eshot { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.eshot img { display: block; width: 100%; height: auto; }
.ecaps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ecaps li { display: flex; gap: 8px; align-items: flex-start; }
.ecaps .n { width: 20px; height: 20px; border-radius: 50%; background: #D9480F; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kshot { border-top: 1px solid var(--line); padding-top: 14px; }
.modal.wide { max-width: 760px; }
.pvwrap { display: flex; flex-direction: column; gap: 14px; max-width: 420px; margin: 0 auto; }
.pv { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.pv .pk { font-size: 11px; font-weight: 600; color: var(--teal-dark); text-transform: uppercase; letter-spacing: .5px; }
.pv .ph2 { font-size: 15px; font-weight: 600; }
.pv .pt { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
