﻿/* ==========================================================================
   BUCC theme for the Revit Upgrader.
   Tokens and patterns follow the BUCC brand guide (same look as IFC Exporter).
   Bootstrap 3 and jsTree stay loaded; this file overrides their look.
   ========================================================================== */

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --beige: #f6f7eb;
  --army: #494c3f;
  --army-dark: #2c2f25;
  --basil: #a3be8c;
  --basil-dark: #6a8550;
  --basil-light: #f4faf0;
  --azure: #3b82f6;
  --azure-dark: #2563eb;
  --azure-light: #eff6ff;
  --steel: #c5d9e2;
  --steel-light: #f0f7fa;
  --muted: #717567;
  --muted-light: #a3a89b;
  --border: rgba(73, 76, 63, 0.14);
  --border-light: rgba(73, 76, 63, 0.08);
  --border-strong: rgba(73, 76, 63, 0.28);
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --success: #22c55e;
  --nav-height: 44px;
  --gutter: 1.25rem;
  --font: 'IBM Plex Sans', Tahoma, Arial, sans-serif;
  --mono: 'Consolas', 'Monaco', monospace;
}

/* ---------- Base ---------- */

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding-top: var(--nav-height);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--army);
  background-color: var(--beige);
  background-image: radial-gradient(circle, rgba(73, 76, 63, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
button, input, select, textarea {
  font-family: var(--font);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--army);
  font-weight: 600;
}

a {
  color: var(--azure-dark);
}
a:hover, a:focus {
  color: var(--azure-dark);
}

small, .small {
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(73, 76, 63, 0.3) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(73, 76, 63, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(73, 76, 63, 0.45); }

/* ---------- Top bar ---------- */

.bucc-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 2.5rem;
  background: var(--army-dark);
  color: var(--beige);
}

.bucc-wordmark,
.bucc-wordmark:hover,
.bucc-wordmark:focus {
  color: var(--beige);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.7;
}
.bucc-wordmark:hover { opacity: 1; }

.bucc-nav-divider {
  width: 1px;
  height: 18px;
  background: rgba(246, 247, 235, 0.15);
}

.bucc-nav-app {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--beige);
  white-space: nowrap;
}

.bucc-nav-spacer { flex: 1; }

.bucc-nav-link,
.bucc-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 28px;
  padding: 0 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.bucc-nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(246, 247, 235, 0.75);
}
.bucc-nav-link:hover,
.bucc-nav-link:focus {
  background: rgba(246, 247, 235, 0.1);
  color: var(--beige);
}

.bucc-nav-btn {
  border: 1px solid rgba(246, 247, 235, 0.25);
  background: transparent;
  color: var(--beige);
}
.bucc-nav-btn:hover {
  background: rgba(246, 247, 235, 0.1);
  border-color: rgba(246, 247, 235, 0.45);
}
.bucc-nav-btn-cta {
  border-color: var(--azure);
  background: var(--azure);
  color: #fff;
  font-weight: 600;
}
.bucc-nav-btn-cta:hover {
  border-color: var(--azure-dark);
  background: var(--azure-dark);
}

#userInfo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(246, 247, 235, 0.75);
}
#userInfo:empty { display: none; }
#userInfo img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

/* ---------- Page layout ---------- */

.bucc-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2.1fr) minmax(220px, 1fr);
  gap: var(--gutter);
  align-items: start;
  padding: var(--gutter) 2.5rem 2.5rem;
}

.bucc-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(73, 76, 63, 0.08);
}

.bucc-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.bucc-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
}

.bucc-eyebrow {
  display: block;
  margin: 0 0 0.15rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--basil-dark);
}

.bucc-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--army);
}

.bucc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bucc-icon-btn:hover {
  background: var(--beige);
  color: var(--army);
}

/* Side columns: the two folder trees stay in view while the centre scrolls. */
.bucc-tree-card {
  position: sticky;
  top: calc(var(--nav-height) + var(--gutter));
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-height) - (2 * var(--gutter)));
  min-height: 320px;
  overflow: hidden;
}

#sourceHubs,
#destinationHubs {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  padding: 0.6rem 0.5rem 0.75rem;
  font-size: 13px;
}

.bucc-tree-empty {
  padding: 3.5rem 1.5rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Centre column */
.bucc-center {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  min-width: 0;
}

.bucc-page-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.25rem 0.25rem 0;
}
.bucc-page-head img {
  height: 52px;
  width: auto;
}
.bucc-page-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.2;
  color: var(--army);
}
.bucc-page-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Settings form ---------- */

.bucc-field + .bucc-field { margin-top: 1.1rem; }

.bucc-label {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.bucc-fields-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 2.25rem;
  margin-top: 1.1rem;
}
.bucc-fields-row .bucc-field + .bucc-field { margin-top: 0; }

