/* finesse · register=product · palette=mineral-slate · shell=DirectCP booking workspace + compact dispatch ledger · DENSITY=8 SPECTACLE=2 · Warehouse, eDocs, Email Queue, cross-POD move */
:root {
  color-scheme: light;
  --ink: #172231;
  --ink-soft: #536274;
  --muted: #7b8998;
  --line: #dce4ec;
  --line-strong: #cad6e2;
  --surface: #ffffff;
  --surface-soft: #f6f9fc;
  --surface-blue: #eef5fb;
  --navy: #14273c;
  --navy-deep: #0d1f31;
  --blue: #1769aa;
  --blue-bright: #2787ce;
  --teal: #168b84;
  --teal-soft: #dff5f1;
  --amber: #ae6b16;
  --amber-soft: #fff3dd;
  --red: #b53a4b;
  --red-soft: #fff0f2;
  --shadow-sm: 0 4px 16px rgba(20, 39, 60, 0.06);
  --shadow-md: 0 18px 45px rgba(20, 39, 60, 0.11);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

.editor-field.is-readonly input,
.editor-field.is-readonly textarea {
  color: #555;
  background: #ededed;
  border-color: #b8b8b8;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f3f7fa;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgba(39, 135, 206, 0.08), transparent 26rem),
    linear-gradient(180deg, #f8fbfd 0%, #f1f5f8 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
tr:focus-visible {
  outline: 3px solid rgba(39, 135, 206, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  color: #fff;
  background: var(--navy-deep);
  border-radius: 7px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 56px));
  min-height: 78px;
  margin: 0 auto;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--blue-bright), var(--teal));
  border-radius: 11px;
  box-shadow: 0 7px 16px rgba(23, 105, 170, 0.2);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.header-tools,
.header-user {
  display: flex;
  align-items: center;
}

.header-tools {
  gap: 17px;
}

.header-user {
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding-left: 17px;
  border-left: 1px solid var(--line);
}

.header-user-name {
  max-width: 220px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-role {
  color: var(--muted);
  font-size: 11px;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.connection-badge::before {
  width: 7px;
  height: 7px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 13%, transparent);
}

.connection-badge.is-active {
  color: var(--teal);
}

.connection-badge.is-pending {
  color: var(--amber);
}

.connection-badge.is-error {
  color: var(--red);
}

.main-content {
  width: min(1440px, calc(100% - 56px));
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(202, 214, 226, 0.88);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: clamp(42px, 8vw, 150px);
  align-items: center;
  max-width: 1160px;
  min-height: calc(100vh - 145px);
  margin: 0 auto;
  padding: 56px 0 82px;
}

.eyebrow,
.card-kicker,
.module-label,
.meta-label {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-intro {
  padding: 11px 0;
}

.login-intro h1 {
  max-width: 680px;
  margin: 18px 0 19px;
  color: var(--navy-deep);
  font-size: clamp(39px, 5vw, 67px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.login-intro h1 em {
  color: var(--blue);
  font-style: normal;
}

.intro-copy {
  max-width: 500px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.intro-points {
  display: grid;
  gap: 16px;
  max-width: 430px;
  margin-top: 47px;
}

.intro-point {
  display: flex;
  align-items: center;
  gap: 13px;
}

.point-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--blue);
  background: var(--surface-blue);
  border: 1px solid #d9e9f6;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
}

.intro-point span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.intro-point strong {
  color: var(--ink);
  font-size: 12px;
}

.intro-point small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.login-card {
  padding: 31px 32px 23px;
  box-shadow: var(--shadow-md);
}

.login-card h2,
.module-header h2,
.editor-heading h3,
.modal-header h2 {
  margin: 0;
  color: var(--navy-deep);
  letter-spacing: -0.035em;
}

.login-card h2 {
  margin-top: 12px;
  font-size: 27px;
}

.card-lead {
  margin: 8px 0 26px;
  color: var(--ink-soft);
  font-size: 13px;
}

.stack-form,
.field-group {
  display: flex;
  flex-direction: column;
}

.stack-form {
  gap: 18px;
}

.field-group {
  min-width: 0;
  gap: 7px;
}

.field-group label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.editor-field:has([required]) label::after {
  margin-left: 4px;
  color: var(--red);
  content: "*";
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field-group textarea {
  min-height: 70px;
  resize: vertical;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #a4b0bc;
}

.field-group input:hover,
.field-group select:hover,
.field-group textarea:hover {
  border-color: #aabfd2;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(39, 135, 206, 0.12);
}

.field-group input:disabled,
.field-group select:disabled,
.field-group textarea:disabled {
  color: var(--muted);
  background: var(--surface-soft);
}

.field-hint {
  color: var(--muted);
  font-size: 10px;
}

.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled) {
  border-color: #a5bbce;
  box-shadow: 0 4px 12px rgba(20, 39, 60, 0.08);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  color: #a5b0bb;
  background: #f5f8fa;
  border-color: #e0e7ed;
  box-shadow: none;
}

.button-primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 7px 16px rgba(23, 105, 170, 0.16);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  background: #125d98;
  border-color: #125d98;
}

.button-secondary {
  color: var(--teal);
  background: #f1fbfa;
  border-color: #c1e6e2;
}

.button-secondary:hover:not(:disabled) {
  color: #08766f;
  background: var(--teal-soft);
  border-color: #9fd8d2;
}

.button-quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.button-quiet:hover:not(:disabled) {
  color: var(--blue);
  background: var(--surface-blue);
  border-color: #d5e6f4;
  box-shadow: none;
}

.button-danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 7px 16px rgba(181, 58, 75, 0.15);
}

.button-danger:hover:not(:disabled) {
  color: #fff;
  background: #9c2d3e;
  border-color: #9c2d3e;
}

.button-wide {
  width: 100%;
  min-height: 44px;
  margin-top: 3px;
}

.button-small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 11px;
}

.button-spinner,
.loading-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.is-loading .button-spinner {
  display: block;
}

.button.is-loading .button-label {
  opacity: 0.82;
}

.login-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 27px;
  padding-top: 17px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.status-dot,
.module-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(22, 139, 132, 0.11);
}

.form-message {
  margin: -3px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.error-message {
  color: var(--red);
}

.workspace-view {
  padding: 37px 0 72px;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 7px 1px 28px;
}

.workspace-heading h1 {
  margin: 11px 0 5px;
  color: var(--navy-deep);
  font-size: clamp(31px, 4vw, 48px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.heading-period {
  color: var(--blue);
}

.workspace-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.workspace-meta {
  min-width: 156px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: right;
}

.meta-label {
  color: var(--muted);
  font-size: 9px;
}

.meta-value {
  margin-top: 3px;
  color: var(--amber);
  font-size: 14px;
  font-weight: 800;
}

.meta-value.is-enabled {
  color: var(--teal);
}

.meta-value.is-readonly {
  color: var(--amber);
}

.meta-hint {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.status-strip {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 8px 13px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(220, 228, 236, 0.85);
  border-radius: 8px;
  font-size: 11px;
}

.status-indicator {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--teal);
  border-radius: 50%;
}

.status-indicator.is-pending {
  background: var(--amber);
  animation: breathe 1.2s ease-in-out infinite;
}

.status-indicator.is-error {
  background: var(--red);
}

.status-indicator.is-success {
  background: var(--teal);
}

.status-detail {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.global-error {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -7px 0 18px;
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #f2cbd1;
  border-radius: 8px;
  font-size: 12px;
}

.alert-icon,
.confirm-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.global-error .icon-button {
  margin-left: auto;
}

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.workspace-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  padding: 0 0 1px;
  border-bottom: 1px solid var(--line);
}

.workspace-tab {
  display: flex;
  min-width: 235px;
  align-items: center;
  gap: 11px;
  margin-bottom: -1px;
  padding: 12px 15px 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 9px 9px 0 0;
  text-align: left;
}

.workspace-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
}

.workspace-tab.is-active {
  color: var(--blue);
  background: var(--surface);
  border-color: var(--line);
  border-bottom-color: var(--blue);
  box-shadow: 0 -2px 11px rgba(20, 39, 60, 0.025);
}

.tab-index {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.is-active .tab-index {
  color: var(--blue);
}

.tab-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.tab-copy strong {
  color: currentColor;
  font-size: 12px;
}

.tab-copy small {
  color: var(--muted);
  font-size: 10px;
}

.tab-count {
  min-width: 23px;
  margin-left: auto;
  padding: 3px 6px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.is-active .tab-count {
  color: var(--blue);
  background: var(--surface-blue);
}

.module-panel {
  min-width: 0;
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 27px 1px 18px;
}

.module-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--teal);
  font-size: 9px;
}

.module-pulse {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 3px rgba(22, 139, 132, 0.11);
}

.module-header h2 {
  margin-top: 8px;
  font-size: 26px;
}

.module-header p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.revision-chip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.revision-chip strong {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0;
}

.query-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.65fr) repeat(2, minmax(100px, 0.8fr)) repeat(2, minmax(130px, 0.9fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface-blue);
  border: 1px solid #dcecf7;
  border-radius: 11px;
}

.query-toolbar .field-group {
  gap: 5px;
}

.query-toolbar .field-group label {
  color: var(--blue);
  font-size: 10px;
}

.query-toolbar .field-group input {
  min-height: 36px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.88);
  border-color: #cfe2f0;
  font-size: 12px;
}

.query-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.query-actions .button-primary {
  min-width: 74px;
}

.table-card {
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 13px 9px 16px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.table-toolbar strong {
  color: var(--ink);
  font-size: 12px;
}

.table-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-scroll {
  position: relative;
  min-height: 178px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 1450px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  text-align: left;
}

.booking-table {
  min-width: 2400px;
}

.data-table th,
.data-table td {
  max-width: 260px;
  padding: 10px 12px;
  border-bottom: 1px solid #e9eef3;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--ink-soft);
}

.data-table tbody tr {
  background: var(--surface);
  transition: background 120ms ease;
}

.data-table tbody tr:hover,
.data-table tbody tr.is-selected {
  background: #f5faff;
}

.data-table tbody tr.is-selected {
  box-shadow: inset 3px 0 0 var(--blue);
}

.data-table .select-column {
  position: sticky;
  z-index: 3;
  left: 0;
  width: 80px;
  min-width: 80px;
  background: inherit;
  border-right: 1px solid #e6edf3;
}

.data-table th.select-column {
  z-index: 4;
  background: #fbfcfd;
}

.data-table tbody tr:hover .select-column,
.data-table tbody tr.is-selected .select-column {
  background: #f5faff;
}

.row-select-button {
  min-width: 55px;
  padding: 5px 7px;
  color: var(--blue);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.row-select-button:hover {
  background: var(--surface-blue);
  border-color: #d2e7f5;
}

.is-selected .row-select-button {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.cell-emphasis {
  color: var(--ink) !important;
  font-weight: 750;
}

.cell-flag {
  color: var(--teal) !important;
  font-weight: 750;
}

.empty-state,
.loading-state {
  display: flex;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-state span {
  font-size: 11px;
}

.empty-icon {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 3px;
  place-items: center;
  color: var(--blue);
  background: var(--surface-blue);
  border-radius: 10px;
  font-size: 22px;
}

.loading-state {
  position: absolute;
  inset: 53px 0 0;
  min-height: 125px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
}

.loading-spinner {
  display: block;
  margin-bottom: 2px;
  color: var(--blue);
}

.editor-card {
  margin-top: 20px;
  padding: 22px 22px 18px;
  border-color: #cfe3ef;
  box-shadow: 0 8px 24px rgba(20, 39, 60, 0.07);
}

.editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.editor-heading h3 {
  margin-top: 7px;
  font-size: 18px;
}

.editor-heading p {
  max-width: 780px;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-revision {
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--blue);
  background: var(--surface-blue);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px 13px;
  padding: 18px 0 4px;
}

.booking-editor-grid {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
}

.editor-field.field-wide {
  grid-column: span 3;
}

.editor-field input,
.editor-field textarea {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 11px;
}

.editor-field textarea {
  min-height: 62px;
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 14px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.editor-safety-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.editor-buttons {
  display: flex;
  gap: 8px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 9px;
  width: min(1440px, calc(100% - 56px));
  margin: 0 auto;
  padding: 0 0 24px;
  color: #9aa7b4;
  font-size: 10px;
}

.footer-separator {
  color: #c6d1da;
}

.modal-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 80px rgba(13, 31, 49, 0.23);
}

.modal-dialog::backdrop {
  background: rgba(13, 31, 49, 0.44);
  backdrop-filter: blur(3px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 25px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-top: 7px;
  font-size: 21px;
}

.modal-summary {
  margin: 17px 25px 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.preview-body {
  max-height: min(55vh, 470px);
  overflow: auto;
  padding: 17px 25px 3px;
}

.preview-details,
.confirm-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.preview-details > div,
.confirm-details > div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.preview-details dt,
.confirm-details dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-details dd,
.confirm-details dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-json-label {
  margin-top: 17px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.preview-json {
  max-height: 280px;
  margin: 7px 0 0;
  overflow: auto;
  padding: 12px;
  color: #dceaf3;
  background: var(--navy-deep);
  border-radius: 8px;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 17px 25px 21px;
}

.commit-dialog {
  width: min(540px, calc(100% - 32px));
}

.warning-label {
  color: var(--amber);
}

.confirm-callout {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 20px 25px 16px;
  padding: 12px;
  color: #8d5c17;
  background: var(--amber-soft);
  border: 1px solid #f2d7a9;
  border-radius: 8px;
}

.confirm-icon {
  color: #fff;
  background: var(--amber);
}

.confirm-callout p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.confirm-details {
  grid-template-columns: 1fr;
  margin: 0 25px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

/* CTL 26.8.5.1 compatibility skin.  The modern rules above remain as the
   responsive fallback; these overrides reproduce the native WinForms shell. */
:root {
  --ctl-bg: #f3f4f6;
  --ctl-panel: #f7f7f8;
  --ctl-line: #b9bec7;
  --ctl-line-soft: #d4d7dd;
  --ctl-blue: #2d73b9;
  --ctl-selection: #dbeafa;
}

html,
body {
  background: #fff;
}

body {
  color: #1e2530;
  font-family: "Segoe UI", Tahoma, Arial, "Microsoft YaHei", sans-serif;
  font-size: 12px;
  line-height: 1.25;
}

.site-header,
.main-content,
.site-footer {
  width: 100%;
  max-width: none;
  margin: 0;
}

.site-header {
  display: block;
  min-height: 0;
  padding: 0;
  background: var(--ctl-bg);
  border-bottom: 1px solid #aeb4bd;
}

.window-titlebar {
  display: flex;
  height: 31px;
  align-items: center;
  padding: 0 8px;
  background: #f4f5f7;
  border-bottom: 1px solid #d1d4d9;
}

.brand {
  gap: 6px;
}

.brand-copy {
  flex-direction: row;
  align-items: baseline;
  gap: 5px;
}

.brand-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 0;
  color: #303640;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.window-title-state {
  display: none;
}

.window-controls {
  display: flex;
  gap: 24px;
  margin-left: auto;
  padding-right: 8px;
  font-size: 13px;
}

.ctl-menubar {
  display: flex;
  height: 27px;
  align-items: stretch;
  padding-left: 8px;
  background: #f7f7f8;
  border-bottom: 1px solid #c8ccd2;
}

.ctl-menu {
  position: relative;
}

.ctl-menu > summary {
  height: 26px;
  padding: 6px 12px 5px;
  list-style: none;
  color: #1b2532;
  cursor: default;
  user-select: none;
}

.ctl-menu > summary::-webkit-details-marker {
  display: none;
}

.ctl-menu[open] > summary,
.ctl-menu > summary:hover {
  background: #e3ebf6;
}

.ctl-dropdown {
  position: absolute;
  z-index: 60;
  top: 26px;
  left: 0;
  width: 252px;
  padding: 4px 0;
  background: #fff;
  border: 1px solid #9ca3ad;
  box-shadow: 2px 3px 8px rgba(25, 34, 45, 0.18);
}

.legacy-menu-item {
  display: flex;
  width: 100%;
  height: 27px;
  align-items: center;
  gap: 6px;
  padding: 0 13px 0 24px;
  color: #1e2835;
  background: #fff;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}

.legacy-menu-item:hover:not(:disabled),
.legacy-menu-item:focus-visible,
.legacy-menu-item.is-selected:not(:disabled) {
  color: #10284a;
  background: #dceafb;
  outline: 0;
}

.legacy-menu-item:disabled {
  color: #9298a0;
  background: #fff;
}

.menu-arrow {
  margin-left: auto;
  font-size: 15px;
}

.menu-divider {
  height: 1px;
  margin: 4px 8px;
  background: #d6d8dc;
}

.quick-toolbar {
  display: flex;
  height: 37px;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f1f2f4;
  border-bottom: 1px solid #b9bec6;
}

.quick-caption {
  font-size: 11px;
}

.quick-search-input {
  width: 130px;
  height: 25px;
  padding: 3px 7px;
  background: #fff;
  border: 1px solid #aeb5be;
  border-radius: 0;
  font-size: 11px;
}

.quick-tool-button {
  width: 25px;
  height: 25px;
  padding: 0;
  color: #3f566e;
  background: transparent;
  border: 0;
}

.quick-tool-danger {
  color: #c1434c;
}

.quick-context {
  color: #374fc7;
  font-weight: 600;
}

.header-tools {
  gap: 9px;
  margin-left: auto;
}

.header-user {
  display: inline-flex;
  flex-direction: row;
  gap: 4px;
  padding: 0;
  border: 0;
}

.header-user-name,
.header-user-role,
.build-stamp,
.connection-badge {
  font-size: 10px;
}

.header-user-role::before {
  content: "[";
}

.header-user-role::after {
  content: "]";
}

.connection-badge::before {
  width: 5px;
  height: 5px;
  box-shadow: none;
}

.button,
.icon-button {
  min-height: 25px;
  padding: 3px 9px;
  color: #283443;
  background: linear-gradient(#ffffff, #e8ebef);
  border: 1px solid #abb2bc;
  border-radius: 2px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 400;
  transform: none;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  color: #17273b;
  background: #e6f0fb;
  border-color: #6996c4;
  box-shadow: none;
  transform: none;
}

.button-primary,
.button-secondary,
.button-danger {
  color: #283443;
  background: linear-gradient(#ffffff, #e8ebef);
  border-color: #abb2bc;
}

.button-primary:hover:not(:disabled),
.button-secondary:hover:not(:disabled),
.button-danger:hover:not(:disabled) {
  color: #17273b;
  background: #e6f0fb;
  border-color: #6996c4;
}

.button:disabled {
  color: #9da2a9;
  background: #efeff0;
  border-color: #c9ccd0;
}

.login-view {
  display: grid;
  min-height: calc(100vh - 95px);
  place-items: start center;
  grid-template-columns: minmax(320px, 430px);
  padding: 86px 16px 30px;
  background: #eceff3;
}

.login-intro {
  display: none;
}

.login-card {
  width: 100%;
  padding: 19px 22px 17px;
  background: #f6f7f8;
  border: 1px solid #9fa6af;
  border-radius: 2px;
  box-shadow: 4px 5px 18px rgba(30, 39, 49, 0.16);
}

.login-card h2 {
  margin: 3px 0 13px;
  font-size: 17px;
  font-weight: 600;
}

.card-kicker,
.card-lead,
.login-footnote {
  display: none;
}

.field-group {
  gap: 3px;
}

.field-group input,
.field-group select,
.field-group textarea {
  min-height: 25px;
  padding: 3px 6px;
  background: #fff;
  border: 1px solid #aeb4bc;
  border-radius: 0;
  box-shadow: none;
  font-size: 11px;
}

.field-hint {
  font-size: 9px;
}

.workspace-view {
  padding: 0 0 22px;
}

.workspace-heading,
.status-strip {
  display: none;
}

.legacy-workspace-frame {
  display: flex;
  min-height: calc(100vh - 96px);
  background: #fff;
}

.legacy-rail {
  width: 24px;
  flex: 0 0 24px;
  background: #edf0f4;
  border-right: 1px solid #adb3bc;
}

.legacy-rail-label {
  display: block;
  padding-top: 8px;
  writing-mode: vertical-rl;
  font-size: 10px;
}

.legacy-workspace-main {
  min-width: 0;
  flex: 1;
}

.workspace-tabs {
  height: 29px;
  gap: 0;
  margin: 0;
  padding: 0;
  background: #eceff3;
  border-bottom: 1px solid #aeb4bd;
}

.workspace-tab {
  min-width: 54px;
  height: 28px;
  gap: 4px;
  margin: 0;
  padding: 4px 9px;
  color: #334050;
  background: #eef0f3;
  border: 0;
  border-right: 1px solid #b6bbc3;
  border-radius: 0;
}

.workspace-tab.is-active {
  color: #202b39;
  background: #fff;
  border-color: #b6bbc3;
  border-bottom: 1px solid #fff;
  box-shadow: none;
}

.workspace-tab .tab-copy small,
.workspace-tab .tab-count,
.tab-session-mark,
.tab-count-global {
  display: none;
}

.workspace-tab .tab-copy strong,
.tab-index {
  font-size: 10px;
  font-weight: 400;
}

.workspace-tab-spacer {
  flex: 1;
}

.module-header {
  display: none;
}

.module-panel {
  padding: 7px 10px 0;
}

.query-toolbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(6, minmax(125px, 1fr)) auto;
  align-items: end;
  gap: 5px 12px;
  margin: 0 0 7px;
  padding: 7px 9px 8px;
  background: #f2f3f5;
  border: 0;
  border-bottom: 2px solid #696f77;
  border-radius: 0;
}

.schedule-query-toolbar {
  grid-template-columns: repeat(7, minmax(110px, 1fr)) 100px auto;
}

.schedule-query-toolbar .field-group {
  grid-template-columns: 45px minmax(0, 1fr);
}

.schedule-query-toolbar .field-group:has(#scheduleCountInput) {
  grid-template-columns: 34px minmax(0, 1fr);
}

.query-field {
  min-width: 0;
}

.query-toolbar .field-group {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.query-toolbar .field-group label {
  color: #26303b;
  font-size: 10px;
  font-weight: 500;
  text-align: right;
}

.query-toolbar .field-group input {
  width: 100%;
  min-height: 24px;
  padding: 2px 5px;
  background: #fff;
  border-color: #abb2bb;
  font-size: 10px;
}

.query-cell-wide {
  grid-column: span 2;
}

.query-actions {
  justify-content: flex-end;
}

.legacy-lookup-field {
  position: relative;
  width: 100%;
  min-width: 0;
}

.lookup-popup {
  position: absolute;
  z-index: 100;
  top: calc(100% + 1px);
  left: 0;
  width: max(310px, min(600px, 52vw));
  max-height: 310px;
  overflow: auto;
  color: #222b36;
  background: #fff;
  border: 1px solid #9ca3ac;
  box-shadow: 2px 4px 10px rgba(24, 31, 40, 0.2);
  font-size: 10px;
}

.lookup-grid-row {
  display: grid !important;
  grid-template-columns: minmax(130px, 1.6fr) minmax(82px, 0.9fr) minmax(72px, 0.75fr) minmax(70px, 0.72fr) minmax(130px, 1.4fr);
}

.lookup-header {
  position: sticky;
  z-index: 2;
  top: 0;
  color: #344050;
  background: #f0f1f3;
  border-bottom: 1px solid #aeb4bd;
}

.lookup-cell {
  min-width: 0;
  padding: 4px 6px;
  overflow: hidden;
  border-right: 1px solid #c8ccd2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-option {
  display: flex;
  width: 100%;
  min-height: 23px;
  align-items: center;
  padding: 0;
  color: #222b36;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #d7d9dd;
  border-radius: 0;
  font-size: 10px;
  text-align: left;
}

.lookup-option:first-of-type,
.lookup-option:hover,
.lookup-option.is-active {
  background: var(--ctl-selection);
}

.lookup-label,
.lookup-secondary {
  padding: 4px 7px;
}

.lookup-secondary {
  margin-left: auto;
  color: #5c6570;
}

.lookup-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px;
  background: #f2f3f4;
  border-top: 1px solid #b7bcc4;
}

.lookup-footer-button {
  min-width: 58px;
}

.card,
.table-card,
.editor-card {
  border: 1px solid #b8bdc5;
  border-radius: 0;
  box-shadow: none;
}

.table-toolbar {
  min-height: 31px;
  padding: 3px 5px 3px 8px;
  background: #f0f1f3;
  border-bottom: 1px solid #aeb4bc;
}

.table-scroll {
  min-height: 315px;
}

#bookingsPanel:has(#bookingEditorCard:not([hidden])) .table-scroll {
  min-height: 92px;
  max-height: 118px;
}

.modal-dialog {
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100vh - 50px);
  padding: 0;
  color: #202a35;
  background: #f4f4f5;
  border: 1px solid #7d858f;
  border-radius: 0;
  box-shadow: 4px 5px 14px rgba(24, 31, 40, 0.3);
}

.modal-dialog::backdrop {
  background: rgba(45, 52, 60, 0.28);
  backdrop-filter: none;
}

.modal-header {
  min-height: 36px;
  padding: 5px 8px;
  background: #eceef1;
  border-bottom: 1px solid #aeb4bc;
}

.modal-header .module-label {
  display: none;
}

.modal-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.modal-summary,
.confirm-callout,
.confirm-details {
  margin: 8px;
  padding: 7px;
  background: #fff;
  border: 1px solid #c4c8ce;
  border-radius: 0;
  font-size: 11px;
}

.preview-body {
  padding: 0 8px 8px;
}

.preview-details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: #fff;
  border: 1px solid #bdc2c9;
}

.preview-details > div {
  padding: 5px 6px;
  border-right: 1px solid #d1d5da;
  border-radius: 0;
}

.preview-details dt,
.preview-details dd,
.preview-json-label {
  font-size: 9px;
}

.preview-json-label {
  margin: 7px 0 3px;
}

.preview-json {
  max-height: 255px;
  padding: 7px;
  color: #222;
  background: #fff;
  border: 1px solid #9fa6af;
  border-radius: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  line-height: 1.35;
}

.modal-actions {
  padding: 6px 8px;
  background: #eceef1;
  border-top: 1px solid #b8bdc5;
}

.data-table {
  min-width: 1320px;
  font-size: 10px;
}

.booking-table {
  min-width: 2200px;
}

.data-table th,
.data-table td {
  height: 24px;
  padding: 3px 6px;
  border-right: 1px solid #cfd3d8;
  border-bottom: 1px solid #d8dbe0;
}

.data-table th {
  color: #34404e;
  background: #f1f2f4;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.data-table tbody tr:nth-child(even) {
  background: #f4f7fb;
}

.data-table tbody tr:hover,
.data-table tbody tr.is-selected {
  background: #cfe2f7;
}

.data-table .select-column {
  width: 52px;
  min-width: 52px;
}

.row-select-button {
  min-width: 42px;
  padding: 2px 4px;
  border-radius: 0;
  font-size: 9px;
}

.editor-card {
  margin-top: 6px;
  padding: 8px;
  background: #f7f7f8;
}

.editor-heading {
  padding-bottom: 5px;
}

.editor-heading h3 {
  margin: 0;
  font-size: 15px;
}

.editor-heading .module-label,
.editor-heading p,
.editor-revision {
  font-size: 9px;
}

.editor-grid,
.booking-editor-grid {
  grid-template-columns: repeat(6, minmax(115px, 1fr));
  gap: 5px 8px;
  padding: 7px 0 3px;
}

.editor-field input,
.editor-field textarea {
  min-height: 24px;
  padding: 2px 5px;
  font-size: 10px;
}

.editor-field textarea {
  min-height: 45px;
}

.editor-actions {
  margin-top: 6px;
  padding-top: 6px;
}

.site-footer {
  display: none;
}

@media (max-width: 1050px) {
  .query-toolbar,
  .schedule-query-toolbar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .editor-grid,
  .booking-editor-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

@media (max-width: 1120px) {
  .query-toolbar {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }

  .query-main {
    grid-column: span 2;
  }

  .query-actions {
    grid-column: span 2;
    justify-content: flex-end;
  }

  .editor-grid,
  .booking-editor-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

@media (max-width: 850px) {
  .site-header,
  .main-content,
  .site-footer {
    width: min(100% - 32px, 720px);
  }

  .login-view {
    grid-template-columns: 1fr;
    gap: 35px;
    min-height: auto;
    padding: 45px 0 70px;
  }

  .login-intro h1 {
    max-width: 600px;
    font-size: clamp(38px, 9vw, 58px);
  }

  .intro-points {
    margin-top: 30px;
  }

  .login-card {
    width: min(100%, 480px);
  }

  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-meta {
    width: 100%;
    text-align: left;
  }

  .workspace-tabs {
    overflow-x: auto;
  }

  .workspace-tab {
    min-width: 205px;
  }

  .module-header {
    margin-top: 21px;
  }

  .query-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-main,
  .query-actions {
    grid-column: span 2;
  }

  .query-actions {
    justify-content: flex-start;
  }

  .editor-grid,
  .booking-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-field.field-wide {
    grid-column: span 2;
  }
}

@media (max-width: 540px) {
  .site-header,
  .main-content,
  .site-footer {
    width: calc(100% - 24px);
  }

  .site-header {
    min-height: 69px;
  }

  .header-tools {
    gap: 8px;
  }

  .header-user {
    display: none;
  }

  .connection-badge {
    font-size: 0;
  }

  .connection-badge::before {
    width: 8px;
    height: 8px;
  }

  .login-view {
    padding-top: 32px;
  }

  .login-intro h1 {
    margin-top: 13px;
    font-size: 39px;
  }

  .intro-copy {
    font-size: 14px;
  }

  .intro-points {
    gap: 13px;
    margin-top: 25px;
  }

  .login-card {
    padding: 25px 20px 20px;
  }

  .workspace-view {
    padding-top: 27px;
  }

  .workspace-heading h1 {
    font-size: 32px;
  }

  .workspace-tabs {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .workspace-tab {
    min-width: 178px;
    padding-right: 11px;
    padding-left: 11px;
  }

  .module-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .revision-chip {
    align-self: flex-start;
  }

  .query-toolbar {
    grid-template-columns: 1fr;
  }

  .query-main,
  .query-actions {
    grid-column: auto;
  }

  .query-actions {
    justify-content: stretch;
  }

  .query-actions .button {
    flex: 1;
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .table-toolbar .button {
    align-self: flex-end;
    margin-top: -4px;
  }

  .editor-card {
    padding: 18px 14px 15px;
  }

  .editor-heading {
    flex-direction: column;
    gap: 10px;
  }

  .editor-heading p {
    white-space: normal;
  }

  .editor-grid,
  .booking-editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-field.field-wide {
    grid-column: auto;
  }

  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .editor-buttons .button {
    padding-right: 8px;
    padding-left: 8px;
  }

  .modal-header,
  .preview-body {
    padding-right: 17px;
    padding-left: 17px;
  }

  .modal-summary {
    margin-right: 17px;
    margin-left: 17px;
  }

  .modal-actions {
    padding-right: 17px;
    padding-left: 17px;
  }

  .confirm-callout,
  .confirm-details {
    margin-right: 17px;
    margin-left: 17px;
  }

  .preview-details {
    grid-template-columns: 1fr;
  }
}

/* Modern operations workspace - intentionally overrides the legacy compatibility
   skin above while keeping the native CTL data and interaction contracts. */
html,
body {
  background: #f3f7fa;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(39, 135, 206, 0.09), transparent 29rem),
    linear-gradient(180deg, #f9fbfd 0%, #f1f5f8 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  grid-template-areas:
    "title menu"
    "tools tools";
  width: min(1440px, calc(100% - 56px));
  min-height: 0;
  margin: 18px auto 0;
  padding: 0;
  overflow: visible;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(202, 214, 226, 0.9);
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(20, 39, 60, 0.08);
  backdrop-filter: blur(14px);
}

.window-titlebar {
  grid-area: title;
  display: flex;
  min-width: 0;
  height: auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: transparent;
  border: 0;
}

.brand {
  gap: 10px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.brand-name {
  color: var(--navy-deep);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.window-title-state {
  display: inline-flex;
  align-items: center;
  padding-left: 18px;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ctl-menubar {
  grid-area: menu;
  display: flex;
  height: auto;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 12px 20px 12px 0;
  background: transparent;
  border: 0;
}

.ctl-menu {
  position: relative;
  height: auto;
}

.ctl-menu > summary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}

.ctl-menu > summary::after {
  content: "⌄";
  color: #a9c3da;
}

.ctl-menu[open] > summary,
.ctl-menu > summary:hover {
  background: var(--blue);
  border-color: var(--blue);
}

.ctl-dropdown {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  right: 0;
  left: auto;
  display: grid;
  width: 230px;
  min-width: 0;
  padding: 8px;
  overflow: visible;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 18px 48px rgba(13, 31, 49, 0.18);
}

.legacy-menu-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  padding: 8px 11px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  text-align: left;
}

.legacy-menu-item:hover,
.legacy-menu-item.is-selected:hover {
  color: var(--blue);
  background: var(--surface-blue);
}

.legacy-menu-item.is-selected {
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
  border: 0;
}

.menu-context {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.quick-toolbar {
  grid-area: tools;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 14px;
  padding: 9px 20px;
  background: rgba(246, 249, 252, 0.8);
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.quick-context {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.build-stamp {
  color: var(--muted);
  font-size: 10px;
}

.main-content,
.site-footer {
  width: min(1440px, calc(100% - 56px));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: clamp(42px, 8vw, 150px);
  align-items: center;
  max-width: 1160px;
  min-height: calc(100vh - 180px);
  margin: 0 auto;
  padding: 56px 0 82px;
  background: transparent;
}

.login-intro {
  display: block;
  padding: 11px 0;
}

.login-card {
  width: auto;
  margin: 0;
  padding: 31px 32px 23px;
  border: 1px solid rgba(202, 214, 226, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-card .card-kicker,
.login-card .card-lead,
.login-footnote {
  display: flex;
}

.workspace-view {
  min-height: 0;
  padding: 34px 0 72px;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 7px 1px 26px;
}

.workspace-heading-copy,
.workspace-meta,
.status-strip,
.global-error,
.module-header,
.table-toolbar,
.editor-heading,
.editor-actions {
  display: flex;
}

.workspace-heading-copy,
.workspace-meta {
  display: block;
}

.legacy-workspace-frame {
  display: block;
  min-height: 0;
  background: transparent;
  border: 0;
}

.legacy-workspace-main {
  min-width: 0;
  width: 100%;
}

.workspace-tabs {
  display: flex;
  min-height: 0;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0 0 1px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.workspace-tab {
  display: flex;
  min-width: 220px;
  min-height: 64px;
  align-items: center;
  gap: 11px;
  margin-bottom: -1px;
  padding: 11px 15px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
  text-align: left;
}

.workspace-tab.is-active {
  color: var(--blue);
  background: #fff;
  border-color: var(--line);
  border-bottom-color: var(--blue);
  box-shadow: 0 -3px 15px rgba(20, 39, 60, 0.035);
}

.workspace-tab-spacer {
  flex: 1 1 auto;
}

.tab-session-mark,
.tab-count-global {
  align-self: center;
}

.tab-session-mark {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.tab-count-global {
  margin: 0 8px;
}

.module-panel {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.module-header {
  align-items: flex-start;
  justify-content: space-between;
  margin: 24px 1px 17px;
  padding: 0;
  background: transparent;
  border: 0;
}

.module-heading-copy p,
.module-header p {
  display: block;
}

.query-toolbar,
.schedule-query-toolbar,
.booking-query-toolbar {
  position: relative;
  z-index: 8;
  display: grid;
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px;
  background: rgba(238, 245, 251, 0.92);
  border: 1px solid #d6e8f5;
  border-radius: 13px;
}

.schedule-query-toolbar {
  grid-template-columns: minmax(180px, 1.3fr) repeat(2, minmax(150px, 1fr)) minmax(150px, 1fr) 82px auto;
}

.booking-query-toolbar {
  grid-template-columns: minmax(210px, 1fr) minmax(260px, 1.4fr) 82px auto;
}

.query-field,
.query-toolbar .field-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.query-cell-wide {
  grid-column: auto;
}

.query-toolbar input,
.query-toolbar .field-group input,
.editor-field input,
.editor-field textarea {
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #cbddeb;
  border-radius: 8px;
  box-shadow: none;
}

.query-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.query-actions .button-primary {
  min-width: 92px;
}

.table-card,
.editor-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(202, 214, 226, 0.9);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.table-toolbar-title,
.schedule-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-legacy-action {
  color: var(--blue);
  background: var(--surface-blue);
  border-color: #cee3f2;
}

.table-scroll {
  min-height: 270px;
  max-height: 48vh;
  overflow: auto;
}

.data-table {
  min-width: 1450px;
  font-size: 11px;
}

.booking-table {
  min-width: 2400px;
}

.data-table th,
.data-table td {
  height: auto;
  padding: 10px 12px;
  border-right: 0;
  border-bottom: 1px solid #e9eef3;
}

.data-table th {
  color: var(--muted);
  background: #fbfcfd;
}

.data-table tbody tr.is-selected,
.data-table tbody tr:hover {
  background: #f2f8fd;
}

.lookup-popup {
  position: absolute;
  z-index: 120;
  top: calc(100% + 7px);
  right: auto;
  left: 0;
  width: min(760px, 86vw);
  max-height: 340px;
  overflow: auto;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 20px 55px rgba(13, 31, 49, 0.2);
}

.lookup-grid-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) 100px 90px 90px minmax(120px, 1fr);
  width: 100%;
  align-items: center;
  gap: 8px;
}

.lookup-header {
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lookup-option {
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.lookup-option:hover,
.lookup-option.is-active {
  color: var(--blue);
  background: var(--surface-blue);
}

.lookup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 5px;
  padding: 7px 4px 2px;
  border-top: 1px solid var(--line);
}

.lookup-footer-button {
  min-height: 30px;
  padding: 5px 10px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.editor-card {
  margin-top: 20px;
  padding: 22px;
}

.booking-editor-topline {
  display: block;
}

.editor-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.booking-detail-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 16px 0 2px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.booking-detail-ribbon > div {
  min-width: 0;
  padding: 11px 13px;
  background: var(--surface-soft);
}

.booking-detail-ribbon span,
.booking-detail-ribbon strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-detail-ribbon span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.booking-detail-ribbon strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 11px;
}

.editor-grid,
.booking-editor-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 13px;
  padding: 18px 0 4px;
}

.editor-field.field-wide {
  grid-column: span 2;
}

.editor-actions {
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 14px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.modal-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 80px rgba(13, 31, 49, 0.24);
}

.modal-dialog::backdrop {
  background: rgba(13, 31, 49, 0.48);
  backdrop-filter: blur(4px);
}

.modal-header {
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 25px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 9px;
  padding: 0 0 24px;
  color: #9aa7b4;
  background: transparent;
  border: 0;
  font-size: 10px;
}

@media (max-width: 1180px) {
  .site-header,
  .main-content,
  .site-footer {
    width: min(100% - 32px, 1440px);
  }

  .schedule-query-toolbar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .booking-query-toolbar {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .query-actions {
    justify-content: flex-end;
  }

  .editor-grid,
  .booking-editor-grid {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "menu" "tools";
  }

  .ctl-menubar {
    justify-content: space-between;
    padding: 0 18px 12px;
  }

  .login-view {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 38px;
  }

  .login-intro h1 {
    font-size: clamp(36px, 8vw, 56px);
  }

  .workspace-heading,
  .table-toolbar,
  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-meta {
    text-align: left;
  }

  .workspace-tabs {
    overflow-x: auto;
  }

  .workspace-tab {
    min-width: 190px;
  }

  .tab-session-mark,
  .tab-count-global,
  .workspace-tab-spacer {
    display: none;
  }

  .schedule-query-toolbar,
  .booking-query-toolbar {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .editor-grid,
  .booking-editor-grid,
  .booking-detail-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .site-header,
  .main-content,
  .site-footer {
    width: calc(100% - 20px);
  }

  .window-titlebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
  }

  .window-title-state {
    padding-left: 0;
    border-left: 0;
  }

  .menu-context,
  .build-stamp,
  .quick-context {
    display: none;
  }

  .quick-toolbar {
    justify-content: flex-end;
  }

  .header-tools {
    margin-left: 0;
  }

  .login-card {
    padding: 24px 20px 20px;
  }

  .intro-points {
    margin-top: 30px;
  }

  .schedule-query-toolbar,
  .booking-query-toolbar,
  .editor-grid,
  .booking-editor-grid,
  .booking-detail-ribbon {
    grid-template-columns: 1fr;
  }

  .editor-field.field-wide {
    grid-column: span 1;
  }

  .schedule-result-actions,
  .editor-buttons {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .lookup-popup {
    position: fixed;
    inset: auto 10px 10px;
    width: auto;
    max-height: 48vh;
  }

  .lookup-grid-row {
    grid-template-columns: minmax(130px, 1fr) 86px;
  }

  .lookup-grid-row .lookup-cell:nth-child(n + 3) {
    display: none;
  }
}

/* Restore modern control geometry after the legacy skin's broad form rules. */
.login-view {
  place-items: stretch;
}

.card,
.table-card,
.editor-card {
  border-color: rgba(202, 214, 226, 0.9);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.login-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-card h2 {
  margin: 12px 0 0;
  color: var(--navy-deep);
  font-size: 27px;
  font-weight: 750;
}

.field-group {
  gap: 7px;
}

.field-group label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.field-group input,
.field-group select,
.field-group textarea {
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(39, 135, 206, 0.12);
}

.field-hint {
  color: var(--muted);
  font-size: 10px;
}

.button,
.legacy-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 750;
}

.button-small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 11px;
}

.button-primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 7px 16px rgba(23, 105, 170, 0.16);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  background: #125d98;
  border-color: #125d98;
}

.button-secondary {
  color: var(--teal);
  background: #f1fbfa;
  border-color: #c1e6e2;
}

.button-quiet {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.button-danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.button:disabled {
  color: #a5b0bb;
  background: #f5f8fa;
  border-color: #e0e7ed;
}

.button-wide {
  width: 100%;
  min-height: 44px;
}

/* FINAL COMPACT CTL WORKBENCH OVERRIDE
   Visual-only density pass. Keep the existing markup, [hidden] contract, and
   responsive fallbacks intact while bringing the desktop workspace closer to
   a modern CTL operations desk. */
:root {
  --ctl-compact-control-height: 30px;
  --ctl-compact-radius: 6px;
}

html,
body {
  background: #eef2f6;
}

body {
  color: var(--ink);
  background: #eef2f6;
  font-size: 13px;
  line-height: 1.35;
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  grid-template-areas: "title menu tools";
  width: min(1440px, calc(100% - 32px));
  height: 72px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--ctl-compact-radius);
  box-shadow: 0 1px 3px rgba(20, 39, 60, 0.06);
  backdrop-filter: none;
}

.window-titlebar {
  grid-area: title;
  display: flex;
  min-width: 0;
  height: 70px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: transparent;
  border: 0;
}

.brand {
  min-width: 0;
  gap: 8px;
}

.brand-copy {
  min-width: 0;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
}

.brand-name {
  overflow: hidden;
  color: var(--navy-deep);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.window-title-state {
  display: inline-flex;
  align-items: center;
  padding-left: 12px;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.ctl-menubar {
  grid-area: menu;
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
}

.ctl-menu > summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 750;
}

.ctl-menu > summary::after {
  color: #b8ccdf;
}

.ctl-menu[open] > summary,
.ctl-menu > summary:hover {
  background: var(--blue);
  border-color: var(--blue);
}

.ctl-dropdown {
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  width: 220px;
  padding: 5px;
  border-radius: 5px;
  box-shadow: 0 8px 20px rgba(13, 31, 49, 0.14);
}

.legacy-menu-item {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 11px;
}

.menu-divider {
  margin: 4px 3px;
}

.menu-context {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.quick-toolbar {
  grid-area: tools;
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 70px;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
  background: #f7f9fb;
  border: 0;
  border-left: 1px solid var(--line);
}

.quick-context {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}

.header-user {
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.header-user-name,
.header-user-role,
.build-stamp,
.connection-badge {
  font-size: 9px;
}

.connection-badge::before {
  width: 6px;
  height: 6px;
}

.main-content,
.site-footer {
  width: min(1440px, calc(100% - 32px));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

.card,
.table-card,
.editor-card,
.login-card {
  border-radius: var(--ctl-compact-radius);
  box-shadow: none;
}

.login-view {
  grid-template-columns: minmax(320px, 430px);
  min-height: calc(100vh - 72px);
  align-items: start;
  justify-content: center;
  padding: 26px 16px 32px;
  background: transparent;
}

.login-intro {
  display: none;
}

.login-card {
  width: 100%;
  margin: 0;
  padding: 18px 20px 16px;
  background: #fff;
  border: 1px solid var(--line-strong);
}

.login-card .card-kicker {
  display: block;
  font-size: 9px;
}

.login-card h2 {
  margin: 5px 0 0;
  font-size: 18px;
  font-weight: 750;
}

.login-card .card-lead {
  display: block;
  margin: 4px 0 14px;
  font-size: 11px;
}

.login-card .stack-form {
  gap: 10px;
}

.login-card .field-group {
  gap: 3px;
}

.login-card .field-group input,
.login-card .field-group select {
  height: var(--ctl-compact-control-height);
  min-height: var(--ctl-compact-control-height);
  padding: 4px 8px;
  border-radius: 4px;
}

.login-card .button-wide {
  min-height: 32px;
}

.login-footnote {
  display: flex;
  margin-top: 12px;
  font-size: 9px;
}

.workspace-view {
  min-height: 0;
  padding: 12px 0 24px;
}

.workspace-heading {
  align-items: center;
  gap: 16px;
  margin: 0 1px 8px;
  padding: 0 1px 8px;
}

.workspace-heading h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.workspace-lead {
  margin: 2px 0 0;
  font-size: 10px;
}

.workspace-meta {
  min-width: 132px;
  padding: 5px 8px;
  border-radius: 4px;
}

.meta-value {
  margin-top: 1px;
  font-size: 12px;
}

.meta-hint {
  font-size: 9px;
}

.status-strip {
  min-height: 28px;
  gap: 7px;
  margin-bottom: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 10px;
}

.global-error {
  gap: 7px;
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 10px;
}

.workspace-tabs {
  min-height: 38px;
  gap: 2px;
  margin: 0 0 8px;
  padding: 0 0 1px;
}

.workspace-tab {
  min-width: 150px;
  min-height: 37px;
  gap: 8px;
  padding: 6px 10px 7px;
  border-radius: 5px 5px 0 0;
}

.tab-copy strong {
  font-size: 11px;
}

.tab-copy small {
  font-size: 9px;
}

.tab-count {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
}

.module-header {
  align-items: center;
  gap: 12px;
  margin: 0 1px 8px;
}

.module-label {
  gap: 6px;
  font-size: 8px;
}

.module-header h2 {
  margin-top: 3px;
  font-size: 16px;
}

.module-header p {
  max-width: 720px;
  margin-top: 2px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revision-chip {
  gap: 5px;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 8px;
}

.revision-chip strong {
  font-size: 10px;
}

.query-toolbar,
.schedule-query-toolbar,
.booking-query-toolbar {
  position: relative;
  z-index: 8;
  align-items: end;
  gap: 5px 8px;
  margin: 0 0 8px;
  padding: 7px 8px;
  background: #eef5fb;
  border: 1px solid #d6e5f0;
  border-radius: var(--ctl-compact-radius);
}

.schedule-query-toolbar {
  grid-template-columns: minmax(160px, 1.25fr) repeat(2, minmax(110px, 1fr)) minmax(120px, 1fr) 64px auto;
}

.booking-query-toolbar {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) 64px auto;
}

.query-field,
.query-toolbar .field-group {
  gap: 3px;
}

.query-toolbar .field-group label {
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.1;
}

.query-toolbar input,
.query-toolbar select,
.query-toolbar .field-group input,
.query-toolbar .field-group select {
  height: var(--ctl-compact-control-height);
  min-height: var(--ctl-compact-control-height);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.query-actions {
  gap: 4px;
}

.query-actions .button {
  min-height: var(--ctl-compact-control-height);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 11px;
}

.query-actions .button-primary {
  min-width: 72px;
}

.button,
.legacy-button {
  min-height: var(--ctl-compact-control-height);
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: none;
  font-size: 11px;
}

.button:hover:not(:disabled),
.button:active:not(:disabled),
.legacy-button:hover:not(:disabled) {
  box-shadow: none;
  transform: none;
}

.button-primary,
.button-secondary,
.button-danger {
  box-shadow: none;
}

.button-small {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 10px;
}

.table-card,
.editor-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--ctl-compact-radius);
}

.table-toolbar {
  min-height: 38px;
  gap: 8px;
  padding: 6px 8px;
}

.table-toolbar-title,
.schedule-result-actions {
  gap: 8px;
}

.table-toolbar strong {
  font-size: 11px;
}

.table-meta {
  font-size: 9px;
}

.table-scroll {
  height: clamp(220px, 31vh, 330px);
  min-height: 190px;
  max-height: 330px;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#schedulesPanel:has(#scheduleEditorCard:not([hidden])) .table-scroll,
#bookingsPanel:has(#bookingEditorCard:not([hidden])) .table-scroll {
  height: clamp(120px, 18vh, 180px);
  min-height: 110px;
  max-height: 180px;
}

.data-table {
  font-size: 10px;
}

.data-table th,
.data-table td {
  height: 28px;
  padding: 5px 8px;
}

.data-table th {
  background: #f5f8fb;
  box-shadow: 0 1px 0 var(--line-strong);
  font-size: 9px;
}

.data-table td {
  font-size: 10px;
}

.empty-state,
.loading-state {
  min-height: 110px;
  gap: 4px;
}

.empty-state strong {
  font-size: 11px;
}

.empty-state span {
  font-size: 10px;
}

.empty-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 18px;
}

.loading-state {
  inset: 38px 0 0;
  min-height: 100px;
  font-size: 10px;
}

.lookup-popup {
  top: calc(100% + 3px);
  width: min(760px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(340px, calc(100vh - 96px));
  padding: 5px;
  border-radius: 5px;
  box-shadow: 0 8px 22px rgba(13, 31, 49, 0.16);
}

#scheduleCarrierInput ~ .lookup-popup,
#bookingScheduleInput ~ .lookup-popup,
#schedulesPanel .editor-field.field-pod .lookup-popup,
#bookingsPanel .editor-field.field-pod .lookup-popup {
  right: 0;
  left: auto;
}

.lookup-grid-row {
  gap: 5px;
}

.lookup-header {
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 8px;
}

.lookup-cell {
  padding: 3px 5px;
}

.lookup-option {
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 10px;
}

.lookup-label,
.lookup-secondary {
  padding: 3px 5px;
}

.lookup-footer {
  gap: 4px;
  margin-top: 3px;
  padding: 5px 2px 1px;
}

.lookup-footer-button {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 4px;
}

.editor-card {
  display: flex;
  min-height: 0;
  max-height: min(420px, calc(100vh - 320px));
  flex-direction: column;
  margin-top: 8px;
  padding: 10px;
  background: #fff;
}

.booking-editor-topline {
  flex: 0 0 auto;
}

.editor-heading {
  position: sticky;
  z-index: 3;
  top: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 0 0 8px;
  background: #fff;
}

.editor-heading h3 {
  margin-top: 3px;
  font-size: 15px;
}

.editor-heading p {
  max-width: 780px;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
}

.editor-revision {
  padding: 4px 6px;
  border: 1px solid #d8e7f1;
  border-radius: 4px;
  font-size: 9px;
}

.booking-detail-ribbon {
  gap: 1px;
  margin: 8px 0 0;
  border-radius: 5px;
}

.booking-detail-ribbon > div {
  padding: 6px 8px;
}

.booking-detail-ribbon span {
  font-size: 8px;
}

.booking-detail-ribbon strong {
  margin-top: 2px;
  font-size: 10px;
}

.editor-form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: auto;
}

.editor-grid,
.booking-editor-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 8px;
  flex: 0 0 auto;
  padding: 8px 0 2px;
}

.editor-section-title {
  grid-column: 1 / -1;
  padding: 3px 0 2px;
  color: var(--blue);
  border-bottom: 1px solid #dfe9f1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.editor-field {
  gap: 3px;
}

.editor-field label {
  min-height: 12px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.2;
}

.editor-field input,
.editor-field select {
  height: var(--ctl-compact-control-height);
  min-height: var(--ctl-compact-control-height);
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 10px;
}

.editor-field textarea {
  min-height: 50px;
  height: 50px;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.25;
}

.editor-field input[type="checkbox"] {
  width: auto;
  height: 16px;
  min-height: 16px;
  margin: 7px 0;
  padding: 0;
}

.editor-actions {
  position: sticky;
  z-index: 4;
  bottom: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  padding: 7px 0 0;
  background: #fff;
  border-top: 1px solid var(--line);
}

.editor-safety-note {
  gap: 6px;
  font-size: 9px;
}

.editor-buttons {
  gap: 5px;
}

.editor-buttons .button {
  min-height: 29px;
  padding: 5px 9px;
}

.modal-dialog {
  border-radius: var(--ctl-compact-radius);
  box-shadow: 0 10px 28px rgba(13, 31, 49, 0.18);
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title menu" "tools tools";
    height: auto;
    min-height: 0;
  }

  .window-titlebar,
  .ctl-menubar {
    height: 42px;
  }

  .window-titlebar {
    min-height: 42px;
  }

  .ctl-menubar {
    padding: 0 8px 0 0;
    border-left: 0;
  }

  .quick-toolbar {
    height: 30px;
    min-height: 30px;
    padding: 0 10px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .menu-context {
    display: none;
  }

  .schedule-query-toolbar {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .booking-query-toolbar {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .query-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .editor-grid,
  .booking-editor-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main-content,
  .site-footer {
    width: min(100% - 20px, 720px);
  }

  .workspace-heading {
    align-items: flex-start;
  }

  .workspace-meta {
    min-width: 116px;
  }

  .workspace-tab {
    min-width: 138px;
  }

  .schedule-query-toolbar,
  .booking-query-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .editor-card {
    max-height: calc(100vh - 150px);
  }

  .editor-grid,
  .booking-editor-grid,
  .booking-detail-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-field.field-wide {
    grid-column: span 2;
  }
}

/* FINAL EDITOR CARD GROUPS */
body.workspace-active .module-panel.is-detail-mode > .editor-card {
  overflow: visible;
  padding: 14px;
  border: 1px solid #aebfca;
  border-radius: 14px;
  background: #f4f7f9;
  box-shadow: 0 8px 20px rgb(30 55 72 / 0.09);
}

body.workspace-active .module-panel.is-detail-mode .editor-heading,
body.workspace-active .module-panel.is-detail-mode .booking-editor-topline {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid #c6d4dc;
  background: transparent;
}

body.workspace-active .module-panel.is-detail-mode .booking-detail-ribbon {
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid #b9cad4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgb(29 56 73 / 0.05);
}

body.workspace-active .module-panel.is-detail-mode .editor-form,
body.workspace-active .module-panel.is-detail-mode .editor-grid,
body.workspace-active .module-panel.is-detail-mode .booking-editor-grid {
  overflow: visible;
  padding: 0;
  background: transparent;
}

body.workspace-active .module-panel.is-detail-mode .editor-grid,
body.workspace-active .module-panel.is-detail-mode .booking-editor-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.workspace-active .module-panel.is-detail-mode .editor-section-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 9px 10px;
  min-width: 0;
  margin: 0 !important;
  padding: 12px;
  overflow: visible;
  border: 1px solid #bacbd5 !important;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 9px rgb(30 57 74 / 0.06);
}

body.workspace-active .module-panel.is-detail-mode .editor-section-panel:nth-of-type(3n + 2) {
  border-color: #b9d0c8 !important;
  background: #f8fbfa;
}

body.workspace-active .module-panel.is-detail-mode .editor-section-panel:nth-of-type(3n) {
  border-color: #d2c9b5 !important;
  background: #fcfaf5;
}

body.workspace-active .module-panel.is-detail-mode .editor-section-heading {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  padding: 0 0 7px;
  color: #234f68;
  border-bottom: 1px solid #d4dfe5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

body.workspace-active .module-panel.is-detail-mode .editor-actions {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #bacbd5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 9px rgb(30 57 74 / 0.05);
}

@media (max-width: 1280px) {
  body.workspace-active .module-panel.is-detail-mode .editor-grid,
  body.workspace-active .module-panel.is-detail-mode .booking-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.workspace-active .module-panel.is-detail-mode .editor-section-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.workspace-active .module-panel.is-detail-mode .editor-section-panel {
    grid-template-columns: 1fr;
  }

  body.workspace-active .module-panel.is-detail-mode .editor-section-panel .field-wide {
    grid-column: 1;
  }
}

/* FINAL NATURAL FLOW AND COMPACT SEARCH CONSISTENCY */
body.workspace-active .workspace-view,
body.workspace-active .legacy-workspace-frame,
body.workspace-active .legacy-workspace-main {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.workspace-active .legacy-workspace-main {
  align-items: start;
}

body.workspace-active .module-panel,
body.workspace-active .module-panel.is-results-mode {
  align-self: start;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

body.workspace-active .module-panel > .table-card,
body.workspace-active .module-panel.is-results-mode > .table-card {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  border-radius: 14px !important;
}

body.workspace-active .module-panel .table-scroll,
body.has-result-table-mode.workspace-active .module-panel .table-scroll {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

body.workspace-active .module-panel .data-table,
body.workspace-active .module-panel.is-results-mode .data-table {
  width: max-content;
  min-width: 100%;
  height: auto !important;
  min-height: 0 !important;
  table-layout: fixed !important;
}

body.workspace-active #scheduleQueryForm .query-main,
body.workspace-active #bookingQueryForm .query-main,
body.workspace-active #hblQueryForm .query-main,
body.workspace-active #containerFileQueryForm .query-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 78px;
  grid-template-rows: 40px;
  gap: 8px;
}

body.workspace-active #scheduleQueryForm .query-main .search-box,
body.workspace-active #bookingQueryForm .query-main .search-box,
body.workspace-active #hblQueryForm .query-main .search-box,
body.workspace-active #containerFileQueryForm .query-main .search-box,
body.workspace-active #scheduleQueryForm .query-main input,
body.workspace-active #bookingQueryForm .query-main input,
body.workspace-active #hblQueryForm .query-main input,
body.workspace-active #containerFileQueryForm .query-main input {
  width: 100%;
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 14px !important;
}

body.workspace-active #scheduleQueryForm .query-main .button,
body.workspace-active #bookingQueryForm .query-main .button,
body.workspace-active #hblQueryForm .query-main .button,
body.workspace-active #containerFileQueryForm .query-main .button {
  width: 78px;
  min-width: 78px;
  height: 36px;
  min-height: 36px;
  align-self: center;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 12px;
}

body.workspace-active #scheduleQueryForm .query-main .query-clear-button,
body.workspace-active #bookingQueryForm .query-main .query-clear-button,
body.workspace-active #hblQueryForm .query-main .query-clear-button,
body.workspace-active #containerFileQueryForm .query-main .query-clear-button {
  display: inline-flex !important;
  color: #3e596d !important;
  border: 1px solid #b7cad5 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body.workspace-active .module-panel > .query-toolbar,
body.workspace-active #scheduleQueryForm {
  border-radius: 16px !important;
}

body.workspace-active .workspace-tab:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

body.workspace-active .workspace-tab:focus-visible {
  outline: 2px solid #5b91aa;
  outline-offset: 2px;
}

body.workspace-active #scheduleQueryForm .route-section-list,
body.workspace-active #bookingQueryForm .route-section-list,
body.workspace-active #hblQueryForm .route-section-list,
body.workspace-active #containerFileQueryForm .route-section-list {
  align-items: stretch;
  gap: 8px;
}

body.workspace-active #scheduleQueryForm .route-shortcut-section,
body.workspace-active #bookingQueryForm .route-shortcut-section,
body.workspace-active #hblQueryForm .route-shortcut-section,
body.workspace-active #containerFileQueryForm .route-shortcut-section {
  min-height: 68px !important;
  padding: 7px 10px !important;
  border-radius: 11px !important;
}

body.workspace-active #scheduleQueryForm .route-shortcut-section-heading,
body.workspace-active #bookingQueryForm .route-shortcut-section-heading,
body.workspace-active #hblQueryForm .route-shortcut-section-heading,
body.workspace-active #containerFileQueryForm .route-shortcut-section-heading {
  min-height: 0;
  margin: 0 0 2px;
}

body.workspace-active #scheduleQueryForm .route-pair-list,
body.workspace-active #bookingQueryForm .route-pair-list,
body.workspace-active #hblQueryForm .route-pair-list,
body.workspace-active #containerFileQueryForm .route-pair-list {
  min-height: 21px;
  gap: 4px;
}

body.workspace-active #scheduleQueryForm .route-pair-chip,
body.workspace-active #bookingQueryForm .route-pair-chip,
body.workspace-active #hblQueryForm .route-pair-chip,
body.workspace-active #containerFileQueryForm .route-pair-chip {
  min-height: 21px;
  padding: 0 8px;
  font-size: 9px;
}

@media (max-width: 760px) {
  body.workspace-active #scheduleQueryForm .query-main,
  body.workspace-active #bookingQueryForm .query-main,
  body.workspace-active #hblQueryForm .query-main,
  body.workspace-active #containerFileQueryForm .query-main {
    grid-template-columns: minmax(0, 1fr) 72px 72px;
  }

  body.workspace-active #scheduleQueryForm .query-main .button,
  body.workspace-active #bookingQueryForm .query-main .button,
  body.workspace-active #hblQueryForm .query-main .button,
  body.workspace-active #containerFileQueryForm .query-main .button {
    width: 72px;
    min-width: 72px;
    padding: 0 8px;
  }
}

@media (max-width: 640px) {
  .window-title-state,
  .build-stamp,
  .quick-context {
    display: none;
  }

  .header-tools {
    margin-left: auto;
  }

  .workspace-heading {
    flex-direction: column;
    gap: 6px;
  }

  .workspace-meta {
    width: 100%;
    text-align: left;
  }

  .schedule-query-toolbar,
  .booking-query-toolbar {
    grid-template-columns: 1fr;
  }

  .query-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .query-actions .button {
    flex: 1;
  }

  .editor-grid,
  .booking-editor-grid,
  .booking-detail-ribbon {
    grid-template-columns: 1fr;
  }

  .editor-field.field-wide {
    grid-column: auto;
  }

  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-buttons {
    width: 100%;
  }

  .editor-buttons .button {
    flex: 1;
  }

  .lookup-popup {
    position: fixed;
    inset: auto 10px 10px;
    width: auto;
    max-width: none;
    max-height: 48vh;
  }

  .lookup-grid-row {
    grid-template-columns: minmax(130px, 1fr) 86px;
  }

  .lookup-grid-row .lookup-cell:nth-child(n + 3) {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-header,
  .main-content,
  .site-footer {
    width: calc(100% - 20px);
  }

  .window-titlebar {
    padding: 0 10px;
  }

  .brand-name {
    max-width: 48vw;
    font-size: 12px;
  }

  .brand-subtitle {
    font-size: 8px;
  }

  .ctl-menu > summary {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .header-user {
    display: none;
  }

  .connection-badge {
    font-size: 0;
  }

  .connection-badge::before {
    width: 8px;
    height: 8px;
  }

  .login-view {
    grid-template-columns: minmax(0, 430px);
    padding: 18px 0 24px;
  }

  .login-card {
    padding: 16px 14px 14px;
  }

  .workspace-tabs {
    overflow-x: auto;
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-result-actions {
    width: 100%;
  }

  .schedule-result-actions .button {
    flex: 1;
  }
}

/* Keep the dense field matrix scrolling while the editor actions remain in view. */
.editor-form {
  overflow: hidden;
}

.editor-grid,
.booking-editor-grid {
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  overflow: auto;
  scrollbar-gutter: stable;
}

.editor-grid .lookup-popup,
.booking-editor-grid .lookup-popup {
  max-height: min(200px, calc(100vh - 180px));
}

/* v0.6 MODERN WORKSPACE OVERRIDE
   Append-only visual layer for the B2B logistics operations desk. Existing
   selectors, hidden states, and interaction hooks stay intact. */
:root {
  --ink: #132238;
  --ink-soft: #526174;
  --muted: #718096;
  --line: #d8e1eb;
  --line-strong: #c4d0de;
  --surface: #fffdf9;
  --surface-soft: #f4f7fa;
  --surface-blue: #eff6ff;
  --navy: #0b1525;
  --navy-deep: #0b1525;
  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --teal: #0f9f92;
  --teal-soft: #def7f2;
  --amber: #b7791f;
  --red: #c2414f;
  --ctl-v06-nav-width: 210px;
  --ctl-v06-radius: 14px;
  --ctl-v06-shadow: 0 12px 32px rgba(11, 21, 37, 0.08);
}

html {
  min-width: 320px;
  overflow-x: hidden;
  background: #eef2f6;
}

body {
  min-width: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #eef2f6;
  font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  width: 100%;
  height: 64px;
  min-height: 64px;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0 24px;
  overflow: visible;
  color: #e8f0f8;
  background: #0b1525;
  border: 0;
  border-radius: 0;
  box-shadow: 0 8px 22px rgba(11, 21, 37, 0.18);
}

.window-titlebar,
.ctl-menubar,
.quick-toolbar {
  height: 64px;
  min-height: 64px;
  background: transparent;
  border: 0;
}

.window-titlebar {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  gap: 16px;
  padding: 0;
}

.brand {
  min-width: 0;
  gap: 10px;
  color: #f8fafc;
}

.brand-mark {
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #0f9f92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.brand-copy {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.brand-name {
  max-width: min(33vw, 360px);
  overflow: hidden;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  margin: 0;
  color: #91a4bc;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.window-title-state {
  display: inline-flex;
  align-items: center;
  padding-left: 16px;
  color: #a9bad0;
  border-left: 1px solid rgba(173, 194, 218, 0.24);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ctl-menubar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 16px;
  border-left: 1px solid rgba(173, 194, 218, 0.18);
}

.ctl-menu > summary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #edf4fb;
  background: #172942;
  border: 1px solid #2d4664;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}

.ctl-menu > summary::after {
  color: #9db5d0;
}

.ctl-menu[open] > summary,
.ctl-menu > summary:hover {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.ctl-dropdown {
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 230px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 18px 45px rgba(11, 21, 37, 0.2);
}

.legacy-menu-item {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
}

.legacy-menu-item:hover,
.legacy-menu-item:focus-visible,
.legacy-menu-item.is-selected:hover {
  color: var(--blue);
  background: var(--surface-blue);
}

.quick-toolbar {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 14px;
  padding: 0 0 0 16px;
  border-left: 1px solid rgba(173, 194, 218, 0.18);
}

.quick-context {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: #a9bad0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-user {
  gap: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(173, 194, 218, 0.24);
}

.header-user-name,
.header-user-role,
.build-stamp,
.connection-badge {
  color: #cbd8e7;
  font-size: 11px;
}

.header-user-role,
.build-stamp {
  color: #91a4bc;
}

.connection-badge.is-active {
  color: #4fd1c5;
}

.connection-badge.is-pending {
  color: #f2c66d;
}

.connection-badge.is-error {
  color: #f28c98;
}

.site-header .button-quiet {
  color: #d5e2ef;
  background: transparent;
  border-color: transparent;
}

.site-header .button-quiet:hover:not(:disabled) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.main-content,
.site-footer {
  width: min(1520px, calc(100% - 40px));
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(320px, 460px);
  min-height: calc(100vh - 64px);
  align-items: start;
  justify-content: center;
  padding: 64px 0 48px;
  background: transparent;
}

.login-intro {
  display: none;
}

.login-card {
  width: 100%;
  margin: 0;
  padding: 28px 30px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--ctl-v06-radius);
  box-shadow: var(--ctl-v06-shadow);
}

.login-card h2 {
  margin: 8px 0 0;
  color: var(--navy-deep);
  font-size: 22px;
}

.login-card .card-lead {
  margin: 7px 0 20px;
  font-size: 13px;
}

.login-card .stack-form {
  gap: 14px;
}

.field-group {
  gap: 6px;
}

.field-group label,
.editor-field label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.field-group input,
.field-group select,
.field-group textarea,
.editor-field input,
.editor-field select,
.editor-field textarea {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: none;
  font-size: 13px;
}

.field-group textarea,
.editor-field textarea {
  min-height: 78px;
  line-height: 1.4;
  resize: vertical;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus,
.editor-field input:focus,
.editor-field select:focus,
.editor-field textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.field-group input:disabled,
.field-group select:disabled,
.field-group textarea:disabled,
.editor-field input:disabled,
.editor-field select:disabled,
.editor-field textarea:disabled {
  color: var(--muted);
  background: var(--surface-soft);
}

.button,
.legacy-button,
.icon-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 750;
}

.button:hover:not(:disabled),
.legacy-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  color: var(--ink);
  background: #f7faff;
  border-color: #9bb4d0;
  box-shadow: 0 4px 12px rgba(11, 21, 37, 0.08);
  transform: none;
}

.button-small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.button-primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.button-secondary {
  color: #087f75;
  background: #effbf8;
  border-color: #a9ded7;
}

.button-secondary:hover:not(:disabled) {
  color: #05635c;
  background: var(--teal-soft);
  border-color: #78c8be;
}

.button-danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.button-legacy-action {
  color: var(--blue);
  background: var(--surface-blue);
  border-color: #c5dcf5;
}

.workspace-view {
  display: flex;
  min-height: calc(100vh - 64px);
  flex-direction: column;
  padding: 18px 0 20px;
  overflow: hidden;
}

.workspace-heading {
  flex: 0 0 auto;
  align-items: center;
  gap: 20px;
  margin: 0 0 12px;
  padding: 0 2px;
}

.workspace-heading h1 {
  margin: 0;
  color: var(--navy-deep);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.workspace-lead {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.workspace-meta {
  min-width: 190px;
  padding: 8px 12px;
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: right;
}

.meta-label {
  color: var(--muted);
  font-size: 10px;
}

.meta-value {
  margin-top: 2px;
  color: var(--amber);
  font-size: 13px;
}

.meta-hint {
  color: var(--muted);
  font-size: 11px;
}

.status-strip {
  flex: 0 0 auto;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  padding: 7px 11px;
  color: var(--ink-soft);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
}

.status-detail {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.global-error {
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12px;
}

.legacy-workspace-frame {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--ctl-v06-radius);
  box-shadow: var(--ctl-v06-shadow);
}

.legacy-workspace-main {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: var(--ctl-v06-nav-width) minmax(0, 1fr);
}

.workspace-tabs {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 16px 10px 12px;
  overflow: hidden;
  background: #0b1525;
  border: 0;
}

.workspace-nav-heading {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  margin: 0 4px 8px;
  padding: 0 6px 15px;
  border-bottom: 1px solid rgba(173, 194, 218, 0.18);
}

.workspace-nav-kicker {
  color: #60a5fa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.workspace-nav-heading strong {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
}

.workspace-nav-heading small {
  color: #91a4bc;
  font-size: 11px;
}

.workspace-tab {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 11px;
  color: #9fb1c7;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
}

.workspace-tab:hover {
  color: #e8f0f8;
  background: rgba(255, 255, 255, 0.07);
}

.workspace-tab.is-active {
  color: #fff;
  background: #1b3555;
  border-color: #2c557f;
  box-shadow: inset 3px 0 0 #2563eb, 0 6px 16px rgba(0, 0, 0, 0.12);
}

.tab-index {
  color: #6f89a7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.workspace-tab.is-active .tab-index {
  color: #93c5fd;
}

.tab-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.tab-copy strong {
  overflow: hidden;
  color: currentColor;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-copy small {
  overflow: hidden;
  color: #91a4bc;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-count {
  min-width: 24px;
  margin-left: auto;
  padding: 4px 7px;
  color: #c7d6e7;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.workspace-tab.is-active .tab-count {
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.42);
}

.workspace-tab-spacer {
  display: block;
  min-height: 12px;
  flex: 1 1 auto;
}

.workspace-nav-status {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 7px;
  margin: 8px 4px 0;
  padding: 13px 6px 2px;
  color: #91a4bc;
  border-top: 1px solid rgba(173, 194, 218, 0.18);
  font-size: 11px;
}

.workspace-nav-status > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8fe0d5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.workspace-nav-status > strong {
  color: #dbe7f3;
  font-size: 11px;
  font-weight: 700;
}

.workspace-nav-status .status-dot {
  width: 7px;
  height: 7px;
  background: #4fd1c5;
  box-shadow: 0 0 0 4px rgba(79, 209, 197, 0.12);
}

.module-panel {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(370px, 0.8fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px 16px;
  padding: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 0;
}

.module-panel > .module-header {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.module-label {
  gap: 7px;
  color: #087f75;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.module-header h2 {
  margin: 4px 0 0;
  color: var(--navy-deep);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.module-header p {
  max-width: 760px;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revision-chip {
  flex: 0 0 auto;
  gap: 7px;
  padding: 6px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
}

.revision-chip strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.module-panel > .query-toolbar {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 11px;
  background: #eef6ff;
  border: 1px solid #d4e5f7;
  border-radius: 12px;
}

.schedule-query-toolbar {
  grid-template-columns: minmax(140px, 1.35fr) repeat(2, minmax(100px, 1fr)) minmax(120px, 1fr) 76px auto;
}

.booking-query-toolbar {
  grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.35fr) 76px auto;
}

.query-field,
.query-toolbar .field-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.query-toolbar .field-group label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.query-cell-wide {
  grid-column: auto;
}

.query-toolbar input,
.query-toolbar select,
.query-toolbar .field-group input,
.query-toolbar .field-group select {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 12px;
}

.legacy-lookup-field {
  position: relative;
  width: 100%;
  min-width: 0;
}

.query-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.query-actions .button {
  min-height: 36px;
}

.query-actions .button-primary {
  min-width: 86px;
}

.module-panel > .table-card {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.module-panel > .editor-card {
  grid-column: 2;
  grid-row: 2 / 4;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
}

.module-panel:not(:has(> .editor-card:not([hidden]))) > .query-toolbar,
.module-panel:not(:has(> .editor-card:not([hidden]))) > .table-card {
  grid-column: 1 / -1;
}

.table-card,
.editor-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(11, 21, 37, 0.05);
}

.table-card {
  display: flex;
  flex-direction: column;
}

.table-toolbar {
  min-height: 50px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 8px 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.table-toolbar-title,
.schedule-result-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.table-toolbar strong {
  color: var(--ink);
  font-size: 13px;
}

.table-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-scroll {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: none;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-gutter: stable;
}

.data-table {
  min-width: 1040px;
  font-size: 12px;
}

.booking-table {
  min-width: 1320px;
}

.data-table th,
.data-table td {
  height: 42px;
  padding: 9px 11px;
  border-right: 0;
  border-bottom: 1px solid #e7edf3;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: #65758a;
  background: #f6f8fb;
  box-shadow: 0 1px 0 var(--line-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--ink-soft);
  font-size: 12px;
}

.data-table tbody tr {
  background: var(--surface);
  transition: background 120ms ease;
}

.data-table tbody tr:nth-child(even) {
  background: #fcfdfd;
}

.data-table tbody tr:hover,
.data-table tbody tr.is-selected {
  background: #eff6ff;
}

.data-table tbody tr.is-selected {
  box-shadow: inset 3px 0 0 var(--blue);
}

.data-table tbody tr.is-selected td {
  color: var(--ink);
}

.data-table .select-column {
  width: 84px;
  min-width: 84px;
  position: sticky;
  z-index: 3;
  left: 0;
  background: var(--surface);
  border-right: 1px solid #e0e8f0;
}

.data-table th.select-column {
  z-index: 4;
  background: #f6f8fb;
}

.data-table tbody tr:hover .select-column,
.data-table tbody tr.is-selected .select-column {
  background: #eff6ff;
}

.row-select-button {
  min-width: 58px;
  min-height: 34px;
  padding: 7px 8px;
  color: var(--blue);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.row-select-button:hover {
  background: var(--surface-blue);
  border-color: #c5dcf5;
}

.data-table tbody tr.is-selected .row-select-button {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.empty-state,
.loading-state {
  min-height: 140px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-state span {
  font-size: 12px;
}

.lookup-popup {
  top: calc(100% + 7px);
  width: min(760px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(360px, calc(100vh - 120px));
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 18px 42px rgba(11, 21, 37, 0.2);
}

.lookup-option {
  min-height: 36px;
  padding: 7px 9px;
  color: var(--ink-soft);
  border-radius: 7px;
  font-size: 12px;
}

.lookup-option:hover,
.lookup-option.is-active {
  color: var(--blue);
  background: var(--surface-blue);
}

.editor-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.booking-editor-topline {
  flex: 0 0 auto;
}

.editor-heading {
  position: sticky;
  z-index: 5;
  top: 0;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.editor-heading h3 {
  margin: 4px 0 0;
  color: var(--navy-deep);
  font-size: 17px;
  font-weight: 800;
}

.editor-heading p {
  max-width: 520px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

.editor-revision {
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--blue);
  background: #eef5ff;
  border: 1px solid #d2e3f9;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}

.booking-detail-ribbon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  flex: 0 0 auto;
  margin: 14px 0 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.booking-detail-ribbon > div {
  min-width: 0;
  padding: 10px 11px;
  background: var(--surface-soft);
}

.booking-detail-ribbon span,
.booking-detail-ribbon strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-detail-ribbon span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.booking-detail-ribbon strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
}

.editor-form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

.editor-grid,
.booking-editor-grid {
  display: grid !important;
  min-width: 0;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1 1 auto;
  align-content: start;
  gap: 12px;
  padding: 14px 2px 10px 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.editor-field.field-wide {
  grid-column: span 2;
}

.editor-field {
  min-width: 0;
  gap: 5px;
}

.editor-field label {
  min-height: 16px;
  line-height: 1.25;
}

.editor-field input,
.editor-field select {
  width: 100%;
  height: 36px;
  min-height: 36px;
}

.editor-field textarea {
  min-height: 78px;
}

.editor-field.field-delayReason textarea,
#scheduleEditorFields .field-delayReason textarea {
  min-height: 96px;
}

.editor-field.is-readonly input,
.editor-field.is-readonly select,
.editor-field.is-readonly textarea {
  color: #667589;
  background: #f0f3f6;
  border-color: #d1dae4;
}

.editor-actions {
  position: sticky;
  z-index: 6;
  bottom: 0;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.editor-safety-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.editor-buttons {
  display: flex;
  gap: 8px;
}

.editor-buttons .button {
  min-height: 36px;
}

.site-footer {
  display: none;
}

.modal-dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 25px 70px rgba(11, 21, 37, 0.24);
}

@media (min-width: 1280px) {
  .legacy-workspace-main {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .module-panel {
    grid-template-columns: minmax(0, 1.35fr) minmax(390px, 0.8fr);
  }
}

@media (max-width: 1099px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title menu" "tools tools";
    height: auto;
    min-height: 64px;
    padding: 0 14px;
  }

  .window-titlebar,
  .ctl-menubar {
    height: 64px;
    min-height: 64px;
  }

  .window-titlebar {
    grid-area: title;
  }

  .ctl-menubar {
    grid-area: menu;
    padding: 0 0 0 12px;
    border-left: 1px solid rgba(173, 194, 218, 0.18);
  }

  .quick-toolbar {
    grid-area: tools;
    height: 42px;
    min-height: 42px;
    padding: 0 0 0 4px;
    border-top: 1px solid rgba(173, 194, 218, 0.18);
    border-left: 0;
  }

  .workspace-view {
    min-height: 0;
    padding: 16px 0 24px;
    overflow: visible;
  }

  .legacy-workspace-frame {
    overflow: visible;
  }

  .legacy-workspace-main {
    display: block;
    height: auto;
  }

  .workspace-tabs {
    display: grid;
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    overflow: visible;
    padding: 12px;
    border-radius: var(--ctl-v06-radius) var(--ctl-v06-radius) 0 0;
  }

  .workspace-nav-heading,
  .workspace-nav-status {
    grid-column: 1 / -1;
  }

  .workspace-nav-heading {
    margin: 0 4px 2px;
  }

  .workspace-tab {
    min-height: 52px;
  }

  .workspace-tab-spacer {
    display: none;
  }

  .workspace-nav-status {
    margin-top: 2px;
  }

  .module-panel {
    display: flex;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    overflow: visible;
    border-top: 1px solid var(--line);
  }

  .module-panel > .module-header,
  .module-panel > .query-toolbar,
  .module-panel > .table-card,
  .module-panel > .editor-card {
    width: 100%;
    flex: 0 0 auto;
    grid-column: auto;
    grid-row: auto;
  }

  .module-panel > .table-card {
    height: clamp(320px, 48vh, 520px);
  }

  .module-panel > .editor-card {
    height: clamp(520px, 72vh, 760px);
    margin-top: 0;
  }

  .table-scroll {
    height: auto;
    max-height: none;
  }

  .editor-grid,
  .booking-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-field.field-wide {
    grid-column: auto;
  }
}

/* v0.6.4 schedule form: a purpose-built business form instead of a raw column
   dump. Route settings stay together, operational flags use tactile switches,
   and the six requested dates receive enough width to scan comfortably. */
.schedule-editor-grid .editor-section-title {
  margin-top: 8px;
  padding: 12px 0 7px;
  color: #075f9d;
  border-bottom: 1px solid #d8e5ef;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.schedule-editor-grid .editor-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
}

.schedule-editor-grid .field-switch {
  display: grid;
  min-height: 62px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: #f7fafc;
  border: 1px solid #d8e3ec;
  border-radius: 10px;
}

.schedule-editor-grid .editor-switch-group {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.schedule-editor-grid .field-switch label {
  min-height: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.schedule-editor-grid .field-switch input[type="checkbox"] {
  appearance: none;
  width: 44px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  background-color: #b9c6d2;
  background-image: radial-gradient(circle at 11px 50%, #fff 0 8px, transparent 9px);
  border: 1px solid #a8b6c4;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(14, 37, 59, 0.12);
  transition: background-color 140ms ease, background-position 140ms ease, border-color 140ms ease;
}

.schedule-editor-grid .field-switch input[type="checkbox"]:checked {
  background-color: #087fb5;
  background-image: radial-gradient(circle at 31px 50%, #fff 0 8px, transparent 9px);
  border-color: #0873a6;
}

.schedule-editor-grid .field-switch input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(31, 113, 229, 0.2);
  outline-offset: 2px;
}

.schedule-editor-grid .field-switch input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.schedule-editor-grid .field-etd input,
.schedule-editor-grid .field-eta input,
.schedule-editor-grid .field-onBoard input {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1100px) {
  .module-panel.is-detail-mode .schedule-editor-grid .field-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .schedule-editor-grid .editor-switch-group {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-editor-grid .field-switch {
    min-height: 56px;
  }
}

@media (min-width: 1100px) {
  .legacy-workspace-frame {
    display: flex;
    height: calc(100vh - 230px);
    min-height: 560px;
    flex: 0 0 auto;
  }

  .legacy-workspace-main {
    height: 100%;
    flex: 1 1 auto;
  }

  .module-panel > .editor-card {
    max-height: none;
  }
}

/* v0.6.3 drill-in detail workspace: selecting a record opens a dedicated
   full-size business page, mirroring CTL's separate record-tab behavior. */
.module-panel.is-detail-mode > .module-header,
.module-panel.is-detail-mode > .query-toolbar,
.module-panel.is-detail-mode > .table-card {
  display: none !important;
}

.module-panel.is-detail-mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.module-panel.is-detail-mode > .editor-card {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 18px 20px;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.editor-heading-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.module-panel.is-detail-mode .editor-heading {
  padding-bottom: 14px;
}

.module-panel.is-detail-mode .editor-grid,
.module-panel.is-detail-mode .booking-editor-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 16px 4px 14px 0;
}

.module-panel.is-detail-mode .editor-field.field-wide {
  grid-column: span 2;
}

.module-panel.is-detail-mode .booking-detail-ribbon {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1099px) {
  .module-panel.is-detail-mode > .editor-card {
    height: clamp(620px, 82vh, 900px);
    padding: 16px;
  }

  .module-panel.is-detail-mode .editor-grid,
  .module-panel.is-detail-mode .booking-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-panel.is-detail-mode .booking-detail-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .module-panel.is-detail-mode .editor-grid,
  .module-panel.is-detail-mode .booking-editor-grid,
  .module-panel.is-detail-mode .booking-detail-ribbon {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-panel.is-detail-mode .editor-field.field-wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0 10px;
  }

  .brand-name {
    max-width: 45vw;
    font-size: 13px;
  }

  .window-title-state,
  .menu-context,
  .quick-context,
  .build-stamp {
    display: none;
  }

  .header-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .header-user {
    display: none;
  }

  .workspace-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .workspace-meta {
    width: 100%;
    text-align: left;
  }

  .workspace-tabs {
    grid-template-columns: 1fr;
  }

  .workspace-nav-heading,
  .workspace-nav-status {
    grid-column: auto;
  }

  .module-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .module-header p {
    white-space: normal;
  }

  .revision-chip {
    align-self: flex-start;
  }

  .query-toolbar,
  .schedule-query-toolbar,
  .booking-query-toolbar {
    grid-template-columns: 1fr;
  }

  .query-actions {
    justify-content: stretch;
  }

  .query-actions .button {
    flex: 1 1 0;
  }

  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-result-actions {
    width: 100%;
  }

  .schedule-result-actions .button {
    flex: 1 1 0;
  }

  .editor-heading {
    flex-direction: column;
    gap: 8px;
  }

  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-buttons {
    width: 100%;
  }

  .editor-buttons .button {
    flex: 1 1 0;
  }

  .booking-detail-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .main-content,
  .site-footer {
    width: calc(100% - 20px);
  }

  .site-header {
    padding: 0 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-name {
    max-width: 48vw;
    font-size: 12px;
  }

  .ctl-menubar {
    padding-left: 6px;
  }

  .ctl-menu > summary {
    min-height: 34px;
    padding: 7px 9px;
  }

  .module-panel {
    padding: 12px;
  }

  .booking-detail-ribbon {
    grid-template-columns: 1fr;
  }
}

/* v0.6 HBL module extension: the shared module grid handles the panel; these
   selectors only tune the HBL-specific query density and AES signal. */
.booking-confirmation-workspace {
  display: flex;
  min-height: clamp(560px, 72vh, 860px);
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
}

.booking-edocs-workspace {
  display: flex;
  min-height: clamp(560px, 72vh, 860px);
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
}

.booking-edocs-workspace[hidden] {
  display: none;
}

.booking-edocs-inline {
  width: 100%;
  min-height: 0;
  flex: 0 0 auto;
  padding: 12px;
  background: #f6f9fa;
  border: 1px solid #c5d5dc;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgb(34 60 75 / 0.05);
}

.booking-edocs-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid #d7e2e7;
}

.booking-edocs-inline-header h4 {
  margin: 0;
  color: #31586d;
  font-size: 13px;
  font-weight: 800;
}

.booking-edocs-inline-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.booking-edocs-inline .edocs-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.75fr);
  gap: 12px;
  padding-top: 0;
}

.booking-edocs-inline .edocs-table-scroll {
  min-height: 180px;
  max-height: 340px;
}

.booking-edocs-inline .edocs-preview-card {
  padding: 16px;
}

.booking-edocs-inline .edocs-preview-card iframe {
  min-height: 250px;
}

@media (max-width: 820px) {
  .booking-edocs-inline-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .booking-edocs-inline .edocs-layout {
    grid-template-columns: 1fr;
  }
}

.booking-confirmation-workspace[hidden] {
  display: none;
}

#bookingsPanel.is-confirmation-mode > .module-header,
#bookingsPanel.is-confirmation-mode > .query-toolbar,
#bookingsPanel.is-confirmation-mode > .table-card,
#bookingsPanel.is-confirmation-mode > .editor-card {
  display: none !important;
}

.edocs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 20px;
  min-height: 0;
  flex: 1 1 auto;
  padding-top: 20px;
}

.edocs-list-card,
.edocs-preview-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.edocs-list-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.edocs-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.edocs-table-scroll {
  min-height: 360px;
  flex: 1 1 auto;
}

.edocs-table {
  min-width: 960px;
}

.edocs-preview-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24px;
  text-align: center;
}

.edoc-file-badge {
  display: grid;
  width: 64px;
  height: 76px;
  place-items: center;
  margin-bottom: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), #0f9f92);
  border-radius: 8px 8px 8px 2px;
  box-shadow: 0 8px 20px rgba(26, 104, 183, 0.2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.edocs-preview-card > strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.edocs-preview-card > span,
.edocs-preview-card > p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.edocs-preview-card iframe {
  width: 100%;
  min-height: 430px;
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-grid {
  display: flex !important;
  min-height: 0;
  flex-direction: column;
  gap: 0 !important;
}

.editor-section-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  overflow-x: auto;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.editor-section-tab {
  min-height: 34px;
  padding: 7px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.editor-section-tab:hover {
  color: var(--ink);
  background: #fff;
}

.editor-section-tab[aria-selected="true"] {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 4px 12px rgba(26, 104, 183, 0.22);
}

.editor-section-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 14px 16px;
  min-height: 0;
  padding: 4px 2px 12px;
}

.editor-section-panel[hidden] {
  display: none;
}

.editor-section-panel > input[type="hidden"] {
  display: none;
}

.editor-section-panel .field-wide {
  grid-column: span 2;
}

.editor-section-panel .editor-switch-group {
  grid-column: 1 / -1;
}

#bookingsPanel.is-detail-mode > .editor-card,
#hblPanel.is-detail-mode > .editor-card {
  height: clamp(560px, 72vh, 820px);
}

#bookingsPanel.is-detail-mode .editor-section-panel,
#hblPanel.is-detail-mode .editor-section-panel {
  overflow: auto;
}

#bookingsPanel.is-detail-mode .field-notes textarea,
#hblPanel.is-detail-mode .field-shipper textarea,
#hblPanel.is-detail-mode .field-consignee textarea,
#hblPanel.is-detail-mode .field-notify textarea,
#hblPanel.is-detail-mode .field-marks textarea,
#hblPanel.is-detail-mode .field-goods textarea {
  min-height: 150px;
}

.confirmation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.confirmation-header h3 {
  margin: 6px 0 4px;
  font-size: 22px;
}

.confirmation-header p {
  margin: 0;
  color: var(--muted);
}

.confirmation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 20px;
  min-height: 0;
  flex: 1 1 auto;
  padding-top: 20px;
}

.confirmation-message-card,
.confirmation-attachment-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.confirmation-message-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 20px;
}

.confirmation-envelope {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.confirmation-envelope > div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
}

.confirmation-envelope dt,
.confirmation-body-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirmation-envelope dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.confirmation-body-label {
  margin: 20px 0 9px;
}

.confirmation-body {
  min-height: 320px;
  flex: 1 1 auto;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: 13px/1.7 "Segoe UI", Arial, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.confirmation-attachment-card {
  display: flex;
  align-items: center;
  align-self: start;
  flex-direction: column;
  padding: 28px 22px;
  text-align: center;
}

.pdf-badge {
  display: grid;
  width: 64px;
  height: 76px;
  place-items: center;
  margin-bottom: 18px;
  color: #fff;
  background: #d63b32;
  border-radius: 8px 8px 8px 2px;
  box-shadow: 0 8px 20px rgba(214, 59, 50, 0.2);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.confirmation-attachment-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.confirmation-attachment-card span,
.confirmation-attachment-card p {
  color: var(--muted);
  font-size: 12px;
}

.confirmation-attachment-card p {
  margin: 18px 0;
  line-height: 1.6;
}

.confirmation-attachment-card .button {
  width: 100%;
}

.data-table th[data-column-key] {
  position: sticky;
  padding-right: 24px;
  cursor: grab;
  user-select: none;
}

.data-table th[data-column-key]::after {
  position: absolute;
  right: 8px;
  color: var(--muted);
  content: "↕";
  font-size: 10px;
}

.data-table th[data-sort-direction="asc"]::after {
  color: var(--blue);
  content: "↑";
}

.data-table th[data-sort-direction="desc"]::after {
  color: var(--blue);
  content: "↓";
}

.data-table th.is-column-dragging {
  opacity: 0.45;
}

.data-table th.is-column-drop-target {
  box-shadow: inset 3px 0 0 var(--blue);
}

@media (max-width: 820px) {
  .confirmation-header {
    flex-direction: column;
  }

  .confirmation-layout {
    grid-template-columns: 1fr;
  }

  .edocs-layout {
    grid-template-columns: 1fr;
  }

  .editor-section-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .confirmation-attachment-card {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .editor-section-panel {
    grid-template-columns: 1fr;
  }

  .editor-section-panel .field-wide {
    grid-column: auto;
  }
}

/* Result-grid interaction and narrow-screen presentation. Column widths use
   fixed table layout on desktop so <col> updates visibly resize the selected
   column. Narrow screens switch rows to labelled cards and avoid an internal
   horizontal scroller. */
.data-table {
  table-layout: fixed;
}

@media (max-width: 640px) {
  .site-header {
    display: grid !important;
    height: auto !important;
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title menu"
      "tools tools";
    align-items: center;
    padding: 6px 10px 8px !important;
  }

  .window-titlebar {
    grid-area: title;
  }

  .ctl-menubar {
    grid-area: menu;
  }

  .quick-toolbar {
    grid-area: tools;
    width: 100%;
    padding: 6px 0 0 !important;
    border-top: 1px solid rgba(173, 194, 218, 0.18);
    border-left: 0;
  }

  .window-titlebar,
  .ctl-menubar {
    height: 48px !important;
    min-height: 48px !important;
  }

  .quick-toolbar {
    height: auto !important;
    min-height: 38px !important;
  }

  .brand-name {
    max-width: calc(100vw - 190px);
  }

  .header-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px 8px;
  }

  .connection-badge {
    margin-right: auto;
  }

  .site-header .button-small {
    min-height: 28px;
    padding: 3px 6px;
  }

  .workspace-tabs {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 0.72fr);
    gap: 5px;
    padding: 9px;
  }

  .workspace-nav-heading,
  .workspace-nav-status {
    grid-column: 1 / -1;
  }

  .workspace-nav-heading {
    margin-bottom: 2px;
  }

  .workspace-tab {
    min-height: 42px;
    padding: 7px 8px;
  }

  .workspace-tab .tab-copy small,
  .workspace-tab .tab-count {
    display: none;
  }

  .workspace-nav-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    padding-top: 8px;
  }

  .module-panel > .table-card {
    height: auto;
    min-height: 0;
  }

  .table-scroll {
    overflow: visible !important;
    scrollbar-gutter: auto;
  }

  .data-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .data-table colgroup,
  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .data-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--ctl-compact-radius);
    box-shadow: 0 1px 2px rgba(11, 21, 37, 0.05);
  }

  .data-table tbody td,
  .data-table .select-column {
    position: static;
    display: grid;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 36px;
    grid-template-columns: minmax(68px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    overflow: visible;
    border-right: 0;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .data-table tbody td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .data-table .select-column {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    background: var(--surface-blue);
    border-bottom: 1px solid var(--line);
  }

  .data-table .select-column::before {
    display: none;
  }

  .data-table .row-select-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-subtitle {
    display: none;
  }

  .brand-name {
    max-width: calc(100vw - 172px);
  }

  .header-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .connection-badge {
    grid-column: 1 / -1;
  }

  .data-table tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* User-adjustable result columns.  The handle is a real button so keyboard
   users can focus it and use the arrow keys without triggering column sort. */
.table-column-resizer {
  position: absolute;
  z-index: 5;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 10px;
  min-height: 25px;
  padding: 0;
  color: transparent;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: col-resize;
  touch-action: none;
}

.table-column-resizer:hover,
.table-column-resizer:focus-visible,
.table-column-resizer.is-resizing {
  background: rgba(45, 115, 185, 0.2);
  outline: none;
}

.data-table td.cell-flag-full {
  color: #c62828 !important;
  font-weight: 750;
}

.data-table th[data-column-key]::after {
  right: 14px;
}

/* Operator lookup mirrors the native CTL ellipsis chooser while keeping the
   inline prefix suggestions available for quick keyboard entry. */
.lookup-input-row {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 6px;
}

.lookup-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.lookup-more-button {
  flex: 0 0 34px;
  min-width: 34px;
  height: var(--ctl-compact-control-height);
  padding: 3px 5px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--ctl-compact-radius);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.lookup-more-button:hover,
.lookup-more-button:focus-visible {
  color: var(--blue);
  border-color: var(--blue);
}

.lookup-more-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.operator-picker-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
}

.operator-picker-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 16px 25px 8px;
}

.operator-picker-search label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.operator-picker-search input {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--ctl-compact-radius);
}

.operator-picker-status {
  min-height: 20px;
  margin: 0 25px 4px;
  color: var(--muted);
  font-size: 11px;
}

.operator-picker-results {
  max-height: min(380px, calc(100vh - 250px));
  overflow: auto;
  padding: 3px 17px;
}

.operator-picker-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.operator-picker-option .lookup-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-picker-option .lookup-secondary {
  flex: 0 0 auto;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .operator-picker-search {
    grid-template-columns: 1fr;
    padding-right: 17px;
    padding-left: 17px;
  }

  .operator-picker-status {
    margin-right: 17px;
    margin-left: 17px;
  }

  .operator-picker-results {
    padding-right: 9px;
    padding-left: 9px;
  }
}

.hbl-query-toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.25fr) minmax(0, 1fr) 76px auto;
}

.hbl-detail-ribbon .hbl-ribbon-aes {
  background: #e6fffa;
  box-shadow: inset 3px 0 0 #0f9f92;
}

.hbl-detail-ribbon .hbl-ribbon-aes span {
  color: #087f75;
}

.hbl-detail-ribbon .hbl-ribbon-aes strong {
  color: #075e57;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* v0.6.2 selected-record layout: keep the result grid full width and open the
   editor as a coordinated bottom workbench instead of compressing both panes. */
@media (min-width: 1100px) {
  .module-panel:has(> .editor-card:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(240px, 0.9fr) minmax(300px, 1.1fr);
    gap: 10px;
  }

  .module-panel:has(> .editor-card:not([hidden])) > .query-toolbar,
  .module-panel:has(> .editor-card:not([hidden])) > .table-card,
  .module-panel:has(> .editor-card:not([hidden])) > .editor-card {
    grid-column: 1 / -1;
    width: 100%;
  }

  .module-panel:has(> .editor-card:not([hidden])) > .query-toolbar {
    grid-row: 2;
  }

  .module-panel:has(> .editor-card:not([hidden])) > .table-card {
    grid-row: 3;
  }

  .module-panel:has(> .editor-card:not([hidden])) > .editor-card {
    grid-row: 4;
    height: 100%;
    padding: 12px 14px;
  }

  .module-panel:has(> .editor-card:not([hidden])) .editor-heading {
    padding-bottom: 8px;
  }

  .module-panel:has(> .editor-card:not([hidden])) .editor-heading p {
    max-width: 900px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .module-panel:has(> .editor-card:not([hidden])) .booking-detail-ribbon {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
  }

  .module-panel:has(> .editor-card:not([hidden])) .editor-grid,
  .module-panel:has(> .editor-card:not([hidden])) .booking-editor-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
    padding-top: 10px;
  }

  .module-panel:has(> .editor-card:not([hidden])) .editor-field.field-wide {
    grid-column: span 2;
  }

  .module-panel:has(> .editor-card:not([hidden])) .editor-actions {
    padding-top: 9px;
  }
}

@media (max-width: 1199px) and (min-width: 1100px) {
  .hbl-query-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 1fr 1fr 70px;
  }

  .hbl-query-toolbar .query-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* Final desktop precedence for the drill-in page. These selectors intentionally
   outrank the previous selected-workbench experiment above. */
@media (min-width: 1100px) {
  .module-panel.is-detail-mode:has(> .editor-card:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  .module-panel.is-detail-mode:has(> .editor-card:not([hidden])) > .editor-card {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 100%;
    padding: 18px 20px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .module-panel.is-detail-mode:has(> .editor-card:not([hidden])) .editor-heading {
    padding-bottom: 14px;
  }

  .module-panel.is-detail-mode:has(> .editor-card:not([hidden])) .editor-grid,
  .module-panel.is-detail-mode:has(> .editor-card:not([hidden])) .booking-editor-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 16px 4px 14px 0;
  }
}

@media (max-width: 1099px) {
  .query-toolbar,
  .schedule-query-toolbar,
  .booking-query-toolbar,
  .hbl-query-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .query-actions {
    grid-column: auto;
    justify-content: stretch;
  }
}

/* FINAL COMPACT CONTINUOUS-EDITOR OVERRIDE
   Keep this block last. Schedule, Booking, and HBL sections are rendered as
   one continuous work surface with section headings. */
:root {
  --ctl-compact-control-height: 30px;
  --ctl-compact-radius: 6px;
}

.site-header {
  height: 72px;
  min-height: 72px;
  border-radius: 0;
  box-shadow: 0 1px 3px rgba(11, 21, 37, 0.1);
}

.window-titlebar,
.ctl-menubar,
.quick-toolbar {
  height: 72px;
  min-height: 72px;
}

.main-content,
.site-footer {
  width: min(1600px, calc(100% - 24px));
}

.login-intro {
  display: none;
}

.login-view {
  min-height: calc(100vh - 72px);
  padding: 24px 0 28px;
}

.workspace-view {
  height: calc(100vh - 72px);
  min-height: 0;
  padding: 8px 0 10px;
  overflow: hidden;
}

.workspace-heading {
  gap: 12px;
  margin-bottom: 8px;
}

.workspace-heading h1 {
  font-size: 18px;
}

.workspace-lead {
  font-size: 11px;
}

.status-strip {
  min-height: 30px;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: var(--ctl-compact-radius);
}

.global-error {
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: var(--ctl-compact-radius);
}

.legacy-workspace-frame {
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
  border-radius: var(--ctl-compact-radius);
  box-shadow: none;
}

.query-toolbar {
  gap: 6px 8px;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: var(--ctl-compact-radius);
  box-shadow: none;
}

.query-toolbar .field-group {
  gap: 4px;
}

.query-toolbar .field-group label {
  font-size: 10px;
}

.query-toolbar input,
.query-toolbar select,
.query-toolbar .field-group input,
.query-toolbar .field-group select {
  height: var(--ctl-compact-control-height);
  min-height: var(--ctl-compact-control-height);
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 12px;
}

.query-actions {
  gap: 6px;
}

.query-actions .button {
  height: var(--ctl-compact-control-height);
  min-height: var(--ctl-compact-control-height);
  padding: 4px 9px;
  border-radius: 5px;
}

.button,
.legacy-button,
.icon-button {
  min-height: var(--ctl-compact-control-height);
  padding: 5px 9px;
  border-radius: 5px;
}

.button-small {
  min-height: 28px;
  padding: 4px 8px;
}

.table-card,
.editor-card {
  border-radius: var(--ctl-compact-radius);
  box-shadow: none;
}

.table-toolbar {
  min-height: 36px;
  padding: 5px 8px;
}

.table-scroll {
  min-height: 0;
  overflow: auto;
}

.data-table th,
.data-table td {
  height: 34px;
  padding: 6px 8px;
}

.data-table th {
  top: 0;
}

.editor-card {
  padding: 12px;
}

.module-panel.is-detail-mode > .editor-card {
  padding: 12px;
}

.editor-heading {
  top: 0;
  gap: 10px;
  padding-bottom: 8px;
  background: var(--surface);
}

.module-panel.is-detail-mode .editor-heading {
  padding-bottom: 8px;
}

.editor-heading h3 {
  margin-top: 2px;
  font-size: 15px;
}

.editor-heading p {
  margin-top: 2px;
  font-size: 11px;
}

.editor-heading-actions {
  gap: 6px;
}

.editor-heading-actions .button {
  min-height: 30px;
  padding: 4px 8px;
}

.editor-revision {
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 10px;
}

.booking-detail-ribbon {
  gap: 1px;
  margin-top: 8px;
  border-radius: 6px;
}

.booking-detail-ribbon > div {
  padding: 7px 8px;
}

.editor-form {
  overflow: hidden;
}

.editor-grid,
.booking-editor-grid {
  display: block !important;
  min-height: 0;
  flex: 1 1 auto;
  padding: 8px 2px 8px 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

#bookingEditorFields > .editor-section-tabs,
#hblEditorFields > .editor-section-tabs {
  display: none;
}

.editor-section-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 8px 10px;
  min-height: 0;
  padding: 8px 0 10px;
  overflow: visible;
}

.editor-section-panel:first-child {
  padding-top: 0;
  border-top: 0;
}

.editor-section-panel + .editor-section-panel {
  margin-top: 1px;
  border-top: 1px solid var(--line);
}

.editor-section-panel[hidden] {
  display: none !important;
}

.editor-section-heading {
  grid-column: 1 / -1;
  margin: 0 0 1px;
  padding: 0 0 5px;
  color: var(--blue);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.editor-section-panel .field-wide {
  grid-column: span 2;
}

.editor-section-panel .editor-switch-group {
  grid-column: 1 / -1;
}

.editor-field {
  gap: 4px;
}

.editor-field label {
  min-height: 14px;
  font-size: 11px;
}

.editor-field input,
.editor-field select {
  height: var(--ctl-compact-control-height);
  min-height: var(--ctl-compact-control-height);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
}

.editor-field textarea {
  height: 96px;
  min-height: 96px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.32;
  resize: vertical;
  white-space: pre-wrap;
}

.editor-actions {
  min-height: 42px;
  padding: 7px 0 0;
  background: var(--surface);
}

.editor-buttons .button {
  min-height: var(--ctl-compact-control-height);
}

.lookup-popup-portal {
  position: fixed;
  z-index: 2000;
  top: auto;
  right: auto;
  left: auto;
  max-width: calc(100vw - 24px);
  max-height: min(360px, calc(100vh - 24px));
  border-radius: var(--ctl-compact-radius);
}

.lookup-popup-portal[hidden] {
  display: none;
}

@media (min-width: 1100px) {
  .query-toolbar .field-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .query-toolbar .field-group label {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .query-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .schedule-query-toolbar {
    grid-template-columns: minmax(155px, 1.35fr) repeat(2, minmax(120px, 1fr)) minmax(130px, 1fr) 76px auto;
  }

  .booking-query-toolbar {
    grid-template-columns: minmax(165px, 1fr) minmax(205px, 1.25fr) 76px auto;
  }

  .hbl-query-toolbar {
    grid-template-columns: minmax(135px, 1fr) minmax(135px, 1fr) minmax(165px, 1.2fr) minmax(105px, 0.8fr) 76px auto;
  }

  .module-panel > .table-card {
    min-height: 0;
  }

  .module-panel.is-detail-mode .editor-section-panel {
    overflow: visible;
  }
}

@media (max-width: 1099px) {
  .site-header {
    display: flex;
    height: 64px;
    min-height: 64px;
    padding: 0 12px;
  }

  .window-titlebar,
  .ctl-menubar,
  .quick-toolbar {
    height: 64px;
    min-height: 64px;
  }

  .window-titlebar {
    flex: 1 1 auto;
    gap: 8px;
  }

  .ctl-menubar {
    flex: 0 0 auto;
    gap: 6px;
    padding: 0 0 0 8px;
  }

  .quick-toolbar {
    flex: 0 0 auto;
    gap: 8px;
    padding: 0 0 0 8px;
  }

  .quick-context {
    display: none;
  }

  .workspace-view {
    height: auto;
    min-height: 0;
    padding: 8px 0 16px;
    overflow: visible;
  }

  .legacy-workspace-frame {
    height: auto;
    flex: 0 0 auto;
    overflow: visible;
  }

  .module-panel.is-detail-mode > .editor-card {
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .editor-grid,
  .booking-editor-grid {
    overflow: visible;
  }

  .editor-form {
    overflow: visible;
  }

  .editor-section-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0 10px;
  }

  .brand-name {
    max-width: 45vw;
    font-size: 13px;
  }

  .window-title-state,
  .menu-context,
  .build-stamp,
  .header-user {
    display: none;
  }

  .ctl-menubar,
  .quick-toolbar {
    padding-left: 6px;
  }

  .editor-section-panel {
    grid-template-columns: 1fr;
  }

  .editor-section-panel .field-wide {
    grid-column: auto;
  }
}

/* Mobile header stays on one line. Primary workspace navigation remains in
   the workspace tabs, so the duplicate Sea Export menu is hidden here. */
@media (max-width: 640px) {
  .site-header {
    display: flex !important;
    width: 100%;
    height: 56px !important;
    min-height: 56px !important;
    align-items: center;
    padding: 0 8px !important;
    overflow: hidden;
  }

  .window-titlebar {
    min-width: 0;
    height: 56px !important;
    min-height: 56px !important;
    flex: 1 1 auto;
    gap: 6px;
    padding: 0;
  }

  .brand {
    min-width: 0;
    gap: 6px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    font-size: 10px;
  }

  .brand-copy {
    min-width: 0;
  }

  .brand-name {
    max-width: none;
    overflow: hidden;
    font-size: 10px;
    letter-spacing: 0.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-subtitle,
  .window-title-state,
  .quick-context,
  .build-stamp,
  .header-user,
  .ctl-menubar {
    display: none !important;
  }

  .quick-toolbar {
    display: flex;
    min-width: 0;
    width: auto;
    height: 56px !important;
    min-height: 56px !important;
    flex: 0 0 auto;
    padding: 0 !important;
    background: transparent;
    border: 0;
  }

  .header-tools {
    display: flex !important;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 4px;
    margin: 0;
  }

  .connection-badge {
    grid-column: auto;
    flex: 0 0 auto;
    gap: 3px;
    margin: 0;
    font-size: 9px;
    letter-spacing: 0;
  }

  .connection-badge::before {
    width: 5px;
    height: 5px;
  }

  .site-header .button-small {
    min-height: 24px;
    flex: 0 0 auto;
    padding: 2px 3px;
    font-size: 9px;
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  .connection-badge {
    width: 7px;
    overflow: hidden;
    color: transparent;
  }

  .connection-badge::before {
    color: #4fd1c5;
  }
}

/* Selected-row actions, complete-value result columns, and compact detail pages. */
.reassign-dialog {
  width: min(1180px, calc(100% - 32px));
  max-height: min(92vh, 850px);
  overflow: hidden;
  border: 1px solid rgb(20 35 48 / 0.12);
  background: #eef3f6;
  box-shadow: 0 30px 90px -58px rgb(18 44 62 / 0.46);
}

.reassign-dialog .modal-header {
  padding: 18px 22px 15px;
  border-bottom: 1px solid rgb(26 59 82 / 0.1);
  background: #fbfdfe;
}

.reassign-dialog .modal-header h2 {
  margin-top: 4px;
  font-size: 17px;
}

.reassign-dialog .modal-subtitle {
  max-width: 900px;
  margin-top: 6px;
  font-size: 12px;
}

.reassign-warning,
.reassign-summary {
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid rgb(183 122 22 / 0.3);
  border-left-width: 4px;
  border-radius: 10px;
  background: #fff9ea;
  color: #5b3b0a;
  font-size: 11.5px;
  line-height: 1.4;
}

.reassign-summary.is-success {
  border-color: #8ec3a0;
  background: #effaf3;
  color: #145c32;
}

.reassign-summary.is-error {
  border-color: #dc7f86;
  background: #fff1f2;
  color: #8d1f2a;
}

.reassign-form {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(360px, 0.62fr);
  align-items: start;
  gap: 14px;
  max-height: calc(min(90vh, 820px) - 120px);
  overflow: auto;
  overflow-anchor: none;
  padding: 16px 18px 78px;
}

.reassign-main-panel,
.reassign-notification-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgb(25 61 84 / 0.09);
  border-radius: 8px;
  background: #fbfdfe;
  box-shadow: 0 1px 3px rgb(22 52 72 / 0.05);
}

.reassign-controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.45fr);
  gap: 10px;
}

.reassign-controls-grid > label {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.reassign-form select,
.reassign-form input,
.reassign-form textarea {
  width: 100%;
  min-height: 38px;
  border-color: #b8cfdd;
  border-radius: 9px;
  background: #fbfdff;
  font-size: 12px;
}

.reassign-reason {
  grid-column: 1 / -1;
}

.reassign-summary,
.reassign-form .modal-actions {
  grid-column: 1 / -1;
}

.reassign-table-scroll {
  max-height: min(38vh, 340px);
  margin: 0;
  overflow: auto;
  border: 1px solid #d6e4ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgb(30 55 72 / 0.05);
}

.reassign-table-scroll .data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.reassign-table-scroll th,
.reassign-table-scroll td {
  padding: 8px 9px;
}

.reassign-table-scroll th:nth-child(1),
.reassign-table-scroll td:nth-child(1) {
  width: 15%;
}

.reassign-table-scroll th:nth-child(2),
.reassign-table-scroll td:nth-child(2),
.reassign-table-scroll th:nth-child(3),
.reassign-table-scroll td:nth-child(3) {
  width: 18%;
}

.reassign-table-scroll th:nth-child(5),
.reassign-table-scroll td:nth-child(5) {
  width: 90px;
}

.reassign-table-scroll .reassign-booking-row > td {
  vertical-align: top;
  background: #ffffff;
}

.reassign-table-scroll .reassign-op-note-row > td {
  width: 100% !important;
  max-width: none !important;
  padding-top: 3px;
  padding-bottom: 9px;
  border-top: 0;
  background: #f7fbfc;
  color: #536d7c;
  white-space: normal;
}

.reassign-op-note-cell {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.reassign-op-note-label {
  flex: 0 0 auto;
  color: #2b718c;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.reassign-op-note-value {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reassign-table-scroll.is-record-cards {
  border: 0;
  background: transparent;
  box-shadow: none;
  max-height: min(42vh, 430px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.reassign-table-scroll.is-record-cards .data-table,
.reassign-table-scroll.is-record-cards tbody {
  table-layout: auto !important;
  display: grid;
  gap: 9px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.reassign-table-scroll.is-record-cards .data-table {
  display: block !important;
}

.reassign-table-scroll.is-record-cards tbody {
  display: grid !important;
}

.reassign-table-scroll.is-record-cards thead {
  display: none;
}

.reassign-record-card {
  display: grid !important;
  width: auto !important;
  max-width: 100%;
  grid-template-columns: minmax(96px, 0.72fr) minmax(150px, 1fr) minmax(160px, 1.55fr) minmax(58px, 0.35fr) minmax(120px, 0.95fr) minmax(76px, auto);
  gap: 10px 14px;
  align-items: start;
  height: auto !important;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid rgb(25 61 84 / 0.1);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(22 52 72 / 0.05);
}

.reassign-table-scroll.is-record-cards .reassign-record-card td {
  display: grid;
  gap: 4px;
  height: auto !important;
  min-height: 0;
  width: auto !important;
  min-width: 0;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: #22394b;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.reassign-table-scroll.is-record-cards .reassign-record-card td::before {
  content: attr(data-label);
  color: #6b8291;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.reassign-table-scroll.is-record-cards .reassign-record-kind {
  color: #173850;
  font-weight: 800;
}

.reassign-table-scroll.is-record-cards .reassign-record-id {
  color: #0d3554;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.reassign-table-scroll.is-record-cards .reassign-record-card td.reassign-record-fields {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  grid-column: auto;
}

.reassign-table-scroll.is-record-cards .reassign-record-fields::before {
  flex-basis: 100%;
}

.reassign-field-chip,
.reassign-field-none {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgb(23 108 107 / 0.16);
  border-radius: 999px;
  background: rgb(23 108 107 / 0.08);
  color: #174f50;
  font-size: 11px;
  font-weight: 700;
}

.reassign-field-none {
  border-color: rgb(68 88 104 / 0.13);
  background: #f2f6f8;
  color: #647684;
}

.reassign-table-scroll.is-record-cards .reassign-record-status {
  align-self: start;
  width: fit-content;
  min-width: 84px;
  padding: 5px 9px;
  border: 1px solid #c3d8e6;
  border-radius: 999px;
  background: #eef6fb;
  color: #244c64;
  font-size: 11px;
  font-weight: 800;
}

.reassign-table-scroll.is-record-cards .reassign-record-status::before {
  display: none;
}

.reassign-table-scroll.is-record-cards .reassign-record-status.is-ready {
  border-color: #9fd2b5;
  background: #effaf3;
  color: #126236;
}

.reassign-notification-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  margin: 0;
}
.reassign-notification-panel[hidden] { display: none; }
.reassign-notification-heading,
.reassign-notification-controls {
  display: grid;
  gap: 10px;
}
.reassign-notification-heading {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 0;
  border-bottom: 0;
}
.reassign-notification-heading h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 14px;
}
.reassign-notification-controls,
.reassign-notification-status,
.reassign-notification-drafts {
  display: none;
}
.reassign-notification-panel.is-expanded .reassign-notification-controls,
.reassign-notification-panel.is-expanded .reassign-notification-drafts {
  display: grid;
  grid-column: 1 / -1;
}
.reassign-notification-panel.is-expanded .reassign-notification-status {
  display: block;
  grid-column: 1 / -1;
}
.reassign-notification-controls {
  grid-template-columns: 1fr;
  grid-row: 2;
  padding-top: 10px;
  border-top: 1px solid #d9e8f1;
}
.reassign-notification-controls label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.reassign-notification-controls textarea {
  min-height: 74px;
  resize: vertical;
}
.reassign-notification-status {
  grid-row: 3;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #d6e5ee;
  border-radius: 8px;
  background: #f6fafc;
  color: #355468;
  font-size: 12px;
}
.reassign-send-notice-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  width: max-content;
  margin: 0;
  padding: 7px 10px 7px 8px;
  border: 1px solid #bfd5e4;
  border-radius: 999px;
  background: #f8fbfd;
  color: #173850;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  cursor: pointer;
  user-select: none;
}

.reassign-send-notice-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.reassign-send-notice-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid #a7bdcc;
  border-radius: 999px;
  background: #dce8ef;
  transition: background 140ms ease, border-color 140ms ease;
}

.reassign-send-notice-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(23 56 80 / 0.28);
  transition: transform 140ms ease;
}

.reassign-send-notice-toggle input:checked + .reassign-send-notice-switch {
  border-color: #0c5c91;
  background: #0d6fa8;
}

.reassign-send-notice-toggle input:checked + .reassign-send-notice-switch::after {
  transform: translateX(16px);
}

.reassign-send-notice-toggle:has(input:focus-visible) {
  outline: 2px solid #70afe0;
  outline-offset: 2px;
}

.reassign-send-notice-toggle:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}
.reassign-notification-drafts {
  grid-row: 4;
  max-height: min(34vh, 310px);
  gap: 8px;
  margin: 0;
  overflow: auto;
  padding: 0;
  list-style: none;
}
.reassign-notification-draft {
  display: grid;
  gap: 6px;
  padding: 13px;
  background: #fbfdff;
  border: 1px solid #d8e6ef;
  border-radius: 11px;
}
.reassign-notification-draft strong {
  color: #0d3554;
  font-size: 13px;
}
.reassign-notification-draft p,
.reassign-notification-draft pre {
  margin: 0;
}
.reassign-email-status {
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid #c3d8e6;
  border-radius: 999px;
  background: #eef6fb;
  color: #244c64;
  font-size: 11px;
  font-weight: 800;
}
.reassign-email-status-sent {
  border-color: #9fd2b5;
  background: #effaf3;
  color: #126236;
}
.reassign-email-status-sending,
.reassign-email-status-queued,
.reassign-email-status-retrying {
  border-color: #c9b77d;
  background: #fff8df;
  color: #6a4a04;
}
.reassign-email-status-failed,
.reassign-email-status-needs-review {
  border-color: #e4a3a7;
  background: #fff1f2;
  color: #9a1f2b;
}
.reassign-notification-subject,
.reassign-notification-attachment {
  color: #526b78;
  font-size: 11px;
}
.reassign-notification-body {
  max-height: 190px;
  overflow: auto;
  color: #273746;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.reassign-form .modal-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid #cbdae4;
  background: rgb(242 247 250 / 0.98);
  backdrop-filter: blur(8px);
}

@media (max-width: 860px) {
  .reassign-form {
    grid-template-columns: 1fr;
  }

  .reassign-record-card {
    grid-template-columns: 1fr;
  }

  .reassign-table-scroll.is-record-cards .reassign-record-fields {
    grid-column: 1;
  }

  .reassign-controls-grid {
    grid-template-columns: 1fr;
  }

  .reassign-notification-controls {
    grid-template-columns: 1fr;
  }

  .reassign-reason {
    grid-column: 1;
  }

  .reassign-notification-panel {
    grid-template-columns: 1fr;
  }

  .reassign-send-notice-toggle {
    justify-self: start;
  }
}

.schedule-notification-dialog {
  width: min(1080px, calc(100% - 32px));
}

.schedule-notification-body {
  display: grid;
  grid-template-columns: minmax(250px, 0.68fr) minmax(0, 1fr);
  gap: 12px;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding: 14px 16px;
  background: #f7fbfd;
}

.schedule-notification-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d4e4ed;
  border-radius: 8px;
}

.schedule-notification-draft-panel {
  grid-column: 1 / -1;
}

.schedule-notification-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.schedule-notification-heading h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.schedule-notification-bookings {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}

.schedule-notification-booking {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin: 0;
  padding: 9px 10px;
  color: #294255;
  background: #f9fcfe;
  border: 1px solid #d9e9f1;
  border-radius: 7px;
  text-transform: none;
  cursor: pointer;
}

.schedule-notification-booking input {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.schedule-notification-booking span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.schedule-notification-booking strong {
  color: #102f4a;
  font-size: 12px;
}

.schedule-notification-booking span span {
  color: #607789;
  font-size: 11px;
  line-height: 1.35;
}

.schedule-notification-controls {
  display: grid;
  gap: 10px;
}

.schedule-notification-controls label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.schedule-notification-controls textarea {
  min-height: 118px;
  resize: vertical;
}

.schedule-notification-status,
.schedule-notification-empty {
  margin: 0;
  color: #526f82;
  font-size: 12px;
  line-height: 1.45;
}

.schedule-notification-drafts {
  display: grid;
  gap: 9px;
  max-height: 320px;
  margin: 0;
  overflow: auto;
  padding: 0;
  list-style: none;
}

.schedule-notification-draft {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  background: #fff;
  border: 1px solid #d8e6ef;
  border-radius: 7px;
}

.schedule-notification-draft p,
.schedule-notification-draft pre {
  margin: 0;
}

.schedule-notification-subject,
.schedule-notification-to,
.schedule-notification-attachment {
  color: #526b78;
  font-size: 11px;
}

.schedule-notification-body-preview {
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  color: #1f3445;
  background: #fbfdff;
  border: 1px solid #e2edf3;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .schedule-notification-body {
    grid-template-columns: 1fr;
  }
}

.selected-row-action-buttons[hidden] {
  display: none !important;
}

.selected-row-actions > td {
  height: auto;
  padding: 7px 10px 8px;
  background: #eef6ff;
  border-top: 0;
  border-bottom: 2px solid #8db9ea;
}

.selected-row-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.bulk-result-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.bulk-result-actions[hidden] {
  display: none !important;
}

.bulk-result-summary {
  color: #2b536f;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.booking-number-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.booking-copy-button {
  min-height: 22px;
  padding: 2px 6px;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid #bfd4eb;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.booking-copy-button:hover {
  background: var(--surface-blue);
}

.booking-table tbody tr.is-deleted-booking td {
  color: #7a3131;
  background: #fff1f1;
}

.booking-status-active,
.booking-status-deleted {
  font-weight: 800;
}

.booking-status-active {
  color: var(--teal) !important;
}

.booking-status-deleted {
  color: #b42318 !important;
}

.clipboard-fallback {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.selected-row-button-strip {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.booking-linked-container-file {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 3px;
  padding: 5px 9px;
  border: 1px solid #b8d7d0;
  border-radius: 8px;
  background: #f6fbf9;
}

.booking-linked-container-file[hidden] {
  display: none !important;
}

.booking-linked-container-file-heading {
  display: flex;
  align-items: center;
  gap: 7px;
}

.booking-linked-container-file-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
}

.booking-linked-container-file-details > div {
  min-width: 0;
}

.booking-linked-container-file-details dt {
  color: #617b8e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline;
}

.booking-linked-container-file-details dd {
  overflow-wrap: anywhere;
  display: inline;
  margin: 0 0 0 4px;
  color: #183a50;
  font-size: 11px;
  font-weight: 700;
  user-select: all;
  cursor: text;
}

.linked-booking-edit-actions {
  display: flex;
  gap: 5px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .booking-linked-container-file-details { gap: 4px 10px; }
}

.booking-second-leg-card {
  flex: 0 1 980px;
  width: min(100%, 980px);
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid #b9d3ee;
  border-radius: 6px;
  background: #f8fbff;
  color: #14283f;
}

.booking-measurements {
  grid-column: 1 / -1;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.booking-measurements-scroll {
  max-height: 190px;
}

.booking-measurements-table {
  min-width: 2100px;
  font-size: 11px;
}

.booking-measurements-table th,
.booking-measurements-table td {
  padding: 6px 8px;
  white-space: nowrap;
}

.booking-second-leg-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.booking-second-leg-heading > div {
  display: grid;
  gap: 2px;
}

.booking-second-leg-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 5px 12px;
  margin: 0;
}

.second-leg-field {
  min-width: 0;
}

.second-leg-field dt {
  margin-bottom: 1px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.second-leg-field dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.25;
}

.second-leg-field-remark {
  grid-column: 1 / -1;
}

@media (max-width: 1099px) {
  .booking-second-leg-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .booking-second-leg-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .second-leg-field-remark {
    grid-column: auto;
  }
}

@media (min-width: 641px) {
  .data-table {
    width: max-content !important;
    min-width: 100%;
    table-layout: auto;
  }

  .data-table th,
  .data-table td {
    width: auto;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
}

#bookingsPanel.is-detail-mode > .editor-card,
#hblPanel.is-detail-mode > .editor-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

#bookingsPanel.is-detail-mode .editor-form,
#hblPanel.is-detail-mode .editor-form,
#bookingsPanel.is-detail-mode .editor-grid,
#hblPanel.is-detail-mode .editor-grid {
  min-height: 0;
  height: auto;
  overflow: visible;
  scrollbar-gutter: auto;
}

#bookingsPanel.is-detail-mode .editor-section-panel,
#hblPanel.is-detail-mode .editor-section-panel {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 5px 0 7px;
  overflow: visible;
}

#bookingsPanel.is-detail-mode .editor-section-panel .field-wide,
#hblPanel.is-detail-mode .editor-section-panel .field-wide {
  grid-column: span 2;
}

#bookingsPanel.is-detail-mode .editor-field textarea,
#hblPanel.is-detail-mode .editor-field textarea,
#bookingsPanel.is-detail-mode .field-notes textarea,
#hblPanel.is-detail-mode .field-shipper textarea,
#hblPanel.is-detail-mode .field-consignee textarea,
#hblPanel.is-detail-mode .field-notify textarea,
#hblPanel.is-detail-mode .field-marks textarea,
#hblPanel.is-detail-mode .field-goods textarea {
  height: 58px;
  min-height: 58px;
  resize: none;
}

.workspace-view:has(.module-panel.is-detail-mode),
.legacy-workspace-frame:has(.module-panel.is-detail-mode),
.legacy-workspace-main:has(.module-panel.is-detail-mode) {
  height: auto;
  min-height: 0;
  overflow: visible;
}

html.has-result-table-mode,
body.has-result-table-mode,
body.has-result-table-mode .app-shell,
body.has-result-table-mode .workspace-view,
body.has-result-table-mode .legacy-workspace-frame,
body.has-result-table-mode .legacy-workspace-main,
.module-panel.is-results-mode {
  height: auto;
  min-height: 0;
  overflow: visible;
}

.module-panel.is-results-mode > .table-card {
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.module-panel.is-results-mode .table-scroll {
  height: auto;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
}

.module-panel.is-results-mode .data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.status-strip {
  display: none !important;
}

@media (max-width: 1099px) {
  #bookingsPanel.is-detail-mode .editor-section-panel,
  #hblPanel.is-detail-mode .editor-section-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #bookingsPanel.is-detail-mode .editor-section-panel,
  #hblPanel.is-detail-mode .editor-section-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  #bookingsPanel.is-detail-mode .editor-section-panel .field-wide,
  #hblPanel.is-detail-mode .editor-section-panel .field-wide {
    grid-column: auto;
  }
}

/* Container File and extended Sailing Schedule search filters. */
.schedule-query-toolbar,
.container-query-toolbar {
  grid-template-columns: repeat(4, minmax(120px, 1fr)) 76px auto;
}

.container-file-table {
  min-width: 1740px;
}

@media (max-width: 1099px) {
  .schedule-query-toolbar,
  .container-query-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-query-toolbar .query-actions,
  .container-query-toolbar .query-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .schedule-query-toolbar,
  .container-query-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-query-toolbar .query-actions,
  .container-query-toolbar .query-actions {
    grid-column: auto;
  }
}

/* 2026 operations visual refresh.
   This final layer preserves the existing DOM and interaction contracts while
   tightening the visual hierarchy for a high-frequency enterprise workspace. */
:root {
  --ink: #172337;
  --ink-soft: #4d5c70;
  --muted: #6e7d90;
  --line: #d8e0ea;
  --line-strong: #bcc8d6;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --surface-blue: #edf4ff;
  --navy: #111b2b;
  --navy-deep: #0b1422;
  --blue: #245fc5;
  --blue-bright: #3474dc;
  --teal: #137d73;
  --teal-soft: #e3f3f0;
  --amber: #9a650e;
  --amber-soft: #fff4dc;
  --red: #b33b4a;
  --red-soft: #fff0f2;
  --shadow-sm: 0 2px 10px rgba(23, 35, 55, 0.06);
  --shadow-md: 0 18px 50px rgba(23, 35, 55, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --ctl-compact-radius: 8px;
}

html,
body {
  min-height: 100%;
  background: #eef2f6;
}

body {
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

button,
a,
input,
select,
textarea,
summary,
tr {
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

button:active:not(:disabled),
.button:active:not(:disabled),
summary:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible,
tr:focus-visible {
  outline: 3px solid rgba(36, 95, 197, 0.3);
  outline-offset: 2px;
}

.site-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  width: 100%;
  height: 64px;
  min-height: 64px;
  align-items: stretch;
  padding: 0 clamp(14px, 2vw, 28px);
  color: #e8eef7;
  background: var(--navy-deep);
  border: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.window-titlebar,
.ctl-menubar,
.quick-toolbar {
  height: 64px;
  min-height: 64px;
}

.window-titlebar {
  gap: 14px;
}

.brand {
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: #f8fbff;
  background: var(--blue);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  box-shadow: none;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.brand-name {
  max-width: min(31vw, 340px);
  color: #f3f7fc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.brand-subtitle {
  color: #94a5ba;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.09em;
}

.window-title-state {
  padding-left: 14px;
  color: #a9b7c8;
  border-left-color: rgba(205, 220, 239, 0.16);
  font-size: 11px;
}

.ctl-menubar,
.quick-toolbar {
  border-left-color: rgba(205, 220, 239, 0.14);
}

.ctl-menubar {
  padding: 0 14px;
}

.ctl-menu > summary {
  min-height: 34px;
  padding: 7px 11px;
  color: #e8eef7;
  background: #19283d;
  border-color: #33445b;
  border-radius: 8px;
  font-weight: 650;
}

.ctl-menu[open] > summary,
.ctl-menu > summary:hover {
  background: var(--blue);
  border-color: var(--blue);
}

.quick-toolbar {
  padding-left: 14px;
}

.menu-context,
.quick-context,
.build-stamp {
  display: none;
}

.header-tools {
  gap: 9px;
}

.connection-badge,
.header-user-name,
.header-user-role {
  font-size: 11px;
}

.site-header .button-quiet {
  color: #dce6f2;
  border-color: rgba(205, 220, 239, 0.22);
}

.site-header .button-quiet:hover:not(:disabled) {
  color: #ffffff;
  background: #1c2d44;
  border-color: rgba(205, 220, 239, 0.34);
}

.main-content,
.site-footer {
  width: min(1600px, calc(100% - 32px));
}

.login-view {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 430px);
  width: min(1120px, 100%);
  min-height: calc(100dvh - 64px);
  align-items: center;
  justify-content: stretch;
  gap: clamp(48px, 7vw, 88px);
  margin: 0 auto;
  padding: 26px 0;
}

.login-intro {
  display: block;
  max-width: 620px;
  padding: 12px 0;
}

.login-intro .eyebrow {
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.login-intro h1 {
  max-width: 11ch;
  margin: 0;
  color: var(--navy-deep);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 690;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.login-intro h1 em {
  display: inline-block;
  padding-bottom: 5px;
  color: var(--blue);
  font-style: normal;
  font-weight: 690;
  line-height: 1.08;
}

.intro-copy {
  max-width: 52ch;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

.intro-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}

.intro-point {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0 20px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.intro-point:first-child {
  padding-left: 0;
}

.intro-point + .intro-point {
  border-left: 1px solid var(--line);
}

.intro-point strong,
.intro-point small {
  display: block;
}

.intro-point strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.intro-point small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.login-card {
  width: 100%;
  margin: 0;
  padding: 34px 34px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-card .card-kicker {
  color: var(--blue);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.login-card h2 {
  margin-top: 10px;
  color: var(--navy-deep);
  font-size: 25px;
  letter-spacing: -0.02em;
}

.login-card .card-lead {
  margin: 8px 0 24px;
  color: var(--ink-soft);
  font-size: 13px;
}

.login-card .stack-form {
  gap: 16px;
}

.login-card .field-group {
  gap: 6px;
}

.login-card .field-group label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.login-card .field-group input,
.login-card .field-group select {
  height: 40px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.login-card .field-group input:hover,
.login-card .field-group select:hover {
  border-color: #91a3b8;
}

.login-card .field-group input:focus,
.login-card .field-group select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 95, 197, 0.12);
}

.login-card .field-hint,
.login-cert-callout,
.login-footnote {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.login-card .button-wide {
  min-height: 40px;
  margin-top: 2px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  white-space: nowrap;
}

.button-primary {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 5px 14px rgba(36, 95, 197, 0.18);
}

.button-primary:hover:not(:disabled) {
  color: #ffffff;
  background: #1d4fa8;
  border-color: #1d4fa8;
  box-shadow: 0 6px 18px rgba(36, 95, 197, 0.24);
}

.login-footnote {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.login-cert-callout {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 10px 11px;
  color: #344f68;
  background: #f5fbff;
  border: 1px solid #cfe0ee;
  border-radius: var(--radius-sm);
}

.login-cert-callout a {
  margin-left: auto;
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.login-cert-callout a:hover {
  text-decoration: underline;
}

.workspace-view {
  height: calc(100dvh - 64px);
  padding-top: 10px;
}

.workspace-heading h1,
.module-header h2,
.editor-heading h3 {
  color: var(--navy-deep);
  letter-spacing: -0.015em;
}

.status-strip,
.query-toolbar,
.table-card,
.editor-card,
.legacy-workspace-frame {
  border-color: var(--line);
  border-radius: var(--ctl-compact-radius);
}

.workspace-tab.is-active {
  color: var(--blue);
  background: var(--surface-blue);
  border-color: #b9cef0;
}

.query-toolbar input,
.query-toolbar select,
.editor-field input,
.editor-field select,
.editor-field textarea {
  border-color: var(--line-strong);
}

.data-table th {
  color: #415168;
  background: #eef2f7;
}

.data-table tbody tr:hover td,
.data-table tbody tr.is-selected td {
  background: #edf4ff;
}

.modal-dialog {
  border-color: var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 70px rgba(11, 20, 34, 0.22);
}

.session-login-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
}

.session-login-dialog .modal-header {
  padding-bottom: 14px;
}

.session-login-form {
  gap: 14px;
  padding: 0 24px 22px;
}

.session-login-actions {
  padding: 3px 0 0;
}

.session-login-actions .button {
  width: 100%;
  min-height: 42px;
}

/* SESSION LOGIN PANEL
   Component scope: make re-authentication feel like a DirectCP system panel,
   not a generic generated white modal. */
.session-login-dialog {
  position: relative;
  width: min(386px, calc(100% - 32px));
  color: var(--ink);
  background: #f7fbfd;
  border: 1px solid #9fb7cb;
  border-radius: 10px;
  box-shadow: 0 22px 58px -28px rgb(16 31 48 / 55%);
}

.session-login-dialog::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  content: "";
  background: linear-gradient(180deg, var(--navy), #3a8aa0);
}

.session-login-dialog::backdrop {
  background: rgb(16 31 48 / 46%);
  backdrop-filter: blur(3px);
}

.session-login-dialog .modal-header {
  padding: 18px 22px 14px 28px;
  background: linear-gradient(180deg, #eef5fa 0%, #f8fbfd 100%);
  border-bottom: 1px solid #c5d5e2;
}

.session-login-dialog .warning-label {
  color: #3a8aa0;
  font-size: 10px;
  letter-spacing: .16em;
}

.session-login-dialog .modal-header h2 {
  margin-top: 7px;
  color: var(--navy);
  font-size: 18px;
  letter-spacing: 0;
}

.session-login-dialog .modal-subtitle {
  max-width: 30rem;
  margin-top: 7px;
  color: #526477;
  font-size: 12px;
  line-height: 1.45;
}

.session-login-form {
  gap: 12px;
  padding: 16px 22px 22px 28px;
  background: #f7fbfd;
}

.session-login-form .field-group {
  gap: 6px;
}

.session-login-form .field-group label {
  color: #4b5e70;
  font-size: 11px;
  font-weight: 800;
}

.session-login-form .field-group input,
.session-login-form .field-group select {
  min-height: 40px;
  color: var(--ink);
  background: #ffffff;
  border-color: #adc1d2;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 86%);
}

.session-login-form .field-group input:focus,
.session-login-form .field-group select:focus {
  outline: 2px solid rgb(35 63 97 / 30%);
  outline-offset: 1px;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 88%);
}

.session-login-form .error-message:not([hidden]) {
  margin: 1px 0 0;
  padding: 9px 11px;
  color: #8e352e;
  background: #fff4f2;
  border: 1px solid #e7b6af;
  border-left: 4px solid #b45a4e;
  border-radius: 8px;
  font-size: 12px;
}

.session-login-actions {
  padding-top: 2px;
}

.session-login-actions .button {
  min-height: 40px;
  border-radius: 8px;
  box-shadow: none;
}

@media (max-width: 1099px) {
  .site-header {
    display: flex;
    height: 64px;
    min-height: 64px;
  }

  .window-titlebar,
  .ctl-menubar,
  .quick-toolbar {
    height: 64px;
    min-height: 64px;
  }

  .login-view {
    grid-template-columns: minmax(0, 430px);
    justify-content: center;
    gap: 0;
  }

  .login-intro {
    display: none;
  }

  .workspace-view {
    height: auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 56px;
    min-height: 56px;
  }

  .main-content,
  .site-footer {
    width: min(100% - 20px, 1600px);
  }

  .login-view {
    min-height: calc(100dvh - 56px);
    align-items: start;
    padding: 18px 0 28px;
  }

  .login-card {
    padding: 26px 22px 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }

  .login-card h2 {
    font-size: 22px;
  }

  .workspace-view {
    height: auto;
  }
}

/* FINAL RESPONSIVE WORKSPACE REPAIR
   Keep the dense desktop rail at tablet widths and give the header a dedicated
   tool row. Phones use a compact horizontal module strip. */
@media (min-width: 641px) and (max-width: 1100px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title menu" "tools tools";
    height: auto;
    min-height: 106px;
    padding: 0 14px;
  }

  .window-titlebar,
  .ctl-menubar {
    height: 64px;
    min-height: 64px;
  }

  .window-titlebar {
    grid-area: title;
    min-width: 0;
  }

  .ctl-menubar {
    grid-area: menu;
    padding-left: 12px;
  }

  .quick-toolbar {
    grid-area: tools;
    width: 100%;
    height: 42px;
    min-height: 42px;
    flex: none;
    padding: 0 0 0 4px;
    border-top: 1px solid rgba(173, 194, 218, 0.18);
    border-left: 0;
  }

  .header-tools {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (min-width: 761px) and (max-width: 1099px) {
  .legacy-workspace-main {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    height: auto;
  }

  .workspace-tabs {
    display: flex;
    height: auto;
    min-height: 480px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 10px;
    overflow: hidden;
    border-radius: var(--ctl-v06-radius) 0 0 var(--ctl-v06-radius);
  }

  .workspace-nav-heading,
  .workspace-nav-status {
    margin-right: 4px;
    margin-left: 4px;
  }

  .workspace-tab {
    width: 100%;
    min-height: 44px;
  }

  .workspace-tab-spacer {
    display: block;
  }

  .workspace-nav-status {
    margin-top: auto;
  }
}

@media (max-width: 760px) {
  .legacy-workspace-main {
    display: block;
  }

  .workspace-tabs {
    display: flex;
    height: auto;
    min-height: 0;
    flex-direction: row;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    border-radius: var(--ctl-v06-radius) var(--ctl-v06-radius) 0 0;
  }

  .workspace-nav-heading,
  .workspace-nav-status,
  .workspace-tab-spacer {
    display: none;
  }

  .workspace-tab {
    width: auto;
    min-width: 150px;
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ADMIN-ALIGNED WORKSPACE THEME
   Shares the administrator console's brand, light surfaces, spacing rhythm,
   radius scale, and blue/teal semantic palette without changing workspace IA. */
:root {
  --ink: #142333;
  --ink-soft: #46586a;
  --muted: #738293;
  --line: #d9e2ea;
  --line-strong: #bccbd8;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-blue: #edf5fb;
  --navy: #0d2237;
  --navy-deep: #0d2237;
  --blue: #1768b3;
  --blue-dark: #0d4d8d;
  --blue-bright: #2787ce;
  --teal: #178b82;
  --teal-soft: #e0f5f1;
  --red: #b13e4e;
  --red-soft: #fff0f2;
  --amber: #966117;
  --amber-soft: #fff4df;
  --shadow-sm: 0 4px 16px rgb(13 34 55 / 6%);
  --shadow-md: 0 18px 48px rgb(13 34 55 / 11%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --ctl-compact-radius: 8px;
}

html,
body {
  background: #f2f6f9;
}

body {
  background:
    radial-gradient(circle at 7% 3%, rgb(39 135 206 / 8%), transparent 26rem),
    linear-gradient(180deg, #f9fbfd 0%, #eff4f7 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.field-group input::placeholder,
.field-group textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #5f7184;
  opacity: 1;
}

.site-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  width: min(1600px, calc(100% - 48px));
  height: 80px;
  min-height: 80px;
  margin: 0 auto;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.window-titlebar,
.ctl-menubar,
.quick-toolbar {
  height: 80px;
  min-height: 80px;
}

.window-titlebar {
  gap: 14px;
}

.brand {
  gap: 11px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  color: #ffffff;
  background: linear-gradient(145deg, #2787ce, var(--teal));
  border: 0;
  border-radius: 12px;
  box-shadow: 0 7px 16px rgb(23 105 170 / 20%);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-name {
  max-width: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.window-title-state {
  padding-left: 14px;
  color: var(--ink-soft);
  border-left-color: var(--line);
  font-size: 11px;
  font-weight: 700;
}

.ctl-menubar,
.quick-toolbar {
  border-left-color: var(--line);
}

.ctl-menu > summary {
  min-height: 36px;
  padding: 7px 12px;
  color: var(--blue-dark, #0d4d8d);
  background: var(--surface);
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 750;
  box-shadow: var(--shadow-sm);
}

.ctl-menu[open] > summary,
.ctl-menu > summary:hover {
  color: var(--blue-dark, #0d4d8d);
  background: var(--surface-blue);
  border-color: #8fa5b8;
}

.quick-toolbar {
  padding-left: 16px;
}

.connection-badge.is-active {
  color: var(--teal);
}

.header-user {
  border-color: var(--line);
}

.header-user-name {
  color: var(--ink);
}

.header-user-role {
  color: var(--muted);
}

.site-header .button-quiet {
  color: var(--blue-dark, #0d4d8d);
  background: var(--surface);
  border-color: var(--line-strong);
}

.site-header .button-quiet:hover:not(:disabled) {
  color: var(--blue-dark, #0d4d8d);
  background: var(--surface-blue);
  border-color: #8fa5b8;
}

.main-content,
.site-footer {
  width: min(1600px, calc(100% - 48px));
}

.workspace-view {
  height: calc(100dvh - 80px);
  padding-top: 18px;
}

.workspace-heading {
  margin-bottom: 14px;
}

.workspace-heading h1 {
  margin-bottom: 5px;
  color: var(--navy);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.workspace-lead {
  color: var(--ink-soft);
  font-size: 13px;
}

.workspace-meta {
  min-width: 220px;
  padding: 12px 15px;
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.status-strip {
  min-height: 38px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.legacy-workspace-frame {
  overflow: hidden;
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.legacy-workspace-main {
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--surface);
}

.workspace-tabs {
  gap: 6px;
  padding: 22px 14px 16px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.workspace-nav-heading {
  margin: 0 7px 10px;
  padding-bottom: 18px;
  border-bottom-color: var(--line);
}

.workspace-nav-kicker {
  color: var(--blue);
}

.workspace-nav-heading strong {
  color: var(--navy);
}

.workspace-nav-heading small {
  color: var(--muted);
}

.workspace-tab {
  min-height: 48px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.workspace-tab:hover:not(.is-active) {
  color: var(--blue-dark, #0d4d8d);
  background: #f0f6fb;
  border-color: #d7e5f0;
}

.workspace-tab.is-active {
  color: var(--blue-dark, #0d4d8d);
  background: var(--surface-blue);
  border-color: #c3d8ea;
  box-shadow: inset 3px 0 0 var(--blue), var(--shadow-sm);
}

.workspace-tab.is-active .tab-index,
.workspace-tab.is-active .tab-copy strong,
.workspace-tab.is-active .tab-count {
  color: var(--blue-dark, #0d4d8d);
}

.workspace-tab .tab-index,
.workspace-tab .tab-copy small,
.workspace-tab .tab-count {
  color: var(--muted);
}

.workspace-tab .tab-copy strong {
  color: var(--ink-soft);
}

.workspace-nav-status {
  color: var(--teal);
  border-top-color: var(--line);
}

.workspace-nav-status > strong {
  color: var(--ink-soft);
}

.module-panel {
  background: var(--surface);
}

.module-label {
  color: var(--teal);
}

.module-header h2,
.editor-heading h3 {
  color: var(--navy);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.revision-chip {
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: var(--radius-md);
}

.query-toolbar {
  background: var(--surface-blue);
  border-color: #d3e3f0;
  border-radius: var(--radius-md);
}

.query-toolbar input,
.query-toolbar select,
.editor-field input,
.editor-field select,
.editor-field textarea {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
}

.query-toolbar input:focus,
.query-toolbar select:focus,
.editor-field input:focus,
.editor-field select:focus,
.editor-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(23 104 179 / 13%);
}

.table-card,
.editor-card {
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.data-table th {
  color: #46586a;
  background: var(--surface-soft);
}

.data-table tbody tr:hover td,
.data-table tbody tr.is-selected td {
  background: var(--surface-blue);
}

.button,
.icon-button {
  border-radius: var(--radius-sm);
}

.button-primary {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 6px 14px rgb(23 104 179 / 16%);
}

.button-primary:hover:not(:disabled) {
  color: #ffffff;
  background: #0d4d8d;
  border-color: #0d4d8d;
}

.button-secondary,
.button-quiet,
.button-legacy-action {
  color: #0d4d8d;
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled),
.button-legacy-action:hover:not(:disabled) {
  color: #0d4d8d;
  background: var(--surface-blue);
  border-color: #8fa5b8;
}

@media (min-width: 641px) and (max-width: 1100px) {
  .site-header {
    width: min(100% - 28px, 1600px);
    background: transparent;
  }

  .quick-toolbar {
    border-top-color: var(--line);
  }
}

@media (min-width: 761px) and (max-width: 1099px) {
  .legacy-workspace-main {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .workspace-tabs {
    padding: 16px 10px;
    border-radius: 0;
  }
}

@media (max-width: 760px) {
  .workspace-tabs {
    background: var(--surface-soft);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    width: min(100% - 20px, 1600px);
    color: var(--ink);
    background: transparent;
  }

  .brand-mark {
    background: linear-gradient(145deg, #2787ce, var(--teal));
    border: 0;
  }

  .brand-name {
    color: var(--ink);
    font-size: 13px;
    letter-spacing: 0.1em;
  }

  .main-content,
  .site-footer {
    width: min(100% - 20px, 1600px);
  }

  .workspace-view {
    padding-top: 12px;
  }

  .legacy-workspace-frame {
    border-radius: var(--radius-md);
  }
}

/* WORKSPACE COLOR DEPTH
   The operator canvas is intentionally distinct from the page background while
   dense tables and editors retain quiet, high-contrast working surfaces. */
.legacy-workspace-frame {
  position: relative;
  background: #d9e8f3;
  border-color: #8fb5cf;
  box-shadow: 0 20px 52px rgb(13 77 141 / 16%), inset 0 4px 0 var(--blue);
}

.legacy-workspace-main {
  background: #e7f1f8;
}

.workspace-tabs {
  background: #dcebf5;
  border-right-color: #a6c2d6;
}

.workspace-nav-heading {
  border-bottom-color: #b4ccdc;
}

.workspace-nav-status {
  border-top-color: #b4ccdc;
}

.module-panel {
  background: #f4f9fc;
  box-shadow: inset 1px 0 0 rgb(255 255 255 / 80%);
}

.module-panel > .module-header {
  background: #eef6fb;
  border-bottom-color: #c9dce9;
}

.module-panel > .query-toolbar {
  background: #e1eff9;
  border-color: #b7d1e3;
}

@media (max-width: 760px) {
  .workspace-tabs {
    background: #dcebf5;
    border-bottom-color: #a6c2d6;
  }
}

/* STEEL NAVY THEME
   Keeps the existing light DirectCP workspace while aligning login, workspace,
   and Outlook add-in surfaces around the selected Steel Navy palette. */
:root {
  --ink: #101f30;
  --ink-soft: #4f6172;
  --muted: #637383;
  --line: #c9d8e4;
  --line-strong: #bdcedd;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-blue: #f3f7fa;
  --navy: #233f61;
  --navy-deep: #172d49;
  --blue: #233f61;
  --blue-dark: #172d49;
  --blue-bright: #3a8aa0;
  --teal: #3a8aa0;
  --teal-soft: #e5f3f6;
  --amber: #b36c42;
  --amber-soft: #fff1e8;
  --shadow-sm: 0 4px 16px rgb(35 63 97 / 6%);
  --shadow-md: 0 18px 48px rgb(35 63 97 / 11%);
}

html,
body {
  background: #eff4f8;
}

body {
  background:
    radial-gradient(circle at 7% 3%, rgb(58 138 160 / 8%), transparent 26rem),
    linear-gradient(180deg, #fbfdfe 0%, #eff4f8 100%);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible,
tr:focus-visible {
  outline-color: rgb(35 63 97 / 30%);
}

.brand-mark {
  background: linear-gradient(145deg, #3a8aa0, #233f61);
  box-shadow: 0 7px 16px rgb(35 63 97 / 18%);
}

.eyebrow,
.card-kicker,
.workspace-nav-kicker,
.meta-label {
  color: var(--blue);
}

.login-intro h1 em {
  color: var(--blue);
}

.login-card {
  border-color: var(--line);
  box-shadow: 0 22px 54px rgb(35 63 97 / 12%);
}

.button-primary {
  color: #ffffff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 7px 16px rgb(35 63 97 / 18%);
}

.button-primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}

.button-secondary,
.button-quiet,
.button-legacy-action,
.site-header .button-quiet {
  color: var(--navy);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled),
.button-legacy-action:hover:not(:disabled),
.site-header .button-quiet:hover:not(:disabled) {
  color: var(--navy-deep);
  background: #f3f7fa;
  border-color: #a8bdcf;
}

.workspace-heading h1,
.workspace-nav-heading strong,
.module-header h2,
.editor-heading h3 {
  color: var(--navy);
}

.workspace-meta,
.status-strip,
.table-card,
.editor-card {
  border-color: var(--line);
}

.legacy-workspace-frame {
  background: #dce7ef;
  border-color: #9fb9cf;
  box-shadow: 0 20px 52px rgb(35 63 97 / 15%), inset 0 4px 0 var(--navy);
}

.legacy-workspace-main {
  background: #e8f0f5;
}

.workspace-tabs {
  background: #e0e9f0;
  border-right-color: #bdcedd;
}

.workspace-nav-heading,
.workspace-nav-status {
  border-color: #bdcedd;
}

.workspace-tab:hover:not(.is-active) {
  color: var(--navy);
  background: #eef4f8;
  border-color: #cfdee9;
}

.workspace-tab.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  border-color: var(--navy);
  box-shadow: 0 10px 22px rgb(35 63 97 / 22%);
}

.workspace-tab.is-active .tab-index,
.workspace-tab.is-active .tab-copy strong,
.workspace-tab.is-active .tab-copy small,
.workspace-tab.is-active .tab-count {
  color: #ffffff;
}

.module-panel {
  background: #fbfdfe;
}

.module-panel > .module-header {
  background: #f3f7fa;
  border-bottom-color: var(--line);
}

.module-label {
  color: var(--teal);
}

.module-panel > .query-toolbar,
.query-toolbar,
.schedule-query-toolbar,
.booking-query-toolbar,
.hbl-query-toolbar,
.container-query-toolbar {
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  border-color: var(--navy);
  box-shadow: 0 10px 22px rgb(35 63 97 / 16%);
}

.query-toolbar .field-group label,
.query-toolbar label,
.schedule-query-toolbar .field-group label,
.booking-query-toolbar .field-group label,
.hbl-query-toolbar .field-group label,
.container-query-toolbar .field-group label {
  color: rgb(255 255 255 / 76%);
}

.query-toolbar input,
.query-toolbar select,
.query-toolbar .field-group input,
.query-toolbar .field-group select {
  color: var(--ink);
  background: rgb(255 255 255 / 96%);
  border-color: rgb(255 255 255 / 22%);
}

.query-toolbar input:focus,
.query-toolbar select:focus,
.query-toolbar .field-group input:focus,
.query-toolbar .field-group select:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgb(255 255 255 / 20%);
}

.query-actions .button-primary {
  color: var(--navy);
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 8px 18px rgb(0 0 0 / 12%);
}

.query-actions .button-primary:hover:not(:disabled) {
  color: var(--navy-deep);
  background: #f3f7fa;
  border-color: #f3f7fa;
}

.query-actions .button-quiet {
  color: #ffffff;
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 34%);
}

.query-actions .button-quiet:hover:not(:disabled) {
  color: #ffffff;
  background: rgb(255 255 255 / 18%);
  border-color: rgb(255 255 255 / 52%);
}

/* QUERY BAR REDESIGN
   The dense search forms read better as quiet work surfaces with navy action
   emphasis, rather than full-width dark bands of mixed labels and fields. */
.module-panel > .query-toolbar,
.query-toolbar,
.schedule-query-toolbar,
.booking-query-toolbar,
.hbl-query-toolbar,
.container-query-toolbar {
  align-items: end;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px 14px 13px;
  background:
    linear-gradient(90deg, var(--navy) 0 4px, transparent 4px),
    linear-gradient(180deg, #fbfdff 0%, #f4f8fb 100%);
  border: 1px solid #bfd1df;
  border-radius: 13px;
  box-shadow: 0 10px 24px rgb(35 63 97 / 8%);
}

.schedule-query-toolbar {
  grid-template-columns:
    minmax(190px, 1.25fr)
    repeat(3, minmax(130px, 1fr))
    minmax(104px, .62fr)
    minmax(156px, .92fr);
}

.booking-query-toolbar {
  grid-template-columns:
    minmax(260px, 1fr)
    minmax(320px, 1.5fr)
    minmax(72px, .24fr)
    auto;
}

.hbl-query-toolbar {
  grid-template-columns:
    minmax(210px, 1fr)
    minmax(210px, 1fr)
    minmax(260px, 1.25fr)
    minmax(200px, .9fr)
    minmax(72px, .24fr)
    auto;
}

.container-query-toolbar {
  grid-template-columns:
    minmax(190px, 1.12fr)
    repeat(3, minmax(150px, 1fr))
    minmax(126px, .76fr)
    minmax(126px, .76fr);
}

.query-field,
.query-toolbar .field-group {
  gap: 5px;
}

.query-toolbar .field-group label,
.query-toolbar label,
.schedule-query-toolbar .field-group label,
.booking-query-toolbar .field-group label,
.hbl-query-toolbar .field-group label,
.container-query-toolbar .field-group label {
  color: #536577;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.15;
  white-space: nowrap;
}

.query-toolbar input,
.query-toolbar select,
.query-toolbar .field-group input,
.query-toolbar .field-group select {
  height: 38px;
  min-height: 38px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #b8c9d7;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
  font-size: 13px;
}

.query-toolbar input::placeholder,
.query-toolbar .field-group input::placeholder {
  color: #7a8a9a;
}

.query-toolbar input:focus,
.query-toolbar select:focus,
.query-toolbar .field-group input:focus,
.query-toolbar .field-group select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgb(35 63 97 / 13%);
}

.query-actions {
  align-self: end;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.query-actions .button {
  min-height: 38px;
  border-radius: 9px;
  font-size: 12px;
}

.query-actions .button-primary {
  min-width: 104px;
  color: #ffffff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 8px 18px rgb(35 63 97 / 18%);
}

.query-actions .button-primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}

.query-actions .button-quiet {
  color: var(--navy);
  background: #ffffff;
  border-color: #a9bdcf;
}

.query-actions .button-quiet:hover:not(:disabled) {
  color: var(--navy-deep);
  background: #edf3f8;
  border-color: #8fa7bd;
}

.schedule-query-toolbar .query-cell-count,
.schedule-query-toolbar .query-actions {
  grid-row: 2;
}

.schedule-query-toolbar .query-actions {
  grid-column: 4 / -1;
}

.container-query-toolbar .query-actions {
  grid-column: 6 / -1;
}

.container-query-toolbar .query-cell-count {
  max-width: 76px;
}

.booking-query-toolbar .query-actions,
.hbl-query-toolbar .query-actions {
  flex-wrap: nowrap;
}

@media (max-width: 1180px) {
  .schedule-query-toolbar,
  .booking-query-toolbar,
  .hbl-query-toolbar,
  .container-query-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-query-toolbar .query-actions,
  .container-query-toolbar .query-actions,
  .booking-query-toolbar .query-actions,
  .hbl-query-toolbar .query-actions {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* HEADER BAR REFINEMENT
   Matches the quieter query controls while keeping the DirectCP identity and
   current information architecture intact. */
.site-header {
  background:
    linear-gradient(90deg, rgb(35 63 97 / 4%), transparent 32rem),
    linear-gradient(180deg, #fbfdff 0%, #f3f8fb 100%);
  border-bottom-color: #cad8e4;
  box-shadow: 0 1px 0 rgb(255 255 255 / 80%);
}

.window-titlebar,
.ctl-menubar,
.quick-toolbar {
  background: transparent;
}

.window-titlebar {
  gap: 20px;
  padding: 0 26px 0 4px;
}

.brand {
  gap: 13px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 16px;
  box-shadow: 0 9px 20px rgb(35 63 97 / 20%);
}

.brand-name {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .16em;
}

.brand-subtitle {
  color: #6a7a89;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .23em;
}

.window-title-state {
  min-height: 30px;
  align-items: center;
  padding-left: 24px;
  color: #526477;
  border-left: 1px solid #c7d6e3;
  font-size: 13px;
  font-weight: 700;
}

.ctl-menubar {
  align-items: center;
  padding: 0 28px;
  border-left-color: #c7d6e3;
  border-right-color: #c7d6e3;
}

.ctl-menu > summary {
  min-height: 42px;
  padding: 0 17px;
  color: var(--navy);
  background: #ffffff;
  border-color: #b6c8d8;
  border-radius: 13px;
  box-shadow: 0 9px 18px rgb(35 63 97 / 8%);
}

.ctl-menu > summary:hover,
.ctl-menu[open] > summary {
  color: var(--navy-deep);
  background: #f7fbfd;
  border-color: #93acc4;
}

.menu-context {
  color: #687b8c;
}

.quick-toolbar {
  padding-left: 22px;
}

.quick-context {
  color: #3a8aa0;
  font-weight: 800;
}

.header-tools {
  gap: 11px;
}

.connection-badge,
.header-user,
.build-stamp {
  color: #5d6f81;
}

.site-header .button-small {
  min-height: 36px;
  border-radius: 11px;
  font-weight: 800;
}

/* QUERY BAR POLISH PASS
   Component scope: the filter row should read as one compact operation strip,
   not as a field card grid. */
.module-panel > .query-toolbar,
.query-toolbar,
.schedule-query-toolbar,
.booking-query-toolbar,
.hbl-query-toolbar,
.container-query-toolbar {
  grid-template-columns: repeat(12, minmax(0, 1fr)) 184px;
  gap: 10px 12px;
  align-items: center;
  padding: 11px 12px 11px 14px;
  background:
    linear-gradient(90deg, var(--navy) 0 4px, transparent 4px),
    linear-gradient(180deg, #f8fbfd 0%, #eef6fb 100%);
  border-color: #aec5d7;
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 72%);
}

.query-field,
.query-toolbar .field-group {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.legacy-lookup-field {
  min-width: 0;
}

.query-toolbar .field-group label,
.query-toolbar label,
.schedule-query-toolbar .field-group label,
.booking-query-toolbar .field-group label,
.hbl-query-toolbar .field-group label,
.container-query-toolbar .field-group label {
  color: #4b5e70;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.query-toolbar input,
.query-toolbar select,
.query-toolbar .field-group input,
.query-toolbar .field-group select {
  height: 36px;
  min-height: 36px;
  border-color: #afc2d2;
  border-radius: 8px;
  font-size: 13px;
}

.query-toolbar input:focus,
.query-toolbar select:focus,
.query-toolbar .field-group input:focus,
.query-toolbar .field-group select:focus {
  outline: 2px solid rgb(35 63 97 / 32%);
  outline-offset: 1px;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 90%);
}

.query-cell-count {
  grid-template-columns: max-content minmax(68px, 86px);
}

.query-actions {
  grid-column: 13;
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid #c8d7e3;
}

.query-actions .button {
  min-height: 36px;
  padding-inline: 12px;
  border-radius: 8px;
}

.query-actions .button-primary {
  min-width: 104px;
}

.schedule-query-toolbar .query-field:has(#scheduleSearchInput) {
  grid-column: 1 / 3;
}

.schedule-query-toolbar .query-field:has(#schedulePolInput) {
  grid-column: 3 / 5;
}

.schedule-query-toolbar .query-field:has(#schedulePodInput) {
  grid-column: 5 / 7;
}

.schedule-query-toolbar .query-field:has(#scheduleCarrierInput) {
  grid-column: 7 / 9;
}

.schedule-query-toolbar .query-field:has(#scheduleEtdFromInput) {
  grid-column: 9 / 11;
}

.schedule-query-toolbar .query-field:has(#scheduleEtdToInput) {
  grid-column: 11 / 13;
}

.schedule-query-toolbar .query-field:has(#scheduleCountInput) {
  grid-column: 1 / 3;
  grid-row: 2;
}

.schedule-query-toolbar .query-actions {
  grid-column: 13;
  grid-row: 1 / 3;
}

.booking-query-toolbar .query-field:has(#bookingJobInput) {
  grid-column: 1 / 5;
}

.booking-query-toolbar .query-field:has(#bookingScheduleInput) {
  grid-column: 5 / 10;
}

.booking-query-toolbar .query-field:has(#bookingCountInput) {
  grid-column: 10 / 13;
}

.hbl-query-toolbar .query-field:has(#hblJobInput) {
  grid-column: 1 / 3;
}

.hbl-query-toolbar .query-field:has(#hblNumberInput) {
  grid-column: 3 / 5;
}

.hbl-query-toolbar .query-field:has(#hblCustomerInput) {
  grid-column: 5 / 8;
}

.hbl-query-toolbar .query-field:has(#hblAesInput) {
  grid-column: 8 / 10;
}

.hbl-query-toolbar .query-field:has(#hblCountInput) {
  grid-column: 10 / 13;
}

.container-query-toolbar .query-field:has(#containerFileSearchInput) {
  grid-column: 1 / 4;
}

.container-query-toolbar .query-field:has(#containerFileJobInput) {
  grid-column: 4 / 6;
}

.container-query-toolbar .query-field:has(#containerFileSoInput) {
  grid-column: 6 / 8;
}

.container-query-toolbar .query-field:has(#containerFileContainerInput) {
  grid-column: 8 / 10;
}

.container-query-toolbar .query-field:has(#containerFileVesselInput) {
  grid-column: 10 / 13;
}

.container-query-toolbar .query-field:has(#containerFileVoyageInput) {
  grid-column: 1 / 3;
  grid-row: 2;
}

.container-query-toolbar .query-field:has(#containerFilePolInput) {
  grid-column: 3 / 5;
  grid-row: 2;
}

.container-query-toolbar .query-field:has(#containerFilePodInput) {
  grid-column: 5 / 7;
  grid-row: 2;
}

.container-query-toolbar .query-field:has(#containerFileEtdFromInput) {
  grid-column: 7 / 9;
  grid-row: 2;
}

.container-query-toolbar .query-field:has(#containerFileEtdToInput) {
  grid-column: 9 / 11;
  grid-row: 2;
}

.container-query-toolbar .query-field:has(#containerFileCountInput) {
  grid-column: 11 / 13;
  grid-row: 2;
}

.container-query-toolbar .query-actions {
  grid-column: 13;
  grid-row: 1 / 3;
}

.lookup-popup-portal {
  max-height: 250px;
  overflow: auto;
  background: #f8fbfd;
  border-color: #9fb7cb;
  border-radius: 10px;
  box-shadow: 0 18px 40px -24px rgb(35 63 97 / 55%);
}

.lookup-popup-portal .lookup-grid-row {
  grid-template-columns: minmax(0, 1.45fr) minmax(72px, .75fr) minmax(56px, .5fr);
}

.lookup-popup-portal .lookup-cell:nth-child(n + 4) {
  display: none;
}

.lookup-popup-portal .lookup-header {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #eef5fa;
  border-bottom: 1px solid #cad9e5;
}

.lookup-popup-portal .lookup-option {
  min-height: 34px;
}

.lookup-popup-portal .lookup-cell {
  min-width: 0;
  overflow: hidden;
  padding: 8px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookup-popup-portal .lookup-footer {
  position: sticky;
  bottom: 0;
  background: #f3f8fb;
  border-top: 1px solid #cad9e5;
}

@media (max-width: 1180px) {
  .schedule-query-toolbar,
  .booking-query-toolbar,
  .hbl-query-toolbar,
  .container-query-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-query-toolbar .query-field,
  .booking-query-toolbar .query-field,
  .hbl-query-toolbar .query-field,
  .container-query-toolbar .query-field,
  .schedule-query-toolbar .query-actions,
  .booking-query-toolbar .query-actions,
  .hbl-query-toolbar .query-actions,
  .container-query-toolbar .query-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .query-actions {
    grid-column: 1 / -1;
    align-self: auto;
    justify-content: flex-start;
    padding-left: 0;
    border-left: 0;
  }
}

.data-table th {
  color: #4f6172;
  background: #f3f7fa;
}

.data-table tbody tr:hover td,
.data-table tbody tr.is-selected td {
  background: #edf4f8;
}

/* Compact operations search refresh */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

.workspace-heading,
.module-panel > .module-header {
  display: none !important;
}

.status-strip {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.workspace-view {
  width: min(100% - 36px, 1680px);
  min-height: calc(100dvh - 74px);
  padding: 8px 0 12px;
}

.legacy-workspace-frame {
  min-height: calc(100dvh - 92px);
  border-color: #c3d3df;
  border-radius: 22px;
  box-shadow: 0 22px 70px rgb(30 52 71 / 0.14);
}

.workspace-sidebar {
  background: linear-gradient(180deg, #e7f0f6 0%, #dbe8f0 100%);
  border-right-color: #c1d2df;
}

.workspace-tab {
  border-radius: 10px;
}

.workspace-tab.is-active {
  background: #0f253c;
  box-shadow: 0 10px 24px rgb(15 37 60 / 0.2);
}

.workspace-nav-status {
  color: #385166;
}

.module-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
  gap: 12px;
}

.module-panel > .query-toolbar,
.query-toolbar,
.schedule-query-toolbar,
.booking-query-toolbar,
.hbl-query-toolbar,
.container-query-toolbar {
  display: grid !important;
  grid-template-columns: minmax(320px, 1.18fr) minmax(360px, 1.35fr);
  gap: 10px 12px;
  align-items: stretch;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid #bfd1de !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #f9fcfe 0%, #eff6fa 100%) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.82);
}

.query-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 38px;
  gap: 5px 8px;
  align-items: end;
  min-width: 0;
}

.query-main > label {
  grid-column: 1 / -1;
  color: #31506a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.query-main .search-box,
.query-main .legacy-lookup-field {
  min-width: 0;
}

.query-main .button {
  min-width: 104px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  white-space: nowrap;
}

.query-toolbar input,
.query-toolbar select,
.query-toolbar .field-group input,
.query-toolbar .field-group select {
  height: 36px;
  min-height: 36px;
  border-color: #c7d6e1;
  border-radius: 10px;
  background-color: #fbfdfe;
  color: #172c42;
  font-size: 13px;
  font-weight: 750;
}

.query-toolbar input::placeholder,
.query-toolbar .field-group input::placeholder {
  color: #7f93a5;
  font-weight: 650;
}

.query-toolbar input:focus,
.query-toolbar select:focus,
.query-toolbar .field-group input:focus,
.query-toolbar .field-group select:focus {
  border-color: #2f7f9d;
  box-shadow: 0 0 0 3px rgb(47 127 157 / 0.16);
}

.route-shortcuts {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.route-title,
.route-pair-heading {
  display: flex;
  align-items: center;
  min-height: 22px;
  gap: 7px;
  color: #2c7994;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.route-title > span {
  margin-right: auto;
}

.route-section-add-button,
.route-pair-add-button {
  width: 24px;
  height: 22px;
  border-radius: 8px;
  color: #21445e;
  background: #e8f4f7;
  border: 1px solid #c8dce5;
  box-shadow: none;
}

.route-section-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.route-shortcut-section {
  min-width: 0;
  min-height: 67px;
  padding: 8px;
  border: 1px solid #c7d9e4;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.54);
}

.route-section-header,
.route-shortcut-section-heading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 0;
  margin-bottom: 2px;
}

.route-section-name {
  width: 100%;
  height: 23px !important;
  min-height: 23px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  color: #346072 !important;
  background: #f1fbfc !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-section-delete-button {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  border: 1px solid #cfdae4;
  border-radius: 8px;
  color: #6f8495;
  background: #f8fbfd;
}

.route-shortcut-list,
.route-pair-list,
.route-shortcut-dropzone {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 25px;
  align-content: flex-start;
}

.route-pair-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #bedfe7;
  border-radius: 999px;
  color: #176174;
  background: #e7f8fa;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.route-pair-chip.is-active,
.route-pair-chip:hover {
  color: #ffffff;
  background: #1d7188;
  border-color: #1d7188;
}

.route-shortcut-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
}

.route-pair-chip button,
.route-shortcut-delete,
.route-shortcut-remove-button {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: 1;
}

.filter-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 0.82fr) minmax(250px, 0.96fr) auto;
  gap: 8px;
  align-items: stretch;
}

.booking-query-toolbar .filter-row {
  grid-template-columns: minmax(190px, 0.9fr) minmax(230px, 1fr) minmax(120px, 0.34fr) minmax(120px, 0.34fr);
}

.hbl-query-toolbar .filter-row {
  grid-template-columns: minmax(150px, 0.76fr) minmax(170px, 0.85fr) minmax(210px, 1fr) minmax(150px, 0.76fr) auto;
}

.container-query-toolbar .filter-row {
  grid-template-columns: minmax(350px, 1.2fr) minmax(230px, 0.86fr) auto;
}

.filter-row fieldset {
  min-width: 0;
  margin: 0;
  padding: 8px 9px 10px;
  border: 1px solid #c7d9e4;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.55);
}

.filter-row legend {
  padding: 0 5px;
  color: #2b718c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.route-grid,
.two-grid,
.three-grid,
.date-grid {
  display: grid;
  gap: 7px;
  align-items: center;
}

.route-grid {
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
}

.two-grid,
.date-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arrow {
  color: #1b708a;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.filter-row > .button {
  align-self: end;
  min-width: 88px;
  min-height: 38px;
  border-radius: 11px;
  white-space: nowrap;
}

.module-panel > .table-card,
.table-card {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 !important;
  border-color: #c7d6e1;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.table-toolbar {
  min-height: 48px;
  padding: 9px 12px;
  border-bottom: 1px solid #d9e4ec;
  background: #fbfdfe;
}

.table-toolbar-title {
  gap: 10px;
}

.table-toolbar-title strong {
  color: #11283e;
  font-size: 14px;
}

.table-meta {
  color: #6e8191;
  font-size: 12px;
}

.schedule-result-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.selected-row-action-buttons {
  padding: 8px 10px;
  border-bottom: 1px solid #cfdeea;
  background: #d9ebfb;
}

.booking-results-card #bookingRowActions {
  flex-direction: column;
  align-items: stretch;
}

.selected-row-button-strip,
.editor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.linked-hbl-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#containerFilesPanel.is-detail-mode > .editor-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

#containerFilesPanel.is-detail-mode .container-file-editor-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

#containerFilesPanel.is-detail-mode .container-file-editor-grid .editor-section-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

#containerFilesPanel.is-detail-mode .container-file-editor-grid .field-etd,
#containerFilesPanel.is-detail-mode .container-file-editor-grid .field-eta,
#containerFilesPanel.is-detail-mode .container-file-editor-grid .field-ata {
  grid-column: span 1 !important;
}

#containerFilesPanel.is-detail-mode .container-file-editor-grid .field-notes,
#containerFilesPanel.is-detail-mode .container-file-editor-grid .field-agentNotes {
  grid-column: span 2 !important;
}

#containerFilesPanel.is-detail-mode .container-file-editor-grid textarea {
  min-height: 76px;
  resize: vertical;
}

#containerFilesPanel.is-detail-mode .linked-hbl-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bacbd5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 9px rgb(30 57 74 / 0.05);
}

#containerFilesPanel.is-detail-mode .linked-hbl-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d4dfe5;
}

#containerFilesPanel.is-detail-mode .linked-hbl-scroll {
  min-height: 0;
  max-height: none;
  margin-top: 10px;
}

#containerFilesPanel.is-detail-mode .linked-hbl-table {
  min-width: 900px;
}

.table-scroll {
  max-height: calc(100dvh - 300px);
  min-height: 220px;
  overflow: auto;
}

body.has-result-table-mode .table-scroll {
  max-height: calc(100dvh - 238px);
}

.data-table {
  min-width: 980px;
  font-size: 12px;
}

.data-table th,
.data-table td {
  height: 34px;
  padding: 7px 9px;
  border-bottom-color: #e1e9f0;
}

.data-table th {
  position: sticky;
  z-index: 3;
  top: 0;
  color: #40596d;
  background: #f0f6fa;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.data-table tbody tr:hover td,
.data-table tbody tr.is-selected td {
  background: #e5f1fb;
}

.data-table tbody tr.is-selected td:first-child {
  box-shadow: inset 4px 0 0 #2a7f9d;
}

.login-view {
  width: min(100% - 48px, 1080px);
  min-height: calc(100dvh - 80px);
  grid-template-columns: minmax(320px, 430px) minmax(320px, 390px);
  gap: clamp(46px, 7vw, 108px);
  align-items: center;
  padding: 38px 0 64px;
}

.login-intro h1 {
  max-width: 410px;
  color: #15304b;
  font-size: clamp(50px, 5.2vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 430px;
  color: #526c80;
  font-size: 16px;
}

.intro-points {
  max-width: 430px;
}

.login-card {
  width: min(100%, 390px);
  padding: 27px;
  border-color: #cbd9e4;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgb(35 55 76 / 0.13);
}

.login-card .card-kicker {
  color: #31506a;
  letter-spacing: 0.16em;
}

.login-card h2 {
  color: #15304b;
  font-size: 28px;
}

.login-card .card-lead {
  color: #607588;
  font-size: 13px;
}

.login-card .stack-form {
  gap: 14px;
}

.login-card .field-group {
  gap: 6px;
}

.login-card .field-group label {
  color: #233a51;
  font-size: 12px;
  font-weight: 850;
}

.login-card .field-group input,
.login-card .field-group select {
  height: 42px;
  border-color: #c6d6e2;
  border-radius: 10px;
  color: #132a40;
  background: #fbfdff;
}

.login-card .button-wide {
  min-height: 44px;
  margin-top: 2px;
  border-radius: 10px;
}

.login-cert-callout {
  margin-top: 12px;
  padding: 10px 12px;
  border-color: #c6d6e2;
  border-radius: 10px;
  background: #f6fbff;
}

.login-cert-callout a {
  color: #245fc5;
}

.login-card .card-footnote {
  margin-top: 15px;
  padding-top: 13px;
  border-top-color: #d9e4ec;
}

@media (max-width: 1280px) {
  .workspace-view {
    width: min(100% - 24px, 1280px);
  }

  .module-panel > .query-toolbar,
  .query-toolbar,
  .schedule-query-toolbar,
  .booking-query-toolbar,
  .hbl-query-toolbar,
  .container-query-toolbar {
    grid-template-columns: 1fr;
  }

  .route-section-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .container-query-toolbar .filter-row,
  .hbl-query-toolbar .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .container-query-toolbar .filter-row > .button,
  .hbl-query-toolbar .filter-row > .button {
    justify-self: start;
  }
}

@media (max-width: 900px) {
  .legacy-workspace-frame {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    border-right: 0;
    border-bottom: 1px solid #c1d2df;
  }

  .workspace-tabs {
    display: flex;
    padding: 10px;
  }

  .workspace-tab {
    min-width: 168px;
  }

  .workspace-nav-status {
    display: none;
  }

  .filter-row,
  .booking-query-toolbar .filter-row,
  .hbl-query-toolbar .filter-row,
  .container-query-toolbar .filter-row {
    grid-template-columns: 1fr;
  }

  .route-section-list {
    grid-template-columns: 1fr;
  }

  .three-grid,
  .two-grid,
  .date-grid {
    grid-template-columns: 1fr;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .arrow {
    display: none;
  }

  .table-scroll {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .login-view {
    width: min(100% - 28px, 520px);
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
    padding: 28px 0 54px;
  }

  .login-intro h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .login-card {
    width: 100%;
    padding: 22px;
  }

  .workspace-view {
    width: min(100% - 18px, 760px);
    padding-top: 6px;
  }

  .module-panel {
    padding: 10px;
  }

  .query-main {
    grid-template-columns: 1fr;
  }

  .query-main .button,
  .filter-row > .button {
    width: 100%;
  }

  .module-panel > .query-toolbar,
  .query-toolbar,
  .schedule-query-toolbar,
  .booking-query-toolbar,
  .hbl-query-toolbar,
  .container-query-toolbar {
    padding: 10px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 760px) {
  .workspace-tabs {
    background: #e0e9f0;
    border-bottom-color: #bdcedd;
  }
}

/* REFERENCE PARITY WORKSPACE
   Matches the approved compact search preview while retaining all route shortcut
   management behavior behind hover and keyboard focus states. */
body.workspace-active {
  overflow-x: hidden;
  background: #eef5f8;
}

body.workspace-active .site-header,
body.workspace-active .status-strip {
  display: none !important;
}

body.workspace-active .main-content {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 28px;
}

body.workspace-active .workspace-view {
  width: 100%;
  min-height: calc(100dvh - 56px);
  padding: 0;
}

body.workspace-active .legacy-workspace-frame {
  min-height: calc(100dvh - 56px);
  overflow: hidden;
  border: 1px solid #c7d7e1;
  border-radius: 28px;
  background: #f8fbfd;
  box-shadow: 0 24px 54px rgb(31 55 72 / 0.13);
}

body.workspace-active .legacy-workspace-main {
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100dvh - 58px);
  background: #f8fbfd;
}

body.workspace-active .workspace-tabs {
  gap: 5px;
  min-width: 0;
  padding: 28px 18px 20px;
  background: #e3eef3;
  border-right: 1px solid #c6d6df;
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 10px 26px;
  color: #17324d;
  text-decoration: none;
}

.workspace-brand .brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: #14506f;
  box-shadow: none;
  font-size: 13px;
}

.workspace-brand .brand-name {
  color: #162f49;
  font-size: 18px;
  letter-spacing: 0.12em;
}

.workspace-brand .brand-subtitle {
  margin-top: 4px;
  color: #6d8294;
  font-size: 9px;
  letter-spacing: 0.18em;
}

body.workspace-active .workspace-nav-heading {
  margin: 0 12px 9px;
  padding: 0 0 11px;
  border-bottom: 0;
}

body.workspace-active .workspace-nav-kicker {
  color: #657c90;
  font-size: 10px;
  letter-spacing: 0.16em;
}

body.workspace-active .workspace-nav-heading strong {
  margin-top: 8px;
  color: #23415f;
  font-size: 16px;
}

body.workspace-active .workspace-nav-heading small {
  margin-top: 5px;
  color: #788b9b;
  font-size: 11px;
}

body.workspace-active .workspace-tab {
  min-height: 45px;
  padding: 0 12px;
  border-radius: 10px;
}

body.workspace-active .workspace-tab .tab-copy small,
body.workspace-active .workspace-tab .tab-count {
  display: none;
}

body.workspace-active .workspace-tab .tab-copy strong {
  font-size: 12px;
}

body.workspace-active .workspace-tab .tab-index {
  width: 22px;
  font-size: 10px;
}

body.workspace-active .workspace-tab.is-active {
  background: #132d46;
  border-color: #132d46;
  box-shadow: none;
}

body.workspace-active .workspace-nav-status {
  margin: auto 12px 0;
  padding: 19px 0 0;
  color: #18a67d;
  border-top: 1px solid #c4d4dd;
  font-size: 11px;
}

body.workspace-active .workspace-nav-status > strong {
  margin-top: 5px;
  color: #5b7185;
  font-size: 11px;
}

body.workspace-active .module-panel {
  min-height: 0;
  gap: 12px;
  padding: 24px 34px;
  background: #f8fbfd;
}

body.workspace-active .module-panel > .query-toolbar,
body.workspace-active #scheduleQueryForm {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px !important;
  align-items: stretch;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid #bfd2de !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, #fbfdfe 0%, #f1f7fa 100%) !important;
  box-shadow: 0 12px 22px rgb(27 54 74 / 0.08) !important;
}

body.workspace-active #scheduleQueryForm .query-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  grid-template-rows: 40px;
  gap: 8px;
}

body.workspace-active #scheduleQueryForm .query-main > label {
  display: none;
}

body.workspace-active #scheduleQueryForm .query-main .legacy-lookup-field,
body.workspace-active #scheduleQueryForm .query-main input {
  height: 40px;
  min-height: 40px;
}

body.workspace-active #scheduleQueryForm .query-main .legacy-lookup-field {
  position: relative;
}

body.workspace-active #scheduleQueryForm .query-main .legacy-lookup-field::before {
  content: "⌕";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: #14718f;
  font-size: 18px;
  font-weight: 900;
  transform: translateY(-52%);
  pointer-events: none;
}

body.workspace-active #scheduleSearchInput {
  padding-left: 45px;
  color: #18334e;
  border-color: #c3d5df;
  border-radius: 14px;
  background: #ffffff;
  font-size: 13px;
}

body.workspace-active #scheduleQueryForm .query-main .button {
  min-width: 78px;
  min-height: 36px;
  height: 36px;
  align-self: center;
  padding: 0 12px;
  border-radius: 11px;
  background: #132d46;
  border-color: #132d46;
  box-shadow: none;
  font-size: 12px;
}

body.workspace-active #scheduleQueryForm .query-main .button > span {
  display: none;
}

body.workspace-active #scheduleQueryForm .route-shortcuts {
  position: relative;
  display: block;
}

body.workspace-active #scheduleQueryForm .route-title {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 9px;
  min-height: 20px;
}

body.workspace-active #scheduleQueryForm .route-title > span {
  display: none;
}

body.workspace-active #scheduleQueryForm .route-title .icon-button,
body.workspace-active #scheduleQueryForm .route-section-delete-button,
body.workspace-active #scheduleQueryForm .route-shortcut-remove-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

body.workspace-active #scheduleQueryForm .route-shortcuts:hover .route-title .icon-button,
body.workspace-active #scheduleQueryForm .route-shortcuts:focus-within .route-title .icon-button,
body.workspace-active #scheduleQueryForm .route-shortcut-section:hover .route-section-delete-button,
body.workspace-active #scheduleQueryForm .route-shortcut-section:focus-within .route-section-delete-button,
body.workspace-active #scheduleQueryForm .route-shortcut-item:hover .route-shortcut-remove-button,
body.workspace-active #scheduleQueryForm .route-shortcut-item:focus-within .route-shortcut-remove-button {
  opacity: 1;
  pointer-events: auto;
}

body.workspace-active #scheduleQueryForm .route-section-list {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr;
  gap: 8px;
  margin: 0;
}

body.workspace-active #scheduleQueryForm .route-shortcut-section {
  min-height: 96px;
  padding: 11px 10px;
  border: 1px solid #c5d8e2;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.45);
}

body.workspace-active #scheduleQueryForm .route-shortcut-section-heading {
  width: 100%;
  min-height: 0;
  margin: 0 0 2px;
}

body.workspace-active #scheduleQueryForm .route-section-delete-button {
  width: 19px;
  height: 19px;
  border: 0;
  background: transparent;
}

body.workspace-active #scheduleQueryForm .route-pair-list {
  gap: 6px;
  min-height: 24px;
}

body.workspace-active #scheduleQueryForm .route-pair-chip {
  min-height: 24px;
  padding: 0 10px;
  border-color: #c9dde5;
  color: #176276;
  background: #f7fcfd;
  font-size: 10px;
  letter-spacing: 0;
}

body.workspace-active #scheduleQueryForm .route-pair-chip.is-active,
body.workspace-active #scheduleQueryForm .route-pair-chip:hover {
  color: #ffffff;
  background: #1b738b;
  border-color: #1b738b;
}

body.workspace-active #scheduleQueryForm .filter-row {
  display: grid;
  grid-template-columns: 1.1fr 0.84fr 1.04fr;
  gap: 8px;
}

body.workspace-active #scheduleQueryForm .filter-row fieldset {
  min-width: 0;
  padding: 7px 9px 9px;
  border: 1px solid #c7d9e3;
  border-radius: 13px;
  background: rgb(255 255 255 / 0.48);
}

body.workspace-active #scheduleQueryForm .filter-row legend {
  color: #2c6d86;
  font-size: 10px;
  letter-spacing: 0.13em;
}

body.workspace-active #scheduleQueryForm .filter-row input,
body.workspace-active #scheduleQueryForm .filter-row select {
  height: 31px;
  min-height: 31px;
  border-radius: 10px;
  font-size: 11px;
}

body.workspace-active #scheduleQueryForm #clearScheduleQueryButton {
  display: none;
}

body.workspace-active .module-panel > .table-card,
body.workspace-active .module-panel.is-results-mode > .table-card,
body.workspace-active .table-card {
  flex: 0 0 auto;
  min-height: 0;
  margin: 0 !important;
  border: 1px solid #cbdbe4;
  border-radius: 16px;
  box-shadow: none;
}

body.workspace-active .table-toolbar {
  min-height: 58px;
  padding: 10px 16px;
  background: #ffffff;
}

body.workspace-active .table-toolbar-title strong {
  font-size: 14px;
}

body.workspace-active .table-meta {
  font-size: 11px;
}

body.workspace-active .schedule-result-actions .button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 11px;
}

body.workspace-active .table-scroll,
body.workspace-active .module-panel.is-results-mode .table-scroll,
body.workspace-active body.has-result-table-mode .table-scroll {
  min-height: 0;
  max-height: 360px;
  overflow: auto;
}

body.workspace-active #schedulesPanel .data-table {
  min-width: 980px;
  font-size: 11px;
}

body.workspace-active #schedulesPanel .data-table th,
body.workspace-active #schedulesPanel .data-table td {
  height: 41px;
  padding: 8px 10px;
}

body.workspace-active #schedulesPanel .data-table th {
  color: #526a7e;
  background: #e9f2f7;
  font-size: 10px;
  letter-spacing: 0.08em;
}

body.workspace-active #schedulesPanel .data-table .select-column,
body.workspace-active #schedulesPanel .data-table col[data-column-key="__select"],
body.workspace-active #schedulesPanel .data-table th[data-column-key="eta"],
body.workspace-active #schedulesPanel .data-table td[data-field="eta"],
body.workspace-active #schedulesPanel .data-table col[data-column-key="eta"],
body.workspace-active #schedulesPanel .data-table th[data-column-key="cfsClosing"],
body.workspace-active #schedulesPanel .data-table td[data-field="cfsClosing"],
body.workspace-active #schedulesPanel .data-table col[data-column-key="cfsClosing"],
body.workspace-active #schedulesPanel .data-table th[data-column-key="remark"],
body.workspace-active #schedulesPanel .data-table td[data-field="remark"],
body.workspace-active #schedulesPanel .data-table col[data-column-key="remark"],
body.workspace-active #schedulesPanel .data-table th[data-column-key="delayReason"],
body.workspace-active #schedulesPanel .data-table td[data-field="delayReason"],
body.workspace-active #schedulesPanel .data-table col[data-column-key="delayReason"] {
  display: none;
}

body.workspace-active #schedulesPanel .data-table tbody tr.is-selected td:first-of-type {
  box-shadow: inset 4px 0 0 #237993;
}

body.workspace-active .empty-state {
  min-height: 126px;
}

@media (max-width: 1280px) {
  body.workspace-active .main-content {
    padding: 16px;
  }

  body.workspace-active .workspace-view,
  body.workspace-active .legacy-workspace-frame,
  body.workspace-active .legacy-workspace-main {
    min-height: calc(100dvh - 32px);
  }

  body.workspace-active .legacy-workspace-main {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  body.workspace-active .module-panel {
    padding: 18px;
  }
}

@media (max-width: 980px) {
  body.workspace-active #scheduleQueryForm .route-section-list,
  body.workspace-active #scheduleQueryForm .filter-row {
    grid-template-columns: 1fr;
  }

  body.workspace-active #scheduleQueryForm .route-shortcut-section {
    min-height: 72px;
  }
}

@media (max-width: 760px) {
  body.workspace-active .main-content {
    padding: 0;
  }

  body.workspace-active .workspace-view,
  body.workspace-active .legacy-workspace-frame,
  body.workspace-active .legacy-workspace-main {
    min-height: 100dvh;
  }

  body.workspace-active .legacy-workspace-frame {
    border-width: 0;
    border-radius: 0;
  }

  body.workspace-active .legacy-workspace-main {
    grid-template-columns: 1fr;
  }

  body.workspace-active .workspace-tabs {
    display: flex;
    overflow-x: auto;
    padding: 9px;
    border-right: 0;
    border-bottom: 1px solid #c6d6df;
  }

  body.workspace-active .workspace-brand,
  body.workspace-active .workspace-nav-heading,
  body.workspace-active .workspace-nav-status {
    display: none;
  }

  body.workspace-active .workspace-tab {
    min-width: 150px;
  }

  body.workspace-active .module-panel {
    padding: 10px;
  }

  body.workspace-active #scheduleQueryForm .query-main {
    grid-template-columns: minmax(0, 1fr) 72px;
  }
}

/* WORKSPACE DEPTH AND CROSS-MODULE CONSISTENCY */
body.session-pending {
  min-height: 100dvh;
  background: #e7eef2;
}

body.session-pending .site-header,
body.session-pending .main-content {
  visibility: hidden;
}

body.workspace-active {
  overflow-y: auto;
  background: #e7eef2;
}

body.workspace-active .workspace-view,
body.workspace-active .legacy-workspace-frame,
body.workspace-active .legacy-workspace-main,
body.workspace-active .module-panel,
body.workspace-active .module-panel.is-results-mode {
  height: auto !important;
  max-height: none !important;
}

body.workspace-active .legacy-workspace-frame {
  position: relative;
  overflow: visible;
  border-color: #aebfca;
  background: #ffffff;
  box-shadow: 0 24px 58px rgb(24 46 63 / 0.16);
}

body.workspace-active .legacy-workspace-main,
body.workspace-active .module-panel {
  background: #f6f9fb;
}

body.workspace-active .workspace-tabs {
  background: #dce9ef;
  border-right-color: #aec2ce;
}

.workspace-session-tools {
  position: absolute;
  z-index: 8;
  top: 16px;
  right: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 32px;
}

.workspace-session-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 3px;
  color: #334e62;
  font-size: 11px;
  white-space: nowrap;
}

.workspace-session-user .status-dot {
  width: 6px;
  height: 6px;
  background: #159b79;
  box-shadow: 0 0 0 3px rgb(21 155 121 / 0.1);
}

.workspace-session-tools .button {
  min-height: 31px;
  padding: 0 11px;
  color: #234761;
  border-color: #b6c9d5;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgb(28 53 70 / 0.05);
  font-size: 10px;
  text-decoration: none;
}

.workspace-session-tools .button:hover:not(:disabled) {
  color: #102d44;
  border-color: #829eaf;
  background: #f2f7f9;
}

body.workspace-active .module-panel {
  padding-top: 60px;
}

body.workspace-active .module-panel > .query-toolbar {
  gap: 10px !important;
  border-color: #9fb8c6 !important;
  background: #edf4f7 !important;
  box-shadow: 0 8px 20px rgb(32 61 79 / 0.11) !important;
}

body.workspace-active .module-panel > .query-toolbar .query-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  grid-template-rows: 40px;
  gap: 8px;
  min-width: 0;
}

body.workspace-active .module-panel > .query-toolbar .query-main > label {
  display: none;
}

body.workspace-active .module-panel > .query-toolbar .query-main .legacy-lookup-field {
  position: relative;
  min-width: 0;
  height: 40px;
}

body.workspace-active .module-panel > .query-toolbar .query-main .legacy-lookup-field::before {
  content: "⌕";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: #176e8a;
  font-size: 18px;
  font-weight: 900;
  transform: translateY(-52%);
  pointer-events: none;
}

body.workspace-active .module-panel > .query-toolbar .query-main input {
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding-left: 45px;
  color: #18334e;
  border-color: #b8ccd7;
  border-radius: 13px;
  background: #ffffff;
  font-size: 13px;
}

body.workspace-active .module-panel > .query-toolbar .query-main .button {
  min-width: 78px;
  width: 78px;
  height: 36px;
  min-height: 36px;
  align-self: center;
  padding: 0 12px;
  color: #ffffff;
  border-color: #112f48;
  border-radius: 10px;
  background: #112f48;
  box-shadow: none;
  font-size: 12px;
}

body.workspace-active .module-panel > .query-toolbar .query-main .button > span,
body.workspace-active .module-panel > .query-toolbar .route-title > span {
  display: none;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcuts {
  position: relative;
  display: block;
  min-width: 0;
}

body.workspace-active .module-panel > .query-toolbar .route-title {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 9px;
  min-height: 20px;
}

body.workspace-active .module-panel > .query-toolbar .route-title .icon-button,
body.workspace-active .module-panel > .query-toolbar .route-section-delete-button,
body.workspace-active .module-panel > .query-toolbar .route-shortcut-remove-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcuts:hover .route-title .icon-button,
body.workspace-active .module-panel > .query-toolbar .route-shortcuts:focus-within .route-title .icon-button,
body.workspace-active .module-panel > .query-toolbar .route-shortcut-section:hover .route-section-delete-button,
body.workspace-active .module-panel > .query-toolbar .route-shortcut-section:focus-within .route-section-delete-button,
body.workspace-active .module-panel > .query-toolbar .route-shortcut-item:hover .route-shortcut-remove-button,
body.workspace-active .module-panel > .query-toolbar .route-shortcut-item:focus-within .route-shortcut-remove-button {
  opacity: 1;
  pointer-events: auto;
}

body.workspace-active .module-panel > .query-toolbar .route-section-list {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr;
  gap: 9px;
  margin: 0;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section {
  display: block;
  min-width: 0;
  min-height: 88px;
  padding: 10px 11px;
  border: 1px solid #b6cbd6;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgb(30 60 78 / 0.05);
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section:nth-child(2) {
  border-color: #b6d1c8;
  background: #f4faf7;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section:nth-child(3) {
  border-color: #d3cbb8;
  background: #fbf9f2;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section-heading {
  display: flex;
  width: 100%;
  min-height: 0;
  margin: 0 0 2px;
}

body.workspace-active .module-panel > .query-toolbar .route-pair-list {
  gap: 6px;
  min-height: 24px;
}

body.workspace-active .module-panel > .query-toolbar .route-pair-chip {
  min-height: 24px;
  padding: 0 10px;
  color: #176276;
  border-color: #c4d8e1;
  background: #f8fcfd;
  font-size: 10px;
  letter-spacing: 0;
}

body.workspace-active .module-panel > .query-toolbar .filter-row {
  gap: 9px;
}

body.workspace-active #bookingQueryForm .filter-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(120px, 0.42fr);
}

body.workspace-active #hblQueryForm .filter-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

body.workspace-active #containerFileQueryForm .filter-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

body.workspace-active .module-panel > .query-toolbar .filter-row fieldset {
  min-width: 0;
  border-color: #b7cad5;
  background: #ffffff;
}

body.workspace-active .module-panel > .query-toolbar .filter-row .status-filter select {
  width: 100%;
  height: 31px;
  min-height: 31px;
}

body.workspace-active .module-panel > .query-toolbar .filter-row > .button {
  min-height: 34px;
  color: #3e596d;
  border-color: #b7cad5;
  background: #ffffff;
}

body.workspace-active .module-panel > .table-card,
body.workspace-active .module-panel.is-results-mode > .table-card,
body.workspace-active .table-card {
  overflow: visible;
  border-color: #aebfca;
  background: #ffffff;
  box-shadow: 0 7px 18px rgb(30 55 72 / 0.09);
}

body.workspace-active .table-toolbar {
  border-bottom-color: #c4d4dd;
  background: #ffffff;
}

body.workspace-active .table-scroll,
body.workspace-active .module-panel.is-results-mode .table-scroll,
body.has-result-table-mode.workspace-active .table-scroll {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: auto;
  overflow-y: visible;
}

body.workspace-active .data-table th {
  background: #e2edf3;
  border-bottom-color: #b9ccd7;
}

body.workspace-active .data-table tbody tr:nth-child(even) td {
  background: #f7fafb;
}

body.workspace-active .data-table tbody tr:hover td,
body.workspace-active .data-table tbody tr.is-selected td {
  background: #dcecf8;
}

body.workspace-active #schedulesPanel .data-table th[data-column-key="eta"],
body.workspace-active #schedulesPanel .data-table td[data-field="eta"],
body.workspace-active #schedulesPanel .data-table th[data-column-key="cfsClosing"],
body.workspace-active #schedulesPanel .data-table td[data-field="cfsClosing"],
body.workspace-active #schedulesPanel .data-table th[data-column-key="remark"],
body.workspace-active #schedulesPanel .data-table td[data-field="remark"],
body.workspace-active #schedulesPanel .data-table th[data-column-key="delayReason"],
body.workspace-active #schedulesPanel .data-table td[data-field="delayReason"] {
  display: table-cell;
}

body.workspace-active #schedulesPanel .data-table col[data-column-key="eta"],
body.workspace-active #schedulesPanel .data-table col[data-column-key="cfsClosing"],
body.workspace-active #schedulesPanel .data-table col[data-column-key="remark"],
body.workspace-active #schedulesPanel .data-table col[data-column-key="delayReason"] {
  display: table-column;
}

@media (max-width: 1280px) {
  .workspace-session-tools {
    top: 10px;
    right: 18px;
  }

  body.workspace-active .module-panel {
    padding-top: 54px;
  }
}

@media (max-width: 980px) {
  body.workspace-active .module-panel > .query-toolbar .route-section-list,
  body.workspace-active #bookingQueryForm .filter-row,
  body.workspace-active #hblQueryForm .filter-row,
  body.workspace-active #containerFileQueryForm .filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace-session-tools {
    position: static;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 10px;
    border-bottom: 1px solid #c6d6df;
    background: #f6f9fb;
  }

  body.workspace-active .module-panel {
    padding-top: 10px;
  }

  body.workspace-active .module-panel > .query-toolbar .query-main {
    grid-template-columns: minmax(0, 1fr) 72px;
  }
}

/* FINAL UI ACCEPTANCE OVERRIDES */
body.workspace-active .workspace-view,
body.workspace-active .legacy-workspace-frame,
body.workspace-active .legacy-workspace-main,
body.workspace-active .module-panel,
body.workspace-active .module-panel.is-results-mode {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.workspace-active .legacy-workspace-main {
  align-items: start;
}

body.workspace-active .module-panel,
body.workspace-active .module-panel.is-results-mode {
  align-self: start;
  min-height: 0 !important;
}

body.workspace-active .module-panel > .query-toolbar {
  overflow: hidden !important;
  border: 1px solid #9fb8c6 !important;
  border-radius: 16px !important;
  background: #edf4f7 !important;
  box-shadow: 0 8px 20px rgb(32 61 79 / 0.11) !important;
}

body.workspace-active #scheduleQueryForm .query-main,
body.workspace-active #bookingQueryForm .query-main,
body.workspace-active #hblQueryForm .query-main,
body.workspace-active #containerFileQueryForm .query-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 78px 78px !important;
  grid-template-rows: 40px !important;
  gap: 8px !important;
  min-width: 0;
}

body.workspace-active #scheduleQueryForm .query-main .search-box,
body.workspace-active #bookingQueryForm .query-main .search-box,
body.workspace-active #hblQueryForm .query-main .search-box,
body.workspace-active #containerFileQueryForm .query-main .search-box,
body.workspace-active #scheduleQueryForm .query-main input,
body.workspace-active #bookingQueryForm .query-main input,
body.workspace-active #hblQueryForm .query-main input,
body.workspace-active #containerFileQueryForm .query-main input {
  width: 100%;
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 12px !important;
}

body.workspace-active #scheduleQueryForm .query-main .button,
body.workspace-active #bookingQueryForm .query-main .button,
body.workspace-active #hblQueryForm .query-main .button,
body.workspace-active #containerFileQueryForm .query-main .button {
  width: 78px !important;
  min-width: 78px !important;
  height: 36px !important;
  min-height: 36px !important;
  align-self: center;
  padding: 0 10px;
  border-radius: 9px !important;
}

body.workspace-active .module-panel > .query-toolbar .query-main .query-clear-button {
  color: #36546a !important;
  border-color: #b4c7d2 !important;
  background: #ffffff !important;
}

body.workspace-active .module-panel > .query-toolbar .route-section-list {
  gap: 7px !important;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section {
  min-height: 68px !important;
  padding: 7px 10px !important;
  border-radius: 9px !important;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section-heading {
  min-height: 0 !important;
  margin-bottom: 2px !important;
}

body.workspace-active .module-panel > .query-toolbar .route-pair-list {
  gap: 4px !important;
  min-height: 21px !important;
}

body.workspace-active .module-panel > .query-toolbar .route-pair-chip {
  min-height: 21px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  font-size: 9px !important;
}

body.workspace-active .module-panel > .table-card,
body.workspace-active .module-panel.is-results-mode > .table-card,
body.workspace-active .table-card {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  border-radius: 14px !important;
}

body.workspace-active .module-panel .table-scroll,
body.has-result-table-mode.workspace-active .module-panel .table-scroll {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

body.workspace-active .module-panel .data-table,
body.workspace-active .module-panel.is-results-mode .data-table {
  width: max-content;
  min-width: 100%;
  height: auto !important;
  min-height: 0 !important;
  table-layout: fixed !important;
}

body.workspace-active .module-panel.is-detail-mode > .editor-card {
  max-height: none !important;
  overflow: visible !important;
  padding: 14px !important;
  border: 1px solid #aebfca;
  border-radius: 14px !important;
  background: #f4f7f9;
  box-shadow: 0 8px 20px rgb(30 55 72 / 0.09);
}

body.workspace-active .module-panel.is-detail-mode .editor-heading,
body.workspace-active .module-panel.is-detail-mode .booking-editor-topline {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid #c6d4dc;
  background: transparent;
}

body.workspace-active .module-panel.is-detail-mode .booking-detail-ribbon {
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid #b9cad4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgb(29 56 73 / 0.05);
}

body.workspace-active .module-panel.is-detail-mode .editor-form,
body.workspace-active .module-panel.is-detail-mode .editor-grid,
body.workspace-active .module-panel.is-detail-mode .booking-editor-grid {
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  background: transparent;
}

body.workspace-active .module-panel.is-detail-mode .editor-grid,
body.workspace-active .module-panel.is-detail-mode .booking-editor-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body.workspace-active .module-panel.is-detail-mode .editor-section-panel {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-content: start;
  gap: 9px 10px;
  min-width: 0;
  margin: 0 !important;
  padding: 12px !important;
  overflow: visible !important;
  border: 1px solid #bacbd5 !important;
  border-radius: 10px !important;
  background: #ffffff;
  box-shadow: 0 3px 9px rgb(30 57 74 / 0.06);
}

body.workspace-active .module-panel.is-detail-mode .editor-section-panel:nth-of-type(3n + 2) {
  border-color: #b9d0c8 !important;
  background: #f8fbfa;
}

body.workspace-active .module-panel.is-detail-mode .editor-section-panel:nth-of-type(3n) {
  border-color: #d2c9b5 !important;
  background: #fcfaf5;
}

body.workspace-active .module-panel.is-detail-mode .editor-section-heading {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  padding: 0 0 7px;
  color: #234f68;
  border-bottom: 1px solid #d4dfe5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

body.workspace-active .module-panel.is-detail-mode .editor-actions {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #bacbd5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 9px rgb(30 57 74 / 0.05);
}

@media (max-width: 1280px) {
  body.workspace-active .module-panel.is-detail-mode .editor-grid,
  body.workspace-active .module-panel.is-detail-mode .booking-editor-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 980px) {
  body.workspace-active .module-panel > .query-toolbar .route-section-list {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  body.workspace-active #scheduleQueryForm .query-main,
  body.workspace-active #bookingQueryForm .query-main,
  body.workspace-active #hblQueryForm .query-main,
  body.workspace-active #containerFileQueryForm .query-main {
    grid-template-columns: minmax(0, 1fr) 72px 72px !important;
  }

  body.workspace-active #scheduleQueryForm .query-main .button,
  body.workspace-active #bookingQueryForm .query-main .button,
  body.workspace-active #hblQueryForm .query-main .button,
  body.workspace-active #containerFileQueryForm .query-main .button {
    width: 72px !important;
    min-width: 72px !important;
  }

  body.workspace-active .module-panel.is-detail-mode .editor-section-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 520px) {
  body.workspace-active #scheduleQueryForm .query-main,
  body.workspace-active #bookingQueryForm .query-main,
  body.workspace-active #hblQueryForm .query-main,
  body.workspace-active #containerFileQueryForm .query-main {
    grid-template-columns: minmax(0, 1fr) repeat(2, 68px) !important;
  }

  body.workspace-active .module-panel.is-detail-mode .editor-section-panel {
    grid-template-columns: 1fr !important;
  }

  body.workspace-active .module-panel.is-detail-mode .editor-section-panel .field-wide {
    grid-column: 1 !important;
  }
}

/* Workspace corner repair: keep one clipped frame responsible for all four
   outer corners while preserving natural page growth and table overflow. */
body.workspace-active .legacy-workspace-frame {
  isolation: isolate;
  overflow: hidden !important;
  border: 1px solid #c5d7e2 !important;
  border-radius: 28px !important;
  background: #f6f9fb !important;
}

body.workspace-active .legacy-workspace-main {
  overflow: hidden !important;
  border-radius: inherit;
  background: #f6f9fb !important;
}

body.workspace-active .workspace-tabs {
  overflow: hidden !important;
  border-radius: 0 0 0 28px;
  background: #dce9ef !important;
}

body.workspace-active .module-panel,
body.workspace-active .module-panel.is-results-mode {
  overflow: visible !important;
  background: #f6f9fb !important;
}

body.workspace-active .module-panel > .query-toolbar,
body.workspace-active .module-panel > .table-card,
body.workspace-active .module-panel.is-results-mode > .table-card,
body.workspace-active .table-card {
  border-radius: 14px !important;
  background-clip: padding-box;
}

/* Keep the visible search row identical in every module. */
body.workspace-active #scheduleQueryForm.query-toolbar,
body.workspace-active #bookingQueryForm.query-toolbar,
body.workspace-active #hblQueryForm.query-toolbar,
body.workspace-active #containerFileQueryForm.query-toolbar {
  display: grid !important;
  gap: 10px !important;
  padding: 12px !important;
}

body.workspace-active #scheduleQueryForm .query-main,
body.workspace-active #bookingQueryForm .query-main,
body.workspace-active #hblQueryForm .query-main,
body.workspace-active #containerFileQueryForm .query-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 78px 78px !important;
  grid-template-rows: 40px !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.workspace-active #scheduleQueryForm .query-main > label,
body.workspace-active #bookingQueryForm .query-main > label,
body.workspace-active #hblQueryForm .query-main > label,
body.workspace-active #containerFileQueryForm .query-main > label {
  display: none !important;
}

body.workspace-active #scheduleQueryForm .query-main .search-box,
body.workspace-active #bookingQueryForm .query-main .search-box,
body.workspace-active #hblQueryForm .query-main .search-box,
body.workspace-active #containerFileQueryForm .query-main .search-box {
  position: relative !important;
  width: 100% !important;
  height: 40px !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.workspace-active #scheduleQueryForm .query-main .search-box::before,
body.workspace-active #bookingQueryForm .query-main .search-box::before,
body.workspace-active #hblQueryForm .query-main .search-box::before,
body.workspace-active #containerFileQueryForm .query-main .search-box::before {
  content: "⌕";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  color: #176e8a;
  font-size: 18px;
  font-weight: 900;
  transform: translateY(-52%);
  pointer-events: none;
}

body.workspace-active #scheduleQueryForm .query-main input,
body.workspace-active #bookingQueryForm .query-main input,
body.workspace-active #hblQueryForm .query-main input,
body.workspace-active #containerFileQueryForm .query-main input {
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 14px 0 45px !important;
  border: 1px solid #b8ccd7 !important;
  border-radius: 13px !important;
  background: #ffffff !important;
}

body.workspace-active #scheduleQueryForm .query-main .button,
body.workspace-active #bookingQueryForm .query-main .button,
body.workspace-active #hblQueryForm .query-main .button,
body.workspace-active #containerFileQueryForm .query-main .button {
  width: 78px !important;
  min-width: 78px !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  align-self: center !important;
  justify-self: stretch !important;
}

body.workspace-active #scheduleQueryForm .query-main .query-clear-button,
body.workspace-active #bookingQueryForm .query-main .query-clear-button,
body.workspace-active #hblQueryForm .query-main .query-clear-button,
body.workspace-active #containerFileQueryForm .query-main .query-clear-button {
  color: #36546a !important;
  border-color: #b4c7d2 !important;
  background: #ffffff !important;
}

@media (max-width: 760px) {
  body.workspace-active #scheduleQueryForm .query-main,
  body.workspace-active #bookingQueryForm .query-main,
  body.workspace-active #hblQueryForm .query-main,
  body.workspace-active #containerFileQueryForm .query-main {
    grid-template-columns: minmax(0, 1fr) 72px 72px !important;
  }

  body.workspace-active #scheduleQueryForm .query-main .button,
  body.workspace-active #bookingQueryForm .query-main .button,
  body.workspace-active #hblQueryForm .query-main .button,
  body.workspace-active #containerFileQueryForm .query-main .button {
    width: 72px !important;
    min-width: 72px !important;
  }
}

body.workspace-active #scheduleQueryForm .filter-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(120px, 0.42fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
}

body.workspace-active #scheduleQueryForm .schedule-carrier-filter {
  display: none !important;
}

body.workspace-active #scheduleQueryForm .filter-row fieldset {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 8px 10px 10px !important;
  border: 1px solid #b6cbd6 !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgb(30 60 78 / 0.05) !important;
}

body.workspace-active #scheduleQueryForm .filter-row legend {
  color: #24445d !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
}

body.workspace-active #scheduleQueryForm .filter-row .two-grid,
body.workspace-active #scheduleQueryForm .filter-row .date-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 8px !important;
}

body.workspace-active #scheduleQueryForm .filter-row input,
body.workspace-active #scheduleQueryForm .filter-row select {
  width: 100% !important;
  height: 31px !important;
  min-height: 31px !important;
  padding: 0 11px !important;
  border: 1px solid #b8ccd7 !important;
  border-radius: 9px !important;
  background: #ffffff !important;
}

body.workspace-active #scheduleQueryForm .route-section-list,
body.workspace-active #bookingQueryForm .route-section-list,
body.workspace-active #hblQueryForm .route-section-list,
body.workspace-active #containerFileQueryForm .route-section-list {
  display: grid !important;
  grid-template-columns: 1.25fr 0.9fr 0.9fr !important;
  gap: 7px !important;
  margin: 0 !important;
}

body.workspace-active #scheduleQueryForm .route-shortcut-section,
body.workspace-active #bookingQueryForm .route-shortcut-section,
body.workspace-active #hblQueryForm .route-shortcut-section,
body.workspace-active #containerFileQueryForm .route-shortcut-section {
  min-height: 68px !important;
  padding: 7px 10px !important;
  border: 1px solid #b6cbd6 !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgb(30 60 78 / 0.05) !important;
}

body.workspace-active #scheduleQueryForm .route-shortcut-section:nth-child(2),
body.workspace-active #bookingQueryForm .route-shortcut-section:nth-child(2),
body.workspace-active #hblQueryForm .route-shortcut-section:nth-child(2),
body.workspace-active #containerFileQueryForm .route-shortcut-section:nth-child(2) {
  border-color: #b6d1c8 !important;
  background: #f4faf7 !important;
}

body.workspace-active #scheduleQueryForm .route-shortcut-section:nth-child(3),
body.workspace-active #bookingQueryForm .route-shortcut-section:nth-child(3),
body.workspace-active #hblQueryForm .route-shortcut-section:nth-child(3),
body.workspace-active #containerFileQueryForm .route-shortcut-section:nth-child(3) {
  border-color: #d3cbb8 !important;
  background: #fbf9f2 !important;
}

body.workspace-active .module-panel.is-detail-mode > .query-toolbar {
  display: none !important;
}

.linked-hbl-panel {
  border: 1px solid rgba(107, 139, 166, 0.28);
  border-radius: 8px;
  padding: 14px;
  background: rgba(249, 252, 253, 0.88);
}

.linked-hbl-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.linked-hbl-heading h4 {
  margin: 0 0 4px;
  color: #0f3a5c;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.linked-hbl-heading p {
  margin: 0;
  color: #5f7890;
  font-size: 12px;
}

.linked-hbl-scroll {
  max-height: 220px;
}

/* Container File detail final layout: dense operational cards, dates on one row. */
body.workspace-active #containerFilesPanel.is-detail-mode > .editor-card {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid .editor-section-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 9px 10px !important;
}

body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid .field-etd,
body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid .field-eta,
body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid .field-ata {
  grid-column: span 1 !important;
}

body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid .field-notes,
body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid .field-agentNotes {
  grid-column: span 2 !important;
}

body.workspace-active #containerFilesPanel.is-detail-mode .linked-hbl-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bacbd5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 9px rgb(30 57 74 / 0.05);
}

body.workspace-active #containerFilesPanel.is-detail-mode .linked-hbl-heading {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #d4dfe5;
}

body.workspace-active #containerFilesPanel.is-detail-mode .linked-hbl-scroll {
  min-height: 0;
  max-height: none;
  margin-top: 10px;
}

body.workspace-active #containerFilesPanel.is-detail-mode .linked-hbl-table {
  min-width: 900px;
}

@media (max-width: 760px) {
  body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid {
    grid-template-columns: 1fr !important;
  }

  body.workspace-active #containerFilesPanel.is-detail-mode .container-file-editor-grid .editor-section-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.floating-action-card {
  position: fixed;
  z-index: 3200;
  right: 22px;
  bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  padding: 14px;
  color: #153149;
  background: #ffffff;
  border: 1px solid #b8cfdd;
  border-radius: 8px;
  box-shadow: 0 16px 44px rgb(31 64 88 / 0.2);
}

.floating-action-card[hidden] {
  display: none !important;
}

.floating-action-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.floating-action-card p {
  margin: 0;
  color: #476477;
  font-size: 12px;
  line-height: 1.45;
}

.floating-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.booking-loaded-badge,
.booking-not-loaded-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong, #cbd5e1);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.booking-loaded-badge,
.booking-ribbon-loaded {
  color: #155e75;
  background: #ecfeff;
  border-color: #67e8f9;
}

.booking-ribbon-loaded {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #67e8f9;
  border-radius: 6px;
}

.booking-not-loaded-badge {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.booking-route-action-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e2e8f0);
}

.booking-route-action-copy {
  color: var(--text-strong, #1e293b);
  font-size: 12px;
  font-weight: 700;
}

.booking-route-action-state {
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.booking-route-action-rail.is-loaded .booking-route-action-state {
  color: #9f1239;
}

@media (max-width: 720px) {
  .booking-route-action-rail {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Final workspace sidebar palette. */
body.workspace-active .workspace-tabs {
  background: #183447 !important;
  border-right-color: #2e5364;
}

body.workspace-active .workspace-brand {
  color: #f4f8fa;
}

body.workspace-active .workspace-brand .brand-mark {
  background: #1b6074;
}

body.workspace-active .workspace-brand .brand-name {
  color: #f4f8fa;
}

body.workspace-active .workspace-brand .brand-subtitle,
body.workspace-active .workspace-nav-kicker,
body.workspace-active .workspace-nav-heading small,
body.workspace-active .workspace-nav-status > strong {
  color: #91abb6;
}

body.workspace-active .workspace-nav-heading strong {
  color: #d5e4e9;
}

body.workspace-active .workspace-tab {
  color: #d5e4e9;
}

body.workspace-active .workspace-tab .tab-index,
body.workspace-active .workspace-tab .tab-copy strong,
body.workspace-active .workspace-tab .tab-copy small,
body.workspace-active .workspace-tab .tab-count {
  color: #d5e4e9;
}

body.workspace-active .workspace-tab:hover:not(.is-active),
body.workspace-active .workspace-tab:focus-visible:not(.is-active) {
  color: #f4f8fa;
  background: #21485a;
}

body.workspace-active .workspace-tab:hover:not(.is-active) .tab-index,
body.workspace-active .workspace-tab:hover:not(.is-active) .tab-copy strong,
body.workspace-active .workspace-tab:hover:not(.is-active) .tab-copy small,
body.workspace-active .workspace-tab:focus-visible:not(.is-active) .tab-index,
body.workspace-active .workspace-tab:focus-visible:not(.is-active) .tab-copy strong,
body.workspace-active .workspace-tab:focus-visible:not(.is-active) .tab-copy small {
  color: #f4f8fa;
}

body.workspace-active .workspace-tab.is-active {
  color: #f4f8fa;
  background: #237486;
  border-color: #237486;
}

body.workspace-active .workspace-tab.is-active .tab-index,
body.workspace-active .workspace-tab.is-active .tab-copy strong,
body.workspace-active .workspace-tab.is-active .tab-copy small,
body.workspace-active .workspace-tab.is-active .tab-count {
  color: #f4f8fa;
}

body.workspace-active .workspace-nav-status {
  color: #91abb6;
  border-top-color: #2e5364;
}

body.workspace-active .workspace-tab:disabled {
  color: #91abb6;
  opacity: 0.65;
}

body.workspace-active .workspace-tab:disabled .tab-index,
body.workspace-active .workspace-tab:disabled .tab-copy strong,
body.workspace-active .workspace-tab:disabled .tab-copy small,
body.workspace-active .workspace-tab:disabled .tab-count {
  color: #91abb6;
}

/* Route shortcuts stay compact chips, with explicit keyboard and loading states. */
body.workspace-active .module-panel > .query-toolbar .route-pair-chip {
  min-height: 26px !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  font-size: 10px !important;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

body.workspace-active .route-pair-chip:focus-visible {
  outline: 2px solid #237486;
  outline-offset: 2px;
}

body.workspace-active .route-pair-chip.is-active,
body.workspace-active .route-pair-chip[aria-pressed="true"] {
  color: #ffffff !important;
  background: #237486 !important;
  border-color: #237486 !important;
  box-shadow: 0 0 0 2px rgb(35 116 134 / 0.18);
}

body.workspace-active .route-pair-chip:disabled,
body.workspace-active .route-pair-chip[aria-busy="true"] {
  color: #718592 !important;
  background: #eef3f5 !important;
  border-color: #c9d7dd !important;
  cursor: wait;
  opacity: 0.72;
}

@media (hover: hover) and (pointer: fine) {
  body.workspace-active .route-pair-chip:hover:not(:disabled):not(.is-active):not([aria-pressed="true"]) {
    color: #155e75 !important;
    background: #dff4f7 !important;
    border-color: #8ecbd5 !important;
  }
}

/* Unified move workflow: one card language for every reassignment entry point. */
body.workspace-active #bookingQueryForm .filter-row {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.22fr) minmax(112px, .42fr) minmax(112px, .42fr);
}

body.workspace-active #bookingQueryForm .filter-row > .status-filter {
  min-width: 112px;
}

body.workspace-active #bookingQueryForm #bookingLoadedInput,
body.workspace-active #bookingQueryForm #bookingStatusInput {
  color: #18334e;
  border-color: #b7cad5;
  background: #f9fcfd;
}

body.workspace-active #bookingQueryForm .booking-record-status-filter,
body.workspace-active #bookingQueryForm .booking-record-status-filter select,
body.workspace-active #bookingQueryForm .booking-record-status-filter option {
  color: #18334e;
}

body.workspace-active #bookingQueryForm .booking-record-status-filter select {
  border-color: #b7cad5;
  background: #f9fcfd;
}

.reassign-dialog {
  width: min(1240px, calc(100% - 28px));
  max-height: min(94vh, 900px);
  border: 1px solid rgb(20 54 75 / 0.16);
  border-radius: 20px;
  background: #edf3f6;
  box-shadow: 0 30px 90px -48px rgb(18 44 62 / 0.58);
}

.reassign-dialog .modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #d1e0e7;
  background: #f9fcfd;
}

.reassign-dialog .modal-header h2 {
  margin-top: 5px;
  color: #15344d;
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: -0.02em;
}

.reassign-dialog .modal-subtitle {
  max-width: 980px;
  margin-top: 6px;
  color: #597181;
  font-size: 12px;
}

.reassign-warning {
  margin: 12px 20px 0;
  padding: 11px 14px;
  border: 1px solid #e8c784;
  border-left: 4px solid #d99a2b;
  border-radius: 12px;
  background: #fff8e8;
  color: #6a4b17;
  font-size: 11.5px;
  line-height: 1.45;
}

.reassign-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(310px, .86fr);
  align-items: start;
  gap: 14px;
  max-height: calc(min(94vh, 900px) - 146px);
  overflow: auto;
  padding: 16px 20px 78px;
  scrollbar-gutter: stable;
}

.reassign-main-panel,
.reassign-notification-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid #cbdce4;
  border-radius: 16px;
  background: #fafdfe;
  box-shadow: 0 7px 18px rgb(30 55 72 / 0.07);
}

.reassign-main-panel {
  display: grid;
  align-content: start;
  gap: 13px;
}

.reassign-panel-heading,
.reassign-preview-heading,
.reassign-notification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reassign-panel-heading h3,
.reassign-notification-heading h3 {
  margin: 3px 0 0;
  color: #15344d;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.reassign-panel-heading p {
  margin: 5px 0 0;
  color: #69808d;
  font-size: 11px;
}

.reassign-preview-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #c4d9e4;
  border-radius: 999px;
  background: #f0f7fa;
  color: #32667b;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.reassign-controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(170px, .7fr);
  gap: 11px;
}

.reassign-controls-grid > label {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #557080;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reassign-form select,
.reassign-form input,
.reassign-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #b9d0dd;
  border-radius: 11px;
  background: #ffffff;
  color: #18334e;
  font-size: 12px;
}

.reassign-form select:disabled {
  color: #8498a3;
  border-color: #d0dee5;
  background: #edf3f6;
  cursor: not-allowed;
}

.reassign-summary {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #e8c784;
  border-left: 4px solid #d99a2b;
  border-radius: 11px;
  background: #fff8e8;
  color: #6a4b17;
  font-size: 11.5px;
  line-height: 1.45;
}

.reassign-summary.is-success {
  border-color: #8dc9a7;
  border-left-color: #2e9b62;
  background: #effaf3;
  color: #155b35;
}

.reassign-summary.is-error {
  border-color: #e3a0a6;
  border-left-color: #c4424e;
  background: #fff1f2;
  color: #8d1f2a;
}

.reassign-preview-heading {
  align-items: baseline;
  padding-top: 2px;
  color: #1b3f58;
  font-size: 12px;
  font-weight: 850;
}

.reassign-preview-heading > span:last-child {
  color: #708591;
  font-size: 10px;
  font-weight: 650;
}

.reassign-preview-list {
  display: grid;
  gap: 10px;
  max-height: min(45vh, 430px);
  min-height: 92px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 5px 3px 1px;
  scrollbar-gutter: stable;
}

.reassign-record-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d1e0e7;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgb(26 58 77 / 0.055);
}

.reassign-record-card:hover {
  border-color: #9fc4d3;
  box-shadow: 0 8px 18px rgb(26 58 77 / 0.09);
}

.reassign-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.reassign-card-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reassign-card-eyebrow,
.reassign-card-label,
.reassign-op-note-label {
  color: #63818f;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.reassign-card-title {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #123b59;
  font-size: 14px;
  font-weight: 850;
}

.reassign-status-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #c4d8e4;
  border-radius: 999px;
  background: #eff6fa;
  color: #31576b;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.reassign-status-badge.is-ready {
  border-color: #9bd1b1;
  background: #effaf3;
  color: #126236;
}

.reassign-status-badge.is-warning {
  border-color: #e3b779;
  background: #fff7e7;
  color: #795115;
}

.reassign-card-route,
.reassign-card-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-width: 0;
}

.reassign-card-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #e1ebef;
  border-radius: 9px;
  background: #f7fafb;
}

.reassign-card-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #24485e;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.reassign-card-field-wide {
  grid-column: 1 / -1;
}

.reassign-card-facts .reassign-card-field-wide {
  grid-column: 1 / -1;
}

.reassign-op-note-block {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #c6dde7;
  border-left: 3px solid #3e92aa;
  border-radius: 10px;
  background: #f0f8fb;
}

.reassign-op-note-value {
  margin: 0;
  color: #31566a;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.reassign-entity-card {
  gap: 12px;
}

.reassign-entity-facts {
  grid-template-columns: minmax(0, 1.35fr) minmax(100px, .65fr);
}

.reassign-changed-fields {
  align-content: start;
}

.reassign-field-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.reassign-field-chip,
.reassign-field-none {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid #b9deda;
  border-radius: 999px;
  background: #eef9f7;
  color: #1c6562;
  font-size: 10px;
  font-weight: 800;
}

.reassign-field-none {
  border-color: #d6e1e6;
  background: #f1f5f7;
  color: #6d808b;
}

.reassign-empty-state {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 24px 14px;
  border: 1px dashed #b9d0db;
  border-radius: 12px;
  background: #f6fafb;
  color: #6b818d;
  text-align: center;
  font-size: 11px;
}

.reassign-empty-state strong {
  color: #31576b;
  font-size: 12px;
}

.reassign-notification-panel {
  display: grid;
  align-content: start;
  gap: 13px;
  margin: 0;
  background: #f9fcfd;
}

.reassign-notification-panel[hidden] {
  display: none;
}

.reassign-notification-heading h3 {
  font-size: 15px;
}

.reassign-notification-controls {
  display: grid;
  gap: 11px;
  padding-top: 13px;
  border-top: 1px solid #d9e6eb;
}

.reassign-notification-controls label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #5b7582;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reassign-notification-controls textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.45;
}

.reassign-send-notice-toggle {
  justify-self: start;
  margin: 0;
}

.reassign-notification-drafts {
  max-height: min(34vh, 330px);
  padding: 0;
  overflow: auto;
}

.reassign-form > .modal-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  margin: 0;
  padding: 11px 20px;
  border-top: 1px solid #cadbe3;
  background: rgb(240 246 249 / 0.97);
  box-shadow: 0 -5px 15px rgb(25 56 74 / 0.06);
  backdrop-filter: blur(10px);
}

.reassign-action-hint {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 auto 0 0;
  color: #607987;
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .reassign-form {
    grid-template-columns: 1fr;
  }

  .reassign-controls-grid {
    grid-template-columns: minmax(0, 1fr) minmax(150px, .7fr);
  }
}

@media (max-width: 640px) {
  body.workspace-active #bookingQueryForm .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reassign-dialog {
    width: calc(100% - 12px);
    border-radius: 15px;
  }

  .reassign-dialog .modal-header,
  .reassign-form {
    padding-right: 12px;
    padding-left: 12px;
  }

  .reassign-warning {
    margin-right: 12px;
    margin-left: 12px;
  }

  .reassign-controls-grid,
  .reassign-card-route,
  .reassign-card-facts,
  .reassign-entity-facts {
    grid-template-columns: 1fr;
  }

  .reassign-card-field-wide,
  .reassign-card-facts .reassign-card-field-wide {
    grid-column: auto;
  }

  .reassign-form > .modal-actions {
    flex-wrap: wrap;
    padding-right: 12px;
    padding-left: 12px;
  }

  .reassign-action-hint {
    flex-basis: 100%;
    order: -1;
  }
}

/* Final shared move layout: keep the two plan controls together on wide dialogs,
   then collapse them only when the dialog can no longer give each control room. */
.reassign-controls-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.75fr) minmax(180px, 0.75fr) !important;
  align-items: end !important;
  gap: 14px !important;
}

.reassign-notification-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  align-items: start !important;
  column-gap: 14px !important;
  row-gap: 6px !important;
}

.reassign-notification-heading-copy {
  min-width: 0;
}

.reassign-notification-heading-tools {
  justify-self: end;
  margin-left: 0;
}

.reassign-notification-intro {
  grid-column: 1 / -1;
  max-width: none !important;
  margin: 0 !important;
}

@media (max-width: 900px) {
  .reassign-controls-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.6fr) !important;
  }
}

@media (max-width: 640px) {
  .reassign-controls-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .reassign-notification-heading {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .reassign-notification-heading-tools {
    justify-self: stretch;
    justify-content: space-between;
  }
}

/* Keep route shortcut cards aligned without reserving a blank heading row. */
body.workspace-active .module-panel > .query-toolbar .route-section-list {
  align-items: stretch;
  grid-auto-rows: minmax(68px, auto);
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section {
  position: relative;
  height: 100%;
  box-sizing: border-box;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-section-heading {
  position: absolute;
  top: 50%;
  left: -10px;
  z-index: 3;
  width: auto;
  min-height: 0;
  margin: 0;
  transform: translateY(-50%);
}

body.workspace-active .module-panel > .query-toolbar .route-section-delete-button {
  position: relative;
  z-index: 3;
  background: #ffffff;
  box-shadow: 0 1px 4px rgb(30 60 78 / 0.16);
}

/* Booking detail: compact two-line receipts and a preview-first eDocs workspace. */
body.workspace-active .booking-measurements {
  overflow: visible;
  padding: 0 12px 12px;
  background: #f6f8f6;
}

body.workspace-active .booking-measurements > .table-toolbar {
  min-height: 42px;
  margin: 0 -12px 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #d9e0db;
  background: transparent;
}

body.workspace-active .booking-measurement-receipts {
  display: grid;
  gap: 10px;
  min-width: 0;
}

body.workspace-active .booking-measurement-receipt {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d2dbd5;
  border-radius: 8px;
  background: #fbfcfa;
}

body.workspace-active .booking-measurement-summary {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e5e0;
  min-width: 0;
}

body.workspace-active .booking-measurement-facts {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 10px 14px;
  min-width: 0;
  padding-top: 1px;
}

body.workspace-active .booking-measurement-cell {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 0 10px;
  border-left: 1px solid #e3e8e3;
}

body.workspace-active .booking-measurement-summary .booking-measurement-cell:first-child,
body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(10n + 1) {
  border-left: 0;
  padding-left: 0;
}

body.workspace-active .booking-measurement-cell.is-measurement-highlight {
  min-height: 44px;
}

body.workspace-active .booking-measurement-cell.is-measurement-highlight .booking-measurement-value {
  color: #173a35;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

body.workspace-active .booking-measurement-label {
  color: #6d7c76;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
}

body.workspace-active .booking-measurement-value {
  color: #34463f;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

body.workspace-active .booking-edocs-inline {
  min-height: 0;
  padding: 12px;
}

body.workspace-active .booking-edocs-inline .edocs-layout {
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.78fr);
  align-items: stretch;
  gap: 10px;
  min-height: clamp(560px, 68vh, 860px);
  padding: 0;
  overflow: hidden;
}

body.workspace-active .booking-edocs-inline .edocs-list-card,
body.workspace-active .booking-edocs-inline .edocs-preview-card {
  min-height: 0;
}

body.workspace-active .booking-edocs-inline .edocs-list-heading {
  padding: 11px 12px;
}

body.workspace-active .booking-edocs-inline .edocs-table-scroll {
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

body.workspace-active .booking-edocs-inline .edocs-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

body.workspace-active .booking-edocs-inline .edocs-table th:first-child,
body.workspace-active .booking-edocs-inline .edocs-table td:first-child {
  width: auto;
}

body.workspace-active .booking-edocs-inline .edocs-table th:last-child,
body.workspace-active .booking-edocs-inline .edocs-table td:last-child {
  width: 76px;
  text-align: right;
}

body.workspace-active .booking-edocs-inline .edocs-table th,
body.workspace-active .booking-edocs-inline .edocs-table td {
  padding: 9px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.workspace-active .booking-edocs-inline .edoc-file-row {
  cursor: pointer;
}

body.workspace-active .booking-edocs-inline .edoc-file-row:focus-visible {
  outline: 2px solid #237486;
  outline-offset: -2px;
}

body.workspace-active .booking-edocs-inline .edoc-file-cell {
  display: table-cell;
}

body.workspace-active .booking-edocs-inline .edoc-file-name,
body.workspace-active .booking-edocs-inline .edoc-file-details,
body.workspace-active .booking-edocs-inline .edoc-file-description {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

body.workspace-active .booking-edocs-inline .edoc-file-details,
body.workspace-active .booking-edocs-inline .edoc-file-description {
  margin-top: 4px;
  color: #708491;
  font-size: 10px;
  line-height: 1.4;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card {
  align-items: stretch;
  justify-content: flex-start;
  gap: 9px;
  padding: 14px;
  text-align: left;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card > strong {
  font-size: 13px;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card > span,
body.workspace-active .booking-edocs-inline .edocs-preview-card > p {
  margin: 0;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card iframe {
  flex: 1 1 auto;
  width: 100%;
  min-height: clamp(460px, 61vh, 780px);
  margin: 0;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card iframe[hidden] {
  display: none;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card:has(#bookingEdocsPreview[hidden]) {
  align-items: center;
  justify-content: center;
  background: #f5f7f4;
  text-align: center;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card:has(#bookingEdocsPreview[hidden]) > strong,
body.workspace-active .booking-edocs-inline .edocs-preview-card:has(#bookingEdocsPreview[hidden]) > span,
body.workspace-active .booking-edocs-inline .edocs-preview-card:has(#bookingEdocsPreview[hidden]) > p {
  max-width: 44ch;
}

body.workspace-active .booking-edocs-inline .edoc-file-badge {
  width: 52px;
  height: 62px;
  margin: 0 0 5px;
  border: 1px solid #c8d5ce;
  border-radius: 5px 5px 5px 1px;
  color: #33594c;
  background: #e5eee8;
  box-shadow: none;
  font-size: 10px;
}

/* One shared button scale across workspace actions; color still signals intent. */
body.workspace-active .button {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.15;
}

body.workspace-active .button-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

body.workspace-active .icon-button {
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
}

body.workspace-active .editor-heading-actions {
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  body.workspace-active .booking-measurement-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.workspace-active .booking-measurement-facts {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.workspace-active .booking-measurement-summary .booking-measurement-cell,
  body.workspace-active .booking-measurement-facts .booking-measurement-cell {
    border-left: 1px solid #e3e8e3;
    padding-left: 10px;
  }

  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(5n + 1),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(5n + 1) {
    border-left: 0;
    padding-left: 0;
  }
}

/* Booking detail: keep cargo and warehouse data in one scannable work area. */
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse {
  border-color: #bdd1c8 !important;
  border-radius: 12px;
  background: #f6faf7 !important;
  box-shadow: 0 2px 8px rgb(30 57 48 / 0.05);
}

body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .editor-section-heading {
  color: #315d4c;
  border-bottom-color: #d4e2db;
}

body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
  grid-template-areas:
    "heading heading heading heading"
    "service pay sales customer"
    "operator . . ."
    "csnote csnote opnote opnote";
  border-color: #c5d5dc !important;
  border-radius: 12px;
  background: #f6f9fa !important;
  box-shadow: 0 2px 8px rgb(34 60 75 / 0.05);
}

body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes .editor-section-heading {
  grid-area: heading;
  color: #31586d;
  border-bottom-color: #d7e2e7;
}

.booking-section-operations-notes .field-serviceMode { grid-area: service; }
.booking-section-operations-notes .field-payTerm { grid-area: pay; }
.booking-section-operations-notes .field-salespersonName { grid-area: sales; }
.booking-section-operations-notes .field-customerServiceName { grid-area: customer; }
.booking-section-operations-notes .field-operatorName { grid-area: operator; }
.booking-section-operations-notes .field-csNotes { grid-area: csnote; }
.booking-section-operations-notes .field-opNotes { grid-area: opnote; }

body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes textarea {
  height: 132px;
  min-height: 132px;
  border-color: #c8d8de;
  background: #fff;
}

@media (max-width: 760px) {
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
    grid-template-areas:
      "heading heading"
      "service pay"
      "sales customer"
      "operator operator"
      "csnote csnote"
      "opnote opnote";
  }
}

@media (max-width: 520px) {
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
    grid-template-areas:
      "heading"
      "service"
      "pay"
      "sales"
      "customer"
      "operator"
      "csnote"
      "opnote";
  }
}

/* Schedule Send Notice follows the compact email-review panel used by Move Container File. */
.schedule-notification-dialog.is-schedule-notice-mode {
  width: min(1080px, calc(100% - 28px));
  max-height: min(92vh, 880px);
  border: 1px solid rgb(20 54 75 / 0.16);
  border-radius: 20px;
  background: #edf3f6;
  box-shadow: 0 30px 90px -48px rgb(18 44 62 / 0.58);
}

.schedule-notification-dialog.is-schedule-notice-mode > .modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #d1e0e7;
  background: #f9fcfd;
}

.schedule-notification-dialog.is-schedule-notice-mode > .modal-header h2 {
  margin: 3px 0 0;
  color: #102a49;
  font-size: 21px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: none;
  padding: 14px 18px;
  overflow: auto;
  background: #edf3f6;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-bookings-panel {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d1e0e7;
  border-radius: 12px;
  background: #f9fcfd;
  box-shadow: none;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-heading h3 {
  margin: 2px 0 0;
  color: #102a49;
  font-size: 14px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-bookings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  max-height: min(24vh, 190px);
  padding: 0 2px 2px 0;
  overflow: auto;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-booking {
  gap: 8px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #d9e5ed;
  border-radius: 8px;
  background: #fff;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-booking strong {
  color: #102a49;
  font-size: 12px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-booking span span {
  color: #668097;
  font-size: 10px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-email-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  align-content: start;
  gap: 0;
  min-height: 0;
  margin: 0;
  padding: 16px 18px;
  overflow: visible;
  border: 1px solid #d1e0e7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(18 44 62 / 0.07);
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-email-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto !important;
  align-items: start;
  gap: 10px;
  padding: 0;
  border: 0;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-email-heading h3 {
  margin: 2px 0 0;
  color: #102a49;
  font-size: 18px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-intro {
  max-width: none;
  margin: 4px 0 0;
  color: #607987;
  font-size: 11px;
  line-height: 1.45;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px 14px;
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid #e0e9ee;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #18324f;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls label > span:first-child {
  color: #5b7582;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls > label:nth-of-type(1) {
  grid-column: 1;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls > label:nth-of-type(2) {
  grid-column: 2;
  align-self: end;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls > label:nth-of-type(n + 3) {
  grid-column: 1 / -1;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls select,
.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-status {
  display: block;
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid #d6e5ee;
  border-radius: 8px;
  background: #f6fafc;
  color: #355468;
  font-size: 11px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-email-preview-heading {
  display: flex;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e0e9ee;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-email-drafts {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: min(32vh, 280px);
  margin: 9px 0 0;
  padding: 0 2px 2px 0;
  overflow: auto;
  list-style: none;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-draft-common {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid #d9e5ed;
  border-radius: 11px;
  background: #f8fafc;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-draft-common > strong {
  color: #102a49;
  font-size: 13px;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-subject,
.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-attachment {
  margin: 0;
  color: #526b82;
  font-size: 11px;
  line-height: 1.45;
}

.schedule-notification-dialog.is-schedule-notice-mode .schedule-notification-body-preview {
  max-height: 210px;
  padding: 4px 0 2px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #203e59;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.schedule-notification-dialog.is-schedule-notice-mode > .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 20px;
  border-top: 1px solid #cadbe3;
  background: #f0f6f9;
}

@media (max-width: 640px) {
  .schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-notification-dialog.is-schedule-notice-mode .schedule-notice-controls > label {
    grid-column: 1;
  }

  .schedule-notification-dialog.is-schedule-notice-mode > .modal-actions {
    flex-wrap: wrap;
  }

  .schedule-notification-dialog.is-schedule-notice-mode > .modal-actions .button {
    flex: 1 1 auto;
  }
}

.schedule-notification-controls .email-attachment-option,
.reassign-notification-controls .email-attachment-option {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.schedule-notification-controls .email-attachment-option input,
.reassign-notification-controls .email-attachment-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}

.schedule-notification-controls .email-attachment-option span,
.reassign-notification-controls .email-attachment-option span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

/* Shared controls for moving schedules and reviewing linked Booking notices. */
.reassign-target-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.reassign-target-field > label {
  color: #18324f;
  font-size: 12px;
  font-weight: 700;
}

.reassign-target-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reassign-target-controls select {
  width: 100%;
  min-width: 0;
}

.reassign-target-picker {
  position: relative;
  min-width: 0;
}

.reassign-target-picker > input {
  width: 100%;
  min-width: 0;
}

.reassign-target-options {
  position: fixed;
  z-index: 2000;
  top: auto;
  left: auto;
  width: max(100%, 340px);
  max-width: min(440px, calc(100vw - 32px));
  max-height: min(320px, 48vh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 4px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.reassign-target-options[hidden] {
  display: none;
}

.reassign-sailing-option {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.reassign-sailing-option + .reassign-sailing-option {
  margin-top: 2px;
}

.reassign-sailing-option:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: -2px;
}

.reassign-sailing-option:active:not(:disabled) {
  background: var(--line);
}

.reassign-sailing-option.is-active,
.reassign-sailing-option.is-selected {
  background: var(--surface-blue);
}

.reassign-sailing-option-details {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.reassign-sailing-option-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reassign-sailing-option-meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.25;
}

.reassign-sailing-option-date {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.reassign-sailing-option-date-label {
  color: var(--muted);
  font-weight: 650;
}

.reassign-sailing-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
}

.reassign-sailing-status.is-available {
  color: var(--teal);
  background: var(--teal-soft);
}

.reassign-sailing-option:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.reassign-target-footer {
  display: flex;
  justify-content: flex-end;
  margin: 4px 6px 0;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.reassign-target-clear {
  padding: 3px 6px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.reassign-target-clear:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 1px;
}

.reassign-target-empty {
  padding: 14px 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

@media (hover: hover) {
  .reassign-sailing-option:hover:not(:disabled) {
    background: var(--surface-blue);
  }

  .reassign-target-clear:hover {
    color: var(--blue);
    background: var(--surface-soft);
  }
}

.reassign-target-controls .button {
  min-height: 40px;
  white-space: nowrap;
}

.schedule-notification-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1180px, calc(100% - 32px));
  max-height: min(90vh, 860px);
  overflow: hidden;
  border-radius: var(--radius-md);
}

.schedule-notification-dialog:not([open]) {
  display: none !important;
}

.schedule-notification-dialog > .modal-header {
  padding: 20px 24px 16px;
  background: var(--surface);
}

.schedule-notification-dialog .modal-subtitle {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.schedule-notification-body {
  grid-template-columns: minmax(250px, 0.78fr) minmax(0, 1.22fr);
  align-content: start;
  gap: 14px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 16px 20px;
  background: var(--surface-soft);
}

.schedule-notification-panel {
  gap: 12px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.schedule-notification-heading h3 {
  margin: 3px 0 0;
  font-size: 15px;
  line-height: 1.35;
}

.schedule-notification-bookings {
  gap: 8px;
  max-height: 300px;
  padding-right: 3px;
}

.schedule-notification-booking {
  gap: 10px;
  padding: 10px 11px;
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: var(--radius-sm);
}

.schedule-notification-booking:hover {
  border-color: var(--line-strong);
  background: var(--surface-blue);
}

.schedule-notification-booking input {
  accent-color: var(--blue);
}

.schedule-notification-controls {
  gap: 13px;
}

.schedule-notification-controls label {
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}

.schedule-notification-controls label > span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.schedule-notification-controls select,
.schedule-notification-controls textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  text-transform: none;
}

.schedule-notification-controls .email-attachment-option,
.reassign-notification-controls .email-attachment-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.schedule-notification-controls .email-attachment-option input,
.reassign-notification-controls .email-attachment-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}

.schedule-notification-controls .email-attachment-option span,
.reassign-notification-controls .email-attachment-option span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.schedule-notification-controls select:focus,
.schedule-notification-controls textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(39, 135, 206, 0.12);
}

.schedule-notification-controls textarea {
  min-height: 138px;
  resize: vertical;
  line-height: 1.5;
}

.schedule-notification-message-count {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.schedule-notification-status,
.schedule-notification-empty {
  padding: 9px 11px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.schedule-notification-drafts {
  gap: 10px;
  max-height: 360px;
  padding-right: 3px;
}

.schedule-notification-draft {
  gap: 8px;
  padding: 12px;
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: var(--radius-sm);
}

.schedule-notification-body-preview {
  max-height: 240px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
}

.schedule-notification-dialog > .modal-actions {
  align-items: center;
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .schedule-notification-dialog {
    max-height: calc(100vh - 20px);
  }

  .schedule-notification-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .schedule-notification-draft-panel {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .schedule-notification-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .schedule-notification-dialog > .modal-header {
    padding: 16px;
  }

  .schedule-notification-dialog > .modal-actions {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .schedule-notification-dialog > .modal-actions .button {
    flex: 1 1 auto;
  }
}

/* Final move workflow bounds: this must remain after the legacy reference rules so
   the dialog frame and compact two-line records are the actual winning styles. */
.reassign-dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: min(900px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.reassign-form {
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow: hidden;
  padding: 14px 20px 0;
}

.reassign-main-panel,
.reassign-notification-panel {
  min-height: 0;
  overflow: hidden;
}

.reassign-main-panel {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.reassign-preview-list {
  min-height: 0;
  max-height: none;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 6px;
  padding: 1px 4px 2px 0;
}

.reassign-notification-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.reassign-notification-drafts {
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.reassign-form > .modal-actions {
  position: static;
  grid-column: 1 / -1;
  grid-row: 2;
  width: auto;
  min-height: 60px;
  margin: 0 -20px;
  padding: 10px 20px;
  border-top-color: #ccdce4;
  box-shadow: 0 -4px 12px rgb(25 56 74 / 0.05);
}

.reassign-record-card {
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgb(26 58 77 / 0.045);
}

.reassign-card-primary {
  display: grid;
  grid-template-columns: minmax(100px, .72fr) minmax(0, 1.45fr) minmax(0, 1.1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.reassign-card-identity {
  gap: 2px;
  min-width: 0;
}

.reassign-card-eyebrow,
.reassign-card-label,
.reassign-op-note-label {
  font-size: 8px;
  letter-spacing: .08em;
}

.reassign-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.reassign-card-route,
.reassign-card-facts {
  min-width: 0;
  gap: 5px;
}

.reassign-card-field {
  min-width: 0;
  min-height: 38px;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 7px;
}

.reassign-card-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.25;
}

.reassign-card-secondary-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #6b8291;
  font-size: 8px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reassign-card-primary-status {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.reassign-status-badge {
  padding: 4px 7px;
  font-size: 9px;
}

.reassign-op-note-block {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-left-width: 2px;
  border-radius: 7px;
}

.reassign-op-note-value {
  min-width: 0;
  overflow: hidden;
  color: #31566a;
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reassign-entity-primary {
  grid-template-columns: minmax(90px, .68fr) minmax(0, 1.05fr) minmax(0, 1.25fr) auto;
}

.reassign-entity-primary .reassign-card-field-wide,
.reassign-entity-primary .reassign-card-facts .reassign-card-field-wide {
  grid-column: auto !important;
}

.reassign-entity-primary .reassign-field-chip-list {
  flex-wrap: nowrap;
  overflow: hidden;
}

.reassign-entity-primary .reassign-field-chip,
.reassign-entity-primary .reassign-field-none {
  flex: 0 0 auto;
  min-height: 18px;
  padding: 2px 6px;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .reassign-dialog {
    height: min(900px, calc(100dvh - 12px));
    max-height: calc(100dvh - 12px);
  }

  .reassign-form {
    grid-template-rows: minmax(240px, 1fr) minmax(220px, 1fr) auto;
    overflow-y: auto;
  }

  .reassign-form > .modal-actions {
    grid-row: 3;
  }
}

@media (max-width: 640px) {
  .reassign-form {
    padding-right: 12px;
    padding-left: 12px;
  }

  .reassign-form > .modal-actions {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .reassign-card-primary,
  .reassign-entity-primary {
    grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr) auto;
  }

  .reassign-card-route,
  .reassign-card-facts,
  .reassign-entity-primary .reassign-card-facts,
  .reassign-entity-primary .reassign-changed-fields {
    grid-column: 1 / -1;
  }

  .reassign-card-route,
  .reassign-card-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reassign-card-primary-status {
    justify-content: flex-end;
  }
}

/* Shared action placement and feedback: keep every move entry point readable
   in the same linked-record section, and report writes without blocking the UI. */
.linked-schedule-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bacbd5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 9px rgb(30 57 74 / 0.05);
}

.linked-schedule-panel .linked-hbl-heading {
  margin-bottom: 0;
  padding-bottom: 0;
}

.linked-schedule-panel .linked-hbl-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.linked-schedule-search {
  display: block;
  width: min(230px, 30vw);
}

.linked-schedule-search input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #c7d5df;
  border-radius: 6px;
  background: #fff;
  color: #15354a;
  font: inherit;
  font-size: 12px;
}

.linked-schedule-search input:focus-visible {
  outline: 2px solid #2f7eaa;
  outline-offset: 1px;
}

.linked-schedule-record-scroll {
  max-height: 240px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #d4dfe5;
  border-radius: 7px;
}

.linked-bookings-list {
  max-height: none;
  overflow: visible;
  border: 0;
}

.linked-bookings-list .linked-schedule-record-table {
  table-layout: fixed;
}

.linked-bookings-list .linked-schedule-record-table th:nth-child(1),
.linked-bookings-list .linked-schedule-record-table td:nth-child(1) {
  width: 8%;
}

.linked-bookings-list .linked-schedule-record-table th:nth-child(2),
.linked-bookings-list .linked-schedule-record-table td:nth-child(2) {
  width: 11%;
}

.linked-bookings-list .linked-schedule-record-table th:nth-child(3),
.linked-bookings-list .linked-schedule-record-table td:nth-child(3) {
  width: 16%;
}

.linked-bookings-list .linked-schedule-record-table th:nth-child(4),
.linked-bookings-list .linked-schedule-record-table td:nth-child(4) {
  width: 5%;
}

.linked-bookings-list .linked-schedule-record-table th:nth-child(5),
.linked-bookings-list .linked-schedule-record-table td:nth-child(5) {
  width: 8%;
}

.linked-bookings-list .linked-schedule-record-table th:nth-child(6),
.linked-bookings-list .linked-schedule-record-table td:nth-child(6) {
  width: 7%;
}

.linked-bookings-list .linked-schedule-record-table th:nth-child(7),
.linked-bookings-list .linked-schedule-record-table td:nth-child(7) {
  width: 45%;
}

.linked-bookings-list .linked-booking-edit-actions {
  gap: 4px;
}

.linked-bookings-list .linked-booking-edit-actions .button {
  padding: 5px 7px;
}

.linked-bookings-list .linked-schedule-record-table td:nth-child(7) {
  line-height: 1.4;
}

.linked-bookings-list th {
  position: static;
}

.linked-bookings-list th,
.linked-bookings-list td {
  padding: 6px 7px;
  overflow-wrap: anywhere;
}

.linked-schedule-record-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.linked-schedule-record-table th,
.linked-schedule-record-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e0e8ed;
  text-align: left;
  vertical-align: top;
}

.linked-schedule-record-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #527087;
  background: #f2f7fa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.linked-schedule-record-table tbody tr:last-child td {
  border-bottom: 0;
}

.linked-schedule-record-table tbody tr.linked-schedule-openable {
  cursor: pointer;
}

.linked-schedule-record-table tbody tr.linked-schedule-openable:hover {
  background: #f1f7fb;
}

.linked-schedule-record-table .linked-schedule-empty {
  color: #667f91;
  text-align: center;
}

.linked-schedule-record-table .linked-schedule-loaded {
  color: #17734f;
  font-weight: 700;
}

.linked-schedule-record-meta {
  margin: 8px 0 0;
  color: #617b8e;
  font-size: 11px;
}

@media (max-width: 720px) {
  .linked-schedule-panel .linked-hbl-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .linked-schedule-panel .linked-hbl-actions,
  .linked-schedule-search {
    width: 100%;
  }
}

.email-queue-header-status {
  align-self: center;
  text-align: right;
}

.email-queue-filter-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #d6e3e9;
  background: #f7fbfd;
}

.email-queue-filter-bar label {
  display: grid;
  gap: 5px;
  min-width: 180px;
  color: #557181;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.email-queue-filter-bar select {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #b8cfdb;
  border-radius: 7px;
  color: #193a50;
  background: #fff;
}

.email-queue-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.email-queue-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #c5d6de;
  border-radius: 999px;
  color: #557181;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.email-queue-count.is-pending,
.email-queue-count.is-sending,
.email-queue-count.is-retry {
  border-color: #e3bd65;
  color: #8b6519;
  background: #fff8e6;
}

.email-queue-count.is-sent {
  border-color: #8acaa8;
  color: #19724e;
  background: #eefaf3;
}

.email-queue-count.is-failed {
  border-color: #e3a1a8;
  color: #a33443;
  background: #fff1f2;
}

.email-queue-scroll {
  min-height: 300px;
}

.email-queue-table {
  min-width: 980px;
}

.email-queue-table td {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-queue-table td.email-queue-status {
  font-weight: 850;
}

.email-queue-table td.email-queue-status.is-pending,
.email-queue-table td.email-queue-status.is-sending,
.email-queue-table td.email-queue-status.is-retry {
  color: #986b12;
}

.email-queue-table td.email-queue-status.is-sent {
  color: #19724e;
}

.email-queue-table td.email-queue-status.is-failed {
  color: #ae3445;
}

.email-queue-batch-row { cursor: pointer; }
.email-queue-expand {
  padding: 3px 5px;
  border: 0;
  color: #183e55;
  background: transparent;
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.email-queue-expanded-row > td { padding: 12px 18px; background: #f4f9fb; }
.email-queue-task-table { width: 100%; min-width: 1080px; border-collapse: collapse; }
.email-queue-task-table th { padding: 8px; color: #557181; background: #eaf2f5; font-size: 9px; text-align: left; }
.email-queue-task-table td { max-width: 280px; padding: 8px; border-top: 1px solid #dce7eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 420px;
}
.email-queue-actions .button { min-height: 26px; padding: 3px 7px; font-size: 10px; }
.email-queue-actions .button:disabled { opacity: .45; cursor: not-allowed; }
.email-queue-actions .button.is-confirming { border-color: #d99a2b; color: #754c08; background: #fff3d7; }
.email-queue-preview-dialog { width: min(980px, calc(100vw - 28px)); max-height: min(90vh, 1000px); overflow: auto; }
.email-queue-preview-list { display: grid; gap: 14px; }
.email-queue-preview-card { padding: 14px; border: 1px solid #d6e3e9; border-radius: 10px; background: #fff; }
.email-queue-preview-card h3 { margin: 0 0 8px; color: #193a50; }
.email-queue-preview-card p { margin: 5px 0; color: #557181; overflow-wrap: anywhere; }
.email-queue-preview-frame { display: block; width: 100%; min-height: 280px; margin-top: 12px; border: 1px solid #d6e3e9; border-radius: 6px; background: #fff; }

@media (max-width: 760px) {
  .email-queue-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .email-queue-counts {
    justify-content: flex-start;
  }
}

.workspace-toast-region {
  position: fixed;
  z-index: 4000;
  inset: 16px 18px auto auto;
  display: grid;
  gap: 8px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.workspace-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #b9ced9;
  border-radius: 10px;
  color: #193a50;
  background: #f7fbfd;
  box-shadow: 0 10px 28px rgb(24 54 72 / 0.16);
  pointer-events: auto;
}

.workspace-toast.is-pending {
  border-color: #e3bd65;
  background: #fff8e6;
}

.workspace-toast.is-success {
  border-color: #8acaa8;
  background: #eefaf3;
}

.workspace-toast.is-warning {
  border-color: #e3bd65;
  background: #fff8e6;
}

.workspace-toast.is-error {
  border-color: #e3a1a8;
  background: #fff1f2;
}

.workspace-toast-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  background: #63879b;
  font-size: 12px;
  font-weight: 900;
}

.workspace-toast.is-pending .workspace-toast-icon,
.workspace-toast.is-warning .workspace-toast-icon {
  background: #c28a18;
}

.workspace-toast.is-success .workspace-toast-icon {
  background: #19895b;
}

.workspace-toast.is-error .workspace-toast-icon {
  background: #bd4051;
}

.workspace-toast-content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workspace-toast-title,
.workspace-toast-detail {
  overflow-wrap: anywhere;
}

.workspace-toast-title {
  color: #173850;
  font-size: 12px;
  line-height: 1.3;
}

.workspace-toast-detail {
  color: #5c7483;
  font-size: 11px;
  line-height: 1.35;
}

.workspace-toast-close {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #b9ced9;
  border-radius: 6px;
  color: #5a7382;
  background: transparent;
  cursor: pointer;
}

.workspace-toast-close:hover,
.workspace-toast-close:focus-visible {
  color: #173850;
  background: #eaf2f6;
}

.editor-revision {
  display: none !important;
}

dialog#reassignDialog.reassign-dialog .reassign-controls-grid,
.reassign-controls-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.75fr) minmax(180px, 0.75fr) !important;
  align-items: end !important;
  gap: 14px !important;
}

dialog#reassignDialog.reassign-dialog .reassign-notification-heading,
.reassign-notification-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  align-items: start !important;
  column-gap: 14px !important;
  row-gap: 6px !important;
}

.reassign-notification-heading-copy {
  min-width: 0;
}

.reassign-notification-heading-tools {
  justify-self: end;
  margin-left: 0;
}

.reassign-notification-intro {
  grid-column: 1 / -1;
  max-width: none !important;
  margin: 0 !important;
}

@media (max-width: 900px) {
  dialog#reassignDialog.reassign-dialog .reassign-controls-grid,
  .reassign-controls-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.6fr) !important;
  }
}

@media (max-width: 640px) {
  dialog#reassignDialog.reassign-dialog .reassign-controls-grid,
  .reassign-controls-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  dialog#reassignDialog.reassign-dialog .reassign-notification-heading,
  .reassign-notification-heading {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .reassign-notification-heading-tools {
    justify-self: stretch;
    justify-content: space-between;
  }

  .workspace-toast-region {
    inset: 10px 10px auto auto;
    width: min(390px, calc(100vw - 20px));
  }
}

/* Bounded move workflow: the dialog owns the frame, panels own their scroll, and each
   record stays a compact two-line review item instead of growing into a mini form. */
.reassign-dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: min(900px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.reassign-form {
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow: hidden;
  padding: 14px 20px 0;
}

.reassign-main-panel,
.reassign-notification-panel {
  min-height: 0;
  overflow: hidden;
}

.reassign-main-panel {
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.reassign-preview-list {
  min-height: 0;
  max-height: none;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 6px;
  padding: 1px 4px 2px 0;
}

.reassign-notification-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.reassign-notification-drafts {
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.reassign-form > .modal-actions {
  position: static;
  grid-column: 1 / -1;
  grid-row: 2;
  width: auto;
  min-height: 60px;
  margin: 0 -20px;
  padding: 10px 20px;
  border-top-color: #ccdce4;
  box-shadow: 0 -4px 12px rgb(25 56 74 / 0.05);
}

.reassign-record-card {
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgb(26 58 77 / 0.045);
}

.reassign-card-primary {
  display: grid;
  grid-template-columns: minmax(100px, .72fr) minmax(0, 1.45fr) minmax(0, 1.1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.reassign-card-identity {
  gap: 2px;
  min-width: 0;
}

.reassign-card-eyebrow,
.reassign-card-label,
.reassign-op-note-label {
  font-size: 8px;
  letter-spacing: .08em;
}

.reassign-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.reassign-card-route,
.reassign-card-facts {
  min-width: 0;
  gap: 5px;
}

.reassign-card-field {
  min-width: 0;
  min-height: 38px;
  gap: 2px;
  padding: 5px 7px;
  border-radius: 7px;
}

.reassign-card-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.25;
}

.reassign-card-secondary-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #6b8291;
  font-size: 8px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reassign-card-primary-status {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.reassign-status-badge {
  padding: 4px 7px;
  font-size: 9px;
}

.reassign-op-note-block {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-left-width: 2px;
  border-radius: 7px;
}

.reassign-op-note-value {
  min-width: 0;
  overflow: hidden;
  color: #31566a;
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reassign-entity-primary {
  grid-template-columns: minmax(90px, .68fr) minmax(0, 1.05fr) minmax(0, 1.25fr) auto;
}

.reassign-entity-primary .reassign-card-field-wide,
.reassign-entity-primary .reassign-card-facts .reassign-card-field-wide {
  grid-column: auto !important;
}

.reassign-entity-primary .reassign-card-field {
  min-height: 38px;
}

.reassign-entity-primary .reassign-field-chip-list {
  flex-wrap: nowrap;
  overflow: hidden;
}

.reassign-entity-primary .reassign-field-chip,
.reassign-entity-primary .reassign-field-none {
  flex: 0 0 auto;
  min-height: 18px;
  padding: 2px 6px;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .reassign-dialog {
    height: min(900px, calc(100dvh - 12px));
    max-height: calc(100dvh - 12px);
  }

  .reassign-form {
    grid-template-rows: minmax(240px, 1fr) minmax(220px, 1fr) auto;
    overflow-y: auto;
  }

  .reassign-form > .modal-actions {
    grid-row: 3;
  }
}

@media (max-width: 640px) {
  .reassign-form {
    padding-right: 12px;
    padding-left: 12px;
  }

  .reassign-form > .modal-actions {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .reassign-card-primary,
  .reassign-entity-primary {
    grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr) auto;
  }

  .reassign-card-route,
  .reassign-card-facts,
  .reassign-entity-primary .reassign-card-facts,
  .reassign-entity-primary .reassign-changed-fields {
    grid-column: 1 / -1;
  }

  .reassign-card-route,
  .reassign-card-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reassign-card-primary-status {
    justify-content: flex-end;
  }
}
/* Winning move workflow constraints. The older reference block below is retained for
   shared visual tokens, while these scoped rules make the geometry deterministic. */
dialog#reassignDialog.reassign-dialog:not([open]) {
  display: none !important;
}

dialog#reassignDialog.reassign-dialog {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  height: min(900px, calc(100dvh - 24px)) !important;
  max-height: calc(100dvh - 24px) !important;
  overflow: hidden !important;
}

dialog#reassignDialog.reassign-dialog > form#reassignForm.reassign-form {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  align-items: stretch !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow: hidden !important;
  padding: 14px 20px 0 !important;
}

dialog#reassignDialog.reassign-dialog .reassign-content-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.72fr) minmax(360px, 0.92fr) !important;
  align-items: start !important;
  align-content: start !important;
  gap: 16px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0 0 8px !important;
  scrollbar-gutter: stable;
}

dialog#reassignDialog.reassign-dialog .reassign-main-panel,
dialog#reassignDialog.reassign-dialog .reassign-notification-panel {
  min-height: 0 !important;
  height: max-content !important;
  overflow: visible !important;
}

dialog#reassignDialog.reassign-dialog .reassign-main-panel {
  grid-template-rows: auto auto auto auto auto !important;
}

dialog#reassignDialog.reassign-dialog .reassign-preview-list {
  min-height: 0 !important;
  max-height: none !important;
  grid-template-rows: none !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  gap: 6px !important;
  padding: 1px 4px 2px 0 !important;
}

dialog#reassignDialog.reassign-dialog .reassign-notification-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
}

dialog#reassignDialog.reassign-dialog .reassign-notification-drafts {
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

dialog#reassignDialog.reassign-dialog > form#reassignForm.reassign-form > .modal-actions {
  position: static !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  width: auto !important;
  min-height: 60px !important;
  margin: 0 -20px !important;
  padding: 10px 20px !important;
  box-shadow: 0 -4px 12px rgb(25 56 74 / 0.05) !important;
}

dialog#reassignDialog.reassign-dialog .reassign-record-card {
  gap: 6px !important;
  min-height: max-content !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 4px rgb(26 58 77 / 0.045) !important;
}

dialog#reassignDialog.reassign-dialog .reassign-card-primary {
  display: grid !important;
  grid-template-columns: minmax(100px, .72fr) minmax(0, 1.45fr) minmax(0, 1.1fr) auto !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0 !important;
}

dialog#reassignDialog.reassign-dialog .reassign-card-route,
dialog#reassignDialog.reassign-dialog .reassign-card-facts {
  min-width: 0 !important;
  gap: 5px !important;
}

dialog#reassignDialog.reassign-dialog .reassign-card-field {
  min-width: 0 !important;
  min-height: 38px !important;
  gap: 2px !important;
  padding: 5px 7px !important;
  border-radius: 7px !important;
}

dialog#reassignDialog.reassign-dialog .reassign-card-value {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 10px !important;
  line-height: 1.25 !important;
}

dialog#reassignDialog.reassign-dialog .reassign-card-secondary-value {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: #6b8291 !important;
  font-size: 8px !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

dialog#reassignDialog.reassign-dialog .reassign-card-primary-status {
  display: flex !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
}

dialog#reassignDialog.reassign-dialog .reassign-op-note-block {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  align-items: baseline !important;
  gap: 8px !important;
  min-width: 0 !important;
  padding: 6px 8px !important;
  border-left-width: 2px !important;
  border-radius: 7px !important;
}

dialog#reassignDialog.reassign-dialog .reassign-op-note-value {
  min-width: 0 !important;
  overflow: hidden !important;
  font-size: 10px !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

dialog#reassignDialog.reassign-dialog .reassign-entity-primary {
  grid-template-columns: minmax(90px, .68fr) minmax(0, 1.05fr) minmax(0, 1.25fr) auto !important;
}

dialog#reassignDialog.reassign-dialog .reassign-entity-primary .reassign-card-field-wide,
dialog#reassignDialog.reassign-dialog .reassign-entity-primary .reassign-card-facts .reassign-card-field-wide {
  grid-column: auto !important;
}

@media (max-width: 900px) {
  dialog#reassignDialog.reassign-dialog {
    height: min(900px, calc(100dvh - 12px)) !important;
    max-height: calc(100dvh - 12px) !important;
  }

  dialog#reassignDialog.reassign-dialog > form#reassignForm.reassign-form {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    overflow: hidden !important;
  }

  dialog#reassignDialog.reassign-dialog .reassign-content-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    overflow-y: auto !important;
  }

  dialog#reassignDialog.reassign-dialog > form#reassignForm.reassign-form > .modal-actions {
    grid-row: 2 !important;
  }
}

.hbl-pdf-dialog {
  width: min(620px, calc(100vw - 32px));
}

.hbl-pdf-form {
  display: grid;
  gap: 18px;
  padding: 20px 24px 0;
}

.hbl-pdf-format {
  display: grid;
  gap: 7px;
  color: var(--ink-700);
  font-weight: 700;
}

.hbl-pdf-options {
  display: flex;
  gap: 24px;
  align-items: center;
}

.hbl-pdf-options label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.hbl-pdf-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy-700);
}

/* DG/HAZMAT is the red attention state; cancelled records recede in grayscale. */
body.workspace-active .booking-table tbody tr.is-hazardous-booking > td,
body.workspace-active .booking-table tbody tr.is-hazardous-booking:nth-child(even) > td,
body.workspace-active .booking-table tbody tr.is-hazardous-booking:nth-child(odd) > td {
  color: #7a3131 !important;
  background: #fff1f1 !important;
}

body.workspace-active .booking-table tbody tr.is-deleted-booking > td,
body.workspace-active .booking-table tbody tr.is-deleted-booking:nth-child(even) > td,
body.workspace-active .booking-table tbody tr.is-deleted-booking:nth-child(odd) > td {
  color: #707b84 !important;
  background: #eef1f3 !important;
}

body.workspace-active #schedulesPanel .data-table tbody tr.is-full-schedule > td,
body.workspace-active #schedulesPanel .data-table tbody tr.is-full-schedule:nth-child(even) > td,
body.workspace-active #schedulesPanel .data-table tbody tr.is-full-schedule:nth-child(odd) > td,
body.workspace-active #schedulesPanel .data-table tbody tr.is-full-schedule:hover > td,
body.workspace-active #schedulesPanel .data-table tbody tr.is-full-schedule.is-selected > td {
  color: #707b84 !important;
  background: #eef1f3 !important;
}

body.workspace-active .booking-table tbody tr.is-deleted-booking .booking-status-deleted {
  color: #707b84 !important;
}

body.workspace-active .reassign-table-scroll .reassign-booking-row > td {
  background: #ffffff !important;
}

body.workspace-active .reassign-table-scroll .reassign-op-note-row > td {
  background: #f7fbfc !important;
}

/* Reference-matched move workflow: spacious plan, readable booking preview, email review. */
.reassign-dialog {
  width: min(1260px, calc(100vw - 40px));
  max-height: min(94vh, 900px);
  border-radius: 20px;
  background: #edf3f6;
  box-shadow: 0 32px 90px -46px rgb(20 49 70 / 0.58);
}

.reassign-dialog .modal-header {
  padding: 24px 28px 18px;
  background: #ffffff;
  border-bottom: 1px solid #d9e5ea;
}

.reassign-dialog .modal-header h2 {
  margin-top: 4px;
  color: #102a49;
  font-size: clamp(21px, 2vw, 28px);
  letter-spacing: -0.035em;
}

.reassign-dialog .modal-subtitle {
  max-width: 920px;
  margin-top: 7px;
  color: #536d84;
  font-size: 13px;
  line-height: 1.45;
}

.reassign-warning {
  margin: 16px 26px 0;
  padding: 12px 15px;
  border: 1px solid #f0d28d;
  border-left: 4px solid #d99a2b;
  border-radius: 11px;
  background: #fff7df;
  color: #6f4a12;
  font-size: 12px;
  line-height: 1.45;
}

.reassign-form {
  grid-template-columns: minmax(0, 1.72fr) minmax(360px, 0.92fr);
  gap: 16px;
  max-height: calc(min(94vh, 900px) - 152px);
  padding: 18px 26px 86px;
  overflow: auto;
}

.reassign-main-panel,
.reassign-notification-panel {
  padding: 20px;
  border: 1px solid #d5e1e7;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 7px 20px rgb(31 65 84 / 0.055);
}

.reassign-main-panel {
  gap: 16px;
}

.reassign-panel-heading h3,
.reassign-notification-heading h3 {
  margin: 4px 0 0;
  color: #102a49;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.reassign-panel-heading p,
.reassign-notification-intro {
  margin: 6px 0 0;
  color: #5f7890;
  font-size: 13px;
  line-height: 1.45;
}

.reassign-preview-count {
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6a8297;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.reassign-controls-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.reassign-controls-grid > label {
  gap: 7px;
  color: #18324f;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.reassign-form select,
.reassign-form input,
.reassign-form textarea {
  min-height: 44px;
  border-color: #c1d3de;
  border-radius: 10px;
  background: #ffffff;
  color: #18324f;
  font-size: 13px;
}

.reassign-summary {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid #a9dfcd;
  border-left: 1px solid #a9dfcd;
  border-radius: 10px;
  background: #eafaf5;
  color: #1b5d52;
  font-size: 12px;
  line-height: 1.45;
}

.reassign-summary::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: #18a77d;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.reassign-summary:not(.is-success):not(.is-error)::before {
  content: "i";
  background: #8ca5b7;
}

.reassign-summary.is-error {
  border-color: #e3a0a6;
  background: #fff1f2;
  color: #8d1f2a;
}

.reassign-summary.is-error::before {
  content: "!";
  background: #c4424e;
}

.reassign-preview-heading {
  align-items: baseline;
  padding-top: 1px;
}

.reassign-preview-heading > span:first-child {
  color: #102a49;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.reassign-preview-heading > span:last-child {
  color: #698198;
  font-size: 11px;
  font-weight: 600;
}

.reassign-preview-list {
  max-height: min(42vh, 390px);
  min-height: 126px;
  gap: 10px;
  padding: 0;
}

.reassign-record-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d4e2e8;
  border-radius: 12px;
  background: #fff;
}

.reassign-record-group-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  color: #173b56;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 750;
}

.reassign-record-group-heading::-webkit-details-marker {
  display: none;
}

.reassign-record-group-heading::before {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #56758a;
  border-bottom: 1.5px solid #56758a;
  content: "";
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.reassign-record-group[open] > .reassign-record-group-heading::before {
  transform: rotate(45deg);
}

.reassign-record-group-title {
  flex: 1;
}

.reassign-record-group-count {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: #edf4f7;
  color: #45677d;
  font-size: 10px;
  font-weight: 700;
}

.reassign-record-group-items {
  display: grid;
  gap: 9px;
  padding: 0 10px 10px;
}

.reassign-record-group-items > .reassign-record-card {
  border-radius: 9px;
  box-shadow: none;
}

.reassign-template-manager {
  grid-column: 1 / -1;
  margin-top: -4px;
  border-top: 1px solid #e1eaf0;
  color: #36566d;
  font-size: 11px;
}

.reassign-template-manager > summary {
  padding: 9px 0 5px;
  cursor: pointer;
  font-weight: 700;
}

.reassign-template-manager-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.reassign-template-manager-controls label {
  display: grid;
  gap: 5px;
}

.reassign-template-manager-controls #reassignTemplateSaveStatus {
  grid-column: 1 / -1;
  min-height: 14px;
  color: #53738a;
}

.reassign-template-manager > p {
  margin: 5px 0 0;
  color: #71879a;
  font-size: 10px;
}

/* The older table-card rule defined six narrow columns. Reset it explicitly so long
   vessel names and OP notes never collapse into vertical letter-by-letter text. */
.reassign-record-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px;
  width: auto !important;
  min-width: 0;
  height: auto !important;
  min-height: 0;
  padding: 16px;
  border: 1px solid #d4e2e8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgb(27 60 80 / 0.045);
}

.reassign-card-header {
  align-items: center;
  gap: 12px;
}

.reassign-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  color: #102a49;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.reassign-card-route {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}

.reassign-card-route .reassign-card-field,
.reassign-card-facts .reassign-card-field {
  min-width: 0;
  min-height: 62px;
  padding: 8px 12px;
  border-color: #e1ebef;
  background: #f8fbfc;
}

.reassign-card-route .reassign-card-field:first-child {
  border-radius: 10px 0 0 10px;
  border-right: 0;
}

.reassign-card-route .reassign-card-field + .reassign-card-field {
  position: relative;
  border-radius: 0 10px 10px 0;
}

.reassign-card-route .reassign-card-field + .reassign-card-field::before {
  content: "→";
  position: absolute;
  top: 50%;
  left: -11px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  transform: translateY(-50%);
  border: 1px solid #d5e4ea;
  border-radius: 50%;
  background: #ffffff;
  color: #4b8aa0;
  font-size: 12px;
  font-weight: 900;
}

.reassign-card-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reassign-card-field {
  gap: 5px;
}

.reassign-card-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
  color: #203e59;
  font-size: 12px;
  line-height: 1.4;
}

.reassign-card-field-wide,
.reassign-card-facts .reassign-card-field-wide {
  grid-column: 1 / -1;
}

.reassign-op-note-block {
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid #cde1f5;
  border-left: 3px solid #3787df;
  border-radius: 10px;
  background: #eef6ff;
}

.reassign-op-note-label {
  color: #2d6da9;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.reassign-op-note-value {
  margin: 0;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: pre-wrap;
  color: #315675;
  font-size: 12px;
  line-height: 1.5;
}

.reassign-notification-panel {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: none !important;
  align-content: start;
  gap: 0;
  margin: 0;
}

.reassign-notification-heading {
  display: flex !important;
  grid-column: auto !important;
  grid-row: auto !important;
  align-items: flex-start;
  gap: 14px;
  padding: 0;
  border: 0;
}

.reassign-notification-heading h3 {
  font-size: 21px;
}

.reassign-notification-heading-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.reassign-notification-count {
  color: #668097;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.reassign-notification-intro {
  max-width: 250px;
}

.reassign-notification-controls {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
  display: none;
  gap: 14px;
  padding: 18px 0 0;
  border-top: 1px solid #e0e9ee;
  margin-top: 18px;
}

.reassign-notification-panel.is-expanded .reassign-notification-controls {
  display: grid !important;
}

.reassign-notification-controls label {
  gap: 7px;
  color: #18324f;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.reassign-notification-controls label em {
  color: #71879a;
  font-style: normal;
  font-weight: 550;
}

.reassign-notification-controls textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
}

.reassign-message-count {
  align-self: end;
  margin-top: -3px;
  color: #71879a;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.reassign-email-preview-heading {
  display: none;
  grid-column: 1 / -1;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e0e9ee;
  color: #18324f;
  font-size: 13px;
  font-weight: 800;
}

.reassign-email-preview-heading > span:last-child {
  color: #71879a;
  font-size: 10px;
  font-weight: 650;
}

.reassign-notification-panel.is-expanded .reassign-email-preview-heading {
  display: flex;
}

.reassign-send-notice-toggle {
  position: relative;
  display: inline-flex;
  grid-column: auto !important;
  grid-row: auto !important;
  align-self: center;
  justify-self: auto;
  width: max-content;
  margin: 0;
  padding: 5px 9px 5px 6px;
  border: 1px solid #c5d7e2;
  border-radius: 999px;
  background: #f8fbfd;
  color: #18324f;
  font-size: 11px;
  font-weight: 800;
}

.reassign-send-notice-switch {
  width: 34px;
  height: 20px;
}

.reassign-notification-drafts {
  display: none;
  grid-column: 1 / -1;
  grid-row: auto;
  gap: 8px;
  max-height: min(34vh, 310px);
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.reassign-notification-panel.is-expanded .reassign-notification-drafts {
  display: grid !important;
}

.reassign-notification-draft {
  display: grid;
  gap: 9px;
  padding: 15px;
  border: 1px solid #d9e5ed;
  border-radius: 11px;
  background: #f8fafc;
}

.reassign-notification-draft strong {
  color: #102a49;
  font-size: 14px;
}

.reassign-notification-subject,
.reassign-notification-attachment {
  color: #526b82;
  font-size: 11px;
  line-height: 1.45;
}

.reassign-notification-body {
  max-height: 220px;
  padding: 4px 0 2px;
  overflow: auto;
  color: #203e59;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.reassign-form > .modal-actions {
  min-height: 74px;
  padding: 14px 26px;
  border-top-color: #d1e0e7;
  background: rgb(247 250 252 / 0.97);
}

.reassign-action-hint {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}

.reassign-action-hint::before {
  content: "i";
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  border-radius: 50%;
  background: #d9e5ee;
  color: #5b7890;
  font-size: 13px;
  font-weight: 900;
}

.reassign-form > .modal-actions .button {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 17px;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1000px) {
  .reassign-form {
    grid-template-columns: 1fr;
  }

  .reassign-notification-panel {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .reassign-dialog {
    width: calc(100vw - 14px);
    border-radius: 15px;
  }

  .reassign-dialog .modal-header,
  .reassign-form {
    padding-right: 14px;
    padding-left: 14px;
  }

  .reassign-warning {
    margin-right: 14px;
    margin-left: 14px;
  }

  .reassign-card-route,
  .reassign-card-facts {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reassign-card-route .reassign-card-field:first-child,
  .reassign-card-route .reassign-card-field + .reassign-card-field {
    border: 1px solid #e1ebef;
    border-radius: 10px;
  }

  .reassign-card-route .reassign-card-field + .reassign-card-field::before {
    display: none;
  }

  .reassign-notification-heading {
    flex-direction: column;
  }

  .reassign-notification-heading-tools {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .reassign-form > .modal-actions {
    flex-wrap: wrap;
    padding-right: 14px;
    padding-left: 14px;
  }

  .reassign-action-hint {
    flex-basis: 100%;
    order: -1;
  }
}

/* Final shared move layout: keep the two plan controls together on wide dialogs,
   then collapse them only when the dialog can no longer give each control room. */
.reassign-controls-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.75fr) minmax(180px, 0.75fr) !important;
  align-items: end !important;
  gap: 14px !important;
}

.reassign-notification-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  align-items: start !important;
  column-gap: 14px !important;
  row-gap: 6px !important;
}

.reassign-notification-heading-copy {
  min-width: 0;
}

.reassign-notification-heading-tools {
  justify-self: end;
  margin-left: 0;
}

.reassign-notification-intro {
  grid-column: 1 / -1;
  max-width: none !important;
  margin: 0 !important;
}

@media (max-width: 900px) {
  .reassign-controls-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.6fr) !important;
  }
}

@media (max-width: 640px) {
  .reassign-controls-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .reassign-notification-heading {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .reassign-notification-heading-tools {
    justify-self: stretch;
    justify-content: space-between;
  }
}

/* Email queue: a batch-first dispatch ledger, tuned to the existing DirectCP shell. */
.email-queue-panel {
  --queue-paper: #eef2f4;
  --queue-line: #d1dce1;
  --queue-ink: #193347;
  --queue-muted: #657985;
}

.email-queue-panel .module-header {
  margin-bottom: 18px;
}

.email-queue-panel .module-heading-copy p {
  max-width: 58ch;
  color: var(--queue-muted);
}

.email-queue-results-card {
  overflow: visible;
  border-color: var(--queue-line);
  border-radius: 8px;
  background: var(--queue-paper);
  box-shadow: 0 2px 8px rgb(29 47 55 / 6%);
}

.email-queue-results-card .table-toolbar {
  min-height: 58px;
  padding: 11px 16px;
  border-bottom-color: var(--queue-line);
  background: #f5f7f6;
}

.email-queue-results-card .table-toolbar-title strong {
  color: var(--queue-ink);
  font-size: 15px;
  letter-spacing: -0.015em;
}

.email-queue-results-card .table-meta {
  color: var(--queue-muted);
  font-size: 11px;
}

.email-queue-header-status {
  color: var(--queue-muted);
  font-variant-numeric: tabular-nums;
}

.email-queue-filter-bar {
  align-items: center;
  padding: 10px 16px;
  border-bottom-color: var(--queue-line);
  background: #e8eeee;
}

.email-queue-filter-bar label {
  min-width: 170px;
  color: var(--queue-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.email-queue-filter-bar select {
  min-height: 36px;
  border-color: #c9d2d0;
  border-radius: 7px;
  color: var(--queue-ink);
  background: #fff;
}

.email-queue-counts {
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

.email-queue-count {
  position: relative;
  min-height: 28px;
  padding: 2px 10px 2px 18px;
  gap: 7px;
  border: 0;
  border-radius: 4px;
  color: var(--queue-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 550;
}

.email-queue-count::before {
  position: absolute;
  top: 50%;
  left: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aaba7;
  content: "";
  transform: translateY(-50%);
}
.email-queue-count.is-pending::before,
.email-queue-count.is-sending::before,
.email-queue-count.is-retry::before { background: #b87820; }
.email-queue-count.is-sent::before { background: #34805b; }
.email-queue-count.is-failed::before { background: #b14a4d; }
.email-queue-count.is-cancelled::before { background: #899295; }
.email-queue-count-label { white-space: nowrap; }
.email-queue-count-value {
  color: var(--queue-ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}
.email-queue-count.is-pending .email-queue-count-value,
.email-queue-count.is-sending .email-queue-count-value,
.email-queue-count.is-retry .email-queue-count-value { color: #936019; }
.email-queue-count.is-sent .email-queue-count-value { color: #28724f; }
.email-queue-count.is-failed .email-queue-count-value { color: #a23c47; }

.email-queue-scroll {
  min-height: 260px;
  padding: 0 10px 10px;
  background: var(--queue-paper);
}

.email-queue-table {
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.email-queue-table th {
  height: 36px;
  padding: 8px 10px;
  border-bottom: 1px solid #c8d3d4;
  color: #627479;
  background: #e4ebec;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.email-queue-table th:nth-child(1) { width: 135px; }
.email-queue-table th:nth-child(2) { width: 190px; }
.email-queue-table th:nth-child(3) { width: 280px; }
.email-queue-table th:nth-child(4) { width: 125px; }
.email-queue-table th:nth-child(5) { width: 105px; }
.email-queue-table th:nth-child(6) { width: 165px; }
.email-queue-table th:nth-child(7) { width: 165px; }

.email-queue-table td {
  max-width: none;
  padding: 9px 10px;
  overflow: hidden;
  border-bottom: 1px solid #d9e1e0;
  color: #314954;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-queue-table tbody tr.email-queue-batch-row {
  background: #f8faf8;
  cursor: default;
  transition: background-color 120ms ease;
}

.email-queue-table tbody tr.email-queue-batch-row:nth-child(4n + 1) { background: #f0f4f2; }
.email-queue-table tbody tr.email-queue-batch-row:hover { background: #e7eeee; }
.email-queue-table tbody tr.email-queue-batch-row:has(+ .email-queue-detail-row) { background: #e7eeee; }

.email-queue-batch-cell {
  display: table-cell;
  font-variant-numeric: tabular-nums;
}

.email-queue-expand {
  width: 30px;
  height: 30px;
  margin-right: 9px;
  padding: 0;
  border: 1px solid #c1cece;
  border-radius: 5px;
  color: #315158;
  background: #f8fbfa;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
}

.email-queue-expand:hover { border-color: #537c7d; background: #f2f6f3; }
.email-queue-batch-id { color: #1b4051; font-weight: 760; letter-spacing: 0.015em; }
.email-queue-bookings,
.email-queue-recipients { overflow: hidden; text-overflow: ellipsis; }
.email-queue-overflow {
  display: inline-block;
  margin-left: 6px;
  color: #64797b;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
}

.email-queue-status-badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #cbd4d0;
  border-radius: 5px;
  color: #536b70;
  background: #f2f4f1;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.email-queue-status-badge.is-pending,
.email-queue-status-badge.is-sending,
.email-queue-status-badge.is-retry {
  border-color: #dfc38f;
  color: #80551b;
  background: #f8f0df;
}
.email-queue-status-badge.is-sent { border-color: #b8d2c1; color: #286547; background: #eaf2ec; }
.email-queue-status-badge.is-failed { border-color: #d9b4b5; color: #933940; background: #f6e9e8; }
.email-queue-status-badge.is-cancelled { border-color: #cbd1d0; color: #667273; background: #eef0ed; }
.email-queue-email-count { color: #425f67; font-variant-numeric: tabular-nums; font-weight: 650; }
.email-queue-created { color: #687b7e !important; font-variant-numeric: tabular-nums; }

.email-queue-actions {
  display: flex;
  max-width: none;
  align-items: center;
  gap: 6px;
}

.email-queue-actions .button {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 11px;
}

.email-queue-preview-action {
  color: #fff;
  background: #18394c;
  border-color: #18394c;
}
.email-queue-preview-action:hover:not(:disabled) { background: #244d5c; border-color: #244d5c; }

.email-queue-more { position: relative; }
.email-queue-more > summary { list-style: none; cursor: pointer; }
.email-queue-more > summary::-webkit-details-marker { display: none; }
.email-queue-more[open] > summary { border-color: #93a7a4; background: #eef1ec; }
.email-queue-action-menu {
  position: fixed;
  z-index: 1200;
  display: grid;
  width: 176px;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 360px);
  overflow-y: auto;
  gap: 3px;
  padding: 4px;
  border: 1px solid #cbd5d5;
  border-radius: 7px;
  background: #f7faf9;
  box-shadow: 0 10px 26px rgb(24 57 76 / 18%);
}
.email-queue-action-menu .button {
  width: 100%;
  justify-content: flex-start;
  border-color: transparent;
  color: #324f59;
  background: transparent;
}
.email-queue-action-menu .button:hover:not(:disabled) { border-color: #d5dfdd; background: #eaf0ee; }
.email-queue-action-menu .button:disabled { opacity: 0.45; }

.email-queue-detail-row td {
  padding: 0 10px 12px !important;
  overflow: visible;
  background: #e7eeee;
  white-space: normal;
}

.email-queue-detail-panel {
  padding: 10px 12px 12px;
  border-top: 1px solid #c8d5d5;
  background: #edf2f1;
}

.email-queue-detail-heading {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 8px;
  color: #243b43;
  font-size: 13px;
}
.email-queue-detail-heading span { color: var(--queue-muted); font-size: 11px; }
.email-queue-message-columns,
.email-queue-message {
  display: grid;
  grid-template-columns: minmax(175px, 1.15fr) minmax(145px, 0.9fr) minmax(240px, 1.8fr) 96px 86px minmax(160px, auto);
  align-items: center;
  column-gap: 14px;
  min-width: 0;
}
.email-queue-message-columns {
  min-height: 30px;
  padding: 0 10px;
  border-top: 1px solid #cbd6d5;
  border-bottom: 1px solid #d9e1e0;
  color: #687a7d;
  font-size: 10px;
  font-weight: 700;
}
.email-queue-message-list { display: grid; }
.email-queue-message {
  position: relative;
  row-gap: 5px;
  padding: 7px 10px;
  border-bottom: 1px solid #dbe2e0;
  color: #42575d;
  font-size: 12px;
}
.email-queue-message-identity { display: grid; gap: 2px; min-width: 0; }
.email-queue-message-title,
.email-queue-message-booking,
.email-queue-message-recipient { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-queue-message-title { color: #294752; font-weight: 700; }
.email-queue-message-booking { font-variant-numeric: tabular-nums; }
.email-queue-message-recipient { color: #617579; }
.email-queue-message-meta { color: #687b7e; font-size: 11px; font-variant-numeric: tabular-nums; }
.email-queue-message-detail {
  margin: 0;
  color: #72817d;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.email-queue-message-error { grid-column: 1 / 6; grid-row: 2; }
.email-queue-message-actions { grid-column: 6; grid-row: 1; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.email-queue-message-actions .button { min-height: 36px; padding: 6px 11px; font-size: 11px; }
.email-queue-message-actions .email-queue-action-menu .button { width: 100%; }
.email-queue-message-error {
  margin: 0;
  padding: 5px 8px;
  border: 1px solid #d9b4b5;
  border-radius: 4px;
  color: #803a3e;
  background: #f5e9e7;
  font-size: 11px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.email-queue-empty-state,
.email-queue-scroll .empty-state { margin: 20px 8px; }

@media (max-width: 980px) {
  .email-queue-filter-bar { align-items: flex-start; flex-direction: column; }
  .email-queue-counts { justify-content: flex-start; flex-wrap: wrap; }
  .email-queue-count:first-child { padding-left: 0; }
}

@media (max-width: 760px) {
  .email-queue-scroll { padding-inline: 6px; }
  .email-queue-table { min-width: 960px; }
  .email-queue-message-columns { display: none; }
  .email-queue-message { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .email-queue-message-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; }
  .email-queue-message-title,
  .email-queue-message-recipient,
  .email-queue-message-error { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 820px) {
  body.workspace-active .booking-edocs-inline .edocs-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    overflow: visible;
  }

  body.workspace-active .booking-edocs-inline .edocs-list-card {
    max-height: 320px;
  }

  body.workspace-active .booking-edocs-inline .edocs-preview-card iframe {
    min-height: 62vh;
  }
}

@media (max-width: 560px) {
  body.workspace-active .booking-measurement-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.workspace-active .booking-measurement-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(odd),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
}

/* Booking eDocs: a restrained file rail beside a working preview surface. */
body.workspace-active .booking-edocs-inline {
  display: flex;
  min-height: 0;
  margin-top: 16px;
  padding: 14px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  border-color: #cbd6d3;
  border-radius: 10px;
  background: #f7f9f8;
  box-shadow: 0 1px 3px rgb(21 43 52 / 0.04);
}

body.workspace-active .booking-edocs-inline-header {
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0 2px 11px;
  border-bottom-color: #d9e1de;
}

body.workspace-active .booking-edocs-inline-header > div:first-child {
  min-width: 0;
}

body.workspace-active .edocs-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #668078;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

body.workspace-active .booking-edocs-inline-header h4 {
  color: #1e3733;
  font-size: 15px;
  letter-spacing: -0.01em;
}

body.workspace-active .booking-edocs-inline-header p {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 11px;
}

body.workspace-active .booking-edocs-inline .edocs-layout {
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.68fr);
  align-items: stretch;
  gap: 12px;
  min-height: clamp(450px, 58vh, 700px);
  padding: 0;
  overflow: visible;
}

body.workspace-active .booking-edocs-inline .edocs-list-card,
body.workspace-active .booking-edocs-inline .edocs-preview-card {
  min-height: 0;
  border-color: #d5dfdb;
  border-radius: 8px;
  box-shadow: none;
}

body.workspace-active .booking-edocs-inline .edocs-list-heading {
  min-height: 45px;
  padding: 10px 13px;
  background: #fff;
}

body.workspace-active .booking-edocs-inline .edocs-list-heading strong {
  color: #30443f;
  font-size: 12px;
}

body.workspace-active .booking-edocs-inline .edocs-table-scroll {
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
}

body.workspace-active .booking-edocs-inline .edocs-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

body.workspace-active .booking-edocs-inline .edocs-table th:first-child,
body.workspace-active .booking-edocs-inline .edocs-table td:first-child {
  width: auto;
}

body.workspace-active .booking-edocs-inline .edocs-table th:last-child,
body.workspace-active .booking-edocs-inline .edocs-table td:last-child {
  width: 66px;
  text-align: right;
}

body.workspace-active .booking-edocs-inline .edocs-table th,
body.workspace-active .booking-edocs-inline .edocs-table td {
  padding: 10px 11px;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.workspace-active .booking-edocs-inline .edocs-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf2f0;
}

body.workspace-active .booking-edocs-inline .edoc-file-row {
  cursor: pointer;
}

body.workspace-active .booking-edocs-inline .edoc-file-row:hover td {
  background: #f5f8f6;
}

body.workspace-active .booking-edocs-inline .edoc-file-row.is-selected td {
  background: #eaf1ed;
}

body.workspace-active .booking-edocs-inline .edoc-file-row:focus-visible {
  outline: 2px solid #24766e;
  outline-offset: -2px;
}

body.workspace-active .booking-edocs-inline .edoc-file-cell {
  display: table-cell;
}

body.workspace-active .booking-edocs-inline .edoc-file-name,
body.workspace-active .booking-edocs-inline .edoc-file-details,
body.workspace-active .booking-edocs-inline .edoc-file-description {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

body.workspace-active .booking-edocs-inline .edoc-file-name {
  color: #203c37;
  font-size: 11px;
  line-height: 1.45;
}

body.workspace-active .booking-edocs-inline .edoc-file-details,
body.workspace-active .booking-edocs-inline .edoc-file-description {
  margin-top: 4px;
  color: #71817b;
  font-size: 10px;
  line-height: 1.4;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
  background: #fff;
  text-align: left;
}

body.workspace-active .edocs-preview-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid #e1e7e4;
}

body.workspace-active .booking-edocs-inline .edoc-file-badge {
  display: grid;
  width: 38px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  margin: 0;
  border: 1px solid #c9d7d1;
  border-radius: 4px 4px 4px 1px;
  color: #365b50;
  background: #edf3ef;
  box-shadow: none;
  font-size: 9px;
  font-weight: 800;
}

body.workspace-active .edocs-preview-file {
  display: grid;
  min-width: 0;
  gap: 4px;
}

body.workspace-active .booking-edocs-inline .edocs-preview-file > strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #233a35;
  font-size: 12px;
  line-height: 1.4;
}

body.workspace-active .booking-edocs-inline .edocs-preview-file > span {
  color: #71817b;
  font-size: 10px;
  line-height: 1.4;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card iframe {
  width: calc(100% - 24px);
  min-height: 0;
  flex: 1 1 auto;
  margin: 0 12px;
  border-color: #e0e7e3;
  border-radius: 5px;
  background: #f8faf9;
}

body.workspace-active .booking-edocs-inline .edocs-preview-card iframe[hidden] {
  display: none;
}

body.workspace-active .edocs-preview-content {
  min-height: 0;
  margin: 0 12px;
  padding: 14px 16px;
  flex: 1 1 auto;
  overflow: auto;
  border: 1px solid #e0e7e3;
  border-radius: 5px;
  background: #fbfcfb;
}

body.workspace-active .edocs-preview-content[hidden] {
  display: none;
}

body.workspace-active .edocs-image-preview {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  object-fit: contain;
}

body.workspace-active .edocs-preview-content.is-file-notice {
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 24px clamp(18px, 5vw, 64px);
  background: #f7f9f8;
}

body.workspace-active .edoc-notice-type {
  color: #29483f;
  font-size: 15px;
}

body.workspace-active .edocs-preview-content.is-file-notice p {
  max-width: 50ch;
  margin: 8px 0 0;
  color: #66766f;
  font-size: 12px;
  line-height: 1.65;
}

body.workspace-active .edoc-email-details {
  display: grid;
  gap: 7px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e1e7e4;
}

body.workspace-active .edoc-email-detail {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.45;
}

body.workspace-active .edoc-email-label {
  color: #71817b;
  font-weight: 700;
}

body.workspace-active .edoc-email-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #31443e;
}

body.workspace-active .edoc-email-body {
  margin: 14px 0 0;
  color: #263b35;
  font: 12px/1.65 var(--font-mono, ui-monospace, monospace);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.workspace-active .edoc-email-attachments {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e1e7e4;
  color: #40564f;
  font-size: 11px;
}

body.workspace-active .edoc-email-attachments ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 18px;
  overflow-wrap: anywhere;
}

body.workspace-active .booking-edocs-inline .edocs-preview-hint {
  margin: 0 14px 12px;
  color: #788780;
  font-size: 10px;
  line-height: 1.5;
}

body.workspace-active .booking-edocs-inline:has(#bookingEdocsEmpty:not([hidden])) .edocs-layout {
  min-height: 190px;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.68fr);
}

@media (max-width: 820px) {
  body.workspace-active .booking-edocs-inline .edocs-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  body.workspace-active .booking-edocs-inline .edocs-list-card {
    max-height: 300px;
  }

  body.workspace-active .booking-edocs-inline .edocs-preview-card {
    min-height: 56vh;
  }

  body.workspace-active .booking-edocs-inline .edocs-preview-card iframe {
    min-height: 45vh;
  }
}

@media (max-width: 560px) {
  body.workspace-active .booking-edocs-inline {
    margin-top: 12px;
    padding: 10px;
  }

  body.workspace-active .booking-edocs-inline-header {
    align-items: flex-start;
  }

  body.workspace-active .booking-edocs-inline-header .editor-heading-actions {
    flex: 0 0 auto;
  }

  body.workspace-active .booking-edocs-inline .edocs-layout {
    gap: 9px;
  }

  body.workspace-active .edocs-preview-heading {
    padding: 11px;
  }
}

/* DirectCP booking detail: Warehouse-led measurement summary and readable files. */
body.workspace-active .module-panel > .query-toolbar .route-shortcut-section-heading {
  top: 5px;
  right: 5px;
  left: auto;
  z-index: 1;
  width: auto;
  transform: none;
  pointer-events: none;
}

body.workspace-active .module-panel > .query-toolbar .route-section-delete-button {
  pointer-events: auto;
}

body.workspace-active .module-panel > .query-toolbar .route-shortcut-item,
body.workspace-active .module-panel > .query-toolbar .route-pair-chip {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

body.workspace-active .booking-measurements {
  margin-top: 0;
  padding: 0 12px 10px;
}

body.workspace-active .booking-measurement-receipts { gap: 8px; }

body.workspace-active .booking-measurement-receipt {
  gap: 0;
  overflow: hidden;
  border: 1px solid #d8e1dc;
  border-radius: 7px;
  background: #fff;
}

body.workspace-active .booking-measurement-identity {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(150px, 0.85fr);
  border-bottom: 1px solid #e0e7e3;
  background: #f7f9f7;
}

body.workspace-active .booking-measurement-identity .booking-measurement-cell {
  min-height: 58px;
  justify-content: center;
  padding: 8px 13px;
}

body.workspace-active .booking-measurement-identity .booking-measurement-cell + .booking-measurement-cell {
  border-left: 1px solid #e0e7e3;
}

body.workspace-active .booking-measurement-identity .is-warehouse-number .booking-measurement-value {
  color: #173a55;
  font-size: 18px;
  letter-spacing: -0.025em;
}

body.workspace-active .booking-measurement-summary,
body.workspace-active .booking-measurement-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 2px 6px;
}

body.workspace-active .booking-measurement-summary { border-bottom: 1px solid #e4e9e6; }

body.workspace-active .booking-measurement-cell {
  min-width: 0;
  min-height: 43px;
  justify-content: center;
  padding: 6px 10px;
  border-left: 1px solid #e7ece9;
}

body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(6n + 1),
body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(6n + 1) {
  border-left: 0;
  padding-left: 8px;
}

body.workspace-active .booking-measurement-label { font-size: 9px; }
body.workspace-active .booking-measurement-value { font-size: 11px; }
body.workspace-active .booking-measurement-cell.is-measurement-highlight .booking-measurement-value { font-size: 14px; }

body.workspace-active .booking-edocs-inline {
  margin-block-start: 18px;
  padding: 12px;
  border-color: #d3ded9;
  border-radius: 8px;
  background: #f8faf9;
}

body.workspace-active .booking-edocs-inline .edocs-layout {
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 2.18fr);
  gap: 10px;
  min-height: clamp(360px, 48vh, 560px);
  padding-top: 10px;
}

body.workspace-active .booking-edocs-inline:has(#bookingEdocsEmpty:not([hidden])) .edocs-layout {
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 2.18fr);
  min-height: 190px;
}

body.workspace-active .booking-edocs-inline .edocs-list-card,
body.workspace-active .booking-edocs-inline .edocs-preview-card {
  border-color: #dbe3df;
  border-radius: 7px;
  background: #fff;
}

body.workspace-active .booking-edocs-inline .edocs-list-card { min-height: 0; }
body.workspace-active .booking-edocs-inline .edocs-list-heading { padding: 8px 11px; }
body.workspace-active .booking-edocs-inline .edocs-table-scroll { min-height: 0; overflow-x: hidden; }
body.workspace-active .booking-edocs-inline .edocs-table { width: 100%; min-width: 0; table-layout: fixed; }
body.workspace-active .booking-edocs-inline .edocs-table th,
body.workspace-active .booking-edocs-inline .edocs-table td { padding: 0; }
body.workspace-active .booking-edocs-inline .edocs-table th { height: 0; padding: 0; border: 0; font-size: 0; }
body.workspace-active .booking-edocs-inline .edocs-table td { white-space: normal; overflow-wrap: anywhere; }
body.workspace-active .booking-edocs-inline .edocs-table td:first-child,
body.workspace-active .booking-edocs-inline .edocs-table th:first-child { width: 100%; }
body.workspace-active .booking-edocs-inline .edocs-table td:last-child,
body.workspace-active .booking-edocs-inline .edocs-table th:last-child { width: auto; text-align: left; }
body.workspace-active .booking-edocs-inline .edoc-file-cell { display: grid; gap: 4px; padding: 9px 11px !important; }
body.workspace-active .booking-edocs-inline .edoc-file-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
body.workspace-active .booking-edocs-inline .edoc-file-details { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
body.workspace-active .booking-edocs-inline .edocs-preview-card { align-items: stretch; padding: 14px; text-align: left; }
body.workspace-active .booking-edocs-inline .edocs-preview-heading { padding: 0 0 10px; text-align: left; }
body.workspace-active .booking-edocs-inline .edocs-preview-content { min-width: 0; text-align: left; }
body.workspace-active .edoc-email-details { padding: 10px 12px; background: #f7f9f8; }
body.workspace-active .edoc-email-detail { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 2px 0; }
body.workspace-active .edoc-email-value { text-align: left; }
body.workspace-active .edoc-email-body {
  margin: 0;
  padding: 14px 12px;
  color: #263b35;
  font: 13px/1.55 var(--font-ui, Arial, sans-serif);
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Email Queue: a compact batch ledger that keeps the existing Preview and More controls. */
.email-queue-panel .module-heading-copy p { max-width: 72ch; }
.email-queue-results-card { background: #f7f9f8; box-shadow: 0 1px 5px rgb(29 47 55 / 5%); }
.email-queue-results-card .table-toolbar { min-height: 50px; padding-block: 8px; }
.email-queue-filter-bar { padding-block: 7px; }
.email-queue-scroll { min-height: 180px; padding: 0 8px 8px; }
.email-queue-table { width: 100%; min-width: 900px; }
.email-queue-table th:nth-child(1) { width: 11%; }
.email-queue-table th:nth-child(2) { width: 18%; }
.email-queue-table th:nth-child(3) { width: 25%; }
.email-queue-table th:nth-child(4) { width: 10%; }
.email-queue-table th:nth-child(5) { width: 8%; }
.email-queue-table th:nth-child(6) { width: 13%; }
.email-queue-table th:nth-child(7) { width: 15%; }
.email-queue-table td { padding-block: 6px; }
.email-queue-table tbody tr.email-queue-batch-row,
.email-queue-table tbody tr.email-queue-batch-row:nth-child(4n + 1) { background: #fff; }
.email-queue-table tbody tr.email-queue-batch-row:nth-child(4n + 3) { background: #f7f9f8; }
.email-queue-expand {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  margin-right: 9px;
  padding: 0;
  border: 1px solid #cbd8de;
  border-radius: 6px;
  color: #244e63;
  background: #edf3f5;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  pointer-events: auto;
  vertical-align: middle;
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.email-queue-expand:hover {
  border-color: #8ba9b6;
  color: #173d53;
  background: #e2edf1;
}
.email-queue-expand[aria-expanded="true"] {
  border-color: #a9c0ca;
  color: #173d53;
  background: #e4eef1;
}
.email-queue-expand:active { background: #d6e5ea; }
.email-queue-expand:focus-visible { outline: 2px solid #39758d; outline-offset: 2px; }
.email-queue-actions .button { min-height: 30px; padding: 4px 9px; }
.email-queue-detail-row td { padding: 0 8px 8px !important; background: #f1f5f6; }
.email-queue-detail-panel {
  padding: 8px 10px 4px;
  border: 1px solid #d8e1e4;
  border-radius: 6px;
  background: #fff;
}
.email-queue-detail-heading { margin-bottom: 4px; font-size: 12px; }
.email-queue-message-columns,
.email-queue-message {
  grid-template-columns: minmax(130px, 1.05fr) minmax(120px, 0.9fr) minmax(170px, 1.5fr) 74px 65px minmax(128px, auto);
  column-gap: 10px;
}
.email-queue-message-columns {
  min-height: 25px;
  padding-inline: 7px;
  border-top: 0;
  color: #65777d;
  background: #f1f5f6;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.email-queue-message-list { border-top: 1px solid #e0e6e3; }
.email-queue-message { row-gap: 2px; min-height: 38px; padding: 4px 7px; font-size: 11px; }
.email-queue-message:nth-child(even) { background: #fbfcfc; }
.email-queue-message-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: #244d60;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}
.email-queue-message-actions { min-width: 0; grid-column: 6; grid-row: 1; gap: 5px; }
.email-queue-message-actions .button { min-height: 27px; padding: 3px 8px; font-size: 10px; }

@media (max-width: 1180px) {
  body.workspace-active .booking-measurement-summary,
  body.workspace-active .booking-measurement-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(6n + 1),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(6n + 1) { border-left: 1px solid #e7ece9; padding-left: 10px; }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(3n + 1),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(3n + 1) { border-left: 0; padding-left: 8px; }
}

@media (max-width: 820px) {
  body.workspace-active .booking-edocs-inline .edocs-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  body.workspace-active .booking-edocs-inline .edocs-list-card { max-height: 280px; }
  body.workspace-active .booking-edocs-inline .edocs-preview-card { min-height: 52vh; }
}

@media (max-width: 760px) {
  .email-queue-table { min-width: 900px; }
  .email-queue-expand { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
  .email-queue-message-columns { display: none; }
  .email-queue-message { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .email-queue-message-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; }
  .email-queue-message-title,
  .email-queue-message-recipient,
  .email-queue-message-error { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 560px) {
  body.workspace-active .booking-measurement-identity { grid-template-columns: minmax(0, 1fr); }
  body.workspace-active .booking-measurement-identity .booking-measurement-cell + .booking-measurement-cell { border-left: 0; border-top: 1px solid #e0e7e3; }
  body.workspace-active .booking-measurement-summary,
  body.workspace-active .booking-measurement-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(3n + 1),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(3n + 1) { border-left: 1px solid #e7ece9; padding-left: 10px; }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(odd),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(odd) { border-left: 0; padding-left: 8px; }
}

/* Email Queue uses one fixed-width ledger at every expansion state. */
.email-queue-scroll { overflow-x: hidden; }
.email-queue-table { width: 100%; min-width: 0; max-width: 100%; table-layout: fixed; }
.email-queue-table th:nth-child(1) { width: 16%; }
.email-queue-table th:nth-child(2) { width: 39%; }
.email-queue-table th:nth-child(3) { width: 11%; }
.email-queue-table th:nth-child(4) { width: 12%; }
.email-queue-table th:nth-child(5) { width: 14%; }
.email-queue-table th:nth-child(6) { width: 8%; }
.email-queue-table th,
.email-queue-table td { min-width: 0; overflow-wrap: anywhere; }
.email-queue-table td { white-space: normal; }
.email-queue-message-table,
.email-queue-message-list,
.email-queue-detail-panel { width: 100%; min-width: 0; max-width: 100%; }
.email-queue-message-columns,
.email-queue-message {
  grid-template-columns: minmax(150px, 1.15fr) minmax(100px, 0.8fr) minmax(0, 1.35fr) 66px 60px 98px;
  column-gap: 8px;
  width: 100%;
  min-width: 0;
}
.email-queue-message-recipient {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.email-queue-message-actions .email-queue-more { margin-left: auto; }
.email-queue-created.is-sent { color: #28724f !important; }

@media (max-width: 760px) {
  .email-queue-table,
  .email-queue-table tbody { display: block; width: 100%; }
  .email-queue-table thead { display: none; }
  .email-queue-table tbody tr.email-queue-batch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    padding: 9px 10px;
    border-bottom: 1px solid #d9e1e0;
  }
  .email-queue-table tbody tr.email-queue-batch-row > td {
    display: block;
    min-width: 0;
    padding: 0 !important;
    border: 0;
    overflow-wrap: anywhere;
  }
  .email-queue-table .email-queue-batch-cell { grid-column: 1; }
  .email-queue-table .email-queue-bookings { grid-column: 1 / -1; }
  .email-queue-table .email-queue-status,
  .email-queue-table .email-queue-email-count,
  .email-queue-table .email-queue-created { grid-column: 1; }
  .email-queue-table .email-queue-actions { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .email-queue-table tbody tr.email-queue-detail-row { display: block; }
  .email-queue-detail-row > td { display: block; padding: 0 6px 8px !important; }
  .email-queue-message-columns { display: none; }
  .email-queue-message { grid-template-columns: minmax(0, 1fr) auto; }
  .email-queue-message-actions { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .email-queue-message-booking { grid-column: 1; grid-row: 2; }
  .email-queue-message-recipient { grid-column: 1 / -1; grid-row: 3; }
  .email-queue-message-meta { grid-column: 2; grid-row: 2; text-align: right; }
  .email-queue-message-error { grid-column: 1 / -1; grid-row: 4; }
}

/* Warehouse Measure: keep the warehouse identity in the section heading and the
   measurements in three calm, evenly aligned bands. */
body.workspace-active .booking-measurements {
  margin-top: 16px;
  padding: 0 12px 12px;
  border: 1px solid #d2ddd7;
  border-radius: 9px;
  background: #f7f9f7;
  box-shadow: 0 1px 3px rgb(28 54 48 / 4%);
}
body.workspace-active .booking-measurements > .booking-measurement-toolbar {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -12px 10px;
  padding: 8px 16px;
  border-bottom: 1px solid #d9e2dd;
  background: transparent;
}
body.workspace-active .booking-measurement-toolbar .table-toolbar-title { flex: 1 1 auto; gap: 10px; }
body.workspace-active .booking-measurement-toolbar .table-toolbar-title strong { color: #18394b; font-size: 18px; }
body.workspace-active .booking-measurement-toolbar .table-meta { font-size: 12px; }
body.workspace-active .booking-measurement-header-identity {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(130px, 0.9fr);
  flex: 0 1 450px;
  min-width: 0;
}
body.workspace-active .booking-measurement-header-identity[hidden] { display: none; }
body.workspace-active .booking-measurement-header-identity > div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 18px;
  border-left: 1px solid #d4ded9;
}
body.workspace-active .booking-measurement-header-identity span { color: #6d7e7b; font-size: 12px; }
body.workspace-active .booking-measurement-header-identity strong {
  overflow: hidden;
  color: #153951;
  font-size: 21px;
  font-weight: 760;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.workspace-active .booking-measurement-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid #e0e7e3;
  background: #f5f8f6;
}
body.workspace-active .booking-measurement-identity .booking-measurement-cell { min-height: 50px; padding: 8px 12px; }
body.workspace-active .booking-measurement-identity .is-warehouse-number .booking-measurement-value { font-size: 18px; }
body.workspace-active .booking-measurement-summary,
body.workspace-active .booking-measurement-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  padding: 0 4px;
}
body.workspace-active .booking-measurement-summary { border-bottom: 1px solid #dfe6e2; }
body.workspace-active .booking-measurement-cell {
  min-width: 0;
  min-height: 64px;
  align-content: center;
  padding: 9px 13px;
  border-left: 1px solid #e2e9e5;
}
body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(6n + 1),
body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(6n + 1) { border-left: 0; padding-left: 10px; }
body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(n + 7) { border-top: 1px solid #e5ebe7; }
body.workspace-active .booking-measurement-label { color: #6d7e7b; font-size: 11px; }
body.workspace-active .booking-measurement-value { overflow-wrap: anywhere; color: #344b48; font-size: 13px; font-weight: 600; }
body.workspace-active .booking-measurement-cell.is-measurement-highlight .booking-measurement-value { color: #173a4e; font-size: 20px; font-weight: 750; }
body.workspace-active .booking-measurement-receipts { gap: 10px; }
body.workspace-active .booking-measurement-receipt { gap: 0; padding: 0; border-color: #dce5e0; border-radius: 7px; background: #fbfcfb; }

/* Outlook previews use a bounded, scrollable HTML reading surface. */
body.workspace-active .edoc-email-html-frame {
  display: block;
  width: 100%;
  height: min(620px, 62vh);
  min-height: 360px;
  margin-top: 14px;
  border: 1px solid #d7e1dd;
  border-radius: 7px;
  background: #fbfcfb;
  color-scheme: light;
}
body.workspace-active .edoc-email-attachments {
  margin-top: 14px;
  padding: 14px 0 2px;
  border-top: 1px solid #dfe7e3;
  color: #40564f;
  font-size: 12px;
}
body.workspace-active .edoc-email-attachments-title { display: block; margin-bottom: 11px; font-size: 13px; }
body.workspace-active .edoc-email-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(164px, 100%), 184px));
  gap: 12px;
}
body.workspace-active .edoc-email-attachment {
  display: grid;
  min-width: 0;
  min-height: 176px;
  align-content: start;
  justify-items: center;
  gap: 11px;
  padding: 14px 12px 12px;
  border: 1px solid #d5e0dc;
  border-radius: 8px;
  color: #28443f;
  background: linear-gradient(180deg, #fff 0%, #f7faf8 100%);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
body.workspace-active .edoc-email-attachment:hover { border-color: #7d9e98; background: #edf4f1; transform: translateY(-2px); box-shadow: 0 5px 14px rgb(26 59 51 / 10%); }
body.workspace-active .edoc-email-attachment:focus-visible { outline: 2px solid #39758d; outline-offset: 2px; }
body.workspace-active .edoc-email-attachment-icon {
  position: relative;
  display: grid;
  width: 72px;
  height: 84px;
  place-items: end center;
  padding: 0 4px 10px;
  border: 1px solid #bdd0c8;
  border-radius: 7px;
  color: #286357;
  background: linear-gradient(145deg, #e7f0eb, #dceae4);
  box-shadow: 0 3px 8px rgb(23 56 48 / 10%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.025em;
  overflow-wrap: anywhere;
}
body.workspace-active .edoc-email-attachment-icon::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 28px;
  height: 34px;
  transform: translateX(-50%);
  border: 2px solid currentColor;
  border-radius: 3px;
  background: linear-gradient(135deg, transparent 0 68%, #dceae4 69%);
}
body.workspace-active .edoc-email-attachment-copy { display: grid; gap: 5px; min-width: 0; width: 100%; }
body.workspace-active .edoc-email-attachment-copy strong { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; color: #29433f; font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
body.workspace-active .edoc-email-attachment-copy small { color: #70817c; font-size: 10px; }

@media (max-width: 900px) {
  body.workspace-active .booking-measurement-summary,
  body.workspace-active .booking-measurement-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(3n + 1),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(3n + 1) { border-left: 0; padding-left: 10px; }
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(n + 7) { border-top: 0; }
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(n + 4) { border-top: 1px solid #e5ebe7; }
  body.workspace-active .edoc-email-html-frame { height: min(560px, 58vh); min-height: 320px; }
}

@media (max-width: 600px) {
  body.workspace-active .booking-measurements > .booking-measurement-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  body.workspace-active .booking-measurement-header-identity { width: 100%; flex-basis: auto; }
  body.workspace-active .booking-measurement-header-identity > div { padding: 5px 9px; }
  body.workspace-active .booking-measurement-header-identity strong { font-size: 16px; }
  body.workspace-active .booking-measurement-summary,
  body.workspace-active .booking-measurement-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(3n + 1),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(3n + 1) { border-left: 1px solid #e2e9e5; }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(odd),
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(odd) { border-left: 0; padding-left: 10px; }
  body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(n + 3) { border-top: 1px solid #e5ebe7; }
  body.workspace-active .booking-measurement-cell.is-measurement-highlight .booking-measurement-value { font-size: 17px; }
  body.workspace-active .edoc-email-html-frame { height: 55vh; min-height: 280px; }
}

body.workspace-active .schedule-por-panel { margin: 10px 0 14px; }
body.workspace-active .schedule-por-heading { padding: 9px 12px; }
body.workspace-active .schedule-por-heading h4 { font-size: 13px; }
body.workspace-active .schedule-por-heading p { margin-top: 2px; }
body.workspace-active .schedule-por-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-width: 0;
}
body.workspace-active .schedule-por-entry {
  display: grid;
  min-width: 0;
  gap: 5px;
  align-content: center;
  padding: 8px 11px;
  border-right: 1px solid #e7edea;
  border-bottom: 1px solid #e7edea;
}
body.workspace-active .schedule-por-entry-identity {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
body.workspace-active .schedule-por-location {
  overflow: hidden;
  color: #18384a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.workspace-active .schedule-por-code { width: auto; font-size: 10px; }
body.workspace-active .schedule-por-cutoff { width: auto; color: #184d48; font-size: 11px; font-weight: 650; }
body.workspace-active .schedule-por-entry:nth-child(5n) { border-right: 0; }
body.workspace-active .schedule-por-entry:nth-last-child(-n + 5) { border-bottom: 0; }

/* Keep long eDoc names on a readable line above the email metadata. */
body.workspace-active .booking-edocs-inline .edocs-preview-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  width: 100%;
  align-self: stretch;
}
body.workspace-active .booking-edocs-inline .edocs-preview-file,
body.workspace-active .booking-edocs-inline .edocs-preview-file > strong {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
body.workspace-active .booking-edocs-inline .edoc-email-html-frame {
  flex: 0 0 auto;
  min-width: 0;
}

@media (max-width: 1100px) {
  body.workspace-active .schedule-por-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.workspace-active .schedule-por-entry:nth-child(5n) { border-right: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-child(4n) { border-right: 0; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 5) { border-bottom: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 4) { border-bottom: 0; }
}
@media (max-width: 760px) {
  body.workspace-active .schedule-por-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active .schedule-por-entry:nth-child(4n) { border-right: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-child(2n) { border-right: 0; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 4) { border-bottom: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 2) { border-bottom: 0; }
}
@media (max-width: 600px) {
  body.workspace-active .booking-measurement-identity { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body.workspace-active .booking-measurement-identity .booking-measurement-cell + .booking-measurement-cell { border-top: 0; border-left: 1px solid #edf1ee; }
  body.workspace-active .schedule-por-entry { padding: 7px 8px; }
}

body.workspace-active .schedule-por-panel {
  margin: 14px 0 18px;
  overflow: hidden;
  border: 1px solid #d8e3df;
  border-radius: 8px;
  background: #f9fbfa;
}
body.workspace-active .schedule-por-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 15px;
  border-bottom: 1px solid #e1e9e5;
}
body.workspace-active .schedule-por-heading h4 { margin: 0; color: #18384a; font-size: 14px; }
body.workspace-active .schedule-por-heading p { margin: 4px 0 0; color: #647981; font-size: 11px; }
body.workspace-active .schedule-por-status { flex: 0 0 auto; color: #60767e; font-size: 11px; }
body.workspace-active .schedule-por-table-wrap { max-width: 100%; overflow-x: auto; }
body.workspace-active .schedule-por-table { width: 100%; border-collapse: collapse; font-size: 12px; }
body.workspace-active .schedule-por-table th,
body.workspace-active .schedule-por-table td { padding: 9px 15px; border-bottom: 1px solid #e7edea; text-align: left; }
body.workspace-active .schedule-por-table th { color: #617780; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
body.workspace-active .schedule-por-table tr:last-child td { border-bottom: 0; }
body.workspace-active .schedule-por-location { color: #18384a; font-weight: 650; }
body.workspace-active .schedule-por-code { width: 150px; color: #60767e; font-variant-numeric: tabular-nums; }
body.workspace-active .schedule-por-cutoff { width: 220px; color: #184d48; font-variant-numeric: tabular-nums; font-weight: 650; }
@media (max-width: 600px) {
  body.workspace-active .schedule-por-heading { align-items: flex-start; flex-direction: column; gap: 6px; padding: 10px 12px; }
  body.workspace-active .schedule-por-table th,
  body.workspace-active .schedule-por-table td { padding: 8px 10px; }
  body.workspace-active .schedule-por-code { width: auto; }
  body.workspace-active .schedule-por-cutoff { width: auto; white-space: nowrap; }
}

body.workspace-active .booking-edocs-inline .edocs-list-card { min-width: 0; }
body.workspace-active .booking-edocs-inline .edocs-table-scroll {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.workspace-active .booking-edocs-inline .edocs-file-list {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 8px;
}
body.workspace-active .booking-edocs-inline .edoc-file-card {
  display: grid;
  min-width: 0;
  min-height: 88px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #dce5e1;
  border-radius: 8px;
  background: #fff;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
body.workspace-active .booking-edocs-inline .edoc-file-card:hover,
body.workspace-active .booking-edocs-inline .edoc-file-card:focus-within {
  border-color: #8bb1a8;
  background: #f8fbf9;
}
body.workspace-active .booking-edocs-inline .edoc-file-card.is-selected {
  border-color: #5e9487;
  background: #eef5f1;
  box-shadow: inset 3px 0 #2d796d;
}
body.workspace-active .booking-edocs-inline .edoc-file-select {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 2px 0;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
body.workspace-active .booking-edocs-inline .edoc-file-select:focus-visible {
  outline: 2px solid #24766e;
  outline-offset: 3px;
  border-radius: 3px;
}
body.workspace-active .booking-edocs-inline .edoc-file-name,
body.workspace-active .booking-edocs-inline .edoc-file-details,
body.workspace-active .booking-edocs-inline .edoc-file-description {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
body.workspace-active .booking-edocs-inline .edoc-file-name {
  color: #203c37;
  font-size: 12px;
  line-height: 1.4;
}
body.workspace-active .booking-edocs-inline .edoc-file-details,
body.workspace-active .booking-edocs-inline .edoc-file-description {
  color: #71817b;
  font-size: 10px;
  line-height: 1.4;
}
body.workspace-active .booking-edocs-inline .edoc-row-download {
  min-height: 30px;
  padding: 5px 8px;
  color: #204c45;
  border: 1px solid #c7d8d1;
  border-radius: 5px;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background-color 120ms ease;
  cursor: pointer;
}
body.workspace-active .booking-edocs-inline .edoc-file-card:hover .edoc-row-download,
body.workspace-active .booking-edocs-inline .edoc-file-card:focus-within .edoc-row-download {
  opacity: 1;
  pointer-events: auto;
}
body.workspace-active .booking-edocs-inline .edoc-row-download:hover { background: #edf4f1; }
body.workspace-active .booking-edocs-inline .edoc-row-download:focus-visible { outline: 2px solid #24766e; outline-offset: 2px; }

body.workspace-active .edoc-email-attachment-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 6px;
}
body.workspace-active .edoc-email-attachment {
  min-height: 56px;
  grid-template-columns: 30px minmax(0, 1fr);
  align-content: center;
  gap: 8px;
  padding: 6px 8px;
  text-align: left;
}
body.workspace-active .edoc-email-attachment-icon {
  width: 28px;
  height: 34px;
  padding-bottom: 3px;
  font-size: 8px;
}
body.workspace-active .edoc-email-attachment-icon::before { top: 4px; width: 13px; height: 16px; }
body.workspace-active .edoc-email-attachment-copy { gap: 2px; }
body.workspace-active .edoc-email-attachment-copy strong { -webkit-line-clamp: 2; font-size: 11px; }
body.workspace-active .edoc-email-attachment-copy small { font-size: 9px; }

.edoc-attachment-dialog {
  display: flex;
  width: min(1100px, calc(100vw - 32px));
  height: min(82vh, 900px);
  max-height: 82vh;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.edoc-attachment-dialog:not([open]) { display: none; }
.edoc-attachment-dialog::backdrop { background: rgb(10 25 36 / 62%); backdrop-filter: blur(2px); }
.edoc-attachment-dialog[open] { animation: edoc-dialog-enter 180ms ease-out both; }
.edoc-attachment-dialog .modal-header { flex: 0 0 auto; padding: 14px 18px; }
.edoc-attachment-dialog .modal-header h2 { max-width: min(72vw, 760px); overflow-wrap: anywhere; }
.edoc-attachment-loading {
  display: grid;
  flex: 1 1 auto;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #34514a;
  background: #f5f8f6;
}
.edoc-attachment-loading[hidden], .edoc-attachment-content[hidden] { display: none; }
.edoc-attachment-loading > span:last-child { color: #71817b; font-size: 12px; }
.edoc-attachment-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid #dce8e3;
  border-top-color: #23786d;
  border-radius: 50%;
  animation: edoc-attachment-spin 720ms linear infinite;
}
.edoc-attachment-content { display: flex; min-width: 0; min-height: 0; flex: 1 1 auto; background: #eef2f0; }
.edoc-attachment-frame { width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; }
.edoc-attachment-unavailable { display: grid; flex: 1 1 auto; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.edoc-attachment-unavailable > span { color: #71817b; font-size: 12px; }
@keyframes edoc-attachment-spin { to { transform: rotate(360deg); } }
@keyframes edoc-dialog-enter { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 600px) {
  body.workspace-active .booking-edocs-inline .edoc-file-card { min-height: 82px; gap: 6px; padding: 9px; }
  body.workspace-active .booking-edocs-inline .edoc-row-download { padding-inline: 6px; font-size: 9px; }
  .edoc-attachment-dialog { width: calc(100vw - 16px); height: 88vh; max-height: 88vh; }
}

body.workspace-active #bookingsPanel.is-detail-mode .booking-route-heading-row {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-route-heading-row > .editor-section-heading {
  flex: 0 0 auto;
  margin: 0;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-route-heading-row .booking-route-action-rail {
  display: flex;
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
  grid-column: auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-route-action-state {
  max-width: 280px;
  font-size: 10px;
  text-align: right;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-route-action-rail .button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 10px;
}
@media (max-width: 760px) {
  body.workspace-active #bookingsPanel.is-detail-mode .booking-route-heading-row { flex-wrap: wrap; }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-route-heading-row .booking-route-action-rail { flex: 1 1 100%; }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-route-action-state { margin-right: auto; text-align: left; }
}

/* Keep batch operations visible in the ledger and reserve a real action rail. */
.email-queue-table th:nth-child(1) { width: 13%; }
.email-queue-table th:nth-child(2) { width: 31%; }
.email-queue-table th:nth-child(3) { width: 9%; }
.email-queue-table th:nth-child(4) { width: 9%; }
.email-queue-table th:nth-child(5) { width: 16%; }
.email-queue-table th:nth-child(6) { width: 22%; }
.email-queue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.email-queue-actions .button { min-height: 27px; padding: 3px 7px; font-size: 10px; }
.email-queue-message-columns,
.email-queue-message {
  grid-template-columns: minmax(0, 18%) minmax(0, 14%) minmax(0, 1fr) minmax(62px, 8%) minmax(62px, 8%) minmax(74px, 10%);
}
.email-queue-message-actions { min-width: 0; }
.email-queue-message-actions .email-queue-task-more { margin-left: 0; }

@media (max-width: 1100px) {
  .email-queue-table th:nth-child(1) { width: 14%; }
  .email-queue-table th:nth-child(2) { width: 28%; }
  .email-queue-table th:nth-child(3) { width: 9%; }
  .email-queue-table th:nth-child(4) { width: 9%; }
  .email-queue-table th:nth-child(5) { width: 16%; }
  .email-queue-table th:nth-child(6) { width: 24%; }
}
@media (max-width: 760px) {
  .email-queue-table th:nth-child(1),
  .email-queue-table th:nth-child(2),
  .email-queue-table th:nth-child(3),
  .email-queue-table th:nth-child(4),
  .email-queue-table th:nth-child(5),
  .email-queue-table th:nth-child(6) { width: auto; }
  .email-queue-actions { justify-content: flex-end; max-width: 220px; }
  .email-queue-message-columns,
  .email-queue-message { grid-template-columns: minmax(0, 1fr) auto; }
}

/* Receipt collection: one quiet parent surface, with the warehouse number as
   the anchor of each receipt card. */
body.workspace-active .booking-measurements {
  margin-block-start: 16px;
  padding: 0 14px 14px;
  border: 1px solid #cfdbd6;
  border-radius: 9px;
  background: #f8faf9;
}
body.workspace-active .booking-measurements > .booking-measurement-toolbar {
  min-height: 48px;
  margin: 0 -14px 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #dbe4e0;
}
body.workspace-active .booking-measurement-toolbar .table-toolbar-title strong { font-size: 16px; }
body.workspace-active .booking-measurement-receipts { display: grid; gap: 12px; }
body.workspace-active .booking-measurement-receipt {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #d5e0db;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(20 47 40 / 4%);
}
body.workspace-active .booking-measurement-identity {
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 1fr);
  border-bottom: 1px solid #e0e8e4;
  background: #f4f8f6;
}
body.workspace-active .booking-measurement-identity .booking-measurement-cell {
  min-height: 58px;
  padding: 9px 14px;
}
body.workspace-active .booking-measurement-identity .is-warehouse-number .booking-measurement-value {
  color: #173a4e;
  font-size: 20px;
  letter-spacing: .01em;
}
body.workspace-active .booking-measurement-summary,
body.workspace-active .booking-measurement-facts { padding: 0 8px; }
body.workspace-active .booking-measurement-summary { border-bottom: 1px solid #e4ebe7; }
body.workspace-active .booking-measurement-cell { min-height: 56px; padding: 8px 11px; }
body.workspace-active .booking-measurement-summary .booking-measurement-cell:nth-child(6n + 1),
body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(6n + 1) { padding-left: 8px; }
body.workspace-active .booking-measurement-facts .booking-measurement-cell:nth-child(n + 7) { border-top: 0; }

/* Email reader: stable file rail and a full-width message surface. Keep the
   original email markup in its own bounded scrolling document. */
body.workspace-active .booking-edocs-inline {
  margin-block-start: 16px;
  padding: 14px;
  border: 1px solid #d1ddd8;
  border-radius: 9px;
  background: #f8faf9;
}
body.workspace-active .booking-edocs-inline-header {
  margin: 0 0 12px;
  padding: 0 0 11px;
  border-bottom: 1px solid #dce5e1;
}
body.workspace-active .booking-edocs-inline .edocs-layout {
  grid-template-columns: minmax(245px, 0.72fr) minmax(0, 2.28fr);
  align-items: stretch;
  gap: 12px;
  min-height: clamp(420px, 56vh, 660px);
  padding: 0;
}
body.workspace-active .booking-edocs-inline .edocs-list-card,
body.workspace-active .booking-edocs-inline .edocs-preview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e1dc;
  border-radius: 8px;
  background: #fff;
}
body.workspace-active .booking-edocs-inline .edocs-preview-card {
  display: flex;
  flex-direction: column;
}
body.workspace-active .booking-edocs-inline .edocs-preview-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid #e4ebe7;
  background: #fbfcfb;
}
body.workspace-active .booking-edocs-inline .edoc-file-badge { width: 38px; height: 38px; }
body.workspace-active .booking-edocs-inline .edocs-preview-file { min-width: 0; text-align: left; }
body.workspace-active .booking-edocs-inline .edocs-preview-file strong { overflow-wrap: anywhere; }
body.workspace-active .booking-edocs-inline .edocs-preview-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  background: #f4f7f5;
}
body.workspace-active .booking-edocs-inline .edocs-preview-content[hidden] { display: none; }
body.workspace-active .edoc-email-details {
  gap: 6px;
  padding: 10px 13px;
  border: 1px solid #e0e7e3;
  border-radius: 6px;
  background: #fff;
}
body.workspace-active .edoc-email-detail { grid-template-columns: 54px minmax(0, 1fr); font-size: 12px; }
body.workspace-active .edoc-email-value { text-align: left; }
body.workspace-active .edoc-email-attachments {
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid #e0e7e3;
  border-radius: 6px;
  background: #fff;
}
body.workspace-active .edoc-email-attachments-title { margin-bottom: 8px; }
body.workspace-active .edoc-email-attachment-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(138px, 100%), 1fr));
  gap: 8px;
}
body.workspace-active .edoc-email-attachment {
  min-height: 112px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: 10px;
  text-align: left;
}
body.workspace-active .edoc-email-attachment-icon {
  width: 40px;
  height: 48px;
  place-items: end center;
  padding-bottom: 5px;
  font-size: 9px;
}
body.workspace-active .edoc-email-attachment-icon::before { top: 6px; width: 18px; height: 23px; border-width: 1px; }
body.workspace-active .edoc-email-attachment-copy strong { -webkit-line-clamp: 3; }
body.workspace-active .edoc-email-html-frame {
  flex: 1 1 420px;
  width: 100%;
  height: min(620px, 62vh);
  min-height: 360px;
  margin: 0;
  border-color: #d8e1dd;
  background: #fff;
}
body.workspace-active .edocs-preview-hint { margin: 0; padding: 0 12px 10px; }

@media (max-width: 900px) {
  body.workspace-active .booking-edocs-inline .edocs-layout { grid-template-columns: minmax(0, 1fr); }
  body.workspace-active .booking-edocs-inline .edocs-list-card { max-height: 260px; }
  body.workspace-active .booking-edocs-inline .edocs-preview-card { min-height: 420px; }
}
@media (max-width: 600px) {
  body.workspace-active .booking-measurements { padding: 0 9px 9px; }
  body.workspace-active .booking-measurements > .booking-measurement-toolbar { margin-inline: -9px; }
  body.workspace-active .booking-measurement-identity { grid-template-columns: minmax(0, 1fr); }
  body.workspace-active .booking-measurement-identity .booking-measurement-cell + .booking-measurement-cell { border-top: 1px solid #e4ebe7; border-left: 0; }
  body.workspace-active .booking-edocs-inline { padding: 10px; }
  body.workspace-active .booking-edocs-inline .edocs-preview-content { padding: 8px; }
  body.workspace-active .edoc-email-html-frame { height: 55vh; min-height: 280px; }
}

/* Final component overrides: direct task actions, low-profile receipts, and
   compact POR locations remain stable after the responsive base rules above. */
.email-queue-message-columns,
.email-queue-message { grid-template-columns: minmax(125px, 18%) minmax(90px, 14%) minmax(0, 1fr) 64px 68px 190px; column-gap: 7px; }
.email-queue-message-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.email-queue-message-actions .button { min-width: 0; min-height: 27px; justify-content: center; padding: 3px 4px; font-size: 9px; white-space: nowrap; }
body.workspace-active .booking-measurement-receipts { gap: 7px; }
body.workspace-active .booking-measurement-receipt { border-color: #dfe6e2; border-radius: 6px; box-shadow: none; }
body.workspace-active .booking-measurement-identity { grid-template-columns: minmax(0, 1.5fr) minmax(150px, 1fr); background: #f8faf9; }
body.workspace-active .booking-measurement-identity .booking-measurement-cell { min-height: 42px; padding: 6px 11px; }
body.workspace-active .booking-measurement-identity .is-warehouse-number .booking-measurement-value { color: #29483f; font-size: 15px; }
body.workspace-active .booking-measurement-identity .booking-measurement-label,
body.workspace-active .booking-measurement-label { font-size: 9px; }
body.workspace-active .booking-measurement-cell { min-height: 39px; gap: 2px; padding: 5px 9px; border-left-color: #edf1ee; }
body.workspace-active .booking-measurement-value { font-size: 11px; line-height: 1.25; }
body.workspace-active .booking-measurement-cell.is-measurement-highlight .booking-measurement-value { font-size: 15px; }
body.workspace-active .booking-measurement-summary,
body.workspace-active .booking-measurement-facts { padding-inline: 7px; }
body.workspace-active .booking-measurement-summary { border-bottom-color: #edf1ee; }
body.workspace-active .schedule-por-panel { margin: 10px 0 14px; }
body.workspace-active .schedule-por-heading { padding: 9px 12px; }
body.workspace-active .schedule-por-heading h4 { font-size: 13px; }
body.workspace-active .schedule-por-heading p { margin-top: 2px; }
body.workspace-active .schedule-por-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-width: 0; }
body.workspace-active .schedule-por-entry { display: grid; min-width: 0; gap: 5px; align-content: center; padding: 8px 11px; border-right: 1px solid #e7edea; border-bottom: 1px solid #e7edea; }
body.workspace-active .schedule-por-entry-identity { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; }
body.workspace-active .schedule-por-location { overflow: hidden; color: #18384a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body.workspace-active .schedule-por-code { width: auto; font-size: 10px; }
body.workspace-active .schedule-por-cutoff { width: auto; color: #184d48; font-size: 11px; font-weight: 650; }
body.workspace-active .schedule-por-entry:nth-child(5n) { border-right: 0; }
body.workspace-active .schedule-por-entry:nth-last-child(-n + 5) { border-bottom: 0; }
body.workspace-active .booking-edocs-inline .edocs-preview-heading { display: grid; grid-template-columns: 38px minmax(0, 1fr); width: 100%; align-self: stretch; }
body.workspace-active .booking-edocs-inline .edocs-preview-file,
body.workspace-active .booking-edocs-inline .edocs-preview-file > strong { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: normal; }
body.workspace-active .booking-edocs-inline .edoc-email-html-frame { flex: 0 0 auto; min-width: 0; }
@media (max-width: 1100px) {
  .email-queue-message-columns,
  .email-queue-message { grid-template-columns: minmax(0, 18%) minmax(0, 14%) minmax(0, 1fr) 62px 62px 168px; column-gap: 5px; }
  body.workspace-active .schedule-por-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.workspace-active .schedule-por-entry:nth-child(5n) { border-right: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-child(4n) { border-right: 0; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 5) { border-bottom: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 4) { border-bottom: 0; }
}
@media (max-width: 760px) {
  .email-queue-message-actions { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(56px, 1fr)); }
  .email-queue-message-actions .button { font-size: 10px; }
  body.workspace-active .schedule-por-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active .schedule-por-entry:nth-child(4n) { border-right: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-child(2n) { border-right: 0; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 4) { border-bottom: 1px solid #e7edea; }
  body.workspace-active .schedule-por-entry:nth-last-child(-n + 2) { border-bottom: 0; }
}
@media (max-width: 600px) {
  body.workspace-active .booking-measurement-identity { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body.workspace-active .booking-measurement-identity .booking-measurement-cell + .booking-measurement-cell { border-top: 0; border-left: 1px solid #edf1ee; }
  body.workspace-active .schedule-por-entry { padding: 7px 8px; }
}

body.workspace-active .imdg-scan-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d7e2dc;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbfdfb, #f3f8f5);
}
body.workspace-active .imdg-scan-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
body.workspace-active .imdg-scan-header h4 { margin: 4px 0 6px; color: #203a34; font-size: 16px; }
body.workspace-active .imdg-scan-header p { max-width: 620px; margin: 0; color: #657773; font-size: 12px; line-height: 1.5; }
body.workspace-active .imdg-scan-status { color: #45625a; font-size: 12px; font-weight: 650; }
body.workspace-active .imdg-scan-progress { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
body.workspace-active .imdg-scan-progress-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 8px 10px; border: 1px solid #e0e8e3; border-radius: 8px; background: #fff; }
body.workspace-active .imdg-scan-progress-name { overflow: hidden; color: #314943; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
body.workspace-active .imdg-scan-progress-state { flex: 0 0 auto; color: #778781; font-size: 11px; }
body.workspace-active .imdg-scan-progress-state.is-scanning { color: #176c61; font-weight: 700; }
body.workspace-active .imdg-scan-progress-state.is-complete { color: #187254; }
body.workspace-active .imdg-scan-progress-state.is-failed { color: #a03a34; }
body.workspace-active .imdg-scan-result { overflow: hidden; border: 1px solid #dae4de; border-radius: 9px; background: #fff; }
body.workspace-active .imdg-scan-result > summary { padding: 9px 12px; color: #31544a; cursor: pointer; font-size: 12px; font-weight: 700; }
body.workspace-active .imdg-scan-json { max-height: 420px; overflow: auto; margin: 0; padding: 12px; border-top: 1px solid #e5ebe7; color: #263e38; background: #f8faf9; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  body.workspace-active .imdg-scan-header { align-items: stretch; flex-direction: column; }
  body.workspace-active .imdg-scan-header .button { align-self: flex-start; }
  body.workspace-active .imdg-scan-progress-item { align-items: flex-start; flex-direction: column; gap: 4px; }
}

body.workspace-active .imdg-queue-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
body.workspace-active .imdg-queue-controls > label {
  display: grid;
  min-width: 130px;
  gap: 5px;
  color: #516273;
  font-size: 11px;
  font-weight: 700;
}
body.workspace-active .imdg-queue-history-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #627487;
  font-size: 11px;
  font-weight: 700;
}
body.workspace-active .imdg-queue-history-control select { max-width: min(42vw, 380px); min-width: 190px; }
body.workspace-active .imdg-queue-history-control select:disabled { opacity: .7; }
body.workspace-active .imdg-queue-progress-wrap {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e9ee;
  background: #f7fafc;
}
body.workspace-active .imdg-queue-progress-wrap[hidden] { display: none; }
body.workspace-active .imdg-queue-progress-wrap progress { width: 100%; accent-color: #168b84; }
body.workspace-active .imdg-queue-stage {
  display: block;
  max-width: 260px;
  margin-top: 4px;
  overflow: hidden;
  color: #687889;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.workspace-active .imdg-queue-status { min-width: 145px; }
body.workspace-active .imdg-queue-status.is-scanning { color: #166c61; font-weight: 750; }
body.workspace-active .imdg-queue-status.is-complete { color: #187254; }
body.workspace-active .imdg-queue-status.is-failed { color: #a03a34; }
body.workspace-active .imdg-queue-status.is-cancelled { color: #6f7883; }
body.workspace-active .imdg-queue-findings { min-width: 190px; }
body.workspace-active .imdg-queue-findings > * { display: block; }
body.workspace-active .imdg-finding-alert { margin-top: 4px; color: #a03a34; font-size: 11px; }
body.workspace-active .imdg-finding-review { margin-top: 4px; color: #805c12; }
body.workspace-active .imdg-queue-findings ul { max-width: 420px; padding-left: 18px; white-space: normal; }
body.workspace-active .imdg-queue-findings li { margin-top: 4px; color: #34495b; font-size: 11px; }
body.workspace-active .imdg-single-scan {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto minmax(220px, 0.9fr);
  align-items: end;
  gap: 14px;
  padding: 16px 18px;
  border-color: #cbdde3;
  background: linear-gradient(105deg, #fff 0%, #f4f9fb 100%);
}
body.workspace-active .imdg-single-scan > label,
body.workspace-active .imdg-results-search {
  display: grid;
  gap: 6px;
  color: #36566a;
  font-size: 11px;
  font-weight: 750;
}
body.workspace-active .imdg-single-scan .field-hint { max-width: 390px; margin: 0; }
body.workspace-active .imdg-batch-tools { margin-top: 10px; padding: 0 14px; }
body.workspace-active .imdg-batch-tools > summary { padding: 10px 2px; color: #516a79; cursor: pointer; font-size: 12px; font-weight: 750; }
body.workspace-active .imdg-batch-tools .imdg-queue-controls { margin: 0 0 12px; padding: 12px; border-color: #e0e8ec; background: #f8fafb; }
body.workspace-active .imdg-results-tools { display: flex; align-items: end; justify-content: flex-end; gap: 10px; }
body.workspace-active .imdg-results-search { min-width: 190px; }
body.workspace-active .imdg-results-search input { min-width: 210px; }
body.workspace-active .imdg-result-metrics { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid #e5ebef; }
body.workspace-active .imdg-result-metrics > div { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid #dbe4eb; border-radius: 9px; background: #f7fafc; }
body.workspace-active .imdg-result-metrics strong { color: #18394b; font-size: 22px; line-height: 1; }
body.workspace-active .imdg-result-metrics span { color: #697d89; font-size: 10px; font-weight: 700; }
body.workspace-active .imdg-result-metrics .is-hazmat { border-color: #c8e2dc; background: #f1f8f6; }
body.workspace-active .imdg-result-metrics .is-hazmat strong { color: #15725e; }
body.workspace-active .imdg-result-metrics .is-alert { border-color: #f0d0c8; background: #fff7f5; }
body.workspace-active .imdg-result-metrics .is-alert strong { color: #b4493b; }
body.workspace-active .imdg-result-metrics .is-difference { border-color: #eadfbe; background: #fffaf0; }
body.workspace-active .imdg-result-metrics .is-difference strong { color: #927123; }
body.workspace-active .imdg-result-list { display: grid; gap: 12px; padding: 14px; }
body.workspace-active .imdg-result-card { min-width: 0; padding: 16px; border: 1px solid #d9e3e9; border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgb(19 53 72 / 4%); }
body.workspace-active .imdg-result-card.is-failed { border-color: #ead0cd; }
body.workspace-active .imdg-result-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.workspace-active .imdg-result-title { min-width: 0; }
body.workspace-active .imdg-result-title h3 { margin: 0; overflow-wrap: anywhere; color: #18394b; font-size: 16px; }
body.workspace-active .imdg-result-subline { display: block; margin-top: 3px; color: #758692; font-size: 10px; }
body.workspace-active .imdg-result-status { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #dce5ea; border-radius: 99px; color: #566d7a; background: #f6f9fa; font-size: 10px; font-weight: 800; }
body.workspace-active .imdg-result-status.is-complete { color: #187254; border-color: #c8e3d6; background: #f1f8f4; }
body.workspace-active .imdg-result-status.is-partial { color: #865f11; border-color: #eadcae; background: #fffaf0; }
body.workspace-active .imdg-result-status.is-failed { color: #a03a34; border-color: #eccbc7; background: #fff5f3; }
body.workspace-active .imdg-result-progress,
body.workspace-active .imdg-result-error,
body.workspace-active .imdg-result-neutral,
body.workspace-active .imdg-review-reason { margin: 10px 0 0; color: #647783; font-size: 12px; line-height: 1.5; }
body.workspace-active .imdg-result-error { color: #a03a34; }
body.workspace-active .imdg-result-coverage { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
body.workspace-active .imdg-source-chip { padding: 4px 8px; border: 1px solid #dfe7eb; border-radius: 99px; color: #617582; background: #f8fafb; font-size: 10px; font-weight: 700; }
body.workspace-active .imdg-source-chip.is-complete { color: #216d5d; border-color: #cce2dc; background: #f0f7f4; }
body.workspace-active .imdg-source-chip.is-partial,
body.workspace-active .imdg-source-chip.is-unavailable,
body.workspace-active .imdg-source-chip.is-reauth_required { color: #875e11; border-color: #eadcb6; background: #fffaf0; }
body.workspace-active .imdg-result-alerts { display: grid; gap: 6px; margin: 12px 0 0; padding: 10px 12px 10px 30px; border: 1px solid #f0cfca; border-radius: 8px; color: #9d3f36; background: #fff6f4; font-size: 12px; font-weight: 750; }
body.workspace-active .imdg-result-section { margin-top: 14px; }
body.workspace-active .imdg-result-section h4 { margin: 0 0 8px; color: #294a5c; font-size: 12px; }
body.workspace-active .imdg-goods-card { margin-top: 8px; padding: 11px 12px; border: 1px solid #d5e5df; border-radius: 8px; background: #f7fbf9; }
body.workspace-active .imdg-goods-title { display: block; color: #175f50; font-size: 12px; line-height: 1.45; }
body.workspace-active .imdg-goods-details { display: grid; grid-template-columns: repeat(4, minmax(80px, 1fr)); gap: 7px 12px; margin: 9px 0 0; }
body.workspace-active .imdg-goods-details dt { color: #73827f; font-size: 9px; font-weight: 750; }
body.workspace-active .imdg-goods-details dd { margin: 2px 0 0; overflow-wrap: anywhere; color: #304f47; font-size: 11px; }
body.workspace-active .imdg-goods-source { display: block; margin-top: 9px; color: #758782; font-size: 10px; }
body.workspace-active .imdg-result-comparison { padding: 12px; border: 1px solid #eadfbe; border-radius: 9px; background: #fffdf7; }
body.workspace-active .imdg-result-comparison h4 { color: #765c1d; }
body.workspace-active .imdg-result-review { padding: 12px; border: 1px solid #eadfbe; border-radius: 9px; background: #fffdf7; }
body.workspace-active .imdg-result-review h4 { color: #765c1d; }
body.workspace-active .imdg-difference-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
body.workspace-active .imdg-difference-list li { display: grid; gap: 3px; padding: 8px 10px; border-left: 3px solid #d9b24b; border-radius: 4px; background: #fff; }
body.workspace-active .imdg-difference-list li strong { color: #4f4b3e; font-size: 11px; }
body.workspace-active .imdg-difference-list li span { color: #596a70; font-size: 11px; overflow-wrap: anywhere; }
body.workspace-active .imdg-difference-list li small { color: #7d8582; font-size: 10px; }
body.workspace-active .imdg-review-reason { margin-top: 7px; color: #856116; }
body.workspace-active .imdg-source-matrix { min-width: 0; }
body.workspace-active .imdg-source-matrix-scroll { max-width: 100%; overflow: auto; border: 1px solid #dfe7eb; border-radius: 8px; background: #fff; }
body.workspace-active .imdg-source-matrix-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
body.workspace-active .imdg-source-matrix-table th,
body.workspace-active .imdg-source-matrix-table td { min-width: 150px; padding: 9px 10px; border-right: 1px solid #e7ecef; border-bottom: 1px solid #e7ecef; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
body.workspace-active .imdg-source-matrix-table th:first-child { position: sticky; left: 0; z-index: 1; width: 150px; min-width: 150px; background: #f4f7f8; }
body.workspace-active .imdg-source-matrix-table thead th { position: sticky; top: 0; z-index: 2; color: #315064; background: #f3f7f9; font-size: 10px; }
body.workspace-active .imdg-source-matrix-table thead th:first-child { z-index: 3; }
body.workspace-active .imdg-matrix-source-status { display: block; margin-top: 4px; color: #7a8a93; font-size: 9px; font-weight: 600; }
body.workspace-active .imdg-source-matrix-table tbody th { color: #395668; background: #fafcfc; font-size: 10px; }
body.workspace-active .imdg-source-matrix-table td { color: #40545f; background: #fff; font-size: 10px; }
body.workspace-active .imdg-source-matrix-table td.is-difference { background: #fff1ed; box-shadow: inset 0 0 0 1px #e8a79a; }
body.workspace-active .imdg-source-matrix-table td.is-partial,
body.workspace-active .imdg-source-matrix-table td.is-source_unavailable,
body.workspace-active .imdg-source-matrix-table td.is-not_scanned { background: #fffaf0; }
body.workspace-active .imdg-matrix-value { display: block; color: #254758; font-weight: 750; }
body.workspace-active .imdg-evidence-citation { margin-top: 5px; color: #315064; }
body.workspace-active .imdg-evidence-citation summary { cursor: pointer; color: #176c8a; font-size: 9px; font-weight: 700; }
body.workspace-active .imdg-evidence-citation blockquote { margin: 4px 0; padding: 5px 7px; border-left: 2px solid #58a7b1; background: #f2f8f8; white-space: pre-wrap; font-size: 9px; }
body.workspace-active .imdg-matrix-empty { color: #84919a; font-style: italic; }
body.workspace-active .imdg-result-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding-top: 11px; border-top: 1px solid #e9eef0; }
body.workspace-active .imdg-queue-json-details { max-width: 100%; }
body.workspace-active .imdg-queue-json-details > summary { display: inline-flex; }
body.workspace-active .imdg-queue-results-card > .empty-state { padding: 38px 20px; }
/* eDocs uses a bounded file rail beside a dominant preview canvas. */
body.workspace-active .booking-edocs-inline .edocs-layout {
  grid-template-columns: minmax(285px, 0.84fr) minmax(0, 2.16fr);
  align-items: stretch;
  gap: 12px;
  height: clamp(440px, 56vh, 620px);
  min-height: clamp(440px, 56vh, 620px);
  padding: 0;
}
body.workspace-active .booking-edocs-inline .edocs-list-card,
body.workspace-active .booking-edocs-inline .edocs-preview-card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d7e1dc;
  border-radius: 8px;
  background: #fff;
}
body.workspace-active .booking-edocs-inline .edocs-list-card { display: flex; flex-direction: column; }
body.workspace-active .booking-edocs-inline .edocs-list-heading {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-bottom: 1px solid #e7edea;
}
body.workspace-active .booking-edocs-inline .edocs-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.workspace-active .booking-edocs-inline .edocs-file-list {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 6px;
  padding: 8px;
}
body.workspace-active .booking-edocs-inline .edoc-file-card {
  display: grid;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid #e0e7e3;
  border-radius: 7px;
  background: #fff;
  transition: border-color 120ms ease, background-color 120ms ease;
}
body.workspace-active .booking-edocs-inline .edoc-file-card:hover,
body.workspace-active .booking-edocs-inline .edoc-file-card:focus-within { border-color: #9db9b0; background: #f8fbf9; }
body.workspace-active .booking-edocs-inline .edoc-file-card.is-selected {
  border-color: #5b9487;
  background: #eef5f1;
  box-shadow: inset 3px 0 #2d796d;
}
body.workspace-active .booking-edocs-inline .edoc-file-select {
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
body.workspace-active .booking-edocs-inline .edoc-file-select:focus-visible { outline: 2px solid #24766e; outline-offset: 2px; border-radius: 4px; }
body.workspace-active .booking-edocs-inline .edoc-file-type {
  display: grid;
  width: 36px;
  height: 42px;
  place-items: end center;
  padding: 0 2px 5px;
  overflow: hidden;
  color: #25665b;
  border: 1px solid #cbdcd5;
  border-radius: 5px;
  background: #f1f7f4;
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.workspace-active .booking-edocs-inline .edoc-file-copy { display: grid; min-width: 0; gap: 2px; align-content: center; }
body.workspace-active .booking-edocs-inline .edoc-file-name,
body.workspace-active .booking-edocs-inline .edoc-file-details,
body.workspace-active .booking-edocs-inline .edoc-file-description {
  display: -webkit-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  -webkit-box-orient: vertical;
}
body.workspace-active .booking-edocs-inline .edoc-file-name { color: #203c37; font-size: 11px; line-height: 1.3; -webkit-line-clamp: 2; }
body.workspace-active .booking-edocs-inline .edoc-file-details {
  display: block;
  color: #72817c;
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.workspace-active .booking-edocs-inline .edoc-file-description { color: #566d65; font-size: 9px; line-height: 1.3; -webkit-line-clamp: 2; }
body.workspace-active .booking-edocs-inline .edoc-row-download {
  display: grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  padding: 0;
  color: #315f54;
  border: 1px solid #d7e2dc;
  border-radius: 6px;
  background: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
body.workspace-active .booking-edocs-inline .edoc-row-download:hover { background: #edf5f1; border-color: #b9cec5; }
body.workspace-active .booking-edocs-inline .edoc-row-download:focus-visible { outline: 2px solid #24766e; outline-offset: 2px; }
body.workspace-active .booking-edocs-inline .edocs-preview-card { display: flex; flex-direction: column; }
body.workspace-active .booking-edocs-inline .edocs-preview-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 43px;
  padding: 10px 14px;
  border-bottom: 1px solid #e4ebe7;
  background: #fbfcfb;
}
body.workspace-active .booking-edocs-inline .edocs-preview-title { color: #304b43; font-size: 12px; }
body.workspace-active .booking-edocs-inline .edocs-preview-content {
  display: flex;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
body.workspace-active .booking-edocs-inline .edocs-preview-card iframe.edoc-email-html-frame {
  flex: 1 0 320px;
  width: 100%;
  height: min(620px, 62vh);
  min-height: 320px;
  margin: 0;
}
body.workspace-active .booking-edocs-inline #bookingEdocsPreview {
  flex: 1 1 240px;
  width: 100%;
  height: auto;
  min-height: 240px;
  border: 0;
}
body.workspace-active .booking-edocs-inline .edoc-email-body {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 240px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #d8e1dd;
  border-radius: 6px;
  background: #fff;
  white-space: pre-wrap;
}
@media (max-width: 900px) {
  body.workspace-active .booking-edocs-inline .edocs-layout { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  body.workspace-active .booking-edocs-inline .edocs-list-card { max-height: 300px; }
  body.workspace-active .booking-edocs-inline .edocs-preview-card { min-height: 420px; }
}
@media (max-width: 600px) {
  body.workspace-active .booking-edocs-inline .edoc-file-card { grid-template-columns: minmax(0, 1fr) 30px; }
  body.workspace-active .booking-edocs-inline .edoc-file-select { grid-template-columns: 34px minmax(0, 1fr); gap: 7px; }
  body.workspace-active .booking-edocs-inline .edoc-file-type { width: 34px; height: 40px; }
}
@media (max-width: 640px) {
  body.workspace-active .imdg-queue-progress-wrap { grid-template-columns: minmax(0, 1fr); }
  body.workspace-active .imdg-queue-controls > label { flex: 1 1 130px; }
  body.workspace-active .table-toolbar:has(.imdg-queue-history-control) { align-items: flex-start; flex-direction: column; }
  body.workspace-active .imdg-queue-history-control { width: 100%; justify-content: space-between; }
  body.workspace-active .imdg-queue-history-control select { max-width: 72%; min-width: 0; }
}
@media (max-width: 900px) {
  body.workspace-active .imdg-goods-details { grid-template-columns: repeat(2, minmax(80px, 1fr)); }
}
@media (max-width: 640px) {
  body.workspace-active .imdg-single-scan { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  body.workspace-active .imdg-single-scan .button { justify-self: start; }
  body.workspace-active .imdg-results-tools { align-items: stretch; flex-direction: column; }
  body.workspace-active .imdg-results-search input { min-width: 0; }
  body.workspace-active .imdg-result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active .imdg-result-card-header { align-items: flex-start; flex-direction: column; }
}

/* Repeatable warehouse receipt cards, matching the approved Booking detail preview. */
body.workspace-active .booking-measurement-toolbar .table-toolbar-title strong {
  color: #18394b;
  font-size: 17px;
}
body.workspace-active .booking-measurement-toolbar .table-meta,
body.workspace-active .booking-edocs-inline .edocs-header-count {
  padding: 4px 9px;
  color: #315f54;
  border: 1px solid #d2e1da;
  border-radius: 999px;
  background: #eef5f1;
  font-size: 11px;
  font-weight: 700;
}
body.workspace-active .booking-measurement-receipts { gap: 10px; }
body.workspace-active .booking-measurement-receipt {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #d2ddd8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(24 57 75 / 5%);
}
body.workspace-active .booking-measurement-identity {
  display: grid;
  grid-template-columns: minmax(250px, .75fr) minmax(180px, 1fr) minmax(150px, .8fr);
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  color: #fff;
  border: 0;
  background: #183c54;
}
body.workspace-active .booking-measurement-receipt-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
body.workspace-active .booking-measurement-receipt-icon,
body.workspace-active .booking-measurement-next-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: #178b82;
  border: 1px solid #c9e4de;
  border-radius: 8px;
  background: #e5f3ef;
  font-size: 19px;
  font-weight: 700;
}
body.workspace-active .booking-measurement-receipt-number {
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}
body.workspace-active .booking-measurement-identity .booking-measurement-cell {
  min-height: 46px;
  padding: 7px 16px;
  border-left: 1px solid rgb(255 255 255 / 18%);
}
body.workspace-active .booking-measurement-identity .booking-measurement-label { color: #c9d9e1; }
body.workspace-active .booking-measurement-identity .booking-measurement-value {
  color: #fff;
  font-size: 16px;
}
body.workspace-active .booking-measurement-identity .is-warehouse-number .booking-measurement-value { color: #fff; }
body.workspace-active .booking-measurement-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(240px, 1.45fr);
  gap: 7px;
  padding: 9px;
  border-bottom: 1px solid #e5ece8;
  background: #fff;
}
body.workspace-active .booking-measurement-summary .booking-measurement-cell {
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e0e9e4;
  border-radius: 6px;
  background: #f7faf8;
}
body.workspace-active .booking-measurement-icon {
  display: grid;
  width: 38px;
  height: 42px;
  place-items: center;
  color: #178b82;
  border: 1px solid #c9e1d9;
  border-radius: 8px;
  background: #eaf4f0;
  font-size: 22px;
  font-weight: 700;
}
body.workspace-active .booking-measurement-icon svg,
body.workspace-active .booking-measurement-receipt-icon svg,
body.workspace-active .booking-measurement-next-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}
body.workspace-active .booking-measurement-receipt-icon svg,
body.workspace-active .booking-measurement-next-icon svg {
  width: 21px;
  height: 21px;
}
body.workspace-active .booking-measurement-copy { display: grid; min-width: 0; gap: 3px; }
body.workspace-active .booking-measurement-summary .booking-measurement-label {
  color: #62746e;
  font-size: 10px;
}
body.workspace-active .booking-measurement-summary .booking-measurement-value {
  color: #18394b;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
body.workspace-active .booking-measurement-summary .booking-measurement-cell:last-child .booking-measurement-value {
  font-size: clamp(11px, .85vw, 14px);
  overflow-wrap: normal;
  word-break: normal;
}
body.workspace-active .booking-measurement-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 0 8px 6px;
  background: #fff;
}
body.workspace-active .booking-measurement-facts .booking-measurement-cell {
  min-height: 44px;
  padding: 6px 10px;
}
body.workspace-active .booking-measurement-next {
  border-color: #d3e0e3;
  background: #f2f7f8;
  box-shadow: none;
}
body.workspace-active .booking-measurement-next-heading {
  display: grid;
  min-height: 48px;
  grid-template-columns: 42px minmax(200px, .45fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-bottom: 1px solid #dce7e9;
  background: #eef4f5;
}
body.workspace-active .booking-measurement-next-icon { width: 36px; height: 36px; }
body.workspace-active .booking-measurement-next-title { color: #294b5b; font-size: 13px; }
body.workspace-active .booking-measurement-next-hint {
  padding-left: 16px;
  color: #6a8089;
  border-left: 1px solid #cfdddf;
  font-size: 11px;
}
body.workspace-active .booking-measurement-next .booking-measurement-summary { border-bottom-color: #dce7e9; }
body.workspace-active .booking-measurement-next .booking-measurement-value { color: #788b92; }
body.workspace-active .booking-edocs-inline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
body.workspace-active .booking-edocs-inline .edocs-header-count { flex: 0 0 auto; }
body.workspace-active .booking-edocs-inline .edocs-list-heading { min-height: 40px; }
@media (max-width: 1100px) {
  body.workspace-active .booking-measurement-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.workspace-active .booking-measurement-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body.workspace-active .booking-measurement-identity {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }
  body.workspace-active .booking-measurement-receipt-title { padding: 3px 4px 8px; }
  body.workspace-active .booking-measurement-identity .booking-measurement-cell {
    min-height: 42px;
    padding: 6px 8px;
    border-top: 1px solid rgb(255 255 255 / 18%);
    border-left: 0;
  }
  body.workspace-active .booking-measurement-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active .booking-measurement-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active .booking-measurement-next-heading {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
  }
  body.workspace-active .booking-measurement-next-hint {
    grid-column: 2;
    padding: 0;
    border: 0;
  }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
    padding: 7px;
  }
  body.workspace-active .booking-measurement-icon { width: 32px; height: 36px; font-size: 18px; }
  body.workspace-active .booking-measurement-icon svg { width: 19px; height: 19px; }
  body.workspace-active .booking-measurement-summary .booking-measurement-cell:last-child .booking-measurement-value {
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  body.workspace-active .booking-edocs-inline-header { align-items: flex-start; }
}

/* Booking detail field groups follow the work order: measures, cargo, DG, warehouse. */
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "heading heading heading heading"
    "packages unit weight volume"
    "commodity commodity commodity commodity"
    "loadcode dg unno dgclass"
    "warehouse warehouse warehouse warehouse";
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .editor-section-heading { grid-area: heading; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-packages { grid-area: packages; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-packageUnit { grid-area: unit; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-weightKgs { grid-area: weight; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-volumeCbm { grid-area: volume; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-commodity {
  grid-area: commodity;
  grid-column: 1 / -1;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-loadCode { grid-area: loadcode; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-dangerousGoods { grid-area: dg; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-dangerousUnNo { grid-area: unno; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-dangerousClass { grid-area: dgclass; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse .field-warehouseName {
  grid-area: warehouse;
  grid-column: 1 / -1;
}

/* Separate operational controls from the three notes, which share one row. */
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas: none !important;
  gap: 8px;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes .editor-section-heading,
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes .booking-section-subheading,
body.workspace-active #bookingsPanel.is-detail-mode .booking-operations-fields > .editor-field,
body.workspace-active #bookingsPanel.is-detail-mode .booking-notes-fields > .editor-field { grid-area: auto !important; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes::before,
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes::after { content: none; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes .booking-section-subheading {
  margin: 0;
  padding: 5px 0 6px;
  color: #55727f;
  border-bottom: 1px solid #d7e2e7;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-operations-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 1 / -1 !important;
  gap: 7px 8px;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-notes-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  grid-column: 1 / -1 !important;
  gap: 8px;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-operations-fields > .editor-field,
body.workspace-active #bookingsPanel.is-detail-mode .booking-notes-fields > .editor-field {
  min-width: 0;
  grid-column: auto !important;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-operations-fields > .editor-field { min-width: 0; }
body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes textarea {
  height: 112px;
  min-height: 112px;
}

/* The route action stays beside the title; its divider spans the whole card. */
body.workspace-active #bookingsPanel.is-detail-mode .booking-route-heading-row {
  padding-bottom: 7px;
  margin-bottom: 2px;
  border-bottom: 1px solid #d7e2e7;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-route-heading-row > .editor-section-heading {
  flex: 1 1 auto;
  padding: 0;
  border: 0;
}
body.workspace-active #bookingsPanel.is-detail-mode .booking-route-action-state { display: none; }

/* Remove preview chrome from the canvas and give that height to the document. */
body.workspace-active .booking-edocs-inline .edocs-preview-heading { display: none !important; }
body.workspace-active .booking-edocs-inline .edocs-preview-card {
  gap: 0;
  padding: 0;
}
body.workspace-active .booking-edocs-inline .edocs-preview-hint {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
  text-align: center;
}
body.workspace-active .booking-edocs-inline .edocs-preview-card:has(#bookingEdocsPreview:not([hidden])) .edocs-preview-hint,
body.workspace-active .booking-edocs-inline .edocs-preview-card:has(#bookingEdocsPreviewContent:not([hidden])) .edocs-preview-hint {
  display: none;
}
body.workspace-active .booking-edocs-inline #bookingEdocsPreview {
  height: 100%;
  min-height: 0;
}

@media (max-width: 760px) {
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse,
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse {
    grid-template-areas:
      "heading heading"
      "packages unit"
      "weight volume"
      "commodity commodity"
      "loadcode dg"
      "unno dgclass"
      "warehouse warehouse";
  }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
    gap: 7px;
  }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-operations-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-notes-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse,
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
    grid-template-columns: minmax(0, 1fr);
  }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-cargo-warehouse {
    grid-template-areas:
      "heading"
      "packages"
      "unit"
      "weight"
      "volume"
      "commodity"
      "loadcode"
      "dg"
      "unno"
      "dgclass"
      "warehouse";
  }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-section-operations-notes {
    gap: 6px;
  }
  body.workspace-active #bookingsPanel.is-detail-mode .booking-operations-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Keep the POD selector immediately before the sailing picker in the move plan. */
dialog#reassignDialog.reassign-dialog .reassign-controls-grid {
  grid-template-columns: minmax(150px, 0.72fr) minmax(280px, 1.6fr) minmax(145px, 0.68fr) !important;
}

dialog#reassignDialog.reassign-dialog .reassign-controls-grid:has(> #reassignTargetPodField[hidden]) {
  grid-template-columns: minmax(0, 1.75fr) minmax(180px, 0.75fr) !important;
}

dialog#reassignDialog.reassign-dialog #reassignTargetPodField[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  dialog#reassignDialog.reassign-dialog .reassign-controls-grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) !important;
  }
}

@media (max-width: 640px) {
  dialog#reassignDialog.reassign-dialog .reassign-controls-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Unified, permission-scoped search lives at the start of the workspace nav. */
.workspace-tabs {
  position: relative;
  overflow: visible;
}

.workspace-search {
  position: relative;
  z-index: 12;
  flex: 0 0 auto;
  margin: 0 2px 8px;
}

.workspace-search-control {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  padding: 4px 6px 4px 10px;
  color: #91b6c9;
  background: rgba(5, 20, 32, 0.72);
  border: 1px solid rgba(139, 183, 201, 0.26);
  border-radius: 10px;
}

.workspace-search-control:focus-within {
  border-color: #46a5b2;
  box-shadow: 0 0 0 3px rgba(70, 165, 178, 0.2);
}

.workspace-search-control > span {
  font-size: 22px;
  line-height: 1;
}

.workspace-search-control input {
  width: 100%;
  min-width: 0;
  padding: 6px 2px;
  color: #eef7fb;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.workspace-search-control input::placeholder {
  color: #8fa6b6;
  opacity: 1;
}

.workspace-search-control button {
  width: 28px;
  height: 28px;
  padding: 0;
  color: #d6edf1;
  background: #216e7c;
  border: 0;
  border-radius: 7px;
  font-size: 17px;
  line-height: 1;
}

.workspace-search-results {
  position: fixed;
  top: var(--workspace-search-top, 12px);
  left: var(--workspace-search-left, 12px);
  z-index: 12000;
  width: var(--workspace-search-width, min(410px, calc(100vw - 24px)));
  max-height: min(72vh, 680px);
  overflow: auto;
  padding: 8px;
  color: #173047;
  background: #f8fbfc;
  border: 1px solid #c8dce3;
  border-radius: 13px;
  box-shadow: 0 16px 44px rgba(10, 35, 50, 0.24);
}

.workspace-search-results[hidden] {
  display: none !important;
}

.workspace-search-group + .workspace-search-group {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid #dce7eb;
}

.workspace-search-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 4px 7px;
  color: #486475;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-search-group-title small {
  color: #6b8997;
  font-size: 10px;
}

.workspace-search-result {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  color: #173047;
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.workspace-search-result:hover,
.workspace-search-result:focus-visible {
  background: #e4f1f4;
}

.workspace-search-result-primary,
.workspace-search-result-secondary {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
}

.workspace-search-result-primary {
  font-size: 12px;
  font-weight: 750;
}

.workspace-search-result-secondary {
  color: #637c89;
  font-size: 10px;
  line-height: 1.35;
}

.workspace-search-match {
  padding: 0 1px;
  color: #603900;
  background: #ffe08a;
  border-radius: 2px;
}

.workspace-search-empty,
.workspace-search-loading,
.workspace-search-error {
  margin: 0;
  padding: 10px 8px;
  color: #617988;
  font-size: 12px;
}

.workspace-search-error {
  color: #a73345;
}

@media (max-width: 700px) {
  .workspace-search-results {
    max-height: min(62vh, 560px);
  }
}

/* Keep every Send Notice mode on the same review frame and two-panel layout. */
dialog#scheduleNotificationPrompt.schedule-notification-dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1120px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border: 1px solid rgb(20 54 75 / 0.16);
  border-radius: 20px;
  background: #edf3f6;
  box-shadow: 0 30px 90px -48px rgb(18 44 62 / 0.58);
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog:not([open]) {
  display: none !important;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog > .modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #d1e0e7;
  background: #f9fcfd;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog > .modal-header h2 {
  margin: 3px 0 0;
  color: #102a49;
  font-size: 21px;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .modal-subtitle {
  margin: 5px 0 0;
  color: #607987;
  font-size: 12px;
  line-height: 1.45;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog > .schedule-notification-warning {
  margin: 14px 20px 0;
  padding: 11px 14px;
  border: 1px solid #f2d58e;
  border-left: 3px solid #e69b12;
  border-radius: 10px;
  background: #fff8e4;
  color: #70501b;
  font-size: 12px;
  line-height: 1.45;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog > .schedule-notification-body {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  align-content: stretch;
  gap: 14px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 14px 18px 18px;
  background: #edf3f6;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-panel {
  align-content: start;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid #d1e0e7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(18 44 62 / 0.07);
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-heading {
  align-items: start;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-heading h3,
dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-email-heading h3 {
  margin: 2px 0 0;
  color: #102a49;
  font-size: 17px;
  line-height: 1.35;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-bookings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding: 0 2px 2px 0;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-booking {
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d9e5ed;
  border-radius: 8px;
  background: #f8fbfc;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-email-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0;
  min-height: 0;
  overflow: auto;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-email-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto !important;
  align-items: start;
  gap: 10px;
  padding: 0;
  border: 0;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-email-heading h3 {
  font-size: 18px;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-intro {
  margin: 5px 0 0;
  color: #607987;
  font-size: 11px;
  line-height: 1.45;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 10px 14px;
  margin-top: 14px;
  padding: 14px 0 0;
  border-top: 1px solid #e0e9ee;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #18324f;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls label > span:first-child {
  color: #5b7582;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls > label:nth-of-type(1) {
  grid-column: 1;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls > label:nth-of-type(2) {
  grid-column: 2;
  align-self: end;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls > label:nth-of-type(n + 3) {
  grid-column: 1 / -1;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls select,
dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-status {
  display: block;
  grid-row: auto;
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid #d6e5ee;
  border-radius: 8px;
  background: #f6fafc;
  color: #355468;
  font-size: 11px;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-email-preview-heading {
  display: flex;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e0e9ee;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-email-drafts {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: none;
  margin: 9px 0 0;
  padding: 0 2px 2px 0;
  overflow: visible;
  list-style: none;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-draft-common {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid #d9e5ed;
  border-radius: 11px;
  background: #f8fafc;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-body-preview {
  max-height: 210px;
  padding: 4px 0 2px;
  overflow: auto;
  border: 0;
  background: transparent;
  color: #203e59;
  font-size: 12px;
  line-height: 1.55;
}

dialog#scheduleNotificationPrompt.schedule-notification-dialog > .modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  min-height: 60px;
  padding: 10px 20px;
  border-top: 1px solid #cadbe3;
  background: #f0f6f9;
}

@media (max-width: 860px) {
  dialog#scheduleNotificationPrompt.schedule-notification-dialog {
    height: min(900px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog > .schedule-notification-body {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding: 12px;
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-bookings {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-height: min(28vh, 220px);
  }
}

@media (max-width: 520px) {
  dialog#scheduleNotificationPrompt.schedule-notification-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog > .modal-header {
    padding: 14px 16px 12px;
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog > .modal-header h2 {
    font-size: 19px;
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog > .schedule-notification-warning {
    margin: 10px 12px 0;
    padding: 9px 10px;
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notification-panel {
    padding: 13px;
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog .schedule-notice-controls > label {
    grid-column: 1;
  }

  dialog#scheduleNotificationPrompt.schedule-notification-dialog > .modal-actions {
    flex-wrap: wrap;
    padding: 9px 10px;
  }

dialog#scheduleNotificationPrompt.schedule-notification-dialog > .modal-actions .button {
    flex: 1 1 40%;
  }
}

.reassign-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 24px;
  color: #526f82;
  font-size: 13px;
  text-align: center;
}

.reassign-preview-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 3px solid #d8e7ee;
  border-top-color: #187d9b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .reassign-preview-spinner {
    animation: none;
  }
}
