/* Texmo OS - one stylesheet, no build step. */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d2430;
  --ink-2: #5b6574;
  --line: #e2e5ea;
  /* Texmo brand: red and white. Change --brand to the exact logo red. */
  --brand: #b3121f;
  --brand-dark: #8e0e18;
  --side: var(--brand);
  --side-ink: #ffe9eb;
  --accent: var(--brand);
  --accent-ink: #ffffff;
  --bad: #c0392b;   --bad-bg: #fdecea;
  --warn: #b35c00;  --warn-bg: #fff3e0;
  --good: #1e7d4a;  --good-bg: #e7f5ed;
  --muted-bg: #eef0f3;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
small, .sub { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; padding: .25rem .5rem 1rem; display: block; }
.brand span { display: block; font-weight: 400; font-size: .75rem; color: var(--side-ink); }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.7); padding: .9rem .5rem .3rem; }
.side a { display: block; color: var(--side-ink); padding: .42rem .6rem; border-radius: 6px; }
.side a:hover { background: rgba(255,255,255,.14); text-decoration: none; color: #fff; }
.side a.on { background: #fff; color: var(--brand); font-weight: 700; }
.side .me { margin-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.25); padding-top: .75rem; font-size: .85rem; }
.main { padding: 1.5rem 2rem 4rem; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.topbar { display: none; }
.side a.close-menu { display: none; }
@media (max-width: 860px) { .side a.close-menu { display: block; } }

/* Panels & grids */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; min-width: 0; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.kpi .label { font-size: .78rem; color: var(--ink-2); }
.kpi .value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.bad .value { color: var(--bad); }
.kpi.warn .value { color: var(--warn); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; font-size: .75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* Pills */
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; background: var(--muted-bg); color: var(--ink-2); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.good { background: var(--good-bg); color: var(--good); }

/* Buttons & forms */
.btn, button { display: inline-block; font: inherit; font-weight: 600; font-size: .88rem; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { text-decoration: none; border-color: #c5cbd3; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.side .brand .tag { font-style: italic; }
.btn.danger, button.danger { color: var(--bad); }
.btn.sm, button.sm { padding: .25rem .55rem; font-size: .78rem; }
.inline { display: inline; }
form.stack p, .field { margin: 0 0 .9rem; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=file], select, textarea {
  width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid #cfd5dc; border-radius: 6px; background: #fff; color: var(--ink);
}
input[type=checkbox] { width: 1.1rem; height: 1.1rem; vertical-align: middle; }
textarea { resize: vertical; }
.helptext, .field .help { display: block; font-size: .78rem; color: var(--ink-2); margin-top: .2rem; }
.errorlist { color: var(--bad); margin: .2rem 0; padding-left: 1rem; font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filters a { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .85rem; }
.filters a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters form { margin-left: auto; }
.filters input { width: 220px; padding: .35rem .6rem; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .65rem .9rem; border-radius: 6px; margin-bottom: .4rem; background: var(--good-bg); color: var(--good); font-weight: 600; }
.messages li.error { background: var(--bad-bg); color: var(--bad); }
.messages li.info, .messages li.warning { background: var(--warn-bg); color: var(--warn); }
.callout { padding: .75rem 1rem; border-radius: 6px; background: var(--warn-bg); color: #6b3a00; margin-bottom: 1rem; }
.callout.bad { background: var(--bad-bg); color: #7a1e14; }
.callout.info { background: #e8f0fb; color: #1d4273; }

/* Dashboard lists */
.exc { list-style: none; margin: 0; padding: 0; }
.exc li { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.exc li:last-child { border-bottom: 0; }
.empty { color: var(--ink-2); font-style: italic; font-size: .88rem; }
.bar { height: 8px; border-radius: 4px; background: var(--accent); }
.bar-track { background: var(--muted-bg); border-radius: 4px; }
.progress { height: 8px; background: var(--muted-bg); border-radius: 4px; overflow: hidden; min-width: 80px; }
.progress > div { height: 100%; background: var(--good); }

/* Schedule board */
.board { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.board th, .board td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .35rem; min-width: 96px; }
.board th.crew, .board td.crew { position: sticky; left: 0; background: #fff; min-width: 110px; z-index: 1; font-weight: 700; }
.board th.now { background: #e8f0fb; }
.chip { display: block; padding: .25rem .4rem; border-radius: 4px; margin-bottom: .2rem; background: #e8f0fb; color: #1d4273; font-weight: 600; line-height: 1.2; }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.early { background: var(--muted-bg); color: var(--ink-2); }
.board.sched td { vertical-align: top; min-height: 3rem; }
.board.sched td.now { background: #f5f9ff; }
.board td.crew .members { font-weight: 400; font-size: .72rem; }
.load { display: block; font-size: .7rem; color: var(--ink-2); font-weight: 600; margin-top: .1rem; }
.load.over { color: var(--bad); }
.tray-job { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.tray-job:last-child { border-bottom: 0; }
.tray-job .chip { display: inline-block; margin: 0 0 .3rem; }
.sched-form { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.sched-form select { flex: 1 1 90px; width: auto; min-width: 0; padding: .3rem .4rem; font-size: .82rem; }
.sched-form input[type=date] { flex: 1 1 120px; width: auto; min-width: 0; padding: .3rem .4rem; font-size: .82rem; }
.sched-form input[type=number] { width: 4.2rem; padding: .3rem .4rem; font-size: .82rem; }

/* Crew cards */
.crew-card .now { font-size: 1.05rem; font-weight: 700; }
.crew-card dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin: .5rem 0 0; font-size: .88rem; }
.crew-card dt { color: var(--ink-2); }
.crew-card dd { margin: 0; }

/* Status board: one column per stage, like the paper status report */
.stage-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 1fr); gap: .6rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.stage-col { background: var(--muted-bg); border-radius: var(--radius); padding: .5rem; min-width: 0; }
.stage-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: var(--brand); color: #fff; border-radius: 6px; padding: .45rem .6rem; margin-bottom: .5rem; font-weight: 700; font-size: .85rem; line-height: 1.2; }
.stage-head:hover { background: var(--brand-dark); text-decoration: none; }
.stage-head b { background: rgba(255,255,255,.22); border-radius: 999px; padding: 0 .45rem; font-size: .8rem; }
.job-card { display: block; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 6px; padding: .4rem .55rem; margin-bottom: .4rem; color: var(--ink); font-size: .85rem; line-height: 1.3; }
.job-card:hover { text-decoration: none; border-color: #c5cbd3; border-left-color: var(--brand-dark); }
.job-card.blocked { border-left-color: var(--bad); background: var(--bad-bg); }
.job-card b { display: block; }
.job-card.elsewhere { border-style: dashed; border-left-style: solid; border-left-color: #9aa3ae; background: #fbfbfc; }
.job-card .where { color: var(--ink-2); font-style: italic; }
.job-card .note { display: block; color: var(--warn); font-weight: 600; font-size: .8rem; }
.job-card small { display: block; margin-top: .1rem; }
.crew-tag { display: inline-block; background: var(--ink); color: #fff; border-radius: 4px; padding: 0 .35rem; font-size: .72rem; font-weight: 700; }
.list-tags { display: flex; flex-wrap: wrap; gap: .2rem; }
.list-tags:not(:empty) { margin-top: .25rem; }
.list-tag { display: inline-block; background: #e8f0fb; color: #1d4273; border-radius: 4px; padding: 0 .35rem; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.sub-list { margin-top: .6rem; border-top: 2px solid #d5d9df; padding-top: .4rem; }
.sub-list .empty { margin: 0 0 .3rem; font-size: .8rem; }
.sub-head { display: flex; justify-content: space-between; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); margin-bottom: .2rem; }
.stage-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; }
.stage-tabs a { white-space: nowrap; }
.add-row { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .75rem; }
.add-row select { flex: 2 1 200px; width: auto; min-width: 0; max-width: 100%; }
.add-row input[type=text] { flex: 1 1 140px; width: auto; min-width: 0; }
.move-form { display: flex; gap: .3rem; align-items: center; }
.move-form select { width: auto; max-width: 190px; padding: .3rem .4rem; font-size: .82rem; }
td.row-actions { white-space: nowrap; }
.stage-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; counter-reset: step; }
.stage-steps li { counter-increment: step; }
.stage-steps a { display: block; padding: .3rem .6rem; border-radius: 999px; background: var(--muted-bg); color: var(--ink-2); font-size: .8rem; font-weight: 600; }
.stage-steps a::before { content: counter(step) ". "; }
.stage-steps li.on a { background: var(--brand); color: #fff; }
/* Drag and drop (office logins only) */
.draggable { cursor: grab; }
.draggable.dragging { opacity: .45; }
.draggable.saving { opacity: .6; cursor: progress; }
.drop-over { outline: 2px dashed var(--brand); outline-offset: 2px; background: #fff5f5; }
.stage-col.drop-over, .crew-card.drop-over, .drop-panel.drop-over { background: #fff5f5; }
.sub-list.drop-over { border-radius: 6px; }
.side a.sub { padding: .28rem .6rem .28rem 1.2rem; font-size: .86rem; display: flex; justify-content: space-between; gap: .5rem; }
.side a .count { font-size: .75rem; opacity: .8; font-variant-numeric: tabular-nums; }

/* Tasks */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-check { margin: 0; }
.task .check { width: 1.6rem; height: 1.6rem; padding: 0; border-radius: 50%; border: 2px solid #b8c0ca; background: #fff; color: #fff; font-size: .9rem; line-height: 1; flex: none; }
.task .check:hover { border-color: var(--good); background: var(--good-bg); }
.task.done .check { background: var(--good); border-color: var(--good); }
.task.done .task-title { color: var(--ink-2); text-decoration: line-through; }
.task-body { flex: 1; min-width: 0; }
.task-title { color: var(--ink); font-weight: 600; display: block; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: center; margin-top: .1rem; }
.late, h2.late { color: var(--bad); }
.task.overdue .check { border-color: var(--bad); }
.task-add { display: flex; flex-direction: column; gap: .5rem; }
.task-add-title { font-size: 1rem; padding: .65rem .75rem; }
.task-add-opts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.task-add-opts select, .task-add-opts input[type=date] { width: auto; flex: 1 1 140px; min-width: 0; }
.inline-check { display: inline-flex; align-items: center; gap: .3rem; font-weight: 500; margin: 0; }
.task-count { display: block; color: var(--ink-2); font-size: .74rem; font-weight: 600; }
.side a.nav-count { display: flex; justify-content: space-between; align-items: center; }
.side a .count.due { background: #fff; color: var(--brand); border-radius: 999px; padding: 0 .45rem; font-weight: 700; opacity: 1; }
.side a.on .count.due { background: var(--brand); color: #fff; }
tr.on-row td { background: #fff5f5; }
.task.prio-urgent .check { border-color: var(--bad); border-width: 3px; }
.task.prio-urgent { background: linear-gradient(90deg, var(--bad-bg), transparent 40%); }
.task.prio-high .check { border-color: var(--warn); }
.task-add-opts select.prio-pick { flex: 0 1 110px; }
.review-row { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .6rem; }
.review-row.unclear { border-left: 3px solid var(--warn); }
.review-row .keep { flex: none; padding-top: .55rem; }
.review-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.review-fields input[type=text] { font-weight: 600; }
#pages li { align-items: center; }
.tasks-grid > div > .panel:last-child { margin-bottom: 1rem; }

/* Charts */
svg.chart text { font-size: 10px; fill: var(--ink-2); }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--ink-2); margin-top: .5rem; flex-wrap: wrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: middle; }

/* Auth pages */
.auth { max-width: 400px; margin: 8vh auto; padding: 0 16px; }
body.auth-page { min-height: 100vh; background: linear-gradient(var(--brand) 0 38vh, var(--bg) 38vh) no-repeat, var(--bg); }
.auth-page .brand-lg, .auth-page .auth > .sub { color: #fff; }
.auth .panel { padding: 1.75rem; }
.auth .brand-lg { font-size: 1.3rem; font-weight: 800; margin-bottom: .2rem; }

/* Print (customer quote) */
@media print {
  .side, .topbar, .no-print, .messages { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
  .stage-cols { grid-auto-columns: minmax(0, 1fr); overflow: visible; font-size: .75rem; gap: .3rem; }
  .stage-col { padding: .2rem; }
  .job-card { break-inside: avoid; }
}

/* Phone */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; position: fixed; inset: 0; height: 100vh; z-index: 20; }
  .side.open { display: block; }
  .topbar { display: flex; justify-content: space-between; align-items: center; background: var(--side); color: #fff; padding: .6rem 16px; position: sticky; top: 0; z-index: 10; }
  .topbar a { color: #fff; font-weight: 700; }
  .main { padding: 1rem 16px 5rem; }
  .g2, .g3, .form-grid { grid-template-columns: 1fr; }
  .filters form { margin-left: 0; width: 100%; }
  .filters input { width: 100%; }
  input, select, textarea { font-size: 16px; } /* stops iOS zoom */
  .hide-sm { display: none; }
  .stage-cols { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; overflow-x: visible; }
  .move-form select { max-width: 150px; }
}

/* One-tap foreman report (phone first, big and plain) */
body.tap-page { background: var(--bg); font-size: 17px; }
.tap-head { background: var(--brand); color: #fff; padding: .8rem 16px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2; }
.tap-head b { display: block; font-size: 1.1rem; }
.tap-head span { font-size: .85rem; opacity: .9; }
.tap-head a { color: #fff; font-weight: 700; }
.tap-main { max-width: 560px; margin: 0 auto; padding: 1rem 16px 3rem; }
.tap-main textarea { font-size: 17px; padding: .75rem; border-radius: 10px; }
.tap-q { font-size: 1.15rem; font-weight: 700; margin: 1.1rem 0 .4rem; }
.tap-jobs { border: 0; padding: 0; margin: 0; }
.tap-jobs legend { font-size: 1.15rem; font-weight: 700; margin-bottom: .4rem; }
.tap-jobs label { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; margin-bottom: .45rem; font-weight: 600; font-size: 1rem; }
.tap-jobs input[type=radio] { width: 1.3rem; height: 1.3rem; flex: none; }
.tap-jobs small { font-weight: 400; }
.tap-photo { margin-top: 1.1rem; background: #fff; }
.tap-send { font-size: 1.2rem; padding: 1.05rem; border-radius: 12px; }
.tap-sent { background: var(--good-bg); color: var(--good); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.tap-help { margin-top: 1.5rem; text-align: center; }
.tap-done { width: 84px; height: 84px; border-radius: 50%; background: var(--good); color: #fff; font-size: 3rem; line-height: 84px; text-align: center; margin: 1.5rem auto .5rem; }
.tap-thanks { text-align: center; font-size: 1.5rem; }
.tap-needs { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem .6rem 2rem; }
.tap-needs li { padding: .25rem 0; }

/* Crew board: reports */
.crew-card .report-status { font-size: .85rem; font-weight: 700; margin: .1rem 0 .4rem; }
.crew-card .report-status.ok { color: var(--good); }
.crew-card .report-status.missing { color: var(--warn); }
.crew-card .said { background: var(--muted-bg); border-radius: 6px; padding: .5rem .6rem; font-size: .88rem; margin: .4rem 0; white-space: pre-line; }
.crew-card .thumbs { display: flex; gap: .3rem; flex-wrap: wrap; margin: .3rem 0; }
.crew-card .thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.crew-card .link-tools { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.crew-card .link-tools input { flex: 1 1 100%; font-size: .78rem; padding: .3rem .4rem; }

/* Show/hide password eye */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 2.75rem; }
.pw-eye { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: .3rem; color: var(--ink-2); cursor: pointer; line-height: 0; }
.pw-eye:hover { color: var(--ink); border: 0; }
.big-btn { display: block; width: 100%; text-align: center; padding: 1rem; font-size: 1.05rem; margin-bottom: .75rem; }

/* Ask Claude helper */
.ask-btn { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: inline-flex; align-items: center; gap: .4rem; background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: .65rem 1rem; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.ask-btn:hover { background: var(--brand-dark); color: #fff; border: 0; }
.ask-panel { position: fixed; right: 18px; bottom: 18px; z-index: 31; width: 380px; max-width: calc(100vw - 32px); height: min(560px, calc(100vh - 36px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 32px rgba(0,0,0,.2); overflow: hidden; }
.ask-panel[hidden] { display: none; }
.ask-panel header { display: flex; justify-content: space-between; align-items: center; padding: .65rem .9rem; background: var(--brand); color: #fff; }
.ask-close { background: none; border: 0; color: #fff; font-size: 1rem; padding: .2rem .4rem; }
.ask-close:hover { border: 0; }
.ask-log { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .5rem; background: var(--bg); }
.ask-msg { max-width: 88%; padding: .55rem .75rem; border-radius: 10px; white-space: pre-wrap; font-size: .9rem; line-height: 1.4; }
.ask-msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.ask-msg.me { background: var(--brand); color: #fff; align-self: flex-end; }
.ask-msg.wait { color: var(--ink-2); font-style: italic; }
.ask-msg.note { align-self: center; background: var(--good-bg); color: var(--good); font-size: .8rem; font-weight: 600; }
.ask-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); }
.ask-form textarea { flex: 1; resize: none; }
.ask-filled { outline: 2px solid var(--good); background: var(--good-bg) !important; }
@media (max-width: 860px) {
  .ask-btn { right: 16px; bottom: 16px; }
  .ask-panel { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; height: 75vh; border-radius: 14px 14px 0 0; }
}
@media print { .ask-btn, .ask-panel { display: none !important; } }
