.column-controls {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  min-width: 120px;
}
.column-controls input {
  min-width: 70px;
  width: 100%;
  padding: 6px;
  font-size: 12px;
}
.column-controls button {
  padding: 4px 8px;
}
.column-filtered {
  display: none !important;
}
#knowledge-launch {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 90;
  background: #086c77;
  color: white;
  border: 0;
  border-radius: 24px;
  padding: 14px 20px;
  box-shadow: 0 4px 16px #0003;
}
#knowledge-panel {
  width: min(1000px, 94vw);
  max-height: 90vh;
  padding: 20px;
  border: 0;
  border-radius: 16px;
  background: #f5fafb;
  color: #173443;
  font-family: inherit;
  overflow: auto;
}
#knowledge-panel::backdrop {
  background: #112c44aa;
}
#knowledge-panel header {
  position: static;
  background: none;
  color: inherit;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
}
#knowledge-panel .k-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}
#knowledge-panel .k-card {
  background: white;
  border: 1px solid #cbdde1;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}
#knowledge-panel label {
  display: block;
  margin: 10px 0;
}
#knowledge-panel input:not([type="checkbox"]),
#knowledge-panel select,
#knowledge-panel textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #9bbac0;
  border-radius: 6px;
  font: inherit;
  background: white;
  color: #173443;
}
#knowledge-panel textarea {
  min-height: 90px;
}
#knowledge-panel button {
  font: inherit;
  cursor: pointer;
  padding: 9px 13px;
  border: 1px solid #32717a;
  border-radius: 7px;
  background: #e7f4f5;
  color: #174753;
  margin: 3px;
}
#knowledge-panel button:disabled {
  opacity: 0.5;
  cursor: default;
}
#knowledge-panel .k-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
}
#knowledge-panel .k-hint {
  background: #e7f4f5;
  padding: 12px;
  border-right: 4px solid #087e8b;
}
#k-error {
  position: sticky;
  top: 0;
  background: #fff0ec;
  border: 1px solid #ad4533;
  color: #8f2718;
  padding: 12px;
  z-index: 2;
}
#k-error:empty {
  display: none;
}
#knowledge-panel small {
  display: block;
  color: #496771;
}
#knowledge-panel .k-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
#knowledge-panel .k-check input {
  width: auto;
}
#knowledge-panel .k-source {
  padding: 5px;
  border-bottom: 1px solid #d8e6e8;
}
@media print {
  .column-controls,
  #knowledge-launch,
  .k-nav {
    display: none !important;
  }
}

.k-bar-row {
  display: grid;
  grid-template-columns: 2fr 3fr 70px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.k-bar-track {
  background: #e2edef;
  border-radius: 5px;
  overflow: hidden;
}
.k-bar {
  background: #087e8b;
  height: 24px;
}

#report-links-panel {
  width: min(1000px, 95vw);
  max-height: 90vh;
  overflow: auto;
}
#report-links-panel label {
  display: block;
  margin: 12px 0;
}
#report-links-panel input,
#report-links-panel select {
  width: 100%;
  padding: 10px;
}
#link-error {
  color: #a22;
  white-space: pre-line;
}
/* Beta 9: shared, responsive workspace rhythm. */
body {
  background: #f3f6fa;
  color: #183047;
}
button,
.button {
  border-radius: 12px;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #f5ae42;
  outline-offset: 3px;
}
.card,
.stat {
  border: 1px solid #e0e8f0;
  border-radius: 20px;
  box-shadow: 0 8px 26px #163d6210;
}
.hero {
  background: linear-gradient(115deg, #103d59, #147c80);
  color: white;
  padding: 28px;
  border-radius: 24px;
  margin: 0 0 22px;
}
.hero h1 {
  margin: 6px 0;
  font-size: clamp(24px, 4vw, 36px);
}
.hero p {
  color: #dceff3;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 16px;
}
.stat strong {
  font-size: 32px;
  display: block;
  margin: 12px 0;
}
.stat small {
  display: block;
  line-height: 1.9;
}
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.unit-tile {
  display: grid;
  text-align: right;
  gap: 14px;
  background: #edf7f7 !important;
  color: #124c5e !important;
  padding: 22px;
  border: 1px solid #cbe2e7;
}
.unit-tile strong {
  font-size: 30px;
}
.badge.missing,
.badge.returned {
  background: #fff0e5;
  color: #8b3d13;
}
.badge.na {
  background: #eef1f5;
  color: #536174;
}
#priority-alerts {
  max-width: 1400px;
  margin: auto;
  padding: 0 18px;
}
#priority-alerts:empty {
  display: none;
}
.alert-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}
.priority-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 16px;
  padding: 16px 22px;
  margin: 8px 0;
  background: #e9f3ff;
  border-right: 5px solid #3986cf;
}
.priority-alert.warning {
  background: #fff5da;
  border-color: #c58b15;
}
.priority-alert.urgent {
  background: #fff0ee;
  border-color: #c84b41;
}
.priority-alert p {
  white-space: pre-wrap;
  margin: 8px 0;
  max-height: 180px;
  overflow: auto;
}
.priority-alert small {
  color: #4a5967;
}
.priority-alert button {
  flex-shrink: 0;
}
table th {
  background: #f0f5fa;
}
tbody tr:hover {
  background: #f5fafc;
}
@media (max-width: 650px) {
  .priority-alert {
    align-items: stretch;
    flex-direction: column;
  }
  .hero {
    padding: 20px;
  }
  .unit-grid {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat {
    padding: 14px;
  }
  .stat strong {
    font-size: 25px;
  }
}
@media print {
  #priority-alerts {
    display: none !important;
  }
}