.bucc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bucc-pill {
  position: relative;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}
.bucc-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.bucc-pill span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--army);
  font-size: 0.8rem;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}
.bucc-pill:hover span { background: var(--beige); }
.bucc-pill input:checked + span {
  background: var(--army);
  border-color: var(--army);
  color: var(--beige);
}
.bucc-pill input:focus-visible + span {
  outline: 2px solid var(--azure);
  outline-offset: 2px;
}
.bucc-pill input[type='checkbox']:checked + span::before {
  content: '\2713';
  font-size: 0.75rem;
}

/* Bulk processing switch. JS toggles .enabled on the section. */
.bulk-processing-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  background: var(--warning-light);
  transition: background 0.15s, border-color 0.15s;
}
.bulk-processing-section.enabled {
  border-color: rgba(107, 133, 80, 0.25);
  background: var(--basil-light);
}

.bucc-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--army);
  cursor: pointer;
}
.bucc-switch input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--army);
  cursor: pointer;
}

#limitationText {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
}
.bucc-status-ok { color: var(--basil-dark); }
.bucc-status-warn { color: #b45309; }

.bucc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-light);
}
.bucc-actions .btn {
  margin: 0;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
}

#processingModeIndicator {
  margin: 0.9rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
}
#processingModeIndicator strong { color: var(--army); font-weight: 600; }

/* ---------- Progress and log ---------- */

#upgradeTitle {
  display: block;
  margin: 0;
  font-weight: 400;
}
#upgradeTitle h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

#queueStatus {
  font-size: 0.8rem;
  color: var(--muted);
}
#queueStatus:empty { display: none; }

.bucc-log {
  max-height: calc(100vh - 170px);
  min-height: 120px;
  margin-top: 0.85rem;
  overflow: auto;
}

#logStatus {
  margin: 0;
  padding: 0;
  list-style: none;
  box-shadow: none;
}

/* Every log entry is a small card with a status-coloured left edge.
   Styled by position so entries keep their look when scripts swap classes. */
#logStatus > li,
#logStatus > div,
#logStatus > a {
  display: block;
  margin: 0 0 6px;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--muted-light);
  border-radius: 8px;
  background: #fff;
  color: var(--army);
  font-size: 0.82rem;
}

#logStatus > .list-group-item-info,
.list-group-item-info {
  border-left-color: var(--azure);
  background: var(--azure-light);
  color: var(--army);
}
#logStatus > .list-group-item-success,
.list-group-item-success {
  border-left-color: var(--success);
  background: var(--basil-light);
  color: var(--army);
}
#logStatus > .list-group-item-warning,
.list-group-item-warning {
  border-left-color: var(--warning);
  background: var(--warning-light);
  color: var(--army);
}
#logStatus > .list-group-item-danger,
.list-group-item-danger {
  border-left-color: #ef4444;
  background: var(--danger-light);
  color: var(--army);
}

/* ---------- Bootstrap overrides ---------- */

