:root {
  --ctrl-h: 32px;
  --ctrl-pad-x: 10px;
  --ctrl-radius: 6px;
  --ctrl-border: 1px solid rgba(255, 255, 255, 0.15);
  --ctrl-bg: rgba(0, 0, 0, 0.25);
  --ctrl-fg: #e2e8f0;
  --ctrl-placeholder: #64748b;
  --ctrl-label: #94a3b8;
  --ctrl-fs: 0.8125rem;
  --ctrl-label-fs: 0.75rem;
  --page-bg: #1c2433;
  --card-bg: #283244;
  --accent: #3273f6;
  --accent-fg: #f8fafc;
  --heading: #f4f1ea;
  --warn: #fbbf24;
  --ok: #86efac;
  --err: #fca5a5;
  --line: rgba(244, 241, 234, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
}

body {
  background: var(--page-bg);
  color: var(--ctrl-fg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.container {
  position: relative;
  max-width: min(1400px, 100%);
  margin: 0 auto;
  padding: 28px 24px 48px;
  overflow-x: clip;
}

.login-page,
.forbidden-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-page .container,
.forbidden-page .container {
  width: min(360px, calc(100% - 48px));
  margin: auto;
  padding: 0;
}

.login-page h1,
.forbidden-page h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 24px;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .login-page h1,
html:not([data-theme="gold"]):not([data-theme="slate"]) .forbidden-page h1 {
  color: #c8b494;
}

.forbidden-page .forbidden-text {
  margin: 0 0 24px;
  color: var(--ctrl-fg);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.login-page .btn-secondary,
.login-page .btn-secondary:hover,
.login-page .btn-secondary:active {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
  box-shadow: none;
}

.login-page .btn-secondary:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

.login-page .btn-secondary:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

.user-bar {
  position: absolute;
  top: 28px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.user-bar-name {
  color: var(--ctrl-fg);
  font-size: var(--ctrl-fs);
}

header h1,
.app-content > h1 {
  color: var(--heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  max-width: 360px;
}

.field label {
  color: var(--ctrl-label);
  font-size: var(--ctrl-label-fs);
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  height: var(--ctrl-h);
  padding: 0 var(--ctrl-pad-x);
  border: var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  background: var(--ctrl-bg);
  color: var(--ctrl-fg);
  font-size: var(--ctrl-fs);
}

select {
  min-width: 160px;
}

textarea {
  height: auto;
  min-height: 72px;
  padding: 6px var(--ctrl-pad-x);
}

input::placeholder {
  color: var(--ctrl-placeholder);
}

input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ctrl-h);
  padding: 0 var(--ctrl-pad-x);
  border-radius: var(--ctrl-radius);
  font-size: var(--ctrl-fs);
  cursor: pointer;
  border: var(--ctrl-border);
}

.btn-primary {
  background: transparent;
  border: 1px solid #4d94ff;
  color: #4d94ff;
  box-shadow: none;
  text-decoration: none;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

.btn-primary:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
  background: transparent;
}

.btn-secondary {
  background: var(--ctrl-bg);
  color: var(--ctrl-fg);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: start;
}

.form-grid > .field {
  margin-bottom: 0;
  max-width: none;
}

.form-grid + .form-actions,
.choice-panel > .form-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.form-error {
  min-height: 1.25rem;
  margin: 0 0 12px;
  color: var(--err);
  font-size: var(--ctrl-fs);
}

.field-hint {
  margin: 0;
  color: var(--ctrl-placeholder);
  font-size: 12px;
  line-height: 1.4;
}

.field-error {
  min-height: 1.1rem;
  margin: 0;
  color: var(--err);
  font-size: 12px;
  line-height: 1.4;
}

input[aria-invalid="true"] {
  border-color: #f87171;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.portal-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
}

.portal-card h2 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .portal-card h2 {
  color: #c8b494;
}

.portal-status {
  margin: 0;
  color: var(--ctrl-label);
  font-size: var(--ctrl-fs);
}

.portal-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.portal-card-link:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
  color: var(--ctrl-label);
  font-size: var(--ctrl-fs);
}

.app-content .breadcrumb:empty {
  display: none;
}

.app-body:has(.app-side-links:empty) {
  grid-template-columns: minmax(0, 1fr);
}

.app-side:has(.app-side-links:empty) {
  display: none;
}

.setup-card {
  max-width: 420px;
}

.setup-card .field {
  max-width: none;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.crumb-sep {
  color: var(--ctrl-label);
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 16px 0;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: var(--ctrl-border);
  font-size: var(--ctrl-fs);
  vertical-align: top;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin: 0 0 16px;
}

.toolbar > .field {
  margin-bottom: 0;
}

.status-ok {
  color: var(--ok);
  font-size: var(--ctrl-fs);
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0 0 16px;
}

.cap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 8px 0 0;
}

.cap-groups {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 10px;
}

.cap-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cap-filter {
  flex: 1;
  min-width: 0;
}

.cap-group {
  display: block;
  max-width: 100%;
  overflow: visible;
  padding: 8px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cap-group[hidden],
.cap-group label[hidden] {
  display: none;
}

.cap-prefix {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.cap-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px 12px;
}

#role-form .form-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .cap-prefix {
  color: #c8b494;
}

.choice-title {
  margin: 0;
  color: var(--ctrl-fg);
  font-size: var(--ctrl-fs);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
  margin: 8px 0 0;
}

.feishu-filter {
  width: 100%;
  margin: 8px 0 0;
}

.feishu-candidate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 0;
}

.app-content:has(#grant-work) > main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#grant-work {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

#grant-work .product-rail,
#grant-work .gp-work-main {
  min-height: 0;
  height: 100%;
}

#grant-panel .table-wrap {
  margin: 0;
}

#grant-panel .panel-head h2 {
  margin: 0;
}

#grant-panel .panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#grant-panel table.data {
  table-layout: fixed;
  min-width: 0;
}

#grant-panel th:nth-child(1),
#grant-panel td:nth-child(1) {
  width: 14rem;
}

#grant-panel th:nth-child(3),
#grant-panel td:nth-child(3) {
  width: 5rem;
}

#grant-panel td.grant-parties {
  white-space: normal;
  overflow-wrap: anywhere;
}

#grant-form-status:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

#grant-form .toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

#grant-form .toolbar > .field {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  max-width: none;
}

#grant-form .toolbar > .field label {
  width: 4.5em;
  margin: 0;
  flex: 0 0 auto;
}

#grant-form .grant-readonly {
  margin: 0;
  color: var(--ctrl-fg);
  font-size: var(--ctrl-fs);
  line-height: 1.4;
}

.grant-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

#grant-product-field,
#grant-party-field {
  max-width: none;
  margin-bottom: 0;
}

#grant-product-field > input,
#grant-party-field > input {
  width: 100%;
}

#grant-product-filter[hidden] {
  display: none;
}

.grant-pick-list {
  max-height: 280px;
  margin-top: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.grant-pick-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 0;
  padding: 0 10px;
  color: var(--ctrl-fg);
  font-size: 13px;
  font-weight: 400;
}

.grant-pick-list input[type="checkbox"] {
  width: 12px;
  height: 12px;
  accent-color: #3273f6;
}

.grant-pick-list label[hidden],
.grant-pick-list .empty-state[hidden] {
  display: none;
}

.grant-pick-list .empty-state {
  margin: 8px 10px;
  color: var(--ctrl-label);
  font-size: 13px;
}

#grant-form .form-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

#grant-dialog {
  width: min(840px, calc(100vw - 32px));
  max-width: 840px;
}

#btn-new-grant,
#btn-new-grant:hover,
#btn-new-grant:active {
  border: 1px solid #f07171;
  color: #f07171;
}

.grant-batch-warn {
  margin: 0 0 12px;
  color: #f07171;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.grant-batch-warn[hidden] {
  display: none;
}

#grant-panel {
  position: relative;
}

#grant-panel > #page-status:not(:empty) {
  position: absolute;
  top: 0;
  left: 6.5em;
  right: 13rem;
  z-index: 2;
  height: 32px;
  margin: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
  line-height: 32px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--page-bg);
}

#feishu-box .form-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

#feishu-box .form-actions .danger-action,
#feishu-box .form-actions .danger-action:hover,
#feishu-box .form-actions .danger-action:active {
  border: 1px solid #f07171;
  color: #f07171;
}

