.bt-ui {
  box-sizing:border-box; min-width:0; overflow-wrap:anywhere;
  color:var(--ink); background:#fff; font:400 .9rem/1.5 var(--body);
}
.bt-area { padding:20px; border:1px solid var(--line); border-radius:14px; }
.bt-dialog .bt-area { padding:0; border:0; }
dialog.bt-dialog {
  width:min(520px,calc(100% - 24px)); max-height:min(820px,92dvh); margin:auto;
  border:1px solid var(--line); border-radius:15px; box-shadow:0 18px 60px #302a1d40;
  overflow:hidden; padding:0;
}
dialog.bt-dialog[open] { display:flex; flex-direction:column; }
.bt-dialog::backdrop { background:#25231f66; }
.bt-head,.bt-title,.bt-tools,.bt-tags,.bt-ui h2 { display:flex; align-items:center; gap:9px; }
.bt-head,.bt-title { justify-content:space-between; }
.bt-head { padding:13px 18px; border-bottom:1px solid var(--line); }
.bt-title,.bt-tools,.bt-tags { flex-wrap:wrap; }
.bt-title { margin-bottom:12px; }
.bt-tools { padding-block:5px; }
.bt-body { padding:18px; overflow:auto; overscroll-behavior:contain; }
.bt-ui :is(h2,h3) { margin:0; color:var(--ink); font:700 1.28rem/1.2 var(--display); letter-spacing:-.025em; }
.bt-body h3 { margin:5px 0 10px; font-size:1.16rem; }
.bt-ui p { margin:10px 0; }
.bt-ui .office-icon,button.bt-staff .office-icon { width:17px; height:17px; flex:none; }
.bt-ui h2 .office-icon { color:#866319; width:20px; height:20px; }
.bt-ui button,button.bt-staff {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; cursor:pointer;
  color:var(--ink); background:white; min-height:42px; min-width:42px;
  padding:8px 12px; border:1px solid var(--line); border-radius:8px;
  font:620 .875rem/1.37 var(--body);
}
button.bt-staff { position:relative; flex:none; min-height:38px; padding:7px 9px; }
button.bt-staff b:not(:empty) { background:#765512; color:white; padding:1px 5px; border-radius:15px; font:700 .76rem/1.35 var(--body); }
button.bt-staff.bt-alert b:not(:empty) { background:#a53316; }
button.bt-staff b:empty,button.bt-staff[hidden],.bt-ui [role=alert]:empty,.bt-assign:empty { display:none; }
.bt-ui button:hover,button.bt-staff:hover { background:var(--soft); }
.bt-ui button:is([type=submit],[data-new]) { background:var(--dark); color:white; border-color:var(--dark); }
.bt-ui button:is([type=submit],[data-new]):hover { background:#403a30; }
.bt-ui form[inert] { opacity:.6; }
.bt-dialog form,.bt-dialog label,.bt-assign { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.bt-dialog form:not(:first-child) { margin-top:15px; border-top:1px solid var(--line); padding-top:16px; }
.bt-dialog label { gap:5px; color:var(--ink); font:600 .875rem var(--body); }
.bt-ui :is(input,select,textarea) {
  color:var(--ink); background:#fff; min-width:0; width:100%; min-height:44px;
  border:1px solid var(--field-line); border-radius:8px; padding:9px 11px; font:450 1rem/1.4 var(--body);
}
.bt-tools select { width:auto; max-width:calc(100% - 54px); font-size:.91rem; }
.bt-dialog textarea { min-height:72px; resize:vertical; }
.bt-dialog label.bt-check { display:flex; align-items:center; gap:8px; }
.bt-check input[type=checkbox] { width:18px; min-height:18px; accent-color:var(--dark); }
.bt-ui small,.bt-rows p { display:block; color:var(--muted); font:440 .82rem/1.5 var(--body); }
.bt-ui .bt-rows > button {
  display:grid; grid-template-columns:minmax(0,1fr) auto 17px; gap:12px; width:100%;
  text-align:left; white-space:normal; padding:13px 6px; border:none;
  border-radius:0; background:transparent; overflow-wrap:anywhere;
}
.bt-ui .bt-rows > button + button { border-top:1px solid var(--line); }
.bt-ui .bt-rows > button:hover { background:var(--paper); }
.bt-tags { gap:5px; }
.bt-tags>* { background:#f2f1ec; color:#514e46; font:630 .76rem/1.3 var(--body); border-radius:5px; padding:4px 7px; }
.bt-tags [data-state=working] { background:#e7f3fc; color:#215780; }
.bt-tags [data-state=review] { background:#fff2d1; color:#765512; }
.bt-tags b { background:#feebe4; color:#982f15; }
.bt-event,.bt-flash { padding:10px 12px; border-radius:8px; background:var(--paper); margin-block:7px; }
.bt-flash { background:#ebf6f0; color:#22543d; margin-top:0; }
.bt-event p { white-space:pre-wrap; margin:6px 0 0; }
.bt-dialog summary { cursor:pointer; font-weight:620; padding:6px 0; }
.bt-ui [role=alert],.bt-area [role=status] { color:#a03118; }
.bt-area { container-type:inline-size; }
@container (max-width:560px) {
  .bt-ui .bt-rows > button { grid-template-columns:minmax(0,1fr) 17px; gap:6px; }
  .bt-rows .bt-tags { grid-row:2; }
  .bt-rows button>.office-icon { grid-column:2; grid-row:1/3; }
}
@media (max-width:720px) {
  button.bt-staff >span { display:none; }
  button.bt-staff >b { position:absolute; right:-5px; top:-6px; }
  .bt-area { padding:14px; }
  .k-toolbar:has(.bt-staff:not([hidden])) .k-account-name { display:none; }
}
@media (max-width:590px) {
  .k-toolbar:has(.bt-staff:not([hidden])) .k-account a { min-width:40px; padding:0; gap:0; font-size:0; }
  .top nav:has(.bt-staff) { flex-wrap:wrap; }
}
@media (max-width:460px) {
  .k-toolbar:has(.bt-staff:not([hidden])) .k-brand>span,
  .appbar-inner:has(.bt-staff:not([hidden])) .brand>span { display:none; }
}