.btn {
  border-radius: 7px;
  font-family: var(--font);
  font-weight: 600;
  text-shadow: none;
  background-image: none;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn:active, .btn.active { box-shadow: none; }
.btn:focus, .btn:active:focus { outline: 2px solid var(--azure); outline-offset: 2px; }
.btn[disabled], .btn.disabled { opacity: 0.45; }
.btn-xs {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 500;
}
.btn .glyphicon { margin-right: 0.25rem; font-size: 0.85em; }

.btn-primary, .btn-primary:focus, .btn-primary:active, .btn-primary:active:focus,
.btn-primary.active, .btn-primary[disabled], .btn-primary[disabled]:hover {
  background-color: var(--army);
  border-color: var(--army);
  color: var(--beige);
}
.btn-primary:hover, .btn-primary:active:hover {
  background-color: var(--army-dark);
  border-color: var(--army-dark);
  color: var(--beige);
}

.btn-info, .btn-info:focus, .btn-info:active, .btn-info:active:focus,
.btn-info.active, .btn-info[disabled], .btn-info[disabled]:hover {
  background-color: var(--azure);
  border-color: var(--azure);
  color: #fff;
}
.btn-info:hover, .btn-info:active:hover {
  background-color: var(--azure-dark);
  border-color: var(--azure-dark);
  color: #fff;
}

.btn-success, .btn-success:focus, .btn-success:active, .btn-success:active:focus,
.btn-success.active, .btn-success[disabled], .btn-success[disabled]:hover {
  background-color: var(--basil-dark);
  border-color: var(--basil-dark);
  color: #fff;
}
.btn-success:hover, .btn-success:active:hover {
  background-color: #56703f;
  border-color: #56703f;
  color: #fff;
}

.btn-default, .btn-default:focus, .btn-default:active, .btn-default:active:focus,
.btn-default.active, .btn-default[disabled], .btn-default[disabled]:hover {
  background-color: #fff;
  border-color: var(--border-strong);
  color: var(--army);
}
.btn-default:hover, .btn-default:active:hover {
  background-color: var(--beige);
  border-color: var(--army);
  color: var(--army);
}

.btn-danger, .btn-danger:focus, .btn-danger:active, .btn-danger:active:focus,
.btn-danger.active, .btn-danger[disabled], .btn-danger[disabled]:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover, .btn-danger:active:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.btn-warning, .btn-warning:focus, .btn-warning:active, .btn-warning:active:focus,
.btn-warning.active, .btn-warning[disabled], .btn-warning[disabled]:hover {
  background-color: var(--warning);
  border-color: var(--warning);
  color: var(--army-dark);
}
.btn-warning:hover, .btn-warning:active:hover {
  background-color: #d97706;
  border-color: #d97706;
  color: var(--army-dark);
}

.alert {
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--army);
  text-shadow: none;
}
.alert-info { background: var(--azure-light); border-color: rgba(59, 130, 246, 0.25); color: var(--army); }
.alert-success { background: var(--basil-light); border-color: rgba(107, 133, 80, 0.25); color: var(--army); }
.alert-warning { background: var(--warning-light); border-color: rgba(245, 158, 11, 0.3); color: var(--army); }
.alert-danger { background: var(--danger-light); border-color: rgba(220, 38, 38, 0.25); color: #991b1b; }

.text-success { color: var(--basil-dark); }
.text-danger { color: var(--danger); }
.text-info { color: var(--azure-dark); }
.text-warning { color: #b45309; }
.text-muted { color: var(--muted); }

.form-control {
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: none;
  color: var(--army);
  font-family: var(--font);
}
.form-control:focus {
  border-color: var(--azure);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-control[readonly] { background: var(--beige); }
.input-group-addon {
  border-color: var(--border-strong);
  border-radius: 7px;
  background: var(--beige);
  color: var(--army);
  font-size: 0.8rem;
  font-weight: 500;
}
label { font-weight: 500; }

.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
  overflow: hidden;
}
.panel > .panel-heading {
  border-bottom: 1px solid var(--border-light);
  background: var(--beige);
  color: var(--army);
}
.panel-title { font-size: 0.85rem; font-weight: 600; }
.panel-success > .panel-heading { background: var(--basil-light); border-color: rgba(107, 133, 80, 0.25); color: var(--army); }
.panel-warning > .panel-heading { background: var(--warning-light); border-color: rgba(245, 158, 11, 0.3); color: var(--army); }
.panel-danger > .panel-heading { background: var(--danger-light); border-color: rgba(220, 38, 38, 0.25); color: #991b1b; }
.panel-success, .panel-warning, .panel-danger, .panel-info, .panel-default { border-color: var(--border); }
.panel-body h3 { margin-top: 0; font-weight: 300; font-size: 1.6rem; }
.panel-body p { margin: 0; color: var(--muted); font-size: 0.75rem; }

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(73, 76, 63, 0.1);
  box-shadow: none;
}
.progress-bar {
  background-color: var(--azure);
  box-shadow: none;
  font-size: 0.7rem;
  font-weight: 600;
}
.progress-bar-success { background-color: var(--basil-dark); }
.progress-bar-warning { background-color: var(--warning); }
.progress-bar-danger { background-color: var(--danger); }

.well {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--beige);
  box-shadow: none;
}

.table > thead > tr > th {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table > tbody > tr > td { border-top-color: var(--border-light); }

.label {
  border-radius: 999px;
  font-weight: 600;
}
.label-default { background: var(--muted); }
.label-primary { background: var(--army); }
.label-info { background: var(--azure); }
.label-success { background: var(--basil-dark); }
.label-warning { background: var(--warning); color: var(--army-dark); }
.label-danger { background: var(--danger); }

/* Modals */
.modal-backdrop.in { opacity: 0.45; background: var(--army-dark); }
.modal-content {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(44, 47, 37, 0.25);
}
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}
.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--army);
}
.modal-body {
  padding: 1.1rem 1.25rem;
  font-size: 0.85rem;
}
.modal-body img {
  max-width: 100%;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-light);
}
.close { color: var(--army); opacity: 0.5; text-shadow: none; }
.close:hover, .close:focus { color: var(--army); opacity: 0.9; }

.bucc-params {
  margin: 0.6rem 0 1rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--beige);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.7;
  list-style: none;
}

/* ---------- jsTree ---------- */

