:root {
  --br-ink: #0f172a;
  --br-ink-soft: #334155;
  --br-muted: #64748b;
  --br-line: #e2e8f0;
  --br-line-strong: #cbd5e1;
  --br-surface: #ffffff;
  --br-surface-soft: #f8fafc;
  --br-canvas: #f1f5f9;
  --br-navy: #0f172a;
  --br-blue: #2563eb;
  --br-blue-dark: #1d4ed8;
  --br-violet: #7c3aed;
  --br-amber: #f59e0b;
  --br-green: #16a34a;
  --br-red: #dc2626;
  --br-slate: #64748b;
  --br-radius-sm: 8px;
  --br-radius: 12px;
  --br-radius-lg: 18px;
  --br-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .08);
  --br-shadow: 0 14px 40px rgba(15, 23, 42, .1), 0 3px 12px rgba(15, 23, 42, .05);
  --br-shadow-drawer: -24px 0 70px rgba(15, 23, 42, .22);
  --br-header-height: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--br-canvas); }
body.br-app {
  min-height: 100vh;
  margin: 0;
  color: var(--br-ink);
  background:
    radial-gradient(circle at 100% -10%, rgba(37, 99, 235, .08), transparent 28rem),
    var(--br-canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.br-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.br-skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: var(--br-radius-sm);
  color: #fff;
  background: var(--br-blue);
}
.br-skip-link:focus { transform: translateY(0); }

/* Header */
.br-topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: var(--br-header-height);
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  align-items: center;
  gap: 30px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 10px rgba(15, 23, 42, .035);
  backdrop-filter: blur(18px);
}

.br-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--br-ink);
  text-decoration: none !important;
}
.br-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #1e293b, #0f172a 65%, #111827);
  box-shadow: 0 7px 18px rgba(15, 23, 42, .2), inset 0 1px 0 rgba(255,255,255,.16);
}
.br-brand-mark svg { width: 27px; height: 27px; fill: currentColor; stroke: none; }
.br-brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.08; }
.br-brand-copy strong { font-size: 16px; letter-spacing: .025em; }
.br-brand-copy strong em { color: var(--br-blue); font-style: normal; }
.br-brand-copy small { margin-top: 4px; color: var(--br-muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.br-primary-nav { height: var(--br-header-height); display: flex; align-items: stretch; justify-content: center; gap: 6px; }
.br-primary-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--br-muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
.br-primary-nav a::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--br-blue);
  transform: scaleX(0);
  transition: transform .18s ease;
}
.br-primary-nav a:hover { color: var(--br-ink); }
.br-primary-nav a.is-active { color: var(--br-blue); }
.br-primary-nav a.is-active::after { transform: scaleX(1); }

.br-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.br-mobile-search-toggle { display: none !important; }

.br-user-menu { position: relative; }
.br-user-trigger {
  min-height: 48px;
  display: grid;
  grid-template-columns: 38px minmax(95px, auto) 16px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 5px 5px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s, background .18s;
}
.br-user-trigger:hover, .br-user-trigger[aria-expanded="true"] { border-color: var(--br-line); background: var(--br-surface-soft); }
.br-user-trigger > svg { width: 16px; height: 16px; color: var(--br-muted); }
.br-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 5px 12px rgba(37, 99, 235, .22);
}
.br-user-copy { min-width: 0; display: flex; flex-direction: column; }
.br-user-copy strong { max-width: 150px; overflow: hidden; color: var(--br-ink); font-size: 12.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.br-user-copy small { margin-top: 2px; color: var(--br-muted); font-size: 10.5px; }
.br-user-panel {
  position: absolute;
  z-index: 105;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--br-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--br-shadow);
}
.br-user-panel > div { display: flex; flex-direction: column; padding: 10px 11px 12px; border-bottom: 1px solid var(--br-line); }
.br-user-panel > div strong { font-size: 13px; }
.br-user-panel > div small { margin-top: 3px; overflow: hidden; color: var(--br-muted); font-size: 11px; text-overflow: ellipsis; }
.br-user-panel a { display: block; margin-top: 7px; padding: 10px 11px; border-radius: 9px; color: #b91c1c; font-size: 12px; font-weight: 700; text-decoration: none; }
.br-user-panel a:hover { background: #fef2f2; }

/* Controls */
.br-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}
.br-button:hover:not(:disabled) { transform: translateY(-1px); }
.br-button:active:not(:disabled) { transform: translateY(0); }
.br-button:focus-visible, .br-icon-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(37, 99, 235, .19); outline-offset: 1px; }
.br-button:disabled { opacity: .55; cursor: not-allowed; }
.br-button svg { width: 17px; height: 17px; }
.br-button-primary { color: #fff; background: var(--br-blue); box-shadow: 0 6px 14px rgba(37, 99, 235, .18); }
.br-button-primary:hover:not(:disabled) { background: var(--br-blue-dark); box-shadow: 0 8px 18px rgba(37, 99, 235, .24); }
.br-button-quiet { border-color: var(--br-line); color: var(--br-ink-soft); background: #fff; }
.br-button-quiet:hover:not(:disabled) { border-color: var(--br-line-strong); background: var(--br-surface-soft); }
.br-button-danger { color: #fff; background: var(--br-red); }
.br-button-warning { color: #422006; background: #fbbf24; }
.br-button-success { color: #fff; background: var(--br-green); }
.br-button-violet { color: #fff; background: var(--br-violet); }
.br-button-loader { width: 15px; height: 15px; display: none; border: 2px solid rgba(255,255,255,.38); border-top-color: #fff; border-radius: 50%; animation: br-spin .7s linear infinite; }
.br-button.is-loading .br-button-loader { display: block; }
.br-button.is-loading .br-button-label { opacity: .6; }

.br-icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--br-line);
  border-radius: 10px;
  color: var(--br-ink-soft);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.br-icon-button:hover { border-color: var(--br-line-strong); color: var(--br-ink); background: var(--br-surface-soft); }
.br-icon-button svg { width: 18px; height: 18px; }

/* Main page */
.br-main { width: min(1900px, 100%); margin: 0 auto; padding: 28px clamp(18px, 2.2vw, 38px) 44px; }
.br-home-public .br-main,
.br-home-authenticated .br-main { padding-top: 12px; }
.br-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.br-page-heading h1 { margin: 3px 0 3px; color: var(--br-ink); font-size: clamp(25px, 2.2vw, 34px); font-weight: 780; letter-spacing: -.035em; }
.br-page-heading p { margin: 0; color: var(--br-muted); font-size: 13px; }
.br-eyebrow { color: var(--br-blue); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.br-heading-tools { display: flex; align-items: center; gap: 10px; }

.br-install-alert { max-width: 850px; display: flex; gap: 18px; margin: 8vh auto; padding: 28px; border: 1px solid #fecaca; border-radius: var(--br-radius-lg); background: #fff; box-shadow: var(--br-shadow); }
.br-install-alert h1 { margin: 0 0 7px; font-size: 22px; }
.br-install-alert p { margin: 0 0 12px; color: var(--br-muted); }
.br-install-alert code { display: inline-block; padding: 7px 10px; border-radius: 7px; color: #991b1b; background: #fef2f2; }
.br-install-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #fff; background: var(--br-red); font-size: 22px; font-weight: 900; }

/* Calendar workspace */
.br-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 292px; align-items: start; gap: 16px; }
.br-calendar-card { border: 1px solid var(--br-line); border-radius: var(--br-radius-lg); background: #fff; box-shadow: var(--br-shadow-sm); }
.br-calendar-card { min-width: 0; overflow: hidden; }

/* Kuukalender */
.br-calendar-navigator {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 8px;
  border-bottom: 1px solid var(--br-line);
  background:
    radial-gradient(circle at 92% 12%, rgba(37, 99, 235, .095), transparent 19rem),
    linear-gradient(135deg, #fbfdff, #f8fafc);
}
.br-mini-calendar {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--br-line);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 7px 22px rgba(15, 23, 42, .055);
}
.br-mini-calendar-header { min-height: 34px; display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; gap: 5px; }
.br-mini-calendar-period-controls { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 6px; }
.br-mini-calendar-period-controls select {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 19px 0 8px;
  border: 1px solid var(--br-line);
  border-radius: 9px;
  outline: 0;
  color: var(--br-ink);
  background: #fff;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}
.br-mini-calendar-period-controls select:hover { border-color: var(--br-line-strong); }
.br-mini-calendar-period-controls select:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.br-mini-calendar-nav { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--br-muted); background: transparent; cursor: pointer; }
.br-mini-calendar-nav:hover { border-color: var(--br-line); color: var(--br-ink); background: var(--br-surface-soft); }
.br-mini-calendar-nav:focus-visible { outline: 3px solid rgba(37,99,235,.18); outline-offset: 1px; }
.br-mini-calendar-nav svg { width: 16px; height: 16px; }
.br-mini-calendar-weekdays, .br-mini-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.br-mini-calendar-weekdays { margin: 3px 0 2px; }
.br-mini-calendar-weekdays span { height: 17px; display: grid; place-items: center; color: #94a3b8; font-size: 8px; font-weight: 820; letter-spacing: .045em; }
.br-mini-calendar-grid { gap: 2px 0; }
.br-mini-calendar-day {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--br-ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 710;
  line-height: 1;
  transition: color .12s, background .12s, box-shadow .12s, transform .12s;
}
.br-mini-calendar-day:hover { z-index: 1; color: var(--br-blue-dark); background: #dbeafe; }
.br-mini-calendar-day:focus-visible { z-index: 2; outline: 3px solid rgba(37,99,235,.2); outline-offset: -1px; }
.br-mini-calendar-day.is-outside { color: #c2cbd7; font-weight: 620; }
.br-mini-calendar-day.is-active-range { color: #1e40af; background: #eff6ff; }
.br-mini-calendar-day.is-week-start.is-active-range { border-radius: 9px 3px 3px 9px; }
.br-mini-calendar-day.is-week-end.is-active-range { border-radius: 3px 9px 9px 3px; }
.br-mini-calendar-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1.5px #60a5fa; color: #1d4ed8; font-weight: 850; }
.br-mini-calendar-day.is-selected {
  z-index: 3;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 5px 12px rgba(37,99,235,.27), inset 0 1px 0 rgba(255,255,255,.22);
  font-weight: 850;
  transform: translateY(-1px);
}
.br-mini-calendar-day.is-selected:hover { color: #fff; background: linear-gradient(145deg, #2563eb, #1e40af); }
.br-mini-calendar-footer { min-height: 23px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 3px; padding: 3px 2px 0; border-top: 1px solid #eef2f7; }
.br-mini-calendar-footer button { padding: 3px 5px; border: 0; border-radius: 6px; color: var(--br-blue); background: transparent; cursor: pointer; font-size: 8.5px; font-weight: 800; }
.br-mini-calendar-footer button:hover { background: #eff6ff; }

.br-calendar-controls {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  overflow: hidden;
  border: 1px solid rgba(191,219,254,.72);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
}
.br-calendar-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--br-line); }
.br-calendar-toolbar-right { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.br-calendar-refresh.is-loading svg { animation: br-spin .75s linear infinite; }
.br-view-switch { display: inline-flex; flex: 0 0 auto; padding: 3px; border: 1px solid var(--br-line); border-radius: 10px; background: var(--br-surface-soft); }
.br-view-switch button { min-height: 32px; padding: 0 13px; border: 0; border-radius: 7px; color: var(--br-muted); background: transparent; font-size: 11.5px; font-weight: 750; cursor: pointer; }
.br-view-switch button:hover { color: var(--br-ink); }
.br-view-switch button.is-active { color: var(--br-ink); background: #fff; box-shadow: 0 1px 5px rgba(15, 23, 42, .1); }
.br-filter-cluster { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.br-search { min-width: 210px; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--br-line); border-radius: 10px; background: #fff; }
.br-search:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.br-search svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--br-muted); }
.br-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--br-ink); font-size: 12px; }
.br-search input::placeholder { color: #94a3b8; }
.br-select { min-width: 138px; height: 40px; padding: 0 30px 0 10px; border: 1px solid var(--br-line); border-radius: 10px; outline: 0; color: var(--br-ink-soft); background: #fff; font-size: 11.5px; font-weight: 650; }
.br-select:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.br-legend { min-height: 40px; display: flex; align-items: center; flex-wrap: nowrap; gap: 8px 10px; padding: 8px 10px; overflow-x: auto; color: var(--br-muted); background: rgba(248,250,252,.72); font-size: 10px; font-weight: 650; scrollbar-width: none; }
.br-legend::-webkit-scrollbar { display: none; }
.br-legend-title { color: var(--br-ink-soft); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.br-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.br-legend-divider { width: 1px; height: 18px; display: inline-block; background: var(--br-line-strong); }
.br-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor; }
.br-dot-submitted { color: #7c3aed; background: #7c3aed; }
.br-dot-accepted { color: #2563eb; background: #2563eb; }
.br-dot-progress { color: #f59e0b; background: #f59e0b; }
.br-dot-urgent { color: #dc2626; background: #dc2626; }
.br-dot-completed { color: #64748b; background: #64748b; }
.br-dot-closed { color: #9ca3af; background: #9ca3af; }
.br-calendar-wrap { min-height: 650px; padding: 0; background: #fff; }
#calendar { min-height: 650px; }
.br-loading-state { min-height: 650px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--br-muted); }
.br-loading-state strong { font-size: 12px; }
.br-spinner { width: 28px; height: 28px; border: 3px solid #e2e8f0; border-top-color: var(--br-blue); border-radius: 50%; animation: br-spin .75s linear infinite; }
@keyframes br-spin { to { transform: rotate(360deg); } }

/* Nexus Scheduler integration */
#calendar .nx-root {
  --nx-font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nx-primary: #2563eb;
  --nx-border: #e2e8f0;
  --nx-muted: #64748b;
  --nx-surface: #ffffff;
  --nx-surface-alt: #f8fafc;
  min-height: 650px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff;
  box-shadow: none !important;
}
#calendar .nx-toolbar { min-height: 54px; padding: 8px 12px; border-bottom-color: var(--br-line); background: #fff; }
#calendar .nx-toolbar-section { gap: 5px; }
#calendar .nx-button { min-height: 32px; border-radius: 8px; border-color: var(--br-line); color: var(--br-ink-soft); background: #fff; font-size: 10.5px; font-weight: 750; box-shadow: none; }
#calendar .nx-button:hover { border-color: var(--br-line-strong); background: var(--br-surface-soft); }
#calendar .nx-button.is-active, #calendar .nx-button[aria-pressed="true"] { color: #fff; border-color: var(--br-blue); background: var(--br-blue); }
#calendar .nx-toolbar-title { color: var(--br-ink); font-size: 15px; font-weight: 780; letter-spacing: -.02em; }
#calendar .nx-timeline-corner, #calendar .nx-timeline-header { background: #f8fafc; }
#calendar .nx-timeline-corner { border-color: var(--br-line); }
#calendar .nx-resource-column-headers strong { color: var(--br-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#calendar .nx-resource-count { border-radius: 7px; color: var(--br-muted); background: #e2e8f0; font-size: 9px; }
#calendar .nx-timeline-major-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--br-ink-soft);
  border-right: 2px solid #64748b;
  font-size: 10.5px;
  font-weight: 780;
}
#calendar .nx-timeline-major-cell.is-today {
  color: #1d4ed8;
  background: linear-gradient(180deg, rgba(219,234,254,.8), rgba(239,246,255,.58));
  box-shadow: inset 0 -2px 0 rgba(37,99,235,.32);
}
#calendar .nx-timeline-major-cell small {
  color: var(--br-muted);
  font-size: .82em;
  font-weight: 650;
  letter-spacing: .01em;
}
#calendar .nx-timeline-minor-cell { color: var(--br-muted); border-color: #edf2f7; font-size: 9px; font-weight: 650; }
#calendar .nx-timeline-minor-cell.is-today { color: var(--br-blue); background: #eff6ff; }
#calendar .nx-resource-row { border-color: #edf2f7; background: #fff; }
#calendar .nx-resource-row:hover { background: #f8fbff; }
#calendar .nx-resource-text strong { color: var(--br-ink); font-size: 10.5px; font-weight: 740; }
#calendar .nx-resource-text small { color: var(--br-muted); font-size: 8.5px; }
#calendar .nx-resource-avatar { border-radius: 9px; font-size: 9px; font-weight: 800; }
#calendar .nx-resource-util, #calendar .nx-resource-percent { display: none; }
#calendar .nx-timeline-row { border-color: #edf2f7; background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--nx-slot-width) - 1px), rgba(226, 232, 240, .62) calc(var(--nx-slot-width) - 1px), rgba(226, 232, 240, .62) var(--nx-slot-width)); }
#calendar .nx-timeline-row:hover { background-color: rgba(239, 246, 255, .42); }
#calendar .nx-resource-row.is-overlap-expanded {
  align-items: flex-start;
  padding-top: 7px;
  background-image: linear-gradient(180deg, rgba(239,246,255,.38), transparent 34px);
}
#calendar .nx-timeline-row.is-overlap-expanded {
  background-color: rgba(248,250,252,.54);
  box-shadow: inset 0 1px 0 rgba(148,163,184,.12), inset 0 -1px 0 rgba(148,163,184,.12);
}
#calendar .nx-resource-row.is-overlap-expanded .br-resource-label-control {
  position: relative;
  align-self: flex-start;
}
#calendar .nx-timeline-row.is-overlap-expanded .nx-selection-range,
#calendar .nx-timeline-row.is-overlap-expanded .nx-selection-preview { inset-block: 3px; height: auto; }
#calendar .nx-row-capacity { display: none; }
#calendar .nx-timeline-today-band {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  background: rgba(239,246,255,.24);
  box-shadow: inset 1px 0 rgba(96,165,250,.16), inset -1px 0 rgba(96,165,250,.16);
  pointer-events: none;
}
#calendar .nx-timeline-day-boundary {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(51,65,85,.78);
  box-shadow: 1px 0 0 rgba(255,255,255,.9), -1px 0 0 rgba(148,163,184,.28);
  pointer-events: none;
}
#calendar .nx-now-line { border-color: #e11d48; background: #e11d48; }
#calendar .nx-timeline-now {
  z-index: 14;
  width: 2px;
  background: #e11d48;
  box-shadow: 0 0 0 1px rgba(255,255,255,.68), 0 0 8px rgba(225,29,72,.38);
}
#calendar .nx-now-line span {
  width: 10px;
  height: 10px;
  left: -4px;
  background: #e11d48;
  box-shadow: 0 0 0 2px #fff, 0 2px 7px rgba(225,29,72,.36);
}

#calendar .nx-event {
  overflow: hidden;
  border-width: 1px;
  border-radius: 7px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .15), inset 0 1px 0 rgba(255,255,255,.14);
  transition: filter .14s ease, transform .14s ease, box-shadow .14s ease;
}
#calendar .nx-event:hover { z-index: 8; filter: saturate(1.08) brightness(1.03); transform: translateY(-1px); box-shadow: 0 5px 12px rgba(15, 23, 42, .2); }
#calendar .nx-event.br-is-masked { cursor: default; opacity: .94; filter: none; }
#calendar .nx-event.br-is-masked:hover { z-index: auto; filter: none; transform: none; box-shadow: 0 2px 5px rgba(15, 23, 42, .15), inset 0 1px 0 rgba(255,255,255,.14); }
#calendar .nx-event.br-is-masked .br-event-content small,
#calendar .nx-event.br-is-masked .nx-event-progress { display: none; }
#calendar .nx-event-inner { min-width: 0; width: 100%; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
#calendar .br-event-content { min-width: 0; width: 100%; height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 7px; }
#calendar .br-event-content .br-event-icon { width: 15px; height: 15px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 4px; background: rgba(255,255,255,.19); }
#calendar .br-event-content .br-event-icon svg { width: 10px; height: 10px; }
#calendar .br-event-content .br-event-copy { min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; }
#calendar .br-event-content strong { overflow: hidden; font-size: 9.5px; font-weight: 800; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
#calendar .br-event-content small { flex: 0 0 auto; opacity: .86; font-size: 8px; font-weight: 650; }
#calendar .br-event-content .br-event-alert { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
#calendar .nx-event.is-dense-lane .br-event-content { gap: 3px; padding-inline: 5px; }
#calendar .nx-event.is-dense-lane .br-event-icon,
#calendar .nx-event.is-dense-lane .br-event-content small,
#calendar .nx-event.is-dense-lane .nx-event-progress { display: none; }
#calendar .nx-event.is-dense-lane .br-event-content strong { font-size: 8px; line-height: 1; }
#calendar .nx-event-progress { height: 3px; background: rgba(255,255,255,.8); }
#calendar .nx-recurring-event {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .16) 0 6px, transparent 6px 12px);
  border-style: dashed !important;
}
#calendar .nx-recurring-event .br-event-content::after {
  content: "↻";
  flex: 0 0 auto;
  margin-left: 4px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  opacity: .9;
}

#calendar .br-is-closed { opacity: .72; filter: saturate(.72); }
#calendar .br-is-closed:hover { opacity: .95; }
#calendar .br-status-completed .br-event-copy {
  text-decoration-line: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(255,255,255,.9);
}
#calendar .br-status-completed::before {
  content: "";
  position: absolute;
  z-index: 4;
  right: 7px;
  left: 7px;
  top: 50%;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 1px 0 rgba(15,23,42,.2);
  pointer-events: none;
  transform: rotate(-1deg);
}
#calendar .br-status-cancelled, #calendar .br-status-rejected { opacity: .58; text-decoration: line-through; }
#calendar .br-is-overdue::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border: 2px solid rgba(255,255,255,.85); border-radius: 50%; background: #7f1d1d; }
#calendar .br-type-urgent:not(.br-is-closed) { animation: br-urgent-glow 2.4s ease-in-out infinite; }
@keyframes br-urgent-glow { 0%,100% { box-shadow: 0 2px 5px rgba(127,29,29,.24); } 50% { box-shadow: 0 4px 14px rgba(220,38,38,.42); } }

/* FullCalendar-like live drag selection */
#calendar .nx-selection-preview {
  position: absolute;
  z-index: 14;
  top: 4px;
  bottom: 4px;
  min-width: 4px;
  pointer-events: none;
  overflow: visible;
  border: 2px solid #2563eb;
  border-radius: 7px;
  background:
    repeating-linear-gradient(135deg, rgba(37, 99, 235, .28) 0 7px, rgba(255,255,255,.48) 7px 14px),
    rgba(219, 234, 254, .84);
  box-shadow: 0 0 0 1px rgba(255,255,255,.85) inset, 0 6px 18px rgba(37,99,235,.24);
  animation: br-selection-stripes .55s linear infinite;
}
#calendar .nx-selection-preview::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px dashed rgba(37,99,235,.55);
  border-radius: 9px;
}
#calendar .nx-selection-preview-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(100% + 7px);
  max-width: 220px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #fff;
  background: #1e3a8a;
  box-shadow: 0 5px 14px rgba(30,58,138,.28);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}
#calendar .nx-selection-preview-label::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: #1e3a8a; }
@keyframes br-selection-stripes { to { background-position: 20px 0; } }

/* The committed range stays marked while the new-work dialog is open. */
#calendar .nx-selection-range {
  position: absolute;
  z-index: 3;
  top: 4px;
  bottom: 4px;
  min-width: 4px;
  pointer-events: none;
  overflow: visible;
  border: 2px solid #2563eb;
  border-radius: 7px;
  background:
    repeating-linear-gradient(135deg, rgba(37, 99, 235, .22) 0 7px, rgba(255,255,255,.44) 7px 14px),
    rgba(219, 234, 254, .76);
  box-shadow: 0 0 0 1px rgba(255,255,255,.8) inset, 0 4px 14px rgba(37,99,235,.2);
  animation: br-selection-stripes .8s linear infinite;
}
#calendar .nx-selection-range::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px dashed rgba(37,99,235,.48);
  border-radius: 9px;
}
#calendar .nx-selection-range-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(100% + 7px);
  max-width: 260px;
  padding: 5px 8px;
  overflow: hidden;
  border-radius: 7px;
  color: #fff;
  background: #1e3a8a;
  box-shadow: 0 5px 14px rgba(30,58,138,.28);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
}
#calendar .nx-selection-range-label::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: #1e3a8a; }