/* Compact task button shared by the portal and scaling header. */
.work-inbox { position: relative; flex: 0 0 auto; color: #20383e; font-size: 14px; }
.work-inbox[hidden], .work-items[hidden] { display: none !important; }
header .work-inbox .work-toggle { border: 1px solid #c7d7d3; border-radius: 18px; padding: 5px 12px; background: #eef5f3; color: #20383e; white-space: nowrap; font-size: 14px; }
header .work-inbox .work-toggle.has-work { color: #fff; background: #b42332; border-color: #b42332; }
.work-items { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: min(440px, 92vw); max-height: 65vh; overflow: auto; background: #fff; border: 1px solid #c7d7d3; padding: 14px; border-radius: 12px; box-shadow: 0 8px 24px #0003; z-index: 100; }
.work-heading { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.work-inbox .work-items h3 { font-size: 15px; margin: 14px 0 6px; }
.work-items ul { margin: 0; padding: 0; list-style: none; }
header .work-items a { display: block; color: #174d54; border-bottom: 1px solid #e0e8e6; padding: 8px 0; text-decoration: none; }
.work-items a span { display: block; font-size: 13px; overflow-wrap: anywhere; }
@media(max-width:700px) { .work-inbox { margin-inline-start: auto; } .work-items { position: fixed; top: 70px; inset-inline: 4vw; width: auto; max-height: 75vh; } }

/* beta38: shared design polish, no animation or extra network round-trips */
:root { --phoenix-accent:#176e73; --phoenix-line:#d8e3e5; }
#app main .card { border-radius:16px; border-color:var(--phoenix-line); box-shadow:0 2px 12px rgba(20,40,57,.035); }
#app main button, #app main select, #app main input { transition: border-color .12s ease, background-color .12s ease; }
#app main button:focus-visible, #app main input:focus-visible, #app main select:focus-visible, #app aside button:focus-visible { outline:3px solid #69b7bd; outline-offset:2px; }
#app main label { line-height:1.6; }
#app main .table-wrap { max-width:100%; overflow-x:auto; border-radius:12px; }
#app main tbody tr:nth-child(even) { background:rgba(237,246,247,.45); }
#app main tbody tr:hover { background:#eaf5f4; }
#app main .release-notes { max-width:900px; margin-inline:auto; padding:22px 26px; }
#app main .release-notes li { margin-block:10px; }
@media(max-width:700px) { #app main .card { border-radius:12px; } #app main button { min-height:42px; } #app main .release-notes { padding:16px; } }
@media(prefers-reduced-motion:reduce) { #app main button, #app main select, #app main input { transition:none; } }

/* Explicit weekly publication: contained dialog and readable branch context. */
#weekly-release-panel { width:min(1000px,calc(100vw - 32px)); max-height:90dvh; padding:24px; color:#20384a; overflow:auto; }
#weekly-release-panel .weekly-release-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
#weekly-release-panel h2 { margin:0 0 12px; font-size:21px; }
#weekly-release-panel .weekly-release-heading>button { flex-shrink:0; }
#weekly-release-panel .weekly-release-filters { display:grid; grid-template-columns:minmax(160px,1fr) minmax(280px,2fr); gap:16px; align-items:end; }
#weekly-release-panel fieldset { min-width:0; margin:0; padding:8px 12px 12px; border:1px solid #d8e3e5; border-radius:10px; }
#weekly-release-panel legend { padding:0 6px; }
#weekly-release-panel label { display:block; margin:0; }
#weekly-release-panel input,#weekly-release-panel select { display:block; width:100%; margin-top:5px; min-height:44px; }
#weekly-release-panel .weekly-release-period-fields { display:grid; grid-template-columns:1fr 1.3fr 1fr; gap:10px; }
#weekly-release-panel [data-weekly-preview] { margin-top:14px; }
#weekly-release-panel .weekly-release-period { border:1px solid #d8e3e5; border-radius:10px; background:#f5faf9; padding:14px 16px; margin-top:16px; }
#weekly-release-panel .weekly-release-period h3 { margin:0 0 7px; }
#weekly-release-panel .weekly-release-period p { margin:6px 0; }
#weekly-release-panel .weekly-release-ready { color:#126352; }
#weekly-release-panel .weekly-release-wait { color:#7b4a09; }
#weekly-release-panel .weekly-release-error { color:#a82439; white-space:pre-wrap; }
#weekly-release-panel [data-weekly-error]:empty,#weekly-release-panel [data-weekly-notice]:empty { display:none; }
#weekly-release-panel .weekly-release-counts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:16px 0; }
#weekly-release-panel .weekly-release-counts>div { border:1px solid #d8e3e5; border-radius:10px; padding:10px; background:#fff; }
#weekly-release-panel .weekly-release-counts span,#weekly-release-panel .weekly-release-counts strong { display:block; }
#weekly-release-panel .weekly-release-counts span { font-size:12px; }
#weekly-release-panel .weekly-release-counts strong { font-size:24px; }
#weekly-release-panel .weekly-release-table { width:100%; overflow:auto; }
#weekly-release-panel table { width:100%; border-collapse:collapse; }
#weekly-release-panel caption { text-align:start; padding:8px 0; font-weight:600; }
#weekly-release-panel th,#weekly-release-panel td { text-align:start; vertical-align:top; padding:10px; overflow-wrap:anywhere; }
#weekly-release-panel .weekly-release-status { display:inline-block; border:1px solid #d8e3e5; border-radius:6px; padding:2px 7px; font-size:12px; }
#weekly-release-panel .weekly-release-status.create,#weekly-release-panel .weekly-release-status.release { background:#eaf7f1; color:#126352; }
#weekly-release-panel .weekly-release-status.excluded { background:#fff4e1; color:#7b4a09; }
#weekly-release-panel .weekly-release-actions { display:flex; gap:10px; flex-wrap:wrap; border-top:1px solid #d8e3e5; margin-top:20px; padding-top:16px; }
#weekly-release-panel button { min-height:44px; white-space:normal; }
#weekly-release-panel :focus-visible { outline:3px solid #168b85; outline-offset:3px; }
@media(max-width:600px) {
  #weekly-release-panel { width:calc(100vw - 16px); max-height:92dvh; padding:16px; }
  #weekly-release-panel .weekly-release-filters { grid-template-columns:1fr; }
  #weekly-release-panel .weekly-release-counts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #weekly-release-panel input,#weekly-release-panel select { font-size:16px; }
  #weekly-release-panel table,#weekly-release-panel tbody,#weekly-release-panel tr,#weekly-release-panel td { display:block; }
  #weekly-release-panel thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #weekly-release-panel tr { border:1px solid #d8e3e5; border-radius:10px; margin-bottom:12px; padding:8px 12px; }
  #weekly-release-panel td { border:0; padding:5px 0; }
  #weekly-release-panel td[data-label]::before { content:attr(data-label) " : "; font-weight:600; }
  #weekly-release-panel .weekly-release-actions>button { flex:1 1 150px; }
}