.jstree-default .jstree-anchor {
  color: var(--army);
  border-radius: 5px;
}
.jstree-default .jstree-hovered {
  background: var(--steel-light);
  box-shadow: none;
}
.jstree-default .jstree-clicked {
  background: #e3edd9;
  box-shadow: none;
}
.vakata-context,
.vakata-context ul {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(73, 76, 63, 0.18);
  font-family: var(--font);
}
.vakata-context li > a {
  color: var(--army);
  text-shadow: none;
}
.vakata-context .vakata-context-hover > a,
.vakata-context li > a:hover {
  background: var(--beige);
  box-shadow: none;
}
.vakata-context li > a .vakata-contextmenu-sep {
  border-left-color: var(--border-light);
  background: transparent;
}

/* ---------- Token usage and forecast ---------- */

.usage-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.6rem 0;
}
.usage-tile {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.usage-tile-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.usage-tile-value {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--army-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.usage-tile-sub {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Forecast block inside the Revit versions overview */
/* In the narrow progress column the four tiles fold to two rows instead of clipping their numbers. */
.forecast-panel .usage-tiles { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.forecast-panel {
  margin: 10px 0 12px;
  padding: 0.75rem 0.9rem;
  background: var(--basil-light);
  border: 1px solid rgba(106, 133, 80, 0.3);
  border-radius: 10px;
}
.forecast-head strong { color: var(--army-dark); }
.forecast-note,
.forecast-notes {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.forecast-notes { padding-left: 1.1rem; }
.forecast-notes li { margin: 0.1rem 0; }
.version-overview .folder-forecast {
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--basil-dark);
  background: var(--basil-light);
  border: 1px solid rgba(106, 133, 80, 0.3);
  border-radius: 999px;
  white-space: nowrap;
}

/* Usage view */
#usageModal .usage-dialog {
  width: 94%;
  max-width: 1500px;
  margin: 20px auto;
}
#usageModal .modal-body {
  max-height: calc(100vh - 130px);
  overflow: auto;
}
.usage-view { font-size: 13px; }
.usage-view.usage-loading .usage-table,
.usage-view.usage-loading .usage-tiles { opacity: 0.55; }
.usage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.usage-toolbar label { margin: 0; font-weight: 600; }
.usage-toolbar select.form-control { width: auto; min-width: 11rem; }
.usage-rates {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}
.usage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.9rem 0 0.5rem;
}
.usage-tab {
  padding: 0.32rem 0.8rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--army);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
}
.usage-tab:hover { background: var(--beige); }
.usage-tab.active {
  color: var(--beige);
  background: var(--army);
  border-color: var(--army);
}
.usage-tab:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; }
.usage-tab-count { margin-left: 0.25rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.usage-table { margin-bottom: 0.5rem; }
.usage-table th { white-space: nowrap; }
.usage-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.usage-table .usage-name {
  max-width: 34rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.usage-table .usage-context {
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.usage-table .usage-when { white-space: nowrap; color: var(--muted); }
.usage-table .usage-versions { white-space: nowrap; }
.usage-table-wrap { overflow-x: auto; }
.usage-table .usage-bad { color: var(--danger); font-weight: 600; }
.usage-share-cell { width: 14%; min-width: 90px; vertical-align: middle !important; }
.usage-share {
  display: block;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}
.usage-share > span {
  display: block;
  height: 100%;
  background: var(--basil-dark);
  border-radius: 4px;
}
.usage-status {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}
.usage-status-success { color: #3f5a2a; background: var(--basil-light); border: 1px solid rgba(106, 133, 80, 0.35); }
.usage-status-failed { color: #991b1b; background: var(--danger-light); border: 1px solid rgba(220, 38, 38, 0.3); }
.usage-status-pending { color: #7c4a03; background: var(--warning-light); border: 1px solid rgba(245, 158, 11, 0.35); }
.usage-empty {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: var(--muted);
}
.usage-footnote {
  margin: 0.4rem 0;
  font-size: 0.76rem;
  color: var(--muted);
}

@media (max-width: 700px) {
  .usage-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-rates { margin-left: 0; width: 100%; }
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .bucc-layout {
    grid-template-columns: 1fr 1fr;
    padding: var(--gutter) 1rem 2rem;
  }
  .bucc-center { grid-column: 1 / -1; order: 3; }
  .bucc-tree-card { position: static; height: 360px; }
  .bucc-nav { padding: 0 1rem; }
}

@media (max-width: 700px) {
  .bucc-layout { grid-template-columns: 1fr; }
  .bucc-nav .bucc-nav-text { display: none; }
  .bucc-nav { padding-left: 0.75rem; padding-right: 0.75rem; gap: 0.35rem; }
  .bucc-nav-btn, .bucc-nav-link { flex-shrink: 0; white-space: nowrap; }
  #userInfo { display: none; }
  #limitationText { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0.01ms !important; }
}