.feishu-candidate {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  margin: 0;
  padding: 8px 10px;
  border: var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  background: rgba(0, 0, 0, 0.15);
}

.feishu-candidate-body {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.feishu-candidate-name {
  flex: 0 0 6em;
  color: var(--ctrl-fg);
  font-size: var(--ctrl-fs);
  white-space: nowrap;
}

.feishu-candidate-id,
.feishu-candidate-groups,
.feishu-candidate-state {
  color: var(--ctrl-label);
  font-size: var(--ctrl-label-fs);
  line-height: 1.4;
  white-space: nowrap;
}

.feishu-candidate-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cap-list label,
.choice-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ctrl-fs);
  color: var(--ctrl-fg);
}

.cap-list input[type="checkbox"],
.choice-grid input[type="checkbox"] {
  width: 12px;
  height: 12px;
  accent-color: #3273f6;
}

.btn-danger {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fecaca;
}

.btn-ghost {
  background: transparent;
  color: var(--ctrl-fg);
}

.muted {
  color: var(--ctrl-label);
  font-size: var(--ctrl-fs);
}

.panel h2 {
  color: #e2e8f0;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
}

.orders-table tfoot td {
  font-weight: 600;
  border-top: var(--ctrl-border);
}

.summary-facts {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 28px;
  margin-top: 12px;
  overflow-x: auto;
}

.summary-facts .summary-meta,
.summary-facts .metric-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 28px;
  margin-top: 0;
}

.summary-facts .metric {
  min-width: 0;
}

