/* Console frame (LCB-275 1.1). Mobile first: 390 px wide, no horizontal scroll of the frame. */
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.45; }
main { padding: .5rem 1rem 2rem; overflow-wrap: anywhere; }
td, th { overflow-wrap: anywhere; min-width: 5rem; }
pre { white-space: pre-wrap; }
.table-scroll { overflow-x: auto; max-width: 100%; }
textarea { width: 100%; max-width: 40rem; }
img { max-width: 100%; height: auto; }

.shell { background: #f4f4f6; border-bottom: 1px solid #d8d8de; padding: .5rem 1rem; }
.menu { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; }
.menu a, .menu button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem;
  border-radius: 6px; text-decoration: none; color: inherit;
}
.menu a.current { background: #1f4fd8; color: #fff; font-weight: 600; }
.inline-form { display: inline; margin: 0; }
.bot-state, .service-ok, .counters { margin: .25rem 0; }
.counters span { margin-right: 1rem; font-weight: 600; }
.service-ok { color: #1c6b34; }
.health-banner { background: #fde8e8; padding: .5rem .75rem; border-radius: 6px; margin: .25rem 0; }
.health-banner p { margin: .25rem 0; }

button, input[type="submit"], select, input[type="date"], input[type="text"],
input[type="password"], input[type="number"] { min-height: 44px; font-size: 1rem; }
button, input[type="submit"] { padding: 0 1rem; }
.tz-note { color: #555; }

/* clients */
.clients-filters { display: flex; flex-direction: column; gap: .5rem; max-width: 40rem; }
.clients-filters input[type="text"] { width: 100%; }
.clients-more label { display: block; margin: .5rem 0; }
.clients-more select { width: 100%; }
.clients-list { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .5rem; }
.clients-card {
  display: flex; flex-direction: column; gap: .25rem; padding: .75rem;
  border: 1px solid #d8d8de; border-radius: 8px;
}
.clients-badge { display: inline-block; margin-right: .25rem; padding: 0 .5rem; border-radius: 4px; background: #eef1fb; }
.clients-handed { align-self: flex-start; background: #fff3d6; }
.clients-meta { color: #555; }
.clients-pages { display: flex; gap: 1rem; align-items: center; }
.clients-pages a { display: inline-flex; align-items: center; min-height: 44px; }
/* waiting */
.menu-count b { background: #d83a1f; color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .85rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: .5rem 0; }
.tabs a, .card a.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem;
  border-radius: 6px; border: 1px solid #c8c8d0; text-decoration: none; color: inherit;
}
.tabs a.current { background: #1f4fd8; color: #fff; border-color: #1f4fd8; font-weight: 600; }
.card { border: 1px solid #c8c8d0; border-radius: 8px; padding: .5rem .75rem; margin: .5rem 0; }
.card h2 { font-size: 1.05rem; margin: .25rem 0; }
.card .turn + .turn { border-top: 1px dashed #c8c8d0; margin-top: .5rem; padding-top: .5rem; }
.client-said { color: #333; }
.pager { display: flex; gap: 1rem; align-items: center; }
/* overview */
.ov-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin: .5rem 0; }
.ov-periods { display: flex; flex-wrap: wrap; gap: .25rem; width: 100%; }
.ov-periods a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem;
  border: 1px solid #c5ccd8; border-radius: 6px; text-decoration: none; color: inherit; }
.ov-periods a.current { background: #1f4fd8; color: #fff; border-color: #1f4fd8; }
.ov-cards, .ov-tiles, .ov-legend { list-style: none; margin: 0; padding: 0; }
.ov-cards li { margin: .25rem 0; }
.ov-cards a { display: block; padding: .75rem; background: #fff4d6; border-radius: 6px; }
.ov-tiles { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.ov-tile { border: 1px solid #c5ccd8; border-radius: 6px; padding: .5rem .75rem; }
.ov-tile a { display: block; color: inherit; text-decoration: none; }
.ov-tile .ov-label, .ov-tile small { display: block; color: #555; }
.ov-value { font-size: 1.5rem; }
.ov-strip { display: flex; height: 2rem; border-radius: 6px; overflow: hidden; margin: .5rem 0; }
.ov-part { min-width: 4px; border-right: 1px solid #fff; }
.ov-legend li { padding: .25rem 0 .25rem .5rem; border-left: .5rem solid var(--ov-c, #888); }
.ov-order { --ov-c: #1c6b34; background: #1c6b34; }
.ov-pending_approval { --ov-c: #d98c00; background: #d98c00; }
.ov-human_requested, .ov-store_rule { --ov-c: #1f4fd8; background: #1f4fd8; }
.ov-out_of_kb { --ov-c: #8a4fd8; background: #8a4fd8; }
.ov-guard, .ov-manager_rejected, .ov-fault { --ov-c: #c0392b; background: #c0392b; }
.ov-answered { --ov-c: #5b9a6d; background: #5b9a6d; }
.ov-silent, .ov-in_progress { --ov-c: #999; background: #999; }
.ov-legend li[class] { background: none; }
@media (min-width: 640px) { .ov-tiles { grid-template-columns: repeat(3, 1fr); } }
/* card */
.card-head, .feed { max-width: 48rem; }
.manager-owns { background: #fff4d6; padding: .5rem .75rem; border-radius: 6px; margin: .5rem 0; }
.notice { background: #e6f4ea; padding: .5rem .75rem; border-radius: 6px; }
.confirm summary, .card-filter a, .feed a { display: inline-flex; align-items: center; min-height: 44px; }
.card-filter { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.feed .row { margin: .5rem 0; }
.feed .bubble { max-width: 85%; padding: .4rem .7rem; border-radius: 10px; background: #eef0f4; }
.feed .bubble p { margin: .2rem 0; }
.feed .bot_reply .bubble, .feed .gate .bubble { margin-left: auto; background: #dbe7ff; }
.feed .manager_message .bubble { margin: 0 auto; background: #e6f4ea; }
.feed .gate .bubble { background: #fde8e8; }
.feed .step { margin: .15rem 0; color: #444; }
.feed .handover .step { font-weight: 600; background: #fff4d6; padding: .25rem .5rem; border-radius: 6px; }
.feed .divider { text-align: center; color: #666; margin: 1rem 0 .25rem; }
.feed .tech { font-size: .85rem; color: #555; }
.muted { color: #666; }

.turn summary, summary, a.touch, .ov-cards a, .ov-legend a {
  display: inline-flex; align-items: center; min-height: 44px; /* touch targets, protocol D1, D6 */
}
label.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
label.check input { width: 1.5rem; height: 1.5rem; }

/* narrow screens: the menu is one scrollable row (protocol D5) */
@media (max-width: 480px) {
  .menu { flex-wrap: nowrap; overflow-x: auto; }
  .menu > * { white-space: nowrap; }
  .shell { padding: .25rem .5rem; }
  .bot-state, .counters { margin: .25rem 0; }
}

/* == quality == */
.quality-card button, .quality-card a.btn { min-height: 44px; margin: .25rem .25rem .25rem 0; }
.quality-verdict { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.quality-reasons label { display: block; margin: .5rem 0; }
.quality-reasons textarea { width: 100%; }
.quality-why { color: #555; }

/* == kb == */
.kb-expiry { color: #a15c00; }
.kb-diff { white-space: pre-wrap; margin: .25rem 0; }
.kb-diff-del { color: #a11; }
.kb-diff-add { color: #176b2c; }

/* == test-chat == */
.chat-feed .chat-msg { margin: 0.3rem 0; }
.chat-feed .chat-client_message { font-weight: 600; }

/* == behavior == */
.behavior-phrase { font-size: 1.1rem; font-weight: 600; }
.behavior-card { margin: 1rem 0; padding: 0.75rem 1rem; border: 1px solid #ccc; border-radius: 6px; }
.behavior-option { display: block; margin: 0.4rem 0; }
.behavior-option small { display: block; color: #555; margin-left: 1.5rem; }

/* == users == */
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td { text-align: left; padding: 0.4rem; border-bottom: 1px solid #ddd; vertical-align: top; }
.users-actions form { display: inline-block; margin: 0 0.4rem 0.3rem 0; }
.users-issued { border: 1px solid #c90; background: #fff8e1; padding: 0.6rem 1rem; margin: 1rem 0; }
.users-issued code { font-size: 1.2rem; user-select: all; }
@media (max-width: 700px) { .users-table { display: block; overflow-x: auto; } }

/* == alerts == */

/* == overview-tabs == */
.alert-item { border-left: 4px solid #e0a800; padding: .25rem .75rem; margin: .5rem 0; }
.alert-urgent { border-left-color: #d83a1f; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ov-part { min-height: 44px; }
.ov-strip { height: 2.75rem; }