/* Drawer */
body.br-drawer-open { overflow: hidden; }
.br-drawer-backdrop { position: fixed; z-index: 500; inset: 0; background: rgba(15, 23, 42, .38); backdrop-filter: blur(2px); opacity: 0; transition: opacity .22s ease; }
body.br-create-modal-open .br-drawer-backdrop { background: rgba(15, 23, 42, .24); backdrop-filter: blur(1px); }
.br-drawer-backdrop.is-visible { opacity: 1; }
.br-work-drawer {
  position: fixed;
  z-index: 510;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(690px, 94vw);
  overflow: hidden;
  border-left: 1px solid var(--br-line);
  background: #fff;
  box-shadow: var(--br-shadow-drawer);
  transform: translateX(102%);
  transition: transform .25s cubic-bezier(.2,.75,.25,1);
}
.br-work-drawer.is-open { transform: translateX(0); }
.br-work-drawer.is-create-modal {
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(860px, calc(100vw - 36px));
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid rgba(203,213,225,.96);
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(15,23,42,.3), 0 8px 24px rgba(15,23,42,.12);
  opacity: 0;
  transform: translate(-50%, -47%) scale(.985);
  transition: transform .22s cubic-bezier(.2,.75,.25,1), opacity .18s ease;
}
.br-work-drawer.is-create-modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.br-work-drawer.is-create-modal .br-drawer-header { border-radius: 20px 20px 0 0; }
.br-work-drawer.is-create-modal .br-drawer-footer {
  border-radius: 0 0 20px 20px;
  box-shadow: 0 -12px 34px rgba(15,23,42,.1);
}
.br-work-drawer > form {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.br-work-drawer > form > .br-drawer-header,
.br-work-drawer > form > .br-selection-summary,
.br-work-drawer > form > .br-progress-track,
.br-work-drawer > form > .br-drawer-tabs,
.br-work-drawer > form > .br-drawer-footer { flex: 0 0 auto; }
.br-work-drawer > form > .br-drawer-body { flex: 1 1 auto; }
.br-drawer-header { min-height: 92px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; border-bottom: 1px solid var(--br-line); background: #fff; }
.br-drawer-title-block { min-width: 0; }
.br-drawer-kicker { display: flex; align-items: center; gap: 8px; min-height: 21px; }
.br-status-pill { display: inline-flex; align-items: center; min-height: 21px; padding: 0 8px; border-radius: 999px; color: #5b21b6; background: #ede9fe; font-size: 9px; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.br-status-pill[data-status="accepted"] { color: #1e40af; background: #dbeafe; }
.br-status-pill[data-status="in_progress"] { color: #92400e; background: #fef3c7; }
.br-status-pill[data-status="completed"] { color: #334155; background: #e2e8f0; }
.br-status-pill[data-status="returned"] { color: #92400e; background: #fef3c7; }
.br-status-pill[data-status="cancelled"], .br-status-pill[data-status="rejected"] { color: #374151; background: #e5e7eb; }
.br-task-number { color: var(--br-muted); font-size: 9.5px; font-weight: 750; letter-spacing: .04em; }
.br-drawer-title-block h2 { margin: 5px 0 2px; overflow: hidden; color: var(--br-ink); font-size: 21px; font-weight: 790; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.br-drawer-title-block p { margin: 0; overflow: hidden; color: var(--br-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.br-drawer-close { margin-top: 1px; border-color: transparent; }
.br-selection-summary { display: flex; align-items: center; gap: 11px; margin: 12px 20px 0; padding: 10px 12px; border: 1px solid #bfdbfe; border-radius: 10px; background: linear-gradient(135deg, #eff6ff, #f8fbff); box-shadow: inset 3px 0 0 #2563eb; }
.br-selection-summary[hidden] { display: none; }
.br-selection-summary-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #dbeafe; color: #1d4ed8; }
.br-selection-summary-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.br-selection-summary-copy { min-width: 0; display: grid; gap: 1px; }
.br-selection-summary-copy small { color: #64748b; font-size: 9px; font-weight: 780; letter-spacing: .055em; text-transform: uppercase; }
.br-selection-summary-copy strong { overflow: hidden; color: #0f172a; font-size: 12px; font-weight: 820; text-overflow: ellipsis; white-space: nowrap; }
.br-selection-summary-copy em { overflow: hidden; color: #475569; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.br-progress-track { height: 3px; overflow: hidden; background: #e2e8f0; }
.br-progress-track span { display: block; height: 100%; width: 0; border-radius: 0 3px 3px 0; background: var(--br-blue); transition: width .25s ease, background .25s ease; }

.br-drawer-tabs { display: flex; align-items: stretch; gap: 2px; padding: 0 18px; overflow-x: auto; border-bottom: 1px solid var(--br-line); background: #fff; scrollbar-width: none; }
.br-drawer-tabs::-webkit-scrollbar { display: none; }
.br-drawer-tabs button { position: relative; min-height: 47px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 0 12px; border: 0; color: var(--br-muted); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.br-drawer-tabs button::after { content: ""; position: absolute; right: 9px; bottom: -1px; left: 9px; height: 2px; border-radius: 2px 2px 0 0; background: var(--br-blue); transform: scaleX(0); transition: transform .15s; }
.br-drawer-tabs button:hover { color: var(--br-ink); }
.br-drawer-tabs button.is-active { color: var(--br-blue); }
.br-drawer-tabs button.is-active::after { transform: scaleX(1); }
.br-drawer-tabs button span { min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; color: var(--br-muted); background: #f1f5f9; font-size: 8.5px; }

.br-drawer-body { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: #fbfdff; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.br-tab-panel { padding: 0 22px 26px; }
.br-form-section { margin: 18px 0 0; padding: 18px; border: 1px solid var(--br-line); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .025); }
.br-form-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.br-form-section-heading > div { display: flex; align-items: center; gap: 9px; }
.br-form-section-heading > div > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--br-blue); background: #eff6ff; font-size: 8.5px; font-weight: 850; }
.br-form-section-heading h3 { margin: 0; font-size: 13px; font-weight: 790; letter-spacing: -.01em; }
.br-form-section-heading small { color: #94a3b8; font-size: 9px; }
.br-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.br-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.br-field-wide { grid-column: 1 / -1; }
.br-field > label, .br-field > legend, .br-type-choice > legend { margin: 0; color: var(--br-ink-soft); font-size: 10.5px; font-weight: 750; }
.br-field label em, .br-field legend em { color: var(--br-red); font-style: normal; }
.br-field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), .br-field select, .br-field textarea,
.br-form-section > .br-field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), .br-form-section > .br-field select, .br-form-section > .br-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--br-line);
  border-radius: 9px;
  outline: 0;
  color: var(--br-ink);
  background: #fff;
  font-size: 12px;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.br-field textarea, .br-form-section > .br-field textarea { min-height: 94px; resize: vertical; line-height: 1.5; }
.br-field input::placeholder, .br-field textarea::placeholder { color: #a3afbf; }
.br-field input:focus, .br-field select:focus, .br-field textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.br-field input:disabled, .br-field select:disabled, .br-field textarea:disabled { color: #475569; background: #f8fafc; cursor: not-allowed; }
.br-field.is-invalid input, .br-field.is-invalid select, .br-field.is-invalid textarea { border-color: #f87171; box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.br-field-error { min-height: 0; color: #b91c1c; font-size: 9px; font-weight: 650; }
.br-field-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: #94a3b8; font-size: 8.5px; }
.br-field-meta b { color: inherit; }
.br-help { color: #94a3b8; font-size: 8.8px; line-height: 1.35; }
.br-help.is-warning { color: #b45309; font-weight: 700; }

.br-type-choice { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 0; border: 0; }
.br-type-choice > legend { grid-column: 1 / -1; margin-bottom: 0; }
.br-type-choice > label { min-width: 0; margin: 0; cursor: pointer; }
.br-type-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.br-type-card { min-height: 68px; display: grid; grid-template-columns: 37px minmax(0, 1fr) 16px; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--br-line); border-radius: 11px; background: #fff; transition: border-color .15s, box-shadow .15s, background .15s; }
.br-type-card:hover { border-color: var(--br-line-strong); }
.br-type-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; }
.br-type-icon svg { width: 18px; height: 18px; }
.br-type-normal { color: #2563eb; background: #eff6ff; }
.br-type-urgent { color: #dc2626; background: #fef2f2; }
.br-type-card > span { min-width: 0; display: flex; flex-direction: column; }
.br-type-card strong { color: var(--br-ink); font-size: 11px; }
.br-type-card small { margin-top: 2px; overflow: hidden; color: var(--br-muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.br-type-card > b { width: 15px; height: 15px; display: grid; place-items: center; border: 1.5px solid var(--br-line-strong); border-radius: 50%; }
.br-type-choice input:checked + .br-type-card { border-color: #60a5fa; background: #f8fbff; box-shadow: 0 0 0 3px rgba(37,99,235,.07); }
.br-type-choice input[value="urgent"]:checked + .br-type-card { border-color: #f87171; background: #fffafa; box-shadow: 0 0 0 3px rgba(220,38,38,.06); }
.br-type-choice input:checked + .br-type-card > b { border: 4px solid var(--br-blue); }
.br-type-choice input[value="urgent"]:checked + .br-type-card > b { border-color: var(--br-red); }
.br-type-choice input:disabled + .br-type-card { opacity: .62; cursor: not-allowed; }

.br-assignee-picker { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.br-assignee-option { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--br-line); border-radius: 9px; cursor: pointer; }
.br-assignee-option:hover { border-color: var(--br-line-strong); background: var(--br-surface-soft); }
.br-assignee-option input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--br-blue); }
.br-assignee-option span { min-width: 0; display: flex; flex-direction: column; }
.br-assignee-option strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.br-assignee-option small { overflow: hidden; color: var(--br-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.br-assignee-empty { padding: 12px; border: 1px dashed var(--br-line-strong); border-radius: 9px; color: var(--br-muted); font-size: 9.5px; text-align: center; }

.br-completion-card { display: flex; gap: 12px; margin-top: 16px; padding: 14px 16px; border: 1px solid #bbf7d0; border-radius: 12px; background: #f0fdf4; }
.br-completion-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #fff; background: var(--br-green); }
.br-completion-icon svg { width: 19px; height: 19px; }
.br-completion-card small { color: #166534; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.br-completion-card p { margin: 4px 0 0; color: #14532d; font-size: 11px; line-height: 1.45; white-space: pre-wrap; }

/* Conversation */
.br-conversation { display: flex; flex-direction: column; gap: 12px; padding: 20px 0 10px; }
.br-comment { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 9px; }
.br-comment-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #64748b; font-size: 9px; font-weight: 800; }
.br-comment-body { min-width: 0; padding: 10px 12px; border: 1px solid var(--br-line); border-radius: 4px 12px 12px 12px; background: #fff; }
.br-comment.is-internal .br-comment-body { border-color: #fde68a; background: #fffbeb; }
.br-comment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.br-comment-head strong { font-size: 10.5px; }
.br-comment-head time { color: var(--br-muted); font-size: 8.5px; white-space: nowrap; }
.br-comment-body p { margin: 0; color: var(--br-ink-soft); font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.br-internal-label { display: inline-flex; margin-left: 5px; padding: 2px 5px; border-radius: 999px; color: #92400e; background: #fef3c7; font-size: 7.5px; font-weight: 800; text-transform: uppercase; }
.br-comment-compose { position: sticky; bottom: 0; margin: 14px -22px -26px; padding: 14px 22px 18px; border-top: 1px solid var(--br-line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.br-comment-compose > label { display: block; margin-bottom: 6px; color: var(--br-ink-soft); font-size: 10px; font-weight: 750; }
.br-comment-compose textarea { width: 100%; min-height: 76px; padding: 10px 11px; border: 1px solid var(--br-line); border-radius: 10px; outline: 0; resize: vertical; color: var(--br-ink); font-size: 11px; }
.br-comment-compose textarea:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.br-comment-compose > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.br-check { display: inline-flex; align-items: center; gap: 7px; color: var(--br-muted); font-size: 9px; font-weight: 650; cursor: pointer; }
.br-check input { accent-color: var(--br-blue); }

/* Files */
.br-upload-zone { min-height: 145px; display: grid; place-items: center; align-content: center; gap: 5px; margin: 20px 0 16px; padding: 18px; border: 1.5px dashed #93c5fd; border-radius: 14px; color: var(--br-blue); background: #f8fbff; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.br-upload-zone:hover, .br-upload-zone.is-dragover { border-color: var(--br-blue); background: #eff6ff; }
.br-upload-zone.is-disabled { opacity: .55; pointer-events: none; }
.br-upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.br-upload-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 11px; color: #fff; background: var(--br-blue); box-shadow: 0 5px 14px rgba(37,99,235,.2); }
.br-upload-icon svg { width: 19px; height: 19px; }
.br-upload-zone strong { color: var(--br-ink); font-size: 11px; }
.br-upload-zone small { color: var(--br-muted); font-size: 8.5px; }
.br-file-list { display: flex; flex-direction: column; gap: 8px; }
.br-file-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--br-line); border-radius: 10px; background: #fff; }
.br-file-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--br-blue); background: #eff6ff; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.br-file-copy { min-width: 0; display: flex; flex-direction: column; }
.br-file-copy strong { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.br-file-copy small { margin-top: 3px; color: var(--br-muted); font-size: 8.5px; }
.br-file-item a { min-height: 32px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--br-line); border-radius: 8px; color: var(--br-blue); font-size: 9px; font-weight: 750; text-decoration: none; }
.br-file-item a:hover { background: #eff6ff; }

/* History */
.br-history { position: relative; margin: 20px 0 0; padding: 0 0 0 18px; list-style: none; }
.br-history::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 1px; background: var(--br-line); }
.br-history-item { position: relative; padding: 0 0 18px 18px; }
.br-history-item::before { content: ""; position: absolute; top: 4px; left: -17px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--br-blue); box-shadow: 0 0 0 1px #93c5fd; }
.br-history-item.is-status::before { background: var(--br-green); box-shadow: 0 0 0 1px #86efac; }
.br-history-item.is-warning::before { background: var(--br-amber); box-shadow: 0 0 0 1px #fcd34d; }
.br-history-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.br-history-item-head strong { color: var(--br-ink); font-size: 10.5px; }
.br-history-item-head time { color: var(--br-muted); font-size: 8px; white-space: nowrap; }
.br-history-item p { margin: 4px 0 0; color: var(--br-ink-soft); font-size: 9.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.br-history-item small { display: block; margin-top: 3px; color: var(--br-muted); font-size: 8.5px; }

.br-empty-panel { padding: 55px 22px; color: var(--br-muted); text-align: center; }
.br-empty-panel svg { width: 40px; height: 40px; margin: 0 auto 12px; color: #94a3b8; }
.br-empty-panel h3 { margin: 0; color: var(--br-ink); font-size: 13px; }
.br-empty-panel p { margin: 5px 0 0; font-size: 10px; }

/* Drawer footer + actions */
.br-drawer-footer { position: relative; z-index: 6; min-height: 70px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--br-line); background: #fff; box-shadow: 0 -8px 24px rgba(15,23,42,.045); }
.br-save-actions, .br-action-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.br-save-actions { margin-left: auto; justify-content: flex-end; }
.br-save-actions #saveWorkButton { min-width: 148px; }
.br-action-menu:empty { display: none; }
.br-action-menu .br-button { min-height: 38px; padding: 0 12px; }
.br-action-menu .br-button[data-action="cancel"], .br-action-menu .br-button[data-action="reject"] { color: #b91c1c; border-color: #fecaca; background: #fff; }
.br-action-menu .br-button[data-action="reopen"] { color: #9a3412; border-color: #fed7aa; background: #fff7ed; }

/* Action dialog */
.br-dialog-backdrop { position: fixed; z-index: 600; inset: 0; background: rgba(15,23,42,.46); opacity: 0; transition: opacity .18s; }
.br-dialog-backdrop.is-visible { opacity: 1; }
.br-dialog { position: fixed; z-index: 610; top: 50%; left: 50%; width: min(500px, calc(100vw - 28px)); overflow: hidden; border: 1px solid var(--br-line); border-radius: 16px; background: #fff; box-shadow: 0 30px 80px rgba(15,23,42,.26); opacity: 0; transform: translate(-50%, -48%) scale(.98); transition: opacity .18s, transform .18s; }
.br-dialog.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.br-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--br-line); }
.br-dialog h2 { margin: 3px 0 0; font-size: 18px; font-weight: 790; letter-spacing: -.02em; }
.br-dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.br-dialog-body > p { margin: 0; color: var(--br-muted); font-size: 11px; line-height: 1.5; }
.br-dialog > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }

/* Toasts */
.br-toast-region { position: fixed; z-index: 900; right: 20px; bottom: 20px; width: min(370px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.br-toast { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--br-line); border-radius: 12px; background: rgba(255,255,255,.97); box-shadow: var(--br-shadow); opacity: 0; pointer-events: auto; transform: translateY(10px); transition: opacity .2s, transform .2s; backdrop-filter: blur(12px); }
.br-toast.is-visible { opacity: 1; transform: translateY(0); }
.br-toast.is-pulsing { animation: br-toast-pulse .24s ease; }
@keyframes br-toast-pulse { 50% { transform: translateY(0) scale(1.018); } }
.br-toast-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--br-blue); }
.br-toast-icon svg { width: 16px; height: 16px; }
.br-toast.is-success .br-toast-icon { background: var(--br-green); }
.br-toast.is-error .br-toast-icon { background: var(--br-red); }
.br-toast.is-warning .br-toast-icon { color: #422006; background: #fbbf24; }
.br-toast-copy { min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; word-break: normal; }
.br-toast-copy strong { font-size: 10.5px; }
.br-toast-copy span { margin-top: 2px; color: var(--br-muted); font-size: 9px; line-height: 1.35; }
.br-toast button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--br-muted); background: transparent; cursor: pointer; }
.br-toast button:hover { background: var(--br-surface-soft); }
.br-toast button svg { width: 14px; height: 14px; }

/* Generic loading overlay */
.br-panel-loading { position: relative; }
.br-panel-loading::after { content: ""; position: absolute; z-index: 30; inset: 0; background: rgba(255,255,255,.58); backdrop-filter: blur(1px); }

/* Responsive */
@media (max-width: 1280px) {
  .br-topbar { grid-template-columns: minmax(205px, auto) 1fr auto; gap: 14px; padding: 0 18px; }
  .br-primary-nav a { padding: 0 9px; }
  .br-user-copy { display: none; }
  .br-user-trigger { grid-template-columns: 38px 16px; }
  .br-workspace { grid-template-columns: minmax(0,1fr) 260px; }
  .br-calendar-navigator { grid-template-columns: 300px minmax(0,1fr); }
  .br-filter-cluster .br-search { min-width: 170px; }
  .br-filter-cluster .br-select { min-width: 118px; }
}

@media (max-width: 1080px) {
  .br-primary-nav a:nth-child(n+3) { display: none; }
  .br-workspace { display: block; }
  .br-calendar-navigator { grid-template-columns: 290px minmax(0,1fr); }
  .br-calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .br-calendar-toolbar-right { width: 100%; justify-content: stretch; }
  .br-filter-cluster { width: 100%; justify-content: stretch; }
  .br-filter-cluster .br-search { flex: 1; }
}

@media (max-width: 760px) {
  :root { --br-header-height: 62px; }
  body.br-app { background: var(--br-canvas); }
  .br-topbar { grid-template-columns: 1fr auto; padding: 0 12px; }
  .br-brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .br-brand-copy small { display: none; }
  .br-primary-nav { display: none; }
  .br-header-actions { gap: 6px; }
  .br-mobile-search-toggle { display: inline-grid !important; }
  .br-header-actions > .br-button { width: 40px; padding: 0; }
  .br-header-actions > .br-button span { display: none; }
  .br-user-menu { display: none; }
  .br-main { padding: 18px 10px 28px; }
  .br-home-public .br-main,
  .br-home-authenticated .br-main { padding-top: 8px; }
  .br-page-heading { align-items: flex-start; margin-bottom: 15px; }
  .br-page-heading p { display: none; }
  .br-page-heading h1 { font-size: 24px; }
  .br-heading-tools { margin-top: 1px; }
  .br-heading-tools .br-button { width: 40px; padding: 0; font-size: 0; }
  .br-calendar-card { border-radius: 14px; }
  .br-calendar-navigator { grid-template-columns: 1fr; gap: 10px; padding: 10px; }
  .br-mini-calendar { width: 100%; max-width: 390px; justify-self: center; }
  .br-mini-calendar-day { height: 34px; font-size: 10.5px; }
  .br-calendar-controls { width: 100%; }
  .br-calendar-toolbar { min-height: auto; gap: 10px; padding: 10px; }
  .br-calendar-toolbar-right { align-items: stretch; }
  .br-view-switch { width: 100%; }
  .br-view-switch button { flex: 1; }
  .br-filter-cluster { display: none; flex-wrap: wrap; }
  .br-filter-cluster.is-mobile-open { display: flex; }
  .br-filter-cluster .br-search { min-width: 100%; flex-basis: 100%; }
  .br-filter-cluster .br-select { min-width: 0; flex: 1; }
  .br-legend { gap: 10px; padding: 9px 10px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .br-legend-title { display: none; }
  .br-legend::-webkit-scrollbar { display: none; }
  .br-calendar-wrap, #calendar, #calendar .nx-root { min-height: calc(100vh - 365px); }
  #calendar .nx-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  #calendar .nx-toolbar-title { font-size: 12px; }
  #calendar .nx-resource-text small { display: none; }
  .br-work-drawer { width: 100vw; max-width: none; }
  .br-work-drawer.is-create-modal {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    opacity: 1;
    transform: translateY(102%);
  }
  .br-work-drawer.is-create-modal.is-open { transform: translateY(0); }
  .br-work-drawer.is-create-modal .br-drawer-header,
  .br-work-drawer.is-create-modal .br-drawer-footer { border-radius: 0; }
  .br-drawer-header { min-height: 82px; padding: 15px 15px 12px; }
  .br-drawer-title-block h2 { font-size: 18px; }
  .br-drawer-tabs { padding: 0 7px; }
  .br-drawer-tabs button { min-height: 44px; padding: 0 9px; font-size: 10px; }
  .br-tab-panel { padding: 0 10px 22px; }
  .br-form-section { margin-top: 10px; padding: 14px; }
  .br-form-section-heading small { display: none; }
  .br-form-grid { grid-template-columns: 1fr; }
  .br-field-wide { grid-column: auto; }
  .br-type-choice { grid-template-columns: 1fr; }
  .br-assignee-picker { grid-template-columns: 1fr; }
  .br-comment-compose { margin-right: -10px; margin-bottom: -22px; margin-left: -10px; padding-right: 10px; padding-left: 10px; }
  .br-drawer-footer { align-items: stretch; flex-direction: column; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); }
  .br-action-menu { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .br-action-menu .br-button { flex: 0 0 auto; }
  .br-save-actions { width: 100%; margin-left: 0; }
  .br-save-actions .br-button { flex: 1; }
  .br-toast-region { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
}

@media (max-width: 430px) {
  .br-brand-copy strong { font-size: 14px; }
  .br-comment-compose > div { align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Work list / reports */
.br-report-summary { display:grid; grid-template-columns:repeat(5,minmax(130px,1fr)); gap:10px; margin-bottom:14px; }
.br-report-summary article { min-height:74px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border:1px solid var(--br-line); border-radius:13px; background:#fff; box-shadow:var(--br-shadow-sm); }
.br-report-summary small { color:var(--br-muted); font-size:10px; font-weight:750; }
.br-report-summary strong { color:var(--br-ink); font-size:23px; font-weight:800; letter-spacing:-.04em; }
.br-report-card { overflow:hidden; border:1px solid var(--br-line); border-radius:var(--br-radius-lg); background:#fff; box-shadow:var(--br-shadow-sm); }
.br-report-tabs { display:flex; align-items:center; gap:3px; padding:10px 12px 0; overflow-x:auto; border-bottom:1px solid var(--br-line); scrollbar-width:none; }
.br-report-tabs::-webkit-scrollbar { display:none; }
.br-report-tabs button { position:relative; min-height:42px; flex:0 0 auto; padding:0 13px; border:0; color:var(--br-muted); background:transparent; font-size:11px; font-weight:750; cursor:pointer; }
.br-report-tabs button::after { content:""; position:absolute; right:10px; bottom:-1px; left:10px; height:2px; background:var(--br-blue); transform:scaleX(0); }
.br-report-tabs button.is-active { color:var(--br-blue); }
.br-report-tabs button.is-active::after { transform:scaleX(1); }
.br-report-filters { display:flex; align-items:flex-end; flex-wrap:wrap; gap:8px; padding:12px; border-bottom:1px solid var(--br-line); background:#fbfdff; }
.br-report-search { flex:1 1 260px; }
.br-report-date { min-width:126px; display:flex; flex-direction:column; gap:3px; }
.br-report-date span { color:var(--br-muted); font-size:8px; font-weight:750; text-transform:uppercase; }
.br-report-date input { height:40px; padding:0 9px; border:1px solid var(--br-line); border-radius:10px; outline:0; color:var(--br-ink-soft); background:#fff; font-size:10.5px; }
.br-report-table-wrap { overflow-x:auto; }
.br-report-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.br-report-table th { padding:10px 12px; border-bottom:1px solid var(--br-line); color:var(--br-muted); background:#f8fafc; font-size:8.5px; font-weight:850; letter-spacing:.055em; text-align:left; text-transform:uppercase; }
.br-report-table th:nth-child(1){width:25%}.br-report-table th:nth-child(2){width:12%}.br-report-table th:nth-child(3){width:18%}.br-report-table th:nth-child(4){width:14%}.br-report-table th:nth-child(5){width:18%}.br-report-table th:nth-child(6){width:10%}.br-report-table th:nth-child(7){width:42px}
.br-report-table td { padding:12px; border-bottom:1px solid #eef2f7; vertical-align:middle; }
.br-report-table tbody tr { transition:background .14s; }
.br-report-table tbody tr:hover { background:#f8fbff; }
.br-work-title { min-width:0; display:grid; grid-template-columns:auto 1fr; gap:2px 7px; color:inherit; text-decoration:none!important; }
.br-work-title > span { grid-column:1; color:var(--br-blue); font-size:8.5px; font-weight:850; letter-spacing:.04em; }
.br-work-title > strong { grid-column:1/-1; overflow:hidden; color:var(--br-ink); font-size:10.5px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.br-work-title > small { grid-column:2; grid-row:1; color:var(--br-muted); font-size:8px; text-align:right; }
.br-status-stack { display:flex; align-items:flex-start; flex-direction:column; gap:4px; }
.br-table-status,.br-table-urgent,.br-table-overdue { display:inline-flex; align-items:center; min-height:20px; padding:0 7px; border-radius:999px; font-size:8px; font-weight:800; white-space:nowrap; }
.br-table-status { color:var(--status-text); background:var(--status-color); }
.br-table-urgent { color:#991b1b; background:#fee2e2; }
.br-table-overdue { color:#9a3412; background:#ffedd5; }
.br-table-copy { min-width:0; display:flex; flex-direction:column; }
.br-table-copy strong { overflow:hidden; color:var(--br-ink-soft); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.br-table-copy small { margin-top:3px; overflow:hidden; color:var(--br-muted); font-size:8.5px; text-overflow:ellipsis; white-space:nowrap; }
.br-table-progress { display:flex; align-items:center; gap:7px; }
.br-table-progress > span { height:5px; min-width:40px; flex:1; overflow:hidden; border-radius:5px; background:#e2e8f0; }
.br-table-progress i { height:100%; display:block; border-radius:5px; }
.br-table-progress strong { width:28px; color:var(--br-muted); font-size:8.5px; text-align:right; }
.br-table-open { width:30px; height:30px; display:grid; place-items:center; border-radius:8px; color:var(--br-muted); text-decoration:none!important; }
.br-table-open:hover { color:var(--br-blue); background:#eff6ff; }
.br-table-open svg { width:15px; height:15px; }
.br-report-empty { padding:55px 20px; color:var(--br-muted); text-align:center; }
.br-report-empty strong,.br-report-empty span { display:block; }
.br-report-empty strong { color:var(--br-ink); font-size:13px; }.br-report-empty span{margin-top:4px;font-size:10px}
.br-list-loading { min-height:260px; }
.br-report-footer { min-height:58px; display:flex; align-items:center; justify-content:space-between; gap:15px; padding:10px 14px; color:var(--br-muted); font-size:9.5px; }
.br-pagination { display:flex; align-items:center; gap:4px; }
.br-pagination button { min-width:31px; height:31px; padding:0 8px; border:1px solid var(--br-line); border-radius:8px; color:var(--br-ink-soft); background:#fff; font-size:9.5px; font-weight:750; cursor:pointer; }
.br-pagination button:hover:not(:disabled),.br-pagination button.is-active { color:#fff; border-color:var(--br-blue); background:var(--br-blue); }
.br-pagination button:disabled { opacity:.4; cursor:not-allowed; }.br-pagination span{padding:0 3px}
.br-report-mobile-list { display:none; }
@media(max-width:1080px){.br-report-summary{grid-template-columns:repeat(3,minmax(130px,1fr))}.br-report-table th:nth-child(3),.br-report-table td:nth-child(3){display:none}.br-report-table th:nth-child(1){width:29%}.br-report-table th:nth-child(4){width:18%}.br-report-table th:nth-child(5){width:23%}}
@media(max-width:760px){.br-report-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.br-report-summary article{min-height:61px;padding:11px}.br-report-summary article:last-child{grid-column:1/-1}.br-report-summary strong{font-size:20px}.br-report-tabs{padding-left:6px}.br-report-filters{align-items:stretch}.br-report-filters .br-select{flex:1 1 calc(50% - 8px)}.br-report-date{flex:1 1 calc(50% - 8px)}.br-report-table-wrap{display:none}.br-report-mobile-list{display:flex;flex-direction:column;padding:8px}.br-mobile-work-card{display:block;padding:13px;border-bottom:1px solid var(--br-line);border-radius:10px;color:inherit;text-decoration:none!important}.br-mobile-work-card:hover{background:#f8fbff}.br-mobile-work-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.br-mobile-work-head>span{color:var(--br-blue);font-size:9px;font-weight:850}.br-mobile-work-head .br-status-stack{align-items:flex-end}.br-mobile-work-card h3{margin:6px 0 3px;font-size:12px}.br-mobile-work-card p{margin:0;color:var(--br-muted);font-size:9.5px}.br-mobile-work-card footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:9px;color:var(--br-muted);font-size:8.5px}.br-report-footer{align-items:flex-start;flex-direction:column}.br-pagination{width:100%;justify-content:center;flex-wrap:wrap}.br-list-page .br-header-actions>.br-button span{display:none}}

/* Administration */
.br-admin-page .br-main { max-width: 1680px; }
.br-admin-alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  color: #1e3a8a;
  background: #eff6ff;
  box-shadow: var(--br-shadow-sm);
  transition: opacity .22s ease, transform .22s ease;
}
.br-admin-alert.is-dismissing { opacity: 0; transform: translateY(-7px); pointer-events: none; }
.br-admin-alert strong { flex: 0 0 auto; font-size: 10.5px; }
.br-admin-alert span { flex: 1 1 auto; min-width: 0; color: inherit; font-size: 10.5px; }
.br-admin-alert.is-error { border-color: #fecaca; color: #991b1b; background: #fef2f2; }
.br-admin-alert.is-success { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
.br-admin-alert .br-feedback-dismiss {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  margin: -6px -7px -6px auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: currentColor;
  background: transparent;
  cursor: pointer;
  opacity: .72;
}
.br-admin-alert .br-feedback-dismiss:hover, .br-admin-alert .br-feedback-dismiss:focus-visible { background: rgba(255,255,255,.7); opacity: 1; }
.br-admin-alert .br-feedback-dismiss svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) {
  .br-toast.is-pulsing { animation: none; }
  .br-admin-alert { transition: opacity .01ms; }
}

.br-admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.br-admin-stats article {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--br-line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--br-shadow-sm);
}
.br-admin-stats small { color: var(--br-muted); font-size: 9.5px; font-weight: 750; }
.br-admin-stats strong { color: var(--br-ink); font-size: 22px; font-weight: 850; letter-spacing: -.04em; }
.br-admin-stats-note { margin: -6px 2px 14px; color: var(--br-muted); font-size: 11.5px; line-height: 1.45; }

.br-admin-layout {
  display: grid;
  grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
.br-admin-card {
  overflow: hidden;
  border: 1px solid var(--br-line);
  border-radius: var(--br-radius-lg);
  background: #fff;
  box-shadow: var(--br-shadow-sm);
}
.br-admin-card > header,
.br-admin-list-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--br-line);
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.br-admin-card > header h2,
.br-admin-list-header h2 { margin: 2px 0 0; color: var(--br-ink); font-size: 17px; letter-spacing: -.025em; }
.br-admin-editor { position: sticky; top: calc(var(--br-header-height) + 14px); }
.br-admin-editor > header .br-icon-button { font-size: 22px; text-decoration: none; }
.br-admin-note {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 14px 16px 0;
  padding: 11px 12px;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  color: #5b21b6;
  background: #f5f3ff;
}
.br-admin-note strong { font-size: 10px; }
.br-admin-note span { font-size: 9px; }

.br-admin-form { padding: 17px; }
.br-admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.br-admin-form-grid > label { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.br-admin-form-grid > label > span {
  color: var(--br-ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .025em;
}
.br-admin-form-grid input,
.br-admin-form-grid select,
.br-admin-form-grid textarea,
.br-admin-search input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--br-line);
  border-radius: 9px;
  outline: 0;
  color: var(--br-ink);
  background: #fff;
  font-size: 10.5px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.br-admin-form-grid textarea { min-height: 86px; resize: vertical; line-height: 1.5; }
.br-admin-form-grid input:focus,
.br-admin-form-grid select:focus,
.br-admin-form-grid textarea:focus,
.br-admin-search input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.br-admin-form-grid input[readonly],
.br-admin-form-grid select:disabled { color: var(--br-muted); background: #f8fafc; }
.br-admin-form-grid label small { color: var(--br-muted); font-size: 8px; line-height: 1.35; }
.br-admin-span-2 { grid-column: 1 / -1; }
.br-admin-checks { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--br-line); }
.br-admin-checks label { display: flex; align-items: center; gap: 8px; color: var(--br-ink-soft); font-size: 9.5px; font-weight: 650; cursor: pointer; }
.br-admin-checks input { width: 16px; height: 16px; accent-color: var(--br-blue); }
.br-admin-check-option { display: grid; gap: 3px; }
.br-admin-check-option small { padding-left: 24px; color: var(--br-muted); font-size: 11.5px; line-height: 1.4; }
.br-admin-form > footer { display: flex; align-items: center; gap: 8px; margin: 17px -17px -17px; padding: 13px 17px; border-top: 1px solid var(--br-line); background: #f8fafc; }
.br-color-field { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; }
.br-color-field input[type="color"] { width: 48px; height: 40px; padding: 4px; cursor: pointer; }
.br-color-field code { min-height: 40px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--br-line); border-radius: 9px; color: var(--br-ink-soft); background: #f8fafc; font-size: 9.5px; }

.br-admin-list-card { min-width: 0; }
.br-admin-list-header { flex-wrap: wrap; }
.br-admin-search { min-width: 250px; display: flex; align-items: center; gap: 7px; }
.br-admin-search input { min-width: 220px; }
.br-admin-table-wrap { overflow-x: auto; }
.br-admin-table { width: 100%; border-collapse: collapse; }
.br-admin-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--br-line);
  color: var(--br-muted);
  background: #f8fafc;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .055em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.br-admin-table td { padding: 11px 12px; border-bottom: 1px solid #eef2f7; vertical-align: middle; font-size: 10px; }
.br-admin-table tbody tr { transition: background .14s, opacity .14s; }
.br-admin-table tbody tr:hover { background: #f8fbff; }
.br-admin-table tr.is-inactive { opacity: .58; }
.br-admin-person,
.br-admin-resource { min-width: 210px; display: flex; align-items: center; gap: 9px; }
.br-admin-person > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #64748b, #334155);
  font-size: 9px;
  font-weight: 850;
}
.br-admin-person > div,
.br-admin-resource > div,
.br-admin-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.br-admin-person strong,
.br-admin-resource strong,
.br-admin-meta strong { overflow: hidden; color: var(--br-ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.br-admin-person small,
.br-admin-resource small,
.br-admin-meta small { max-width: 290px; overflow: hidden; color: var(--br-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.br-admin-resource > i { width: 10px; height: 38px; flex: 0 0 auto; border-radius: 6px; background: var(--resource-color, #64748b); box-shadow: inset 0 0 0 1px rgba(15,23,42,.08); }
.br-admin-role,
.br-admin-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.br-admin-role.is-admin { color: #5b21b6; background: #ede9fe; }
.br-admin-role.is-worker { color: #b45309; background: #fef3c7; }
.br-admin-role.is-requester { color: #047857; background: #d1fae5; }
.br-admin-state.is-good { color: #166534; background: #dcfce7; }
.br-admin-state.is-off { color: #991b1b; background: #fee2e2; }
.br-admin-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.br-admin-row-actions form { margin: 0; }
.br-admin-row-actions .br-button { min-height: 31px; padding: 0 9px; font-size: 8.5px; }
.br-admin-row-actions .br-icon-button { width: 31px; height: 31px; font-size: 11px; }
.br-admin-pagination { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--br-muted); font-size: 9px; }
.br-admin-pagination nav { display: flex; gap: 4px; }
.br-admin-pagination a { min-width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--br-line); border-radius: 8px; color: var(--br-ink-soft); text-decoration: none; font-size: 9px; font-weight: 750; }
.br-admin-pagination a:hover,
.br-admin-pagination a.is-active { color: #fff; border-color: var(--br-blue); background: var(--br-blue); }

@media (max-width: 1240px) {
  .br-admin-layout { grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); }
  .br-admin-stats { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .br-admin-table th:nth-child(4), .br-admin-table td:nth-child(4) { display: none; }
}

@media (max-width: 960px) {
  .br-admin-layout { grid-template-columns: 1fr; }
  .br-admin-editor { position: static; }
  .br-admin-table th:nth-child(4), .br-admin-table td:nth-child(4) { display: table-cell; }
}

@media (max-width: 760px) {
  .br-admin-page .br-primary-nav { display: none; }
  .br-admin-page .br-header-actions > .br-button span { display: none; }
  .br-admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .br-admin-stats article { min-height: 58px; padding: 10px 11px; }
  .br-admin-stats strong { font-size: 20px; }
  .br-admin-form-grid { grid-template-columns: 1fr; }
  .br-admin-span-2 { grid-column: auto; }
  .br-admin-list-header { align-items: stretch; flex-direction: column; }
  .br-admin-search { min-width: 0; width: 100%; }
  .br-admin-search input { min-width: 0; flex: 1; }
  .br-admin-table thead { display: none; }
  .br-admin-table,
  .br-admin-table tbody,
  .br-admin-table tr,
  .br-admin-table td { display: block; width: 100%; }
  .br-admin-table tr { position: relative; padding: 12px; border-bottom: 1px solid var(--br-line); }
  .br-admin-table td { padding: 5px 0; border: 0; }
  .br-admin-table td:last-child { position: absolute; top: 9px; right: 9px; width: auto; }
  .br-admin-table td:nth-last-child(2) { padding-right: 110px; }
  .br-admin-person,
  .br-admin-resource { min-width: 0; padding-right: 105px; }
  .br-admin-table tr.is-inactive { opacity: .65; }
  .br-admin-row-actions .br-button { background: #fff; }
}

/* --------------------------------------------------------------------------
   R8 readability, compact calendar controls and completed-work polish
   -------------------------------------------------------------------------- */
body.br-app { font-size: 16px; line-height: 1.55; }

.br-brand-copy strong { font-size: 17px; }
.br-brand-copy small { font-size: 12px; }
.br-primary-nav a { font-size: 14px; }
.br-user-copy strong { font-size: 14px; }
.br-user-copy small,
.br-user-panel > div small { font-size: 12px; }
.br-user-panel > div strong { font-size: 14px; }
.br-user-panel a { font-size: 13px; }
.br-button { min-height: 42px; font-size: 14px; }
.br-login-button { white-space: nowrap; }
.br-page-heading p { font-size: 15px; }
.br-eyebrow { font-size: 11px; }
.br-calendar-navigator { grid-template-columns: 310px minmax(0, 1fr); }
.br-mini-calendar-period-controls select { font-size: 13px; }
.br-mini-calendar-weekdays span { font-size: 10px; }
.br-mini-calendar-day { font-size: 12px; }
.br-mini-calendar-footer button { font-size: 12px; }
.br-view-switch button { font-size: 13px; }
.br-search input,
.br-select,
.br-select select { font-size: 14px; }
.br-legend { font-size: 12.5px; }
.br-loading-state strong { font-size: 14px; }

/* Timeline stays dense but avoids micro text. */
#calendar .nx-root { font-size: 15px; }
#calendar .nx-button { min-height: 35px; font-size: 13px; }
#calendar .nx-toolbar-title { font-size: 18px; }
#calendar .nx-resource-column-headers strong { font-size: 12px; }
#calendar .nx-resource-count { font-size: 12px; }
#calendar .nx-timeline-major-cell { font-size: 14px; }
#calendar .nx-timeline-minor-cell { font-size: 12px; }
#calendar .nx-resource-text strong { font-size: 14px; }
#calendar .nx-resource-text small { font-size: 12px; }
#calendar .nx-resource-avatar { font-size: 12px; }
#calendar .br-event-content strong { font-size: 13px; }
#calendar .br-event-content small { font-size: 11.5px; }
#calendar .nx-selection-preview-label,
#calendar .nx-selection-range-label { font-size: 11px; }

/* Work card */
.br-status-pill { font-size: 11px; }
.br-task-number { font-size: 11.5px; }
.br-drawer-title-block h2 { font-size: 23px; }
.br-drawer-title-block p { font-size: 13px; }
.br-selection-summary-copy small { font-size: 10.5px; }
.br-selection-summary-copy strong { font-size: 14px; }
.br-selection-summary-copy em { font-size: 12px; }
.br-drawer-tabs button { font-size: 13px; }
.br-drawer-tabs button span { font-size: 10px; }
.br-form-section-heading h3 { font-size: 15px; }
.br-form-section-heading small { font-size: 11.5px; }
.br-field > label,
.br-field > legend,
.br-type-choice > legend { font-size: 13px; }
.br-field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.br-field select,
.br-field textarea,
.br-form-section > .br-field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.br-form-section > .br-field select,
.br-form-section > .br-field textarea { min-height: 46px; font-size: 14px; }
.br-field-error { font-size: 12px; }
.br-field-meta,
.br-help { font-size: 12px; }
.br-type-card strong { font-size: 13px; }
.br-type-card small { font-size: 11px; }
.br-assignee-option strong { font-size: 12.5px; }
.br-assignee-option small,
.br-assignee-empty { font-size: 12px; }
.br-completion-card small { font-size: 10.5px; }
.br-completion-card p { font-size: 13px; }
.br-comment-head strong { font-size: 13px; }
.br-comment-head time { font-size: 11px; }
.br-comment-body p,
.br-comment-compose textarea { font-size: 13px; }
.br-comment-compose > label { font-size: 12.5px; }
.br-check { font-size: 11.5px; }
.br-upload-zone strong { font-size: 13px; }
.br-upload-zone small,
.br-file-copy small { font-size: 11px; }
.br-file-copy strong { font-size: 13px; }
.br-file-item a { font-size: 11.5px; }
.br-history-item-head strong { font-size: 13px; }
.br-history-item-head time { font-size: 11px; }
.br-history-item p { font-size: 12px; }
.br-history-item small { font-size: 11px; }
.br-dialog-body > p { font-size: 13px; }
.br-toast-copy strong { font-size: 13px; }
.br-toast-copy span { font-size: 11.5px; }

/* Public cards expose schedule details, not private contacts or internal work data. */

/* Work overview */
.br-report-summary small { font-size: 12.5px; }
.br-report-tabs button { font-size: 13px; }
.br-report-date span { font-size: 10.5px; }
.br-report-date input { font-size: 13px; }
.br-report-table th { font-size: 11.5px; }
.br-work-title > span { font-size: 12px; }
.br-work-title > strong { font-size: 14px; }
.br-work-title > small { font-size: 12px; }
.br-table-status,
.br-table-urgent,
.br-table-overdue { font-size: 11.5px; }
.br-table-copy strong { font-size: 13.5px; }
.br-table-copy small { font-size: 12px; }
.br-table-progress strong { font-size: 11px; }
.br-report-footer,
.br-pagination button { font-size: 12px; }
.br-report-table tr.is-completed .br-work-title > strong,
.br-report-table tr.is-completed .br-work-title > span,
.br-mobile-work-card.is-completed h3 { text-decoration: line-through 2px; }
.br-report-table tr.is-completed,
.br-mobile-work-card.is-completed { opacity: .76; }

/* Administration */
.br-admin-alert strong,
.br-admin-alert span { font-size: 13px; }
.br-admin-stats small { font-size: 12px; }
.br-admin-stats strong { font-size: 25px; }
.br-admin-note strong { font-size: 12.5px; }
.br-admin-note span { font-size: 12px; }
.br-admin-form-grid > label > span { font-size: 13px; }
.br-admin-form-grid input,
.br-admin-form-grid select,
.br-admin-form-grid textarea,
.br-admin-search input { min-height: 44px; font-size: 14px; }
.br-admin-form-grid label small { font-size: 12px; }
.br-admin-checks label { font-size: 12.5px; }
.br-color-field code { font-size: 12px; }
.br-admin-table th { font-size: 11.5px; }
.br-admin-table td { font-size: 14px; }
.br-admin-person > span { font-size: 12px; }
.br-admin-person strong,
.br-admin-resource strong,
.br-admin-meta strong { font-size: 14px; }
.br-admin-person small,
.br-admin-resource small,
.br-admin-meta small { font-size: 12px; }
.br-admin-role,
.br-admin-state { font-size: 11.5px; }
.br-admin-row-actions .br-button { font-size: 12.5px; }
.br-admin-row-actions .br-icon-button { font-size: 13px; }
.br-admin-pagination,
.br-admin-pagination a { font-size: 12.5px; }

@media (max-width: 760px) {
  body.br-app { font-size: 15px; }
  .br-mini-calendar-day { font-size: 12px; }
  #calendar .nx-toolbar-title { font-size: 15px; }
  #calendar .br-event-content strong { font-size: 11px; }
  #calendar .br-event-content small { font-size: 10px; }
  .br-drawer-tabs button { font-size: 12px; }
  .br-field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
  .br-field select,
  .br-field textarea,
  .br-admin-form-grid input,
  .br-admin-form-grid select,
  .br-admin-form-grid textarea,
  .br-admin-search input { font-size: 16px; }
  .br-mobile-work-head > span { font-size: 11px; }
  .br-mobile-work-card h3 { font-size: 14px; }
  .br-mobile-work-card p { font-size: 12px; }
  .br-mobile-work-card footer { font-size: 11px; }
}


/* Keep validation and save-result notices clear of the drawer action bar. */
body.br-drawer-open .br-toast-region {
  bottom: calc(92px + env(safe-area-inset-bottom));
}

@media (max-width: 760px) {
  body.br-drawer-open .br-toast-region {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

/* Structured schedule-conflict resolution. */
.br-dialog[aria-hidden="true"] { pointer-events: none; }
.br-conflict-backdrop { z-index: 720; background: rgba(15, 23, 42, .58); backdrop-filter: blur(4px); }
.br-conflict-dialog {
  z-index: 730;
  width: min(720px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
}
.br-conflict-dialog .br-dialog-body { overflow: auto; overscroll-behavior: contain; }
.br-conflict-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.br-conflict-heading-icon {
  width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 12px; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa;
}
.br-conflict-heading-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.br-conflict-candidate {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px;
  padding: 12px; border: 1px solid var(--br-line); border-radius: 12px; background: var(--br-surface-soft);
}
.br-conflict-candidate span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.br-conflict-candidate small { color: var(--br-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.br-conflict-candidate strong { overflow: hidden; color: var(--br-text); font-size: 13.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.br-conflict-list { display: grid; gap: 9px; }
.br-conflict-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid #fed7aa; border-radius: 12px; background: #fffaf5; }
.br-conflict-item.is-hard { border-color: #fecaca; background: #fff7f7; }
.br-conflict-item-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #ffedd5; color: #c2410c; font-size: 14px; font-weight: 850; }
.br-conflict-item.is-hard .br-conflict-item-icon { background: #fee2e2; color: #b91c1c; }
.br-conflict-item-copy { min-width: 0; }
.br-conflict-item-copy strong { display: block; margin-bottom: 3px; color: var(--br-text); font-size: 13.5px; line-height: 1.3; }
.br-conflict-item-copy > p { margin: 0; color: #475569; font-size: 12.5px; line-height: 1.48; }
.br-conflict-related { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.br-conflict-related li { display: flex; flex-wrap: wrap; gap: 4px 8px; padding-top: 7px; border-top: 1px solid rgba(148, 163, 184, .25); font-size: 11.5px; }
.br-conflict-related b { color: var(--br-text); }
.br-conflict-related span { color: var(--br-muted); }
.br-conflict-resolution { padding: 13px; border: 1px solid var(--br-line); border-radius: 12px; background: #fff; }
.br-conflict-resolution .br-form-section-heading { margin-bottom: 12px; }
.br-conflict-override { padding: 12px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; }
.br-conflict-override-toggle { align-items: flex-start; }
.br-conflict-override-toggle > span { display: flex; flex-direction: column; gap: 2px; }
.br-conflict-override-toggle strong { color: #78350f; font-size: 13px; }
.br-conflict-override-toggle small { color: #92400e; font-size: 11.5px; line-height: 1.4; }
.br-conflict-override #conflictReasonField { margin-top: 11px; }
.br-conflict-dialog > footer { flex: 0 0 auto; border-top: 1px solid var(--br-line); background: #fff; }

@media (max-width: 640px) {
  .br-conflict-dialog { top: auto; bottom: 0; left: 0; width: 100%; max-height: min(92vh, 900px); border-radius: 18px 18px 0 0; transform: translateY(24px); }
  .br-conflict-dialog.is-open { transform: translateY(0); }
  .br-conflict-dialog > header { padding: 15px 16px 12px; }
  .br-conflict-dialog .br-dialog-body { padding: 14px 16px; }
  .br-conflict-dialog > footer { padding: 11px 16px calc(12px + env(safe-area-inset-bottom)); }
  .br-conflict-candidate { grid-template-columns: 1fr; }
  .br-conflict-candidate strong { white-space: normal; }
  .br-conflict-heading-icon { width: 38px; height: 38px; }
}

/* --------------------------------------------------------------------------
   R8 ergonomic intake, public calendar and separated reporting
   -------------------------------------------------------------------------- */
.br-workspace.is-calendar-only { grid-template-columns: minmax(0, 1fr); }
.br-workspace.is-calendar-only .br-calendar-card { width: 100%; }
.br-calendar-navigator { grid-template-columns: 310px minmax(0, 1fr); align-items: stretch; }
.br-home-public .br-calendar-toolbar { justify-content: space-between; }
.br-home-public .br-calendar-card { box-shadow: 0 12px 34px rgba(15, 23, 42, .07); }

.br-registry-source {
  padding: 15px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fafc, #fff);
}
.br-registry-source-head { display: flex; align-items: center; gap: 12px; }
.br-registry-source-icon {
  width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 12px; color: #1d4ed8; background: #dbeafe;
}
.br-registry-source-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.br-registry-source-head > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.br-registry-source-head small { color: #64748b; font-size: 11px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.br-registry-source-head strong { color: #0f172a; font-size: 15px; line-height: 1.3; }
.br-registry-source-head span { color: #64748b; font-size: 12.5px; }
.br-registry-source dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 13px 0 0; }
.br-registry-source dl > div { min-width: 0; padding: 10px 11px; border: 1px solid #e2e8f0; border-radius: 10px; background: rgba(255,255,255,.82); }
.br-registry-source dt { margin: 0 0 3px; color: #64748b; font-size: 10.5px; font-weight: 780; text-transform: uppercase; letter-spacing: .035em; }
.br-registry-source dd { margin: 0; overflow-wrap: anywhere; color: #1e293b; font-size: 12.5px; line-height: 1.42; }
.br-registry-warning { margin-top: 10px; padding: 9px 11px; border: 1px solid #fde68a; border-radius: 9px; color: #854d0e; background: #fffbeb; font-size: 12px; line-height: 1.45; }
.br-requester-planning-note { margin-bottom: 12px; padding: 12px 13px; border: 1px solid #bfdbfe; border-radius: 11px; color: #1e40af; background: #eff6ff; font-size: 13px; line-height: 1.5; }

.br-public-work-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.br-public-work-summary > div { min-width: 0; padding: 13px; border: 1px solid var(--br-line); border-radius: 12px; background: #f8fafc; }
.br-public-work-summary small { display: block; margin-bottom: 3px; color: var(--br-muted); font-size: 10.5px; font-weight: 760; text-transform: uppercase; letter-spacing: .04em; }
.br-public-work-summary strong { display: block; overflow-wrap: anywhere; color: var(--br-ink); font-size: 14px; line-height: 1.4; }

.br-report-summary article { align-items: flex-start; flex-direction: column; justify-content: center; }
.br-report-summary article strong { line-height: 1; }
.br-report-summary article em { color: #94a3b8; font-size: 11px; font-style: normal; }

@media (min-width: 1100px) {
  .br-home-authenticated .br-calendar-wrap { min-height: 560px; }
}

@media (max-width: 900px) {
  .br-registry-source dl { grid-template-columns: 1fr; }
  .br-public-work-summary { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .br-calendar-navigator { grid-template-columns: 1fr; }
  .br-registry-source { padding: 12px; }
  .br-registry-source-head { align-items: flex-start; }
  .br-registry-source-icon { width: 38px; height: 38px; }
}

/* Membership diagnostics */
.br-resource-link-option.has-warning,
.br-resource-team-option.has-warning {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
}
.br-resource-link-option.has-warning small,
.br-resource-team-option.has-warning small { color: #92400e; }
.br-resource-link-option.is-organisation-mismatch {
  border-color: #fed7aa;
  background: #fff7ed;
}
.br-resource-link-option.is-organisation-mismatch small { color: #9a3412; }
.br-resource-link-option.is-paused-link,
.br-resource-team-option.is-paused-link {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  opacity: .82;
}
.br-resource-link-option.is-paused-link small,
.br-resource-team-option.is-paused-link small { color: #64748b; }

.br-resource-link-option.is-readonly { cursor: default; }
.br-resource-links-readonly > .br-button { margin-top: 12px; }

/* R10: compact, understandable admin form sections. */
.br-admin-details { margin-top: 14px; border: 1px solid var(--br-line); border-radius: 11px; background: #fbfdff; }
.br-admin-details > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--br-ink-soft); font-size: 13px; font-weight: 800; cursor: pointer; list-style: none; }
.br-admin-details > summary::-webkit-details-marker { display: none; }
.br-admin-details > summary::before { content: "›"; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--br-blue); background: #eff6ff; font-size: 18px; line-height: 1; transition: transform .15s ease; }
.br-admin-details[open] > summary::before { transform: rotate(90deg); }
.br-admin-details[open] > summary { border-bottom: 1px solid var(--br-line); }
.br-admin-details > .br-admin-form-grid { padding: 12px; }
@media (max-width: 760px) {
  .br-admin-details > .br-admin-form-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Reliable administration and visible membership management
   -------------------------------------------------------------------------- */
.br-resource-team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  padding: 13px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}
.br-resource-team-heading h3 { margin: 2px 0 3px; color: var(--br-ink); font-size: 16px; }
.br-resource-team-heading p { margin: 0; color: #475569; font-size: 12px; line-height: 1.45; }

.br-resource-membership-field,
.br-resource-link-field {
  min-width: 0;
  margin: 4px 0 0;
  padding: 14px;
  border: 1px solid var(--br-line);
  border-radius: 12px;
  background: #fbfdff;
}
.br-resource-membership-field > legend,
.br-resource-link-field > legend {
  width: auto;
  float: none;
  margin: 0;
  padding: 0 6px;
  color: var(--br-ink);
  font-size: 14px;
  font-weight: 850;
}
.br-resource-membership-field > p,
.br-resource-link-field > p {
  margin: 0 0 11px;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.5;
}
.br-resource-link-grid,
.br-resource-team-grid,
.br-user-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.br-resource-link-option,
.br-resource-team-option,
.br-user-resource-option {
  min-width: 0;
  border: 1px solid #dbe4ef;
  border-radius: 11px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.br-resource-link-option:hover,
.br-resource-team-option:hover,
.br-user-resource-option:hover,
.br-user-resource-option.is-selected {
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .055);
}
.br-resource-link-option,
.br-resource-team-option > label:first-child,
.br-user-resource-main {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 11px;
  cursor: pointer;
}
.br-resource-link-option input,
.br-resource-team-option input,
.br-user-resource-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--br-blue);
}
.br-resource-link-option > span,
.br-resource-team-option label > span,
.br-user-resource-main > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.br-resource-link-option strong,
.br-resource-team-option strong,
.br-user-resource-option strong {
  color: var(--br-ink-soft);
  font-size: 13px;
  line-height: 1.35;
}
.br-resource-link-option small,
.br-resource-team-option small,
.br-user-resource-option small {
  color: var(--br-muted);
  font-size: 11.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.br-resource-team-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.br-foreman-choice {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px;
  border-left: 1px solid #e2e8f0;
  color: #475569;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
}
.br-user-resource-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.br-user-resource-controls {
  min-width: 104px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 9px 10px;
  border-left: 1px solid #e2e8f0;
  background: rgba(248,250,252,.7);
}
.br-user-resource-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #475569;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
}
.br-user-resource-option.is-disabled { opacity: .56; }
.br-resource-link-field .br-admin-note { margin: 12px 0 0; }
.br-admin-note a { color: inherit; font-weight: 800; }

@media (max-width: 760px) {
  .br-resource-team-heading { align-items: flex-start; flex-direction: column; }
  .br-resource-link-grid,
  .br-resource-team-grid,
  .br-user-resource-grid { grid-template-columns: 1fr; }
  .br-resource-team-option,
  .br-user-resource-option { grid-template-columns: 1fr; }
  .br-foreman-choice,
  .br-user-resource-controls {
    border-top: 1px solid #e2e8f0;
    border-left: 0;
  }
  .br-user-resource-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
  .br-admin-layout.br-admin-layout-wide-editor {
    grid-template-columns: minmax(500px, 590px) minmax(0, 1fr);
  }
}

/* Keep deep-linked work-distribution editors below the sticky header. */
#resourceWorkDistribution,
#userResourceMemberships {
  scroll-margin-top: 7rem;
}

/* R13.2: separately saved discussion/attachment actions */
.br-compose-help {
  display: block;
  margin-top: 5px;
  color: var(--br-muted);
  font-size: 11px;
  line-height: 1.4;
}
.br-upload-zone .br-upload-save-note {
  max-width: 380px;
  margin-top: 2px;
  color: var(--br-muted);
  font-size: 10px;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   R15.4: Resource Timeline labels open a focused Allasutuse calendar.
   The name is the primary link; the compact ellipsis remains a separate
   accessible information action so the two behaviours never compete.
   -------------------------------------------------------------------------- */
#calendar .br-resource-label-control {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}
#calendar .br-resource-label-button {
  appearance: none;
  min-width: 0;
  min-height: 30px;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(37, 99, 235, .12);
}
#calendar .br-resource-label-button:hover {
  color: inherit;
  background: rgba(239, 246, 255, .86);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12);
  text-decoration: none;
}
#calendar .br-resource-label-button:focus-visible,
#calendar .br-resource-label-more:focus-visible {
  outline: 2px solid var(--br-blue);
  outline-offset: 1px;
}
#calendar .br-resource-label-button .nx-resource-text { min-width: 0; }
#calendar .br-resource-label-more {
  appearance: none;
  width: 24px;
  height: 28px;
  min-width: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  opacity: .22;
  transition: opacity .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}
#calendar .br-resource-label-more i {
  width: 2.5px;
  height: 2.5px;
  display: block;
  border-radius: 50%;
  background: currentColor;
}
#calendar .br-resource-label-control:hover .br-resource-label-more,
#calendar .br-resource-label-more:hover,
#calendar .br-resource-label-more:focus-visible,
#calendar .br-resource-label-more[aria-expanded="true"] {
  color: var(--br-blue);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12);
  opacity: 1;
}

.br-resource-peek[hidden] { display: none !important; }
.br-resource-peek {
  position: fixed;
  z-index: 480;
  right: 18px;
  bottom: var(--br-resource-peek-bottom, max(18px, env(safe-area-inset-bottom)));
  width: min(420px, calc(100vw - 24px));
  max-height: min(48vh, 340px);
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) 46px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .55);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .22), 0 3px 10px rgba(15, 23, 42, .10);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.985);
  transform-origin: right bottom;
  transition: opacity .16s ease, transform .16s ease;
}
.br-resource-peek.is-open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.br-resource-peek:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}
.br-resource-peek-accent { background: var(--br-resource-peek-color, var(--br-blue)); }
.br-resource-peek-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: auto;
  padding: 13px 10px 13px 13px;
}
.br-resource-peek-eyebrow {
  color: var(--br-muted);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.br-resource-peek-main > strong {
  color: var(--br-ink);
  font-size: 15px;
  font-weight: 820;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.br-resource-peek-organisation {
  color: var(--br-ink-soft);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.br-resource-peek-context,
.br-resource-peek-description {
  color: var(--br-muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.br-resource-peek-access {
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #334155;
  background: #f1f5f9;
  font-size: 10px;
  font-weight: 780;
  line-height: 1.25;
}
.br-resource-peek-access.is-operable { color: #166534; background: #dcfce7; }
.br-resource-peek-access.is-submitter { color: #1d4ed8; background: #dbeafe; }
.br-resource-peek-access.is-readonly { color: #92400e; background: #fef3c7; }
.br-resource-peek-access.is-public { color: #475569; background: #e2e8f0; }
.br-resource-peek-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  align-self: start;
  margin: 4px 3px 0 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--br-muted);
  background: transparent;
  cursor: pointer;
}
.br-resource-peek-close:hover,
.br-resource-peek-close:focus-visible { color: var(--br-ink); background: var(--br-surface-soft); outline: none; }
.br-resource-peek-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@media (max-width: 900px) {
  /* Remove NEXUS' desktop minimum width. The label column stays fixed while
     the hour canvas scrolls inside its own viewport instead of clipping the
     whole scheduler. */
  #calendar .nx-timeline { min-width: 0 !important; }
  #calendar .nx-timeline-corner {
    min-width: 0;
    gap: 5px;
    padding-inline: 7px;
    box-shadow: 5px 0 10px -10px rgba(15, 23, 42, .85);
  }
  #calendar .nx-resource-viewport { box-shadow: 6px 0 12px -11px rgba(15, 23, 42, .9); }
  #calendar .nx-timeline-header-scroll,
  #calendar .nx-timeline-viewport {
    min-width: 0;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  #calendar .nx-resource-column-headers { min-width: 0; gap: 0; }
  #calendar .nx-resource-column-headers strong {
    overflow: hidden;
    font-size: 10px;
    letter-spacing: .055em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #calendar .nx-resource-count {
    min-width: 20px;
    height: 20px;
    padding-inline: 5px;
    font-size: 9px;
  }
  #calendar .nx-resource-row { min-width: 0; padding: 3px 6px; }
  #calendar .nx-resource-group-label { display: none !important; }
  #calendar .nx-resource-toggle-spacer {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    flex-basis: 0 !important;
  }
  #calendar .nx-resource-toggle {
    width: 20px;
    height: 26px;
    flex-basis: 20px;
    margin-right: 2px;
  }
  #calendar .nx-resource-indent { width: calc(var(--nx-depth, 0) * 10px) !important; }
  #calendar .nx-resource-columns { min-width: 0; gap: 0; margin-left: 0 !important; }
  #calendar .nx-resource-column.is-primary { min-width: 0; overflow: visible; }
  #calendar .br-resource-label-button { min-height: 30px; }
  #calendar .br-resource-label-button .nx-resource-avatar {
    width: 5px;
    height: 29px;
    flex: 0 0 5px;
    border-radius: 5px;
    color: transparent;
    background: var(--nx-resource-color, #2563eb);
    font-size: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
  }
  #calendar .br-resource-label-button .nx-resource-avatar img { display: none; }
  #calendar .nx-resource-column.is-primary .nx-resource-text,
  #calendar .br-resource-label-button .nx-resource-text { min-width: 0; margin-left: 7px !important; }
  #calendar .br-resource-label-button .nx-resource-text strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--br-ink);
    font-size: 11.5px;
    font-weight: 790;
    line-height: 1.14;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  #calendar .br-resource-label-button .nx-resource-text small { display: none !important; }
  #calendar .br-resource-label-more { width: 22px; min-width: 22px; flex-basis: 22px; opacity: 1; }
  /* Thumb-friendly bottom navigation is the primary mobile view switcher.
     Hide the duplicate desktop switch above the calendar and keep the NEXUS
     bar inside the scheduler, including the safe-area inset. */
  .br-calendar-toolbar .br-view-switch { display: none; }
  /* Keep the thumb navigation inside the visible scheduler even on a phone
     held sideways. The old fixed 710 px calendar placed the bottom buttons
     below a short landscape viewport, which looked as if they had vanished. */
  #calendar .nx-root[data-mobile="true"] {
    height: clamp(300px, calc(100dvh - 10px), 760px) !important;
    min-height: min(300px, calc(100dvh - 10px));
  }
  #calendar .nx-mobile-nav {
    display: grid;
    position: relative;
    z-index: 55;
    min-height: 64px;
    flex: 0 0 auto;
    border-top-color: rgba(203,213,225,.92);
    background: rgba(255,255,255,.96);
    box-shadow: 0 -8px 24px rgba(15,23,42,.07);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
  #calendar .nx-mobile-nav-button {
    min-height: 50px;
    border-radius: 11px;
    color: #64748b;
  }
  #calendar .nx-mobile-nav-button span { font-size: 9px; font-weight: 780; }
  #calendar .nx-mobile-nav-button.is-active {
    color: #1d4ed8;
    background: #dbeafe;
  }
  #calendar .nx-mobile-add {
    min-height: 48px;
    margin: 3px 2px;
    border-radius: 12px;
    color: #fff;
    background: #2563eb;
    box-shadow: 0 7px 17px rgba(37,99,235,.25);
  }
  #calendar .nx-mobile-add::before { display: none; }
  #calendar .nx-mobile-add span { color: inherit; }
  #calendar .nx-mobile-add:active { transform: translateY(1px); box-shadow: 0 4px 11px rgba(37,99,235,.22); }
  body.br-home-authenticated:not(.br-drawer-open) .br-toast-region,
  body.br-home-public .br-toast-region {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .br-resource-peek {
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    bottom: var(--br-resource-peek-bottom, calc(74px + env(safe-area-inset-bottom)));
    width: auto;
    max-height: min(54dvh, 360px);
    border-radius: 14px;
    transform-origin: center bottom;
  }
}

@media (max-width: 360px) {
  #calendar .nx-resource-row { padding-inline: 5px; }
  #calendar .br-resource-label-button .nx-resource-text { margin-left: 6px !important; }
  #calendar .br-resource-label-button .nx-resource-text strong { font-size: 11px; }
  #calendar .br-resource-label-more { width: 20px; min-width: 20px; flex-basis: 20px; }
  .br-resource-peek-main > strong { font-size: 14px; }
}


/* R13.5 admin ergonomics: registers stay full width; editors open as drawers. */
.br-admin-page .br-admin-layout,
.br-admin-page .br-admin-layout.br-admin-layout-wide-editor {
  display: block;
}
.br-admin-page .br-admin-list-card {
  width: 100%;
  min-width: 0;
}
.br-admin-page .br-admin-editor {
  display: none;
}
.br-admin-page.br-admin-editor-open {
  overflow: hidden;
}
.br-admin-page.br-admin-editor-open .br-admin-editor {
  position: fixed;
  z-index: 1110;
  top: calc(var(--br-header-height) + 10px);
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100vw - 20px));
  max-width: 100%;
  overflow: hidden;
  border-color: #cbd5e1;
  box-shadow: -24px 0 60px rgba(15, 23, 42, .2);
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}
.br-admin-page.br-admin-editor-open .br-admin-editor.is-open {
  transform: translateX(0);
  opacity: 1;
}
.br-admin-page.br-admin-editor-open .br-admin-editor > header {
  flex: 0 0 auto;
}
.br-admin-page.br-admin-editor-open .br-admin-editor > form,
.br-admin-page.br-admin-editor-open .br-admin-editor > .br-admin-note + form {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.br-admin-editor-backdrop {
  position: fixed;
  z-index: 1100;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, .35);
  opacity: 0;
  transition: opacity .2s ease;
}
.br-admin-editor-backdrop.is-visible { opacity: 1; }
.br-admin-table tbody tr[data-admin-row-href] {
  cursor: pointer;
  transition: background-color .14s ease, box-shadow .14s ease;
}
.br-admin-table tbody tr[data-admin-row-href]:hover,
.br-admin-table tbody tr[data-admin-row-href]:focus-visible {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
  outline: none;
}
.br-admin-table tbody tr[data-admin-row-href] td:first-child strong {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.br-admin-table tbody tr[data-admin-row-href]:hover td:first-child strong,
.br-admin-table tbody tr[data-admin-row-href]:focus-visible td:first-child strong {
  text-decoration: underline;
}
@media (max-width: 760px) {
  .br-admin-page.br-admin-editor-open .br-admin-editor {
    top: max(6px, env(safe-area-inset-top));
    right: 0;
    bottom: 0;
    width: 100vw;
    border-radius: 0;
  }
  .br-admin-page .br-admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* R13.7 global calendar settings */
.br-settings-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.br-settings-card { min-width: 0; }
.br-settings-card > header { padding: 20px 22px 0; }
.br-settings-card .br-admin-form { padding: 20px 22px 22px; }
.br-settings-explainer { padding-bottom: 18px; }
.br-settings-list { display: grid; gap: 12px; margin: 18px 22px 4px; padding: 0; list-style: none; }
.br-settings-list li { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid var(--br-line); border-radius: 12px; background: var(--br-surface-soft); }
.br-settings-list strong { font-size: 13px; }
.br-settings-list span { color: var(--br-muted); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 900px) { .br-settings-layout { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   R15 split workspaces: scalable desktop command centre and role-aware mobile app
   -------------------------------------------------------------------------- */
.br-desktop-commandbar { display: none; }

body.br-desktop-workspace .br-main {
  width: min(2240px, 100%);
  padding: 10px clamp(12px, 1.5vw, 28px) 34px;
}
body.br-desktop-workspace .br-calendar-card {
  overflow: clip;
  border-color: #d8e1ec;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .075);
}
body.br-desktop-workspace .br-desktop-commandbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 8px 10px;
  border-bottom: 1px solid #dbe4ef;
  background:
    radial-gradient(circle at 78% -120%, rgba(37, 99, 235, .16), transparent 19rem),
    linear-gradient(180deg, #ffffff, #f8fafc);
}
.br-desktop-period-nav,
.br-desktop-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.br-desktop-period-nav button,
.br-desktop-tools button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  color: #475569;
  background: rgba(255,255,255,.92);
  box-shadow: 0 1px 2px rgba(15,23,42,.035);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.br-desktop-period-nav button:hover,
.br-desktop-tools button:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37,99,235,.10);
  transform: translateY(-1px);
}
.br-desktop-period-nav button:focus-visible,
.br-desktop-tools button:focus-visible,
.br-shortcut-dialog button:focus-visible {
  outline: 3px solid rgba(37,99,235,.20);
  outline-offset: 1px;
}
.br-desktop-period-nav button:first-child,
.br-desktop-period-nav button:last-child,
.br-desktop-tools button:last-child { width: 38px; padding: 0; }
.br-desktop-period-nav svg,
.br-desktop-tools svg { width: 17px; height: 17px; }
.br-desktop-tools button[aria-pressed="true"] {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.08);
}
.br-desktop-period-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.br-desktop-period-context strong {
  overflow: hidden;
  color: #0f172a;
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 820;
  letter-spacing: -.02em;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.br-desktop-period-context span {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 680;
}

body.br-desktop-workspace .br-calendar-card.is-navigator-collapsed .br-calendar-navigator {
  grid-template-columns: minmax(0, 1fr);
}
body.br-desktop-workspace .br-calendar-card.is-navigator-collapsed .br-mini-calendar { display: none; }
body.br-desktop-workspace .br-calendar-card.is-navigator-collapsed .br-calendar-controls { min-height: 100%; }

body.br-desktop-workspace .br-calendar-card.is-compact-density .br-calendar-toolbar { min-height: 48px; padding-block: 5px; }
body.br-desktop-workspace .br-calendar-card.is-compact-density .br-legend { min-height: 34px; padding-block: 5px; }
body.br-desktop-workspace .br-calendar-card.is-compact-density #calendar .br-event-content strong { font-size: 12px; }
body.br-desktop-workspace .br-calendar-card.is-compact-density #calendar .br-event-content small { font-size: 10.5px; }
body.br-desktop-workspace .br-calendar-card.is-compact-density #calendar .nx-resource-text strong { font-size: 13px; }
body.br-desktop-workspace .br-calendar-card.is-compact-density #calendar .nx-resource-text small { font-size: 11px; }

body.br-calendar-fullscreen-open { overflow: hidden; }
body.br-desktop-workspace .br-calendar-card:fullscreen,
body.br-desktop-workspace .br-calendar-card.is-faux-fullscreen {
  position: fixed;
  z-index: 1800;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: none;
}
body.br-desktop-workspace .br-calendar-card.is-faux-fullscreen { position: fixed; }
body.br-desktop-workspace .br-calendar-card:fullscreen .br-calendar-navigator,
body.br-desktop-workspace .br-calendar-card.is-faux-fullscreen .br-calendar-navigator {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
body.br-desktop-workspace .br-calendar-card:fullscreen .br-calendar-controls,
body.br-desktop-workspace .br-calendar-card.is-faux-fullscreen .br-calendar-controls {
  min-height: 0;
  height: 100%;
}
body.br-desktop-workspace .br-calendar-card:fullscreen .br-calendar-wrap,
body.br-desktop-workspace .br-calendar-card.is-faux-fullscreen .br-calendar-wrap {
  min-height: 0;
  flex: 1 1 auto;
}

.br-shortcut-backdrop {
  z-index: 1810;
  background: rgba(15,23,42,.48);
  opacity: 0;
  transition: opacity .16s ease;
}
.br-shortcut-backdrop.is-visible { opacity: 1; }
.br-shortcut-dialog {
  position: fixed;
  z-index: 1820;
  top: 50%;
  left: 50%;
  width: min(620px, calc(100vw - 32px));
  max-height: min(82dvh, 680px);
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15,23,42,.30);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 14px)) scale(.985);
  transition: opacity .16s ease, transform .16s ease;
}
.br-shortcut-dialog.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.br-shortcut-dialog > header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
}
.br-shortcut-dialog > header span { color: #2563eb; font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.br-shortcut-dialog > header h2 { margin: 2px 0 0; color: #0f172a; font-size: 20px; }
.br-shortcut-dialog > header button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  color: #475569;
  background: #fff;
  cursor: pointer;
}
.br-shortcut-dialog > header svg { width: 17px; height: 17px; }
.br-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  padding: 12px 18px 20px;
}
.br-shortcut-grid > div {
  min-height: 52px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
}
.br-shortcut-grid kbd {
  min-width: 34px;
  justify-self: start;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-bottom-width: 2px;
  border-radius: 7px;
  color: #1e293b;
  background: #f8fafc;
  box-shadow: 0 1px 0 rgba(15,23,42,.06);
  font: 750 12px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}
.br-shortcut-grid span { color: #334155; font-size: 13px; font-weight: 680; }

/* The app-like shell belongs only to mobile.php and the explicit mobile
   calendar route. A workstation never receives a second bottom navigation. */
body.br-desktop-workspace .br-worker-more-sheet,
body.br-desktop-workspace .br-worker-sheet-backdrop,
body.br-desktop-workspace #calendar .nx-mobile-nav { display: none !important; }

@media (max-width: 1280px) {
  body.br-desktop-workspace .br-desktop-commandbar { grid-template-columns: auto minmax(150px, 1fr) auto; gap: 10px; }
  .br-desktop-tools button span { display: none; }
  .br-desktop-tools button { width: 38px; padding: 0; }
}

@media (max-width: 980px) {
  body.br-desktop-workspace .br-desktop-commandbar {
    grid-template-columns: auto minmax(0, 1fr);
  }
  body.br-desktop-workspace .br-desktop-tools { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 760px) {
  .br-shortcut-grid { grid-template-columns: 1fr; }
}


/* R15 desktop scheduler consumes the available viewport. This belongs to the
   desktop stylesheet only; mobile pages never load or inherit it. */
body.br-desktop-workspace .br-calendar-wrap,
body.br-desktop-workspace #calendar,
body.br-desktop-workspace #calendar .nx-root {
  min-height:clamp(420px,calc(100dvh - 178px),1100px);
}

/* --------------------------------------------------------------------------
   R15 adaptive workstation shell

   Three intentionally separate presentation tiers:
   1) wide workstation: full header and Resource Timeline command centre;
   2) compact workstation: the same calendar/forms with hamburger + bottom bar;
   3) phone application: mobile.php and brigaad-mobile.css (never mixed here).
   -------------------------------------------------------------------------- */
:root { --br-compact-nav-height: 0px; }
.br-compact-menu-button,
.br-compact-bottom-nav,
.br-compact-menu-backdrop,
.br-compact-menu { display: none; }

.br-compact-menu-button {
  width: 44px;
  height: 44px;
  place-items: center;
  gap: 3px;
  padding: 0;
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  color: #334155;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  cursor: pointer;
}
.br-compact-menu-button > span { width: 19px; display: grid; gap: 4px; }
.br-compact-menu-button i { height: 2px; display: block; border-radius: 999px; background: currentColor; }
.br-compact-menu-button em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.br-compact-menu-button:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.br-compact-menu-button:focus-visible { outline: 3px solid rgba(37,99,235,.22); outline-offset: 2px; }

.br-compact-menu-backdrop {
  position: fixed;
  z-index: 1880;
  inset: 0;
  border: 0;
  background: rgba(15,23,42,.48);
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: opacity .18s ease;
}
.br-compact-menu-backdrop.is-open { opacity: 1; }
.br-compact-menu {
  position: fixed;
  z-index: 1890;
  top: 8px;
  right: 8px;
  bottom: calc(8px + var(--br-compact-nav-height) + env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 16px));
  min-height: 0;
  grid-template-rows: auto minmax(0,1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(203,213,225,.95);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15,23,42,.35);
  opacity: 0;
  transform: translateX(calc(100% + 20px));
  transition: transform .18s ease, opacity .18s ease;
}
.br-compact-menu.is-open { opacity: 1; transform: translateX(0); }
.br-compact-menu > header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(145deg,#f8fafc,#eff6ff);
}
.br-compact-menu-user { min-width: 0; display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: center; gap: 11px; }
.br-compact-menu-user > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color:#fff; background:linear-gradient(145deg,#2563eb,#1d4ed8); font-size:14px; font-weight:850; }
.br-compact-menu-user div { min-width: 0; display: flex; flex-direction: column; }
.br-compact-menu-user strong { overflow: hidden; color:#0f172a; font-size:15px; text-overflow:ellipsis; white-space:nowrap; }
.br-compact-menu-user small { overflow:hidden; margin-top:2px; color:#64748b; font-size:11.5px; text-overflow:ellipsis; white-space:nowrap; }
.br-compact-menu > header > button { width:40px; height:40px; display:grid; place-items:center; flex:0 0 auto; border:1px solid #d8e1ec; border-radius:11px; color:#475569; background:#fff; cursor:pointer; }
.br-compact-menu > header > button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.9; }
.br-compact-menu > nav { min-height:0; display:grid; align-content:start; gap:5px; padding:12px; overflow-y:auto; overscroll-behavior:contain; }
.br-compact-menu-link { min-height:52px; display:grid; grid-template-columns:38px minmax(0,1fr); align-items:center; gap:11px; padding:7px 10px; border:1px solid transparent; border-radius:13px; color:#334155; text-decoration:none!important; }
.br-compact-menu-link > span { width:38px; height:38px; display:grid; place-items:center; border-radius:11px; color:#475569; background:#f1f5f9; }
.br-compact-menu-link svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.br-compact-menu-link strong { font-size:14px; font-weight:760; }
.br-compact-menu-link:hover { border-color:#dbeafe; color:#1d4ed8; background:#eff6ff; }
.br-compact-menu-link.is-active { border-color:#bfdbfe; color:#1d4ed8; background:#dbeafe; }
.br-compact-menu-link.is-active > span { color:#fff; background:#2563eb; }
.br-compact-menu > footer { display:grid; gap:7px; padding:12px; border-top:1px solid #e2e8f0; background:#f8fafc; }
.br-compact-menu > footer a { min-height:44px; display:flex; align-items:center; justify-content:center; gap:8px; border:1px solid #d8e1ec; border-radius:12px; color:#334155; background:#fff; font-size:13px; font-weight:760; text-decoration:none!important; }
.br-compact-menu > footer a svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.9; }
.br-compact-menu > footer .br-compact-menu-primary { border-color:#2563eb; color:#fff; background:#2563eb; }
body.br-compact-menu-open { overflow:hidden; }

.br-compact-bottom-nav {
  position: fixed;
  /* The compact bar belongs to the page chrome, not to the modal layer.
     Keeping it below drawers/dialogs is the fail-safe even if the compact
     controller is delayed or disabled. */
  z-index: 440;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 8px;
  min-height: 60px;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0,1fr);
  align-items: stretch;
  padding: 5px;
  border: 1px solid rgba(203,213,225,.94);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 16px 46px rgba(15,23,42,.22);
  backdrop-filter: blur(18px);
  transition: opacity .14s ease, transform .18s ease, visibility 0s linear 0s;
}
/* R15.5 — a modal owns the viewport. The compact workstation bar must not
   cover sticky save/cancel controls. Direct state selectors are the no-JS
   fallback; br-compact-overlay-open is synchronised by brigaad-compact.js. */
body.br-compact-overlay-open .br-compact-bottom-nav,
body.br-drawer-open .br-compact-bottom-nav,
body.br-action-dialog-open .br-compact-bottom-nav,
body.br-conflict-open .br-compact-bottom-nav,
body.br-shortcut-open .br-compact-bottom-nav,
body.br-admin-editor-open .br-compact-bottom-nav {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 28px));
  transition: opacity .12s ease, transform .18s ease, visibility 0s linear .18s;
}
.br-compact-bottom-nav > a,
.br-compact-bottom-nav > button {
  min-width:0;
  min-height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:3px;
  padding:3px 4px;
  border:0;
  border-radius:13px;
  color:#64748b;
  background:transparent;
  font:inherit;
  text-decoration:none!important;
  cursor:pointer;
}
.br-compact-bottom-nav svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.br-compact-bottom-nav span { overflow:hidden; max-width:100%; font-size:10px; font-weight:750; line-height:1.1; text-overflow:ellipsis; white-space:nowrap; }
.br-compact-bottom-nav > :is(a,button):hover { color:#1d4ed8; background:#eff6ff; }
.br-compact-bottom-nav > .is-active { color:#1d4ed8; background:#dbeafe; }
.br-compact-bottom-nav > .is-primary { color:#1d4ed8; }
.br-compact-create-icon { width:34px; height:34px; display:grid; place-items:center; margin-top:-14px; border:4px solid #fff; border-radius:50%; color:#fff; background:#2563eb; box-shadow:0 8px 20px rgba(37,99,235,.28); }
.br-compact-create-icon svg { width:19px; height:19px; }

@media (max-width: 1120px), (max-height: 640px) and (max-width: 1366px) {
  body:not(.br-mobile-shell-page) .br-compact-menu-button { display:grid; }
  body:not(.br-mobile-shell-page) .br-compact-bottom-nav { display:grid; }
  body:not(.br-mobile-shell-page) .br-compact-menu-backdrop { display:block; }
  body:not(.br-mobile-shell-page) .br-compact-menu { display:grid; }
  body:not(.br-mobile-shell-page) { padding-bottom:calc(76px + env(safe-area-inset-bottom)); }
  body:not(.br-mobile-shell-page) .br-topbar {
    min-height:64px;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    padding:0 12px;
  }
  body:not(.br-mobile-shell-page) .br-brand-mark { width:39px; height:39px; border-radius:12px; }
  body:not(.br-mobile-shell-page) .br-brand-copy small { display:none; }
  body:not(.br-mobile-shell-page) .br-primary-nav { display:none; }
  body:not(.br-mobile-shell-page) .br-header-actions { gap:7px; }
  body:not(.br-mobile-shell-page) .br-header-actions > .br-button,
  body:not(.br-mobile-shell-page) .br-header-actions > .br-user-menu { display:none; }
  body:not(.br-mobile-shell-page) .br-main { padding-right:10px; padding-bottom:18px; padding-left:10px; }

  body.br-desktop-workspace .br-desktop-commandbar {
    min-height:50px;
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:8px;
    padding:6px 7px;
  }
  body.br-desktop-workspace .br-desktop-period-nav button,
  body.br-desktop-workspace .br-desktop-tools button { min-height:36px; }
  body.br-desktop-workspace .br-desktop-tools button span { display:none; }
  body.br-desktop-workspace .br-desktop-tools button { width:36px; padding:0; }
  body.br-desktop-workspace .br-desktop-tools #calendarNavigatorToggle { display:none; }
  body.br-desktop-workspace .br-calendar-navigator { grid-template-columns:minmax(0,1fr); padding:8px; }
  body.br-desktop-workspace .br-mini-calendar { display:none; }
  body.br-desktop-workspace .br-calendar-toolbar { min-height:48px; gap:8px; padding:7px 8px; }
  body.br-desktop-workspace .br-view-switch { display:none; }
  body.br-desktop-workspace .br-calendar-toolbar-right { width:100%; }
  body.br-desktop-workspace .br-filter-cluster { width:100%; }
  body.br-desktop-workspace .br-filter-cluster .br-search { min-width:180px; flex:1 1 260px; }
  body.br-desktop-workspace .br-filter-cluster .br-select { min-width:112px; flex:0 1 150px; }
  body.br-desktop-workspace .br-legend { min-height:34px; padding:6px 8px; }
  body.br-desktop-workspace .br-calendar-card { border-radius:14px; }
  body.br-desktop-workspace .br-calendar-wrap,
  body.br-desktop-workspace #calendar,
  body.br-desktop-workspace #calendar .nx-root { min-height:clamp(320px,calc(100dvh - 156px),820px); }

  body.br-list-page .br-page-heading,
  body.br-admin-page .br-page-heading { margin-bottom:12px; }
  body.br-list-page .br-report-summary { grid-template-columns:repeat(4,minmax(0,1fr)); }
  body.br-admin-page .br-admin-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  body.br-desktop-workspace .br-desktop-commandbar {
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
  }
  body.br-desktop-workspace .br-desktop-tools { display:none; }
  body.br-desktop-workspace .br-desktop-period-context strong { font-size:14px; }
  body.br-desktop-workspace .br-desktop-period-context span { font-size:10px; }
  body:not(.br-mobile-shell-page) .br-mobile-search-toggle { display:inline-grid!important; }
  body:not(.br-mobile-shell-page) .br-compact-bottom-nav { right:5px; bottom:max(5px,env(safe-area-inset-bottom)); left:5px; border-radius:16px; }
  body:not(.br-mobile-shell-page) .br-main { padding-top:8px; }
  body.br-list-page .br-report-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.br-admin-page .br-admin-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .br-compact-menu,
  .br-compact-menu-backdrop { transition:none; }
}
@media (max-width: 1120px), (max-height: 640px) and (max-width: 1366px) {
  body.br-desktop-workspace .br-desktop-tools #calendarDensityButton { display:none; }
}

/* R15.3 — precision timeline interaction.
   The visible calendar may use 30-minute labels while creation and resizing
   remain accurate to the configured 15-minute snap. During pointer work the
   finer grid is revealed without making the normal week view visually noisy. */
#calendar .nx-root.nx-is-selecting .nx-timeline-row,
#calendar .nx-root.nx-is-event-dragging .nx-timeline-row {
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(var(--nx-snap-width) - 1px),
      rgba(37, 99, 235, .24) calc(var(--nx-snap-width) - 1px),
      rgba(37, 99, 235, .24) var(--nx-snap-width)
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(var(--nx-slot-width) - 2px),
      rgba(100, 116, 139, .52) calc(var(--nx-slot-width) - 2px),
      rgba(100, 116, 139, .52) var(--nx-slot-width)
    );
}

#calendar .nx-timeline-snap-guide {
  position: absolute;
  z-index: 19;
  width: 2px;
  min-height: 1px;
  pointer-events: none;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .92), 0 0 10px rgba(37, 99, 235, .45);
  transform: translateX(-1px);
}

#calendar .nx-timeline-snap-guide::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 2px #fff;
  transform: translateX(-50%);
}

#calendar .nx-timeline-snap-guide-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  max-width: min(300px, 70vw);
  padding: 6px 9px;
  overflow: hidden;
  border-radius: 8px;
  background: #172554;
  color: #fff;
  box-shadow: 0 7px 20px rgba(15, 23, 42, .28);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
}

#calendar .nx-timeline-snap-guide-label::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: #172554;
}

#calendar .nx-root.nx-is-event-dragging,
#calendar .nx-root.nx-is-event-dragging .nx-timeline-row,
#calendar .nx-root.nx-is-selecting,
#calendar .nx-root.nx-is-selecting .nx-timeline-row {
  cursor: crosshair;
  user-select: none;
}

#calendar .nx-event-timeline .nx-resize-handle {
  width: 15px;
}

#calendar .nx-event-timeline .nx-resize-start { left: -2px; }
#calendar .nx-event-timeline .nx-resize-end { right: -2px; }
#calendar .nx-event-timeline .nx-resize-handle::after { left: 6px; }

@media (pointer: coarse) {
  #calendar .nx-event-timeline .nx-resize-handle { width: 22px; }
  #calendar .nx-event-timeline .nx-resize-start { left: -5px; }
  #calendar .nx-event-timeline .nx-resize-end { right: -5px; }
  #calendar .nx-event-timeline .nx-resize-handle::after { left: 9px; }
}

/* R15.3 — content-aware desktop week timeline.
   When all Allasutuse rows fit into the available viewport, the scheduler
   collapses to their real cumulative height and keeps the horizontal scrollbar
   immediately below the last row. If rows no longer fit, the existing internal
   vertical scrolling model remains in force and the bar stays at the visible
   scheduler bottom. */
body.br-desktop-workspace .br-calendar-card.is-timeline-content-fit .br-calendar-wrap,
body.br-desktop-workspace .br-calendar-card.is-timeline-content-fit #calendar {
  min-height: 0;
}
body.br-desktop-workspace .br-calendar-card.is-timeline-content-fit #calendar .nx-root,
body.br-desktop-workspace .br-calendar-card.is-timeline-content-fit #calendar .nx-timeline-resourceTimelineWeek {
  min-height: 0;
}
body.br-desktop-workspace #calendar .nx-timeline-viewport {
  overscroll-behavior: contain;
  scrollbar-color: #94a3b8 #eef2f7;
  scrollbar-width: auto;
}
body.br-desktop-workspace #calendar .nx-timeline-viewport::-webkit-scrollbar {
  width: 12px;
  height: 14px;
}
body.br-desktop-workspace #calendar .nx-timeline-viewport::-webkit-scrollbar-track {
  border-top: 1px solid #dbe3ee;
  background: #eef2f7;
}
body.br-desktop-workspace #calendar .nx-timeline-viewport::-webkit-scrollbar-thumb {
  border: 3px solid #eef2f7;
  border-radius: 999px;
  background: #94a3b8;
  background-clip: padding-box;
}
body.br-desktop-workspace #calendar .nx-timeline-viewport::-webkit-scrollbar-thumb:hover {
  background: #64748b;
  background-clip: padding-box;
}


/* --------------------------------------------------------------------------
   R15.4 — focused Allasutuse calendar
   -------------------------------------------------------------------------- */
body.br-resource-calendar-page .br-main {
  display: grid;
  gap: 14px;
}
.br-resource-calendar-hero {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 0;
}
.br-resource-calendar-back {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid #d8e1ec;
  border-radius: 11px;
  color: #334155;
  background: rgba(255,255,255,.92);
  box-shadow: 0 3px 10px rgba(15,23,42,.04);
  font-size: 12.5px;
  font-weight: 790;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.br-resource-calendar-back svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.br-resource-calendar-back:hover {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 7px 18px rgba(37,99,235,.10);
  text-decoration: none;
  transform: translateX(-1px);
}
.br-resource-calendar-back:focus-visible { outline: 3px solid rgba(37,99,235,.22); outline-offset: 2px; }
.br-resource-calendar-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  text-align: right;
}
.br-resource-calendar-mark {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--br-resource-calendar-color, #2563eb);
  border-color: color-mix(in srgb, var(--br-resource-calendar-color, #2563eb) 48%, #fff);
  border-radius: 13px;
  color: #fff;
  background: var(--br-resource-calendar-color, #2563eb);
  background: linear-gradient(145deg, color-mix(in srgb, var(--br-resource-calendar-color, #2563eb) 82%, #fff), var(--br-resource-calendar-color, #2563eb));
  box-shadow: 0 8px 20px rgba(37,99,235,.18);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--br-resource-calendar-color, #2563eb) 24%, transparent);
  font-size: 18px;
  font-weight: 850;
}
.br-resource-calendar-identity > div { min-width: 0; }
.br-resource-calendar-identity span:not(.br-resource-calendar-mark) {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}
.br-resource-calendar-identity h1 {
  max-width: min(58vw, 800px);
  overflow: hidden;
  margin: 2px 0 0;
  color: #0f172a;
  font-size: clamp(20px, 2vw, 29px);
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.br-resource-calendar-identity p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 650;
}
.br-resource-calendar-workspace,
.br-resource-calendar-card { min-width: 0; }
body.br-resource-calendar-page .br-resource-calendar-navigator {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
}
body.br-resource-calendar-page .br-resource-calendar-navigator .br-calendar-controls {
  min-width: 0;
  width: 100%;
}
body.br-resource-calendar-page .br-calendar-toolbar {
  min-height: 58px;
  padding-inline: 12px;
}
body.br-resource-calendar-page .br-view-switch button {
  min-width: 82px;
  min-height: 38px;
}
body.br-resource-calendar-page .br-calendar-wrap,
body.br-resource-calendar-page #calendar {
  min-height: clamp(560px, calc(100dvh - 285px), 960px);
}
body.br-resource-calendar-page #calendar .nx-timegrid,
body.br-resource-calendar-page #calendar .nx-month {
  min-height: 100%;
}
body.br-resource-calendar-page #calendar .nx-event.br-is-masked {
  cursor: default;
  opacity: .94;
  filter: none;
}
body.br-resource-calendar-page .br-resource-calendar-error .br-button { margin-top: 12px; text-decoration: none; }

@media (max-width: 900px) {
  body.br-resource-calendar-page .br-main { gap: 10px; }
  .br-resource-calendar-hero {
    align-items: flex-start;
    gap: 10px;
    padding-inline: 1px;
  }
  .br-resource-calendar-back {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }
  .br-resource-calendar-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .br-resource-calendar-identity { flex: 1 1 auto; justify-content: flex-start; text-align: left; }
  .br-resource-calendar-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 16px; }
  .br-resource-calendar-identity h1 { max-width: calc(100vw - 134px); font-size: clamp(18px, 5.4vw, 23px); }
  .br-resource-calendar-identity p { max-width: calc(100vw - 134px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.br-resource-calendar-page .br-calendar-toolbar { padding: 9px; }
  body.br-resource-calendar-page .br-calendar-toolbar-right { width: 100%; }
  body.br-resource-calendar-page .br-calendar-wrap,
  body.br-resource-calendar-page #calendar { min-height: clamp(440px, calc(100dvh - 225px), 760px); }
}

@media (max-width: 640px) {
  body.br-resource-calendar-page .br-main { padding-top: 8px; }
  body.br-resource-calendar-page .br-resource-calendar-hero { padding-inline: 2px; }
  body.br-resource-calendar-page .br-view-switch { display: flex; width: 100%; }
  body.br-resource-calendar-page .br-view-switch button { min-width: 0; flex: 1 1 0; }
  body.br-resource-calendar-page .br-calendar-toolbar-right { align-items: stretch; }
  body.br-resource-calendar-page .br-filter-cluster { width: 100%; }
  body.br-resource-calendar-page .br-calendar-wrap,
  body.br-resource-calendar-page #calendar { min-height: calc(100dvh - 186px); }
}

/* --------------------------------------------------------------------------
   R15.6 — natural page scrolling and a tighter desktop Resource Timeline
   -------------------------------------------------------------------------- */
/* The scheduler always receives an explicit numeric height from Brigaad. A
   legacy 650px CSS minimum could override that value while the first async
   resource render was settling, leaving a large blank canvas below the last
   Allasutus. Desktop calendars therefore trust the measured scheduler height
   unconditionally; loading still has its own visible placeholder. */
body.br-desktop-workspace .br-calendar-wrap,
body.br-desktop-workspace #calendar,
body.br-desktop-workspace #calendar .nx-root {
  min-height: 0;
}
body.br-desktop-workspace .br-loading-state {
  min-height: min(520px, calc(100dvh - 250px));
}

/* Keep horizontal timeline momentum inside the scheduler, but allow vertical
   wheel/trackpad motion to chain naturally to the page once the resource list
   reaches its beginning/end (or when the list does not overflow at all). */
body.br-desktop-workspace #calendar .nx-timeline-viewport,
body.br-desktop-workspace #calendar .nx-resource-viewport {
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}

/* A little visual refinement without changing the familiar Brigaad layout. */
body.br-desktop-workspace .br-calendar-wrap {
  border-top: 1px solid rgba(226, 232, 240, .8);
  background: #fff;
}
body.br-desktop-workspace #calendar .nx-timeline-corner,
body.br-desktop-workspace #calendar .nx-timeline-header-scroll {
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
}
body.br-desktop-workspace #calendar .nx-resource-row:nth-child(even):not(.is-overlap-expanded) {
  background-color: #fcfdff;
}
body.br-desktop-workspace #calendar .nx-timeline-row:nth-child(even):not(.is-overlap-expanded) {
  background-color: rgba(248, 250, 252, .46);
}
body.br-desktop-workspace #calendar .nx-resource-row:hover,
body.br-desktop-workspace #calendar .nx-timeline-row:hover {
  background-color: rgba(239, 246, 255, .66);
}
body.br-desktop-workspace .br-calendar-card.is-timeline-content-fit .br-calendar-wrap {
  background: linear-gradient(180deg, #fff 0%, #fff 96%, #f8fafc 100%);
}