#lines-toolbar .btn-secondary.is-active,
.tranche-view-switch .btn-secondary[aria-pressed="true"] {
  background: color-mix(in srgb, #7eb6ff 24%, transparent);
  border-color: #7eb6ff;
  color: #d7e8ff;
}

#lines-toolbar .btn-secondary.is-active:hover,
.tranche-view-switch .btn-secondary[aria-pressed="true"]:hover {
  background: color-mix(in srgb, #7eb6ff 34%, transparent);
  border-color: #7eb6ff;
  color: #d7e8ff;
}

#lines-toolbar .btn-secondary.is-active:active,
.tranche-view-switch .btn-secondary[aria-pressed="true"]:active {
  background: color-mix(in srgb, #7eb6ff 46%, transparent);
  border-color: #7eb6ff;
  color: #d7e8ff;
}

html[data-theme="gold"] #lines-toolbar .btn-secondary.is-active,
html[data-theme="slate"] #lines-toolbar .btn-secondary.is-active,
html[data-theme="gold"] #lines-toolbar .btn-secondary.is-active:hover,
html[data-theme="slate"] #lines-toolbar .btn-secondary.is-active:hover,
html[data-theme="gold"] #lines-toolbar .btn-secondary.is-active:active,
html[data-theme="slate"] #lines-toolbar .btn-secondary.is-active:active,
html[data-theme="gold"] .tranche-view-switch .btn-secondary[aria-pressed="true"],
html[data-theme="slate"] .tranche-view-switch .btn-secondary[aria-pressed="true"],
html[data-theme="gold"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:hover,
html[data-theme="slate"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:hover,
html[data-theme="gold"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:active,
html[data-theme="slate"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:active {
  border-color: #7eb6ff;
  color: #1f5f9e;
}

html[data-theme="gold"] #lines-toolbar .btn-secondary.is-active,
html[data-theme="slate"] #lines-toolbar .btn-secondary.is-active,
html[data-theme="gold"] .tranche-view-switch .btn-secondary[aria-pressed="true"],
html[data-theme="slate"] .tranche-view-switch .btn-secondary[aria-pressed="true"] {
  background: #e7f2ff;
}

html[data-theme="gold"] #lines-toolbar .btn-secondary.is-active:hover,
html[data-theme="slate"] #lines-toolbar .btn-secondary.is-active:hover,
html[data-theme="gold"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:hover,
html[data-theme="slate"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:hover {
  background: #d6e8fc;
}

html[data-theme="gold"] #lines-toolbar .btn-secondary.is-active:active,
html[data-theme="slate"] #lines-toolbar .btn-secondary.is-active:active,
html[data-theme="gold"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:active,
html[data-theme="slate"] .tranche-view-switch .btn-secondary[aria-pressed="true"]:active {
  background: #c5dff8;
}

table.data.order-detail input.line-actual,
table.data.order-detail input.line-note {
  width: 100%;
  max-width: 100%;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  text-align: left;
  font-family: inherit;
}

.summary-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-id-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.summary-id {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.summary-id-row .status-chip {
  font-size: 13px;
}

#order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.detail-title {
  margin: 0;
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 600;
}

.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-chip,
.cf-tab {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: var(--ctrl-border);
  background: transparent;
  color: var(--ctrl-fg);
  font-size: var(--ctrl-label-fs);
  line-height: 1;
  cursor: pointer;
}

.mode-chip.is-active,
.cf-tab.active {
  background: #3273f6;
  border-color: #3273f6;
  color: #f8fafc;
}

.share-record {
  margin: 0 0 12px;
}

.share-record > summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.share-record > summary::-webkit-details-marker {
  display: none;
}

.share-fold {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex: none;
  color: #cbd5e1;
  transition: transform 0.15s ease;
}

.share-record[open] > summary .share-fold {
  transform: rotate(90deg);
}

.share-mark {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  color: #94a3b8;
}

.share-summary-body {
  flex: 1;
  min-width: 0;
}

.share-summary-body p {
  margin: 0 0 4px;
}

.share-summary .form-actions {
  margin-top: 0;
  flex: none;
}

.share-detail {
  margin-top: 8px;
}

.summary-card,
#order-lines,
#order-attachments {
  max-width: 100%;
  min-width: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: var(--ctrl-border);
  font-size: var(--ctrl-label-fs);
  line-height: 1;
}

.status-chip-draft {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.status-chip-confirmed {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.status-chip-voided {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.status-chip-unknown {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 12px;
}

.summary-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.summary-facts .summary-meta-item .muted {
  font-size: 12px;
  line-height: 1.25;
}

.summary-facts .summary-meta-item .meta-value {
  font-size: calc(var(--ctrl-fs) + 4px);
  line-height: 1.25;
}

.summary-facts .summary-meta-item .meta-value {
  margin: 4px 0 0;
  color: var(--ctrl-fg);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.metric-label {
  color: var(--ctrl-label);
  font-size: var(--ctrl-label-fs);
}

.metric-value {
  margin: 4px 0 0;
  color: var(--ctrl-fg);
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Segoe UI", monospace;
  font-size: calc(var(--ctrl-fs) + 4px);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.metric-value-emphasis {
  font-weight: 700;
  color: var(--heading);
}

.metric-hint {
  margin: 6px 0 0;
  color: var(--warn);
  font-size: var(--ctrl-label-fs);
  font-weight: 600;
}

.metric-unallocated .metric-value {
  color: var(--warn);
  font-weight: 700;
}

.void-reason {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.detail-head {
  margin-bottom: 8px;
}

.detail-head h2 {
  margin-bottom: 4px;
}

.detail-head .muted {
  margin: 0 0 6px;
}

table.data.order-detail {
  table-layout: fixed;
  width: 100%;
}

table.data.order-detail th,
table.data.order-detail td {
  height: 40px;
  padding-top: 4px;
  padding-bottom: 4px;
  vertical-align: middle;
  text-align: left;
}

table.data.order-detail th.num,
table.data.order-detail td.num,
table.data.order-detail td.num input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
}

table.data.order-detail th.seq,
table.data.order-detail td.seq,
table.data.order-detail th.party,
table.data.order-detail td.party {
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
}

table.data.order-detail td.note {
  overflow-wrap: anywhere;
  white-space: normal;
}

table.data.order-detail td.amount-emphasis {
  font-weight: 700;
  color: var(--heading);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

table.data.order-detail th.sticky-party,
table.data.order-detail td.sticky-party {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card-bg);
}

table.data.order-detail thead th.sticky-party {
  z-index: 2;
}

table.data.order-detail .param-col {
  display: none;
}

table.data.order-detail.params-on .param-col {
  display: table-cell;
}

table.data.order-detail-all {
  min-width: 880px;
}

table.data.order-detail-all.params-on {
  min-width: 1280px;
}

table.data.order-detail-selected {
  min-width: 480px;
}

.attach-status {
  min-height: 1.25rem;
  margin: 0 0 8px;
}

.gp-manage table.data.attach-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.gp-manage table.data.attach-table th,
.gp-manage table.data.attach-table td {
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.gp-manage table.data.attach-table th:nth-child(2),
.gp-manage table.data.attach-table td:nth-child(2) {
  width: 6.5rem;
  text-align: right;
  white-space: nowrap;
}

.gp-manage table.data.attach-table th:nth-child(3),
.gp-manage table.data.attach-table td:nth-child(3) {
  width: 8rem;
  text-align: left;
  white-space: nowrap;
}

.gp-manage table.data.attach-table .row-ops {
  justify-content: flex-start;
}

.attach-empty {
  margin: 8px 0 0;
}

.attach-upload {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 8px;
}

.attach-drop {
  flex: 1;
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  border: 1px dashed color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  border-radius: 8px;
  background: transparent;
  color: var(--ctrl-fg);
  cursor: pointer;
}

.attach-drop-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.attach-drop-hint {
  color: var(--ctrl-label);
  font-size: var(--ctrl-fs);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.attach-drop:hover,
.attach-drop:focus {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
  outline: none;
}

.attach-drop.is-drag {
  background: color-mix(in srgb, #7eb6ff 24%, transparent);
  border-color: #7eb6ff;
}

.attach-upload .btn-primary {
  align-self: center;
}

#attach-file {
  display: none;
}

@media (max-width: 720px) {
  .user-bar {
    position: static;
    justify-content: flex-end;
    margin-bottom: 16px;
  }

  .form-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 639px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .summary-top {
    align-items: flex-start;
    flex-direction: column;
  }

  #order-actions {
    justify-content: flex-start;
    width: 100%;
  }
}

.app-content:has(.gp-manage) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px 24px;
  background: var(--page-bg);
}

.app-content:has(.gp-manage) > main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
}

.app-content:has(.gp-manage) .breadcrumb {
  margin: 0 -16px 16px;
  padding: 8px 16px;
  gap: 4px;
  background: var(--card-bg);
  color: var(--ctrl-label);
  font-size: 16px;
  line-height: 1.5;
}

.app-content:has(.gp-manage) .breadcrumb a,
.app-content:has(.gp-manage) .breadcrumb .crumb-sep {
  color: var(--ctrl-label);
}

.app-content:has(.gp-manage) .breadcrumb > span:last-child {
  color: var(--heading);
}

body:has(.gp-manage) {
  height: 100vh;
  overflow: hidden;
}

.app-shell:has(.gp-manage) {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-body:has(.gp-manage) {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.app-body:has(.gp-manage) .app-side {
  position: relative;
  top: 0;
  height: 100%;
  align-self: stretch;
}

.app-content:has(.gp-manage) .breadcrumb {
  flex: none;
}

.gp-manage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gp-manage > #page-status {
  flex: none;
}

.app-content:has(#sub-panel) > main {
  position: relative;
}

.app-content:has(#sub-panel) .gp-manage > #page-status:not(:empty) {
  position: absolute;
  top: -45px;
  left: 8em;
  right: 0;
  z-index: 2;
  height: 32px;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  line-height: 32px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--page-bg);
  pointer-events: none;
}

#sub-panel,
#orders-panel {
  position: relative;
}

#sub-panel > #tranche-status:not(:empty),
#orders-panel > #orders-status:not(:empty) {
  position: absolute;
  top: 0;
  left: 8em;
  right: 9rem;
  z-index: 2;
  height: 32px;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  line-height: 32px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--page-bg);
  pointer-events: none;
}

.app-content:has(.order-workspace) > main {
  position: relative;
}

.app-content:has(.order-workspace) .gp-manage > #page-status:not(:empty) {
  position: absolute;
  top: -45px;
  left: 11em;
  right: 0;
  z-index: 2;
  height: 32px;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  line-height: 32px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--page-bg);
  pointer-events: none;
}

.gp-manage > #page-status:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

.gp-work {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.gp-work-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-top,
html:not([data-theme="gold"]):not([data-theme="slate"]) .app-side,
html:not([data-theme="gold"]):not([data-theme="slate"]) .app-content:has(.gp-manage) .breadcrumb {
  background: #0f172a;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-content:has(.gp-manage),
html:not([data-theme="gold"]):not([data-theme="slate"]) .app-content:has(.gp-manage) > main,
html:not([data-theme="gold"]):not([data-theme="slate"]) .product-rail,
html:not([data-theme="gold"]):not([data-theme="slate"]) .gp-work-main {
  background: var(--page-bg);
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .gp-work-main,
html:not([data-theme="gold"]):not([data-theme="slate"]) .product-rail {
  border-color: rgba(244, 241, 234, 0.16);
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-top {
  border-bottom: 1px solid rgba(244, 241, 234, 0.12);
}

.gp-work-main .panel-head {
  height: 32px;
  margin-bottom: 8px;
}

.gp-work-main .panel-head h2 {
  margin: 0;
}

.gp-work-main .table-wrap {
  margin: 4px 0;
}

.gp-work-main > .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.gp-work-main > #work-hint {
  margin: 0;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .gp-work-main > #work-hint {
  color: #c8b494;
}

.product-rail {
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.product-rail h2,
.product-item {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.product-rail h2,
#sub-panel .panel-head h2,
#orders-panel .panel-head h2 {
  margin: 0 0 4px;
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.product-rail h2 {
  display: flex;
  align-items: center;
  height: 32px;
  margin: 0 0 8px;
}

.product-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ctrl-label);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.product-item.is-current,
.product-item:hover:not(:disabled) {
  color: #c8b494;
  background: rgba(200, 180, 148, 0.12);
}

html[data-theme="gold"] .product-item.is-current,
html[data-theme="gold"] .product-item:hover:not(:disabled) {
  background: #f6de7a;
  color: #6b5208;
}

html[data-theme="slate"] .product-item.is-current,
html[data-theme="slate"] .product-item:hover:not(:disabled) {
  background: #e8f1fb;
  color: #1f5f9e;
}

.product-item:disabled {
  cursor: default;
}

.row-ops {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.op-detail {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.more-trigger {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ctrl-label);
  font: inherit;
  letter-spacing: 1px;
  cursor: pointer;
}

.more-trigger:hover,
.fold-btn:hover,
.more-menu-item:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

.more-trigger:active,
.fold-btn:active,
.more-menu-item:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

.gp-work-main .btn-secondary,
.gp-work-main .op-detail,
.gp-work-main .more-trigger {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
  border-radius: 6px;
  box-shadow: none;
}

.gp-work-main .op-detail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border: 0;
  font-size: 13px;
  line-height: 1;
}

.gp-work-main .more-trigger {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
}

.gp-work-main .btn-secondary:hover,
.gp-work-main .op-detail:hover,
.gp-work-main .more-trigger:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
  color: var(--ctrl-fg);
}

.gp-work-main .btn-secondary:active,
.gp-work-main .op-detail:active,
.gp-work-main .more-trigger:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
  color: var(--ctrl-fg);
}

.gp-work-main .attach-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ctrl-fg);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.gp-work-main .attach-download:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

.gp-work-main .attach-download:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

#order-action-reason-wrap[hidden] {
  display: none;
}

.danger-action {
  color: #f07171;
}

button.danger-action:not([class*="btn-"]):not(.more-menu-item) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

button.danger-action:not([class*="btn-"]):not(.more-menu-item):hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

button.danger-action:not([class*="btn-"]):not(.more-menu-item):active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

.more-menu-panel {
  position: fixed;
  z-index: 30;
  min-width: 148px;
  padding: 6px 0;
  background: var(--card-bg);
  color: var(--ctrl-fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.more-menu-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--ctrl-fg);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.more-menu-item.danger-action,
.more-menu-item.danger-action:hover,
.more-menu-item.danger-action:active {
  color: #f07171;
}

.fold-col {
  width: 36px;
}

.fold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ctrl-label);
  cursor: pointer;
}

.fold-btn .share-fold {
  margin: 0;
  transition: transform 0.15s ease;
}

.fold-btn[aria-expanded="true"] .share-fold {
  transform: rotate(90deg);
}

.tranche-child > td {
  background: transparent;
  padding-top: 0;
}

.nested-wrap {
  margin: 0 0 8px;
}

.tranche-view-switch {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
}

.gp-manage table.data.lp-table {
  table-layout: fixed;
  width: 100%;
}

.gp-manage table.data.lp-table th,
.gp-manage table.data.lp-table td,
.gp-manage table.data.lp-table th.actions,
.gp-manage table.data.lp-table td.actions {
  width: 16.66%;
  text-align: left;
}

.gp-manage table.data.lp-table .row-ops {
  justify-content: flex-start;
}

.detail-dl {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 8px 0 0;
}

.detail-dl dt {
  color: var(--ctrl-label);
}

.detail-dl dd {
  margin: 0;
}

.gp-manage .product-bar {
  padding: 12px 16px;
}

.gp-manage .product-bar-row .field {
  margin-bottom: 0;
  max-width: 320px;
}

.gp-manage .product-bar select {
  width: 100%;
  min-width: 240px;
  max-width: 320px;
}

.gp-manage .form-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gp-manage .form-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.gp-manage table.data.sub-lines,
.gp-manage table.data.gp-calc-table,
.gp-manage table.data.orders-table {
  min-width: 720px;
}

.gp-manage table.data.sub-lines th,
.gp-manage table.data.sub-lines td,
.gp-manage table.data.gp-calc-table th,
.gp-manage table.data.gp-calc-table td {
  height: 44px;
  vertical-align: middle;
}

.gp-manage table.data.orders-table th,
.gp-manage table.data.orders-table td {
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  vertical-align: middle;
}

.gp-manage table.data.orders-table th,
.gp-manage table.data.share-table th {
  font-size: 14px;
  font-weight: 700;
}

.gp-work-main .form-error:empty,
.gp-work-main .status-ok:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

.gp-manage table.data.orders-table th.num,
.gp-manage table.data.orders-table td.num {
  font-family: inherit;
}

.gp-manage table.data.orders-table td.num {
  font-size: 13px;
}

#orders-panel .status-chip {
  height: 22px;
  padding: 0 8px;
  font-size: 13px;
}

#orders-panel .table-wrap,
#sub-panel .table-wrap {
  margin: 0;
}

.gp-manage table.data th.num,
.gp-manage table.data td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Segoe UI", monospace;
}

#lots-dialog table.data th,
#lots-dialog table.data td,
#lots-dialog table.data th.num,
#lots-dialog table.data td.num,
#lots-dialog table.data input,
#lots-dialog table.data select {
  text-align: left;
  font-family: inherit;
}

.gp-manage table.data.share-table {
  table-layout: fixed;
}

.gp-manage table.data.share-table .fold-col {
  width: 36px;
  max-width: 36px;
  padding-left: 4px;
  padding-right: 4px;
}

.gp-manage table.data.share-table th,
.gp-manage table.data.share-table td {
  vertical-align: middle;
}

.gp-manage table.data.share-table thead th {
  height: 32px;
  padding-top: 4px;
  padding-bottom: 4px;
  line-height: 1.4;
}

.gp-manage table.data.share-table > thead > tr > th.sub-no,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.sub-no {
  width: 10rem;
  white-space: nowrap;
}

.gp-manage table.data.share-table > thead > tr > th.sub-type {
  width: 5.5rem;
}

.gp-manage table.data.share-table > thead > tr > th.sub-date {
  width: 7.5rem;
}

.gp-manage table.data.share-table > thead > tr > th.sub-note,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.sub-note {
  width: 13rem;
  white-space: nowrap;
}

.gp-manage table.data.share-table > thead > tr > th,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td,
.gp-manage table.data.share-table > thead > tr > th.actions,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.actions,
.gp-manage table.data.share-table > thead > tr > th.end-date,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.end-date {
  text-align: left;
  font-family: inherit;
}

.gp-manage table.data.share-table > thead > tr > th.num,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gp-manage table.data.share-table > tbody > tr.tranche-row .row-ops {
  justify-content: flex-start;
}

.gp-manage table.data.share-table .lp-table th,
.gp-manage table.data.share-table .lp-table td,
.gp-manage table.data.share-table .lp-table th.actions,
.gp-manage table.data.share-table .lp-table td.actions {
  text-align: left;
}

.gp-manage table.data.share-table .lp-table th:nth-child(2),
.gp-manage table.data.share-table .lp-table td:nth-child(2),
.gp-manage table.data.share-table .lp-table th:nth-child(4),
.gp-manage table.data.share-table .lp-table td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gp-manage table.data.share-table .lp-table .row-ops {
  justify-content: flex-start;
}

.gp-manage table.data th.party,
.gp-manage table.data td.party {
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
}

.gp-manage table.data td.num input,
.gp-manage table.data td.num select {
  text-align: right;
  width: 100%;
  max-width: 180px;
  margin-left: auto;
}

#order-lines {
  position: relative;
}

#order-lines > #lines-status:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

#order-lines > #lines-status:not(:empty) {
  position: absolute;
  top: 16px;
  left: 6em;
  right: 10rem;
  z-index: 2;
  height: 32px;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  line-height: 32px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--page-bg);
  pointer-events: none;
}

.gp-manage table.data.order-detail th,
.gp-manage table.data.order-detail td,
.gp-manage table.data.order-detail td.note input {
  text-align: left;
  font-family: inherit;
}

.gp-manage table.data.order-detail th.num,
.gp-manage table.data.order-detail td.num,
.gp-manage table.data.order-detail td.num input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gp-manage table.data.order-detail td.num input,
.gp-manage table.data.order-detail td.note input {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.gp-manage table.data.sub-lines .line-shares {
  width: 160px;
  max-width: 180px;
}

.gp-manage table.data.sub-lines .line-prio {
  width: 100px;
  max-width: 100px;
}

.gp-manage table.data.sub-lines .line-yield {
  width: 140px;
  max-width: 140px;
}

.gp-manage table.data td.amount-emphasis {
  font-weight: 700;
  color: var(--heading);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.gp-manage table.data th.actions,
.gp-manage table.data td.actions {
  text-align: right;
  white-space: nowrap;
}

.gp-manage table.data.orders-table th.actions,
.gp-manage table.data.orders-table td.actions {
  text-align: left;
}

.gp-manage table.data.orders-table .row-ops {
  justify-content: flex-start;
}

.gp-manage #calc-context:empty,
.gp-manage #calc-freshness:empty {
  display: none;
}

@media (max-width: 1100px) {
  .gp-manage .form-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .gp-manage .product-bar-row .field,
  .gp-manage .product-bar select {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .gp-manage .form-grid-4 {
    grid-template-columns: 1fr;
  }

  .gp-manage .form-actions {
    justify-content: stretch;
  }

  .gp-manage .form-actions .btn-primary,
  .gp-manage .form-actions .btn-secondary {
    width: auto;
  }
}

.sheet-dialog {
  background: var(--card-bg);
  color: var(--ctrl-fg);
  color-scheme: dark;
  border: var(--ctrl-border);
  border-radius: 8px;
  padding: 16px 20px 20px;
  max-width: 920px;
  width: calc(100vw - 32px);
}

html[data-theme="gold"] .sheet-dialog,
html[data-theme="slate"] .sheet-dialog {
  color-scheme: light;
}

.sheet-dialog-wide {
  max-width: min(1280px, calc(100vw - 32px));
}

.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
}

.confirm-dialog .form-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.sheet-dialog .muted {
  color: var(--ctrl-label);
}

.sheet-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.dialog-bar h2,
.sheet-dialog h2 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.timeline-block {
  width: 0;
  min-width: 100%;
  max-width: 100%;
}

.timeline-block[hidden] {
  display: none;
}

.timeline-scroll {
  display: block;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.timeline-scroll::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

.timeline-bar {
  position: relative;
  height: 6px;
  margin-top: 8px;
  background: #3d4a60;
  border-radius: 3px;
  cursor: pointer;
}

.timeline-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  min-width: 28px;
  background: #d5dbe6;
  border-radius: 3px;
}

.timeline-measure {
  width: 100%;
  container-type: inline-size;
}

.gp-manage table.data.timeline-table {
  --date-cols: 21.5rem;
  border-collapse: collapse;
  table-layout: fixed;
  width: calc(var(--date-cols) + var(--lp-count, 1) * (100cqi - var(--date-cols)) / 5);
  min-width: 0;
  max-width: none;
}

.gp-manage table.data.timeline-table thead tr:first-child th:nth-child(1) {
  width: 8.25rem;
}

.gp-manage table.data.timeline-table thead tr:first-child th:nth-child(2) {
  width: 4.75rem;
}

.gp-manage table.data.timeline-table thead tr:first-child th:nth-child(3),
.gp-manage table.data.timeline-table thead tr:first-child th:nth-child(4) {
  width: 4.25rem;
}

.gp-manage table.data.timeline-table th,
.gp-manage table.data.timeline-table td {
  white-space: nowrap;
  text-align: center;
  border: var(--ctrl-border);
  vertical-align: middle;
}

.gp-manage table.data.timeline-table th {
  vertical-align: bottom;
  text-align: center;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ctrl-fg);
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .gp-manage table.data.timeline-table th {
  background: rgba(255, 255, 255, 0.06);
}

.timeline-table .share-up {
  color: #f87171;
}

.timeline-table .share-down {
  color: #4ade80;
}

.timeline-table .yield-cell {
  color: var(--ctrl-fg);
}

.app-shell {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ctrl-fg);
}

.app-top {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  padding: 0 20px;
  background: var(--card-bg);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 15;
}

.app-brand {
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
}

.app-modules,
.app-side {
  display: flex;
  gap: 8px;
}

.app-modules a,
.app-side a {
  color: var(--ctrl-label);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}

.app-modules a[aria-current="page"] {
  color: #c8b494;
  background: rgba(200, 180, 148, 0.12);
}

.app-side a[aria-current="page"] {
  color: #c8b494;
  background: rgba(200, 180, 148, 0.1);
  box-shadow: inset 2px 0 0 #c8b494;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-modules a:hover,
html:not([data-theme="gold"]):not([data-theme="slate"]) .app-side a:hover {
  color: #c8b494;
  background: rgba(200, 180, 148, 0.12);
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-side a:hover {
  box-shadow: inset 2px 0 0 #c8b494;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-modules a:active,
html:not([data-theme="gold"]):not([data-theme="slate"]) .app-side a:active {
  background: rgba(200, 180, 148, 0.2);
}

.app-user #logout-btn {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
  box-shadow: none;
}

.app-user #logout-btn:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
  border-color: color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
}

.app-user #logout-btn:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
  border-color: color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .breadcrumb > span:last-child {
  color: #c8b494;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .product-rail h2,
html:not([data-theme="gold"]):not([data-theme="slate"]) #sub-panel .panel-head h2,
html:not([data-theme="gold"]):not([data-theme="slate"]) #orders-panel .panel-head h2,
html:not([data-theme="gold"]):not([data-theme="slate"]) .order-rail h2,
html:not([data-theme="gold"]):not([data-theme="slate"]) #lines-title,
html:not([data-theme="gold"]):not([data-theme="slate"]) .gp-work-main .panel > h2,
html:not([data-theme="gold"]):not([data-theme="slate"]) .summary-id,
html:not([data-theme="gold"]):not([data-theme="slate"]) .dialog-bar h2,
html:not([data-theme="gold"]):not([data-theme="slate"]) .sheet-dialog h2 {
  color: #c8b494;
}

.app-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-body {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

.app-side {
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--card-bg);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.app-side-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: auto;
}

.app-side a,
.side-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.side-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.side-toggle {
  color: var(--ctrl-label);
  margin-top: auto;
}

.app-shell[data-side="icons"] .app-body {
  grid-template-columns: 64px minmax(0, 1fr);
}

.app-shell[data-side="icons"] .app-side {
  padding: 12px 8px;
  overflow: visible;
  z-index: 5;
}

.app-shell[data-side="icons"] .app-side-links {
  overflow: visible;
}

.app-shell[data-side="icons"] .side-label,
.app-shell[data-side="icons"] .side-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app-shell[data-side="icons"] .app-side a,
.app-shell[data-side="icons"] .side-toggle {
  position: relative;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app-shell[data-side="icons"] .app-side a.side-tip .side-label,
.app-shell[data-side="icons"] .app-side a:focus-visible .side-label,
.app-shell[data-side="icons"] .side-toggle.side-tip .side-toggle-label,
.app-shell[data-side="icons"] .side-toggle:focus-visible .side-toggle-label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  box-sizing: border-box;
  width: max-content;
  min-width: 128px;
  height: auto;
  overflow: visible;
  clip: auto;
  padding: 10px 28px;
  background: var(--card-bg);
  color: #c8b494;
  border: 2px solid rgba(200, 180, 148, 0.55);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
  z-index: 6;
  box-shadow: 0 10px 28px rgba(8, 12, 20, 0.45);
}

html[data-theme="gold"] .app-shell[data-side="icons"] .app-side a.side-tip .side-label,
html[data-theme="gold"] .app-shell[data-side="icons"] .app-side a:focus-visible .side-label,
html[data-theme="gold"] .app-shell[data-side="icons"] .side-toggle.side-tip .side-toggle-label,
html[data-theme="gold"] .app-shell[data-side="icons"] .side-toggle:focus-visible .side-toggle-label {
  color: #6b5208;
  border-color: #e6dcc6;
  box-shadow: 0 8px 24px rgba(107, 82, 8, 0.12);
}

html[data-theme="slate"] .app-shell[data-side="icons"] .app-side a.side-tip .side-label,
html[data-theme="slate"] .app-shell[data-side="icons"] .app-side a:focus-visible .side-label,
html[data-theme="slate"] .app-shell[data-side="icons"] .side-toggle.side-tip .side-toggle-label,
html[data-theme="slate"] .app-shell[data-side="icons"] .side-toggle:focus-visible .side-toggle-label {
  color: #1f5f9e;
  border-color: #d5e0ea;
  box-shadow: 0 8px 24px rgba(31, 95, 158, 0.12);
}

.app-content {
  padding: 20px 24px 48px;
}

.gp-manage > .order-workspace {
  flex: 1;
  min-height: 0;
  align-items: stretch;
  gap: 8px;
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr);
}

.order-workspace > .gp-work-main {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  padding-bottom: 64px;
}

.order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 8px;
  align-items: stretch;
}

.order-rail {
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 0;
  overflow: auto;
}

.order-rail h2 {
  display: flex;
  align-items: center;
  height: 32px;
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .order-rail {
  border-color: rgba(244, 241, 234, 0.16);
}

.gp-work-main table.data.order-detail th.sticky-party,
.gp-work-main table.data.order-detail td.sticky-party {
  background: var(--page-bg);
}

#lines-title,
.gp-work-main .panel > h2 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.gp-work-main .panel > h2 {
  margin-bottom: 8px;
}

.rail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.theme-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
}

.settings-card h2 {
  margin: 0;
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.settings-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  min-width: 0;
}

.settings-options .theme-choice {
  margin: 0;
  color: var(--ctrl-fg);
  font-size: 13px;
  font-weight: 400;
}

.settings-options input[type="radio"] {
  width: 12px;
  height: 12px;
  accent-color: #3273f6;
}

.settings-card .field {
  max-width: 480px;
  margin-bottom: 0;
}

.rsp-pair {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 320px);
  gap: 16px;
  max-width: 856px;
}

.rsp-pair .field {
  max-width: none;
}

.rsp-pair .field input {
  width: 100%;
}

.rsp-paths {
  display: flex;
  flex-direction: column;
  max-width: 856px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.rsp-paths-head,
.rsp-path {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 0 12px;
}

.rsp-paths-head {
  min-height: 32px;
  color: var(--ctrl-label);
  font-size: 12px;
  background: color-mix(in srgb, var(--ctrl-fg) 5%, transparent);
  border-bottom: 1px solid var(--line);
}

.rsp-path {
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.rsp-path:last-child {
  border-bottom: 0;
}

.rsp-path span {
  color: var(--ctrl-fg);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}

.rsp-path input {
  width: 100%;
}

@media (max-width: 800px) {
  .rsp-pair,
  .rsp-paths-head,
  .rsp-path {
    grid-template-columns: minmax(0, 1fr);
  }

  .rsp-paths-head span:last-child {
    display: none;
  }

  .rsp-path {
    gap: 6px;
    padding: 8px 12px;
  }
}

.settings-save {
  justify-content: flex-end;
  margin-top: 12px;
}

html[data-theme="gold"] .grant-batch-warn,
html[data-theme="slate"] .grant-batch-warn {
  color: var(--err);
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .settings-card h2 {
  color: #c8b494;
}

html[data-theme="gold"] {
  --page-bg: #fffdf8;
  --card-bg: #ffffff;
  --ctrl-fg: #2a261f;
  --ctrl-label: #6e6758;
  --ctrl-placeholder: #8a8174;
  --ctrl-bg: #ffffff;
  --ctrl-border: 1px solid #e6dcc6;
  --heading: #2a261f;
  --warn: #b45309;
  --ok: #15803d;
  --err: #b91c1c;
  --accent: #e2b93a;
  --accent-fg: #3a2c08;
  --line: #e6dcc6;
}

html[data-theme="slate"] {
  --page-bg: #f4f6f8;
  --card-bg: #ffffff;
  --ctrl-fg: #1f2933;
  --ctrl-label: #6b7280;
  --ctrl-placeholder: #8b95a1;
  --ctrl-bg: #ffffff;
  --ctrl-border: 1px solid #e6eaee;
  --heading: #1f2933;
  --warn: #c2410c;
  --ok: #15803d;
  --err: #b91c1c;
  --accent: #2f6fb6;
  --accent-fg: #ffffff;
  --line: #e6eaee;
}

html[data-theme="gold"] .app-modules a[aria-current="page"],
html[data-theme="gold"] .app-side a[aria-current="page"],
html[data-theme="gold"] .app-modules a:hover,
html[data-theme="gold"] .app-side a:hover {
  background: #f6de7a;
  color: #6b5208;
  box-shadow: none;
}

html[data-theme="gold"] .app-modules a:active,
html[data-theme="gold"] .app-side a:active {
  background: #efd056;
  color: #6b5208;
  box-shadow: none;
}

html[data-theme="slate"] .app-modules a[aria-current="page"],
html[data-theme="slate"] .app-side a[aria-current="page"],
html[data-theme="slate"] .app-modules a:hover,
html[data-theme="slate"] .app-side a:hover {
  background: #e8f1fb;
  color: #1f5f9e;
  box-shadow: none;
}

html[data-theme="slate"] .app-modules a:active,
html[data-theme="slate"] .app-side a:active {
  background: #d5e6f6;
  color: #1f5f9e;
  box-shadow: none;
}

html[data-theme="gold"] input:focus,
html[data-theme="slate"] input:focus,
html[data-theme="gold"] select:focus,
html[data-theme="slate"] select:focus,
html[data-theme="gold"] textarea:focus,
html[data-theme="slate"] textarea:focus {
  border-color: var(--accent);
  box-shadow: none;
}

body:has(.app-shell) {
  height: 100vh;
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.app-body .app-side {
  position: relative;
  top: 0;
  height: 100%;
  align-self: stretch;
}

.app-content:not(:has(.gp-manage)) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0 16px 24px;
  background: var(--page-bg);
}

.app-content:not(:has(.gp-manage)) > main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 64px;
}

.app-content:not(:has(.gp-manage)) .breadcrumb {
  flex: none;
  margin: 0 -16px 16px;
  padding: 8px 16px;
  gap: 4px;
  background: var(--card-bg);
  color: var(--ctrl-label);
  font-size: 16px;
  line-height: 1.5;
}

.app-content:not(:has(.gp-manage)) .breadcrumb a,
.app-content:not(:has(.gp-manage)) .breadcrumb .crumb-sep {
  color: var(--ctrl-label);
}

.app-content:not(:has(.gp-manage)) .breadcrumb > span:last-child {
  color: var(--heading);
}

.app-content:not(:has(.gp-manage)) .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0 0 16px;
}

.app-content:not(:has(.gp-manage)) .panel h2,
.app-content:not(:has(.gp-manage)) .panel-head h2 {
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 8px;
}

.app-content:not(:has(.gp-manage)) .list-bar {
  justify-content: flex-end;
  align-items: center;
  height: 32px;
  margin-bottom: 8px;
}

.app-content:has(#product-panel),
.app-content:has(#company-panel),
.app-content:has(#party-panel),
.app-content:has(#user-panel),
.app-content:has(#role-panel) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-items: center;
}

.app-content:has(#product-panel) > .breadcrumb,
.app-content:has(#company-panel) > .breadcrumb,
.app-content:has(#party-panel) > .breadcrumb,
.app-content:has(#user-panel) > .breadcrumb,
.app-content:has(#role-panel) > .breadcrumb {
  grid-column: 1 / -1;
  grid-row: 1;
}

.app-content:has(#product-panel) > h1,
.app-content:has(#company-panel) > h1,
.app-content:has(#party-panel) > h1,
.app-content:has(#user-panel) > h1,
.app-content:has(#role-panel) > h1 {
  grid-column: 1;
  grid-row: 2;
  margin: 0 0 8px;
  align-self: center;
}

.app-content:has(#product-panel) > main,
.app-content:has(#company-panel) > main,
.app-content:has(#party-panel) > main,
.app-content:has(#user-panel) > main,
.app-content:has(#role-panel) > main {
  display: contents;
}

.app-content:has(#product-panel) .list-bar,
.app-content:has(#company-panel) .list-bar,
.app-content:has(#party-panel) .list-bar,
.app-content:has(#user-panel) .list-bar,
.app-content:has(#role-panel) .list-bar {
  grid-column: 2;
  grid-row: 2;
  margin: 0 0 8px;
  align-self: center;
}

.app-content:has(#product-panel) > main > #page-status:not(:empty),
.app-content:has(#company-panel) > main > #page-status:not(:empty),
.app-content:has(#party-panel) > main > #page-status:not(:empty),
.app-content:has(#user-panel) > main > #page-status:not(:empty),
.app-content:has(#role-panel) > main > #page-status:not(:empty) {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  justify-self: start;
  z-index: 2;
  height: 32px;
  margin: 0 0 8px 7em;
  min-height: 0;
  max-width: calc(100% - 7em);
  overflow: hidden;
  line-height: 32px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--page-bg);
  pointer-events: none;
}

.app-content:has(#product-panel) > main > #product-panel,
.app-content:has(#company-panel) > main > #company-panel,
.app-content:has(#party-panel) > main > #party-panel,
.app-content:has(#user-panel) > main > #user-panel,
.app-content:has(#role-panel) > main > #role-panel {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: stretch;
  min-height: 0;
  overflow: auto;
  margin: 0;
}

#product-panel .table-wrap,
#company-panel .table-wrap,
#party-panel .table-wrap,
#user-panel .table-wrap,
#role-panel .table-wrap {
  margin: 0;
}

.more-menu-item.menu-with-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.menu-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 1px solid var(--ctrl-label);
  border-radius: 50%;
  color: var(--ctrl-label);
  flex: none;
  cursor: pointer;
}

.menu-info-mark {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.menu-info-pop {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  padding: 6px 10px;
  background: var(--page-bg);
  color: var(--ctrl-fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.menu-info:hover .menu-info-pop,
.menu-info.is-open .menu-info-pop,
.menu-info:focus .menu-info-pop {
  display: block;
}

.app-content:not(:has(.gp-manage)) #page-status:empty,
#create-user-status:empty,
#reset-password-status:empty,
#role-form-status:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

.app-content:not(:has(.gp-manage)) .more-trigger {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ctrl-fg);
  box-shadow: none;
}

.app-content:not(:has(.gp-manage)) table.data th {
  font-size: 14px;
  font-weight: 700;
}

.app-content:not(:has(.gp-manage)) table.data td {
  font-size: 13px;
  font-weight: 400;
}

.app-content:not(:has(.gp-manage)) .btn-secondary,
.app-content:not(:has(.gp-manage)) .btn-ghost,
.app-content:not(:has(.gp-manage)) .btn-danger {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
  box-shadow: none;
}

.app-content:not(:has(.gp-manage)) .btn-secondary:hover,
.app-content:not(:has(.gp-manage)) .btn-ghost:hover,
.app-content:not(:has(.gp-manage)) .btn-danger:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
  color: var(--ctrl-fg);
}

.app-content:not(:has(.gp-manage)) .btn-secondary:active,
.app-content:not(:has(.gp-manage)) .btn-ghost:active,
.app-content:not(:has(.gp-manage)) .btn-danger:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
  color: var(--ctrl-fg);
}

.app-content:not(:has(.gp-manage)) table.data .btn-secondary,
.app-content:not(:has(.gp-manage)) table.data .btn-ghost,
.app-content:not(:has(.gp-manage)) table.data .btn-danger {
  border: 0;
  height: 24px;
  padding: 0 8px;
  font-size: 13px;
}

.app-content .more-menu-item,
.app-content .more-menu-item:hover,
.app-content .more-menu-item:active {
  border: 0;
  height: auto;
  min-height: 0;
  padding: 8px 14px;
  background: transparent;
  box-shadow: none;
  color: var(--ctrl-fg);
  font-size: 13px;
  font-weight: 400;
}

.app-content .more-menu-item:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

.app-content .more-menu-item:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

.app-content .more-menu-item.danger-action,
.app-content .more-menu-item.danger-action:hover,
.app-content .more-menu-item.danger-action:active {
  border: 0;
  color: #f07171;
}

#app-confirm-cancel,
#app-confirm-cancel:hover,
#app-confirm-cancel:active {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
  box-shadow: none;
}

#app-confirm-cancel:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

#app-confirm-cancel:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-content:not(:has(.gp-manage)) .breadcrumb {
  background: #0f172a;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .app-content > h1,
html:not([data-theme="gold"]):not([data-theme="slate"]) .app-content:not(:has(.gp-manage)) .panel h2,
html:not([data-theme="gold"]):not([data-theme="slate"]) .app-content:not(:has(.gp-manage)) .panel-head h2 {
  color: #c8b494;
}

@media (max-width: 800px) {
  body:has(.app-shell) {
    height: auto;
    overflow: auto;
  }

  .app-body,
  .order-workspace,
  .app-shell[data-side="icons"] .app-body,
  .gp-work {
    grid-template-columns: 1fr;
  }

  .app-content:has(.gp-manage),
  .app-content:not(:has(.gp-manage)),
  .app-content:not(:has(.gp-manage)) > main {
    height: auto;
    overflow: visible;
  }

  .gp-work,
  .product-rail,
  .gp-work-main {
    height: auto;
  }

  .app-shell[data-side="icons"] .side-label,
  .app-shell[data-side="icons"] .side-toggle-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
}

.tool-calc {
  --tool-ok: var(--ok);
  --tool-bad: var(--err);
  --tool-warn: #fbbf24;
  color-scheme: dark;
}

html[data-theme="gold"] .tool-calc,
html[data-theme="slate"] .tool-calc {
  --tool-warn: #b45309;
  color-scheme: light;
}

.tool-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.tool-calc .panel {
  flex: none;
  margin: 0;
}

.tool-calc .panel h2 {
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 12px;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .tool-calc .panel h2 {
  color: #c8b494;
}

.tool-tip {
  flex: none;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-tip > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  list-style: none;
  color: var(--ctrl-label);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.tool-tip > summary::-webkit-details-marker {
  display: none;
}

.tool-caret {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--ctrl-label);
}

.tool-caret svg {
  width: 16px;
  height: 16px;
}

.tool-tip[open] > summary .tool-caret,
.tool-calc .panel.collapsible.is-open > h2 .tool-caret {
  transform: rotate(180deg);
}

.tool-tip-body {
  padding: 0 20px 14px;
}

.tool-tip-body,
.tool-note {
  color: var(--ctrl-label);
  font-size: 13px;
  line-height: 1.7;
}

.tool-tip-body strong,
.tool-note strong {
  color: var(--ctrl-fg);
  font-weight: 600;
}

.tool-note {
  margin: 0 0 12px;
}

.tool-calc #guarantee-note {
  margin: 0;
}

.tool-calc .toolbar {
  gap: 8px 12px;
  margin: 0 0 12px;
}

.tool-calc .toolbar > .field.grow {
  flex: 1;
  min-width: 14rem;
  max-width: none;
}

.tool-calc .toolbar select,
.tool-calc .toolbar input[type="text"] {
  min-width: 240px;
}

.tool-calc .file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tool-calc .file-name {
  margin: 0;
  line-height: var(--ctrl-h);
  color: var(--ctrl-label);
  font-size: var(--ctrl-fs);
}

.tool-calc .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.tool-calc .kpi-grid.kpi-rows {
  display: flex;
  flex-direction: column;
}

.tool-calc .kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.tool-calc .kpi {
  background: var(--ctrl-bg);
  border: var(--ctrl-border);
  border-radius: 6px;
  padding: 10px 12px;
}

.tool-calc .kpi .label {
  margin-bottom: 4px;
  color: var(--ctrl-label);
  font-size: var(--ctrl-label-fs);
}

.tool-calc .kpi .value {
  color: var(--ctrl-fg);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tool-calc .kpi.er .value {
  color: var(--tool-ok);
}

.tool-calc .kpi.warn .value {
  color: var(--tool-warn);
}

.tool-calc .kpi.bad .value {
  color: var(--tool-bad);
}

.tool-calc .kpi.ok-border {
  border-color: color-mix(in srgb, var(--tool-ok) 45%, transparent);
}

.tool-calc .kpi.bad-border {
  border-color: color-mix(in srgb, var(--tool-bad) 55%, transparent);
}

.tool-calc .batch-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ctrl-label);
  font-size: 13px;
}

.tool-calc .msg,
.tool-calc .balance {
  margin: 8px 0 0;
  font-size: 13px;
}

.tool-calc .batch-list:empty,
.tool-calc .msg:empty,
.tool-calc .balance:empty {
  display: none;
}

.tool-calc .msg.ok,
.tool-calc .balance.ok {
  color: var(--tool-ok);
}

.tool-calc .msg.err,
.tool-calc .balance.err {
  color: var(--tool-bad);
}

.tool-calc .table-wrap {
  margin: 0 0 8px;
}

.tool-calc .er-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ctrl-fs);
}

.tool-calc .er-table th,
.tool-calc .er-table td {
  padding: 6px 8px;
  border-bottom: var(--ctrl-border);
  text-align: left;
  vertical-align: middle;
}

.tool-calc .er-table th {
  color: var(--ctrl-fg);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.tool-calc .er-table input,
.tool-calc .er-table select {
  width: 100%;
  min-width: 80px;
  box-sizing: border-box;
}

.tool-calc .er-table .col-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tool-calc .er-table .ops {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.tool-calc .er-cf-table {
  font-size: 12px;
}

.tool-calc .er-cf-table tfoot td {
  border-top: 2px solid color-mix(in srgb, var(--ctrl-fg) 25%, transparent);
  color: var(--ctrl-fg);
  font-weight: 700;
}

.tool-calc .er-cf-table .is-est {
  color: var(--tool-warn);
  font-style: italic;
}

.tool-calc .er-cf-table tr.is-est-row td {
  background: color-mix(in srgb, var(--tool-warn) 6%, transparent);
}

.tool-calc .cf-sub {
  color: var(--ctrl-label);
  font-size: 12px;
}

.tool-calc .cf-empty {
  margin: 0;
  color: var(--ctrl-placeholder);
  font-size: 13px;
}

.tool-calc .cf-block-title {
  margin: 16px 0 8px;
  color: var(--ctrl-fg);
  font-size: 14px;
  font-weight: 600;
}

.tool-calc .section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-calc .est-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: var(--ctrl-bg);
  border: var(--ctrl-border);
  border-radius: 6px;
  color: var(--ctrl-fg);
  font-size: 13px;
}

.tool-calc .est-mode > span {
  color: var(--ctrl-label);
  font-weight: 600;
}

.tool-calc .est-mode label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ctrl-fg);
  font-size: 13px;
  cursor: pointer;
}

.tool-calc .est-mode input[type="radio"],
.tool-calc .est-mode input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #3273f6;
}

.tool-calc .est-mode input[type="date"] {
  width: auto;
  min-width: 140px;
}

.tool-calc .cf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tool-calc .cf-pane {
  display: none;
}

.tool-calc .cf-pane.active {
  display: block;
}

.tool-calc .col-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 2px 3px;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 25%, transparent);
  border-radius: 4px;
  background: transparent;
  color: var(--ctrl-label);
  line-height: 0;
  vertical-align: middle;
  cursor: pointer;
}

.tool-calc .col-copy:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
  color: var(--ctrl-fg);
}

.tool-calc .col-copy.copied {
  border-color: var(--tool-ok);
  color: var(--tool-ok);
}

.tool-calc .panel.collapsible > h2.card-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.tool-calc .panel.collapsible.is-open > h2.card-toggle {
  margin-bottom: 12px;
}

.tool-calc .panel.collapsible:not(.is-open) .card-fold {
  display: none;
}

.tool-calc .btn-secondary,
.tool-calc .btn-ghost {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
  box-shadow: none;
}

.tool-calc .btn-secondary:hover,
.tool-calc .btn-ghost:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

.tool-calc .btn-secondary:active,
.tool-calc .btn-ghost:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

.side-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ctrl-label);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.side-caret {
  display: flex;
  margin-left: auto;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.side-caret svg {
  width: 16px;
  height: 16px;
}

.side-group-label[aria-expanded="true"] .side-caret {
  transform: rotate(180deg);
}

.app-shell[data-side="icons"] .side-caret {
  display: none;
}

.side-group.is-collapsed .side-sub {
  display: none;
}

html:not([data-theme="gold"]):not([data-theme="slate"]) .side-group-label:hover {
  color: #c8b494;
  background: rgba(200, 180, 148, 0.12);
}

.side-group-label[aria-current="page"] {
  color: #c8b494;
  background: rgba(200, 180, 148, 0.1);
  box-shadow: inset 2px 0 0 #c8b494;
}

html[data-theme="gold"] .side-group-label:hover,
html[data-theme="gold"] .side-group-label[aria-current="page"] {
  background: #f6de7a;
  color: #6b5208;
  box-shadow: none;
}

html[data-theme="slate"] .side-group-label:hover,
html[data-theme="slate"] .side-group-label[aria-current="page"] {
  background: #e8f1fb;
  color: #1f5f9e;
  box-shadow: none;
}

.app-shell[data-side="icons"] .side-group-label {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.side-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 26px;
}

.side-sub a {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-all;
}

.app-shell[data-side="icons"] .side-group {
  position: relative;
}

.app-shell[data-side="icons"] .side-sub {
  display: none;
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  margin: 0;
  min-width: 280px;
  padding: 8px;
  background: var(--card-bg);
  border: 2px solid rgba(200, 180, 148, 0.55);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(8, 12, 20, 0.45);
  z-index: 6;
}

.app-shell[data-side="icons"] .side-group:hover .side-sub,
.app-shell[data-side="icons"] .side-group:focus-within .side-sub,
.app-shell[data-side="icons"] .side-group.is-collapsed:hover .side-sub,
.app-shell[data-side="icons"] .side-group.is-collapsed:focus-within .side-sub {
  display: flex;
}

.app-shell[data-side="icons"] .side-group:hover > .side-group-label.side-tip .side-label,
.app-shell[data-side="icons"] .side-group:focus-within > .side-group-label.side-tip .side-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  min-width: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.app-shell[data-side="icons"] .side-sub a.side-tip .side-label,
.app-shell[data-side="icons"] .side-sub a:focus-visible .side-label,
.app-shell[data-side="icons"] .side-sub .side-label {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  width: auto;
  min-width: 0;
  height: auto;
  overflow: visible;
  clip: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
}

.snap-view {
  gap: 8px;
}

.app-content:has(.snap-view) > h1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.snap-pulled {
  margin-left: auto;
  color: var(--ctrl-label);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.snap-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.snap-total {
  margin-left: 12px;
  color: var(--ctrl-label);
  font-size: 13px;
  font-weight: 400;
}

.snap-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.snap-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--ctrl-h);
  padding: 0 4px 0 10px;
  border: var(--ctrl-border);
  border-radius: 6px;
  background: var(--ctrl-bg);
}

.snap-filter > span {
  color: var(--ctrl-label);
  font-size: 13px;
  white-space: nowrap;
}

.snap-filter select,
.snap-filter input {
  height: calc(var(--ctrl-h) - 2px);
  min-width: 0;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--ctrl-fg);
  font-size: 13px;
  box-shadow: none;
}

.snap-filter select {
  max-width: 180px;
}

.snap-filter input {
  width: 160px;
}

.snap-filter-range input[type="date"] {
  width: 128px;
  color-scheme: dark;
}

html[data-theme="gold"] .snap-filter-range input[type="date"],
html[data-theme="slate"] .snap-filter-range input[type="date"] {
  color-scheme: light;
}

.snap-filter-range em {
  color: var(--ctrl-label);
  font-size: 13px;
  font-style: normal;
}

.snap-filter select:focus,
.snap-filter input:focus {
  outline: none;
  box-shadow: none;
}

.snap-filter:focus-within {
  border-color: rgba(56, 189, 248, 0.55);
}

.snap-filters .snap-reset {
  text-decoration: none;
}

.snap-pager {
  align-items: center;
}

.snap-toolbar #snap-status {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snap-toolbar #snap-refresh,
.snap-filters .snap-reset,
.snap-pager .btn-secondary {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ctrl-fg) 28%, transparent);
  color: var(--ctrl-fg);
  border-radius: 6px;
  box-shadow: none;
}

.snap-toolbar #snap-refresh:hover,
.snap-filters .snap-reset:hover,
.snap-pager .btn-secondary:hover {
  background: color-mix(in srgb, var(--ctrl-fg) 10%, transparent);
}

.snap-toolbar #snap-refresh:active,
.snap-filters .snap-reset:active,
.snap-pager .btn-secondary:active {
  background: color-mix(in srgb, var(--ctrl-fg) 18%, transparent);
}

.snap-toolbar #snap-refresh:disabled {
  opacity: 0.6;
  cursor: default;
}

.snap-meta {
  margin: 0;
  color: var(--ctrl-label);
  font-size: 13px;
}

.snap-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
}

.snap-scroll table.data {
  min-width: 720px;
}

.snap-scroll table.data th {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  color: var(--ctrl-fg);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.snap-pager {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.snap-pager a {
  text-decoration: none;
}

.snap-empty {
  color: var(--ctrl-label);
}

/* RHMG-087-UI-TUNE */
.settings-readonly {
  display: flex;
  align-items: center;
  min-height: var(--ctrl-h);
  margin: 4px 0 0;
  padding: 0 var(--ctrl-pad-x);
  border: var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  background: var(--ctrl-bg);
  color: var(--ctrl-fg);
  font-size: var(--ctrl-fs);
  line-height: 1.4;
}

.gp-manage #sub-panel .table-wrap {
  overflow-x: auto;
}

.gp-manage table.data.share-table {
  table-layout: auto;
  min-width: 1120px;
  width: max-content;
}

.gp-manage table.data.share-table thead th {
  height: auto;
  padding: 8px 10px;
  white-space: nowrap;
  vertical-align: bottom;
}

.gp-manage table.data.share-table > tbody > tr.tranche-row > td {
  padding: 8px 10px;
  white-space: nowrap;
}

.gp-manage table.data.share-table > thead > tr > th.sub-company,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.sub-company {
  min-width: 8.5rem;
  max-width: 14rem;
  white-space: nowrap;
}

.gp-manage table.data.share-table > thead > tr > th.sub-note,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.sub-note {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-manage table.data.share-table > thead > tr > th.num,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.num,
.gp-manage table.data.share-table > thead > tr > th.end-date,
.gp-manage table.data.share-table > tbody > tr.tranche-row > td.end-date {
  white-space: nowrap;
}

.gp-manage table.data.share-table > tbody > tr.tranche-child > td {
  padding: 12px 12px 16px 48px;
  background: color-mix(in srgb, var(--card-bg) 78%, #000);
  border-bottom: 1px solid var(--line);
}

.gp-manage .tranche-view-switch {
  margin: 0 0 12px;
}

.gp-manage table.data.share-table .nested-wrap {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--page-bg) 55%, transparent);
}

.gp-manage table.data.share-table .lp-table {
  table-layout: auto;
  width: 100%;
  min-width: 640px;
}

.gp-manage table.data.share-table .lp-table th,
.gp-manage table.data.share-table .lp-table td {
  width: auto;
  padding: 8px 10px;
  white-space: nowrap;
}

.gp-manage table.data.timeline-table {
  min-width: 720px;
}

.gp-manage table.data.timeline-table th,
.gp-manage table.data.timeline-table td {
  padding: 8px 12px;
  white-space: nowrap;
}

.timeline-scroll {
  scrollbar-width: thin;
}

.timeline-scroll::-webkit-scrollbar {
  display: block;
  height: 8px;
}

.gp-manage > .order-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.order-workspace > .gp-work-main {
  padding-bottom: 28px;
  scrollbar-gutter: stable;
}

#order-lines > .table-wrap {
  overflow-x: auto;
  padding-bottom: 18px;
  margin-bottom: 8px;
  scrollbar-gutter: stable;
}

#order-lines > .table-wrap::-webkit-scrollbar {
  height: 10px;
}


