* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body.portal-body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-page);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

a {
  color: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  border: var(--control-border-width) solid var(--input-border);
  border-radius: var(--radius-input);
  background: var(--input-bg);
  color: var(--color-text-primary);
  font: inherit;
  padding: 8px var(--control-padding-x);
}

input[type="checkbox"] {
  align-items: center;
  appearance: none;
  background: var(--color-card);
  border: 2px solid var(--input-border);
  border-radius: 4px;
  display: inline-grid;
  flex: 0 0 18px;
  height: 18px;
  justify-content: center;
  margin: 0;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

input[type="checkbox"]::before {
  background: var(--color-text-on-accent);
  clip-path: polygon(14% 44%, 0 59%, 38% 100%, 100% 16%, 84% 0, 36% 66%);
  content: "";
  height: 10px;
  transform: scale(0);
  width: 10px;
}

input[type="checkbox"]:checked {
  background: var(--button-primary-bg);
  border-color: var(--button-primary-bg);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--input-border-hover);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--input-border-focus);
}

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

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  gap: var(--button-gap);
  justify-content: center;
  min-height: var(--button-height);
  padding: 0 var(--button-padding-x);
  position: relative;
  text-decoration: none;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    opacity var(--motion-duration-fast) var(--motion-ease-standard);
}

.button:disabled {
  background: var(--button-disabled-bg);
  border-color: var(--button-disabled-border);
  color: var(--button-disabled-fg);
  cursor: not-allowed;
  opacity: 0.72;
}

.button:active:not(:disabled) {
  filter: brightness(0.94);
}

.button.is-pending::before {
  animation: button-spin 900ms linear infinite;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  height: 1em;
  width: 1em;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button.is-pending::before {
    animation: none;
  }
}

.button-primary {
  background: var(--button-primary-bg);
  color: var(--button-primary-fg);
}

.button-primary:hover {
  background: var(--button-primary-bg-hover);
}

.button-secondary {
  background: var(--button-secondary-bg);
  border-color: var(--button-secondary-border);
  color: var(--button-secondary-fg);
}

.button-secondary:hover {
  background: var(--button-secondary-bg-hover);
  border-color: var(--button-secondary-border-hover);
}

.button-danger {
  background: var(--button-danger-bg);
  color: var(--button-danger-fg);
}

.button-danger:hover {
  background: var(--button-danger-bg-hover);
}

.portal-auth-body {
  background: var(--color-page);
  overflow-x: hidden;
}

.auth-shell {
  --auth-accent-stage-glow: var(--color-accent);
  --auth-accent-stage-glow-faint: var(--color-accent);
  --auth-accent-soft: var(--color-accent);
  --auth-accent-shadow: var(--color-accent);
  --auth-accent-focus-ring: var(--color-accent);
  --auth-accent-chip-bg: rgba(255, 255, 255, 0.05);
  --auth-accent-chip-border: rgba(255, 255, 255, 0.22);
  --auth-accent-progress-end: var(--color-accent);
  --auth-submit-bg: var(--color-accent-strong);
  --auth-submit-bg-hover: var(--color-accent-strong-hover);
  background: var(--color-page);
  display: flex;
  min-height: 100vh;
  width: 100%;
}

@supports (color: color-mix(in srgb, black 50%, white)) {
  .auth-shell {
    --auth-accent-stage-glow: color-mix(in srgb, var(--color-accent) 22%, transparent);
    --auth-accent-stage-glow-faint: color-mix(in srgb, var(--color-accent) 10%, transparent);
    --auth-accent-soft: color-mix(in srgb, var(--color-accent) 70%, transparent);
    --auth-accent-shadow: color-mix(in srgb, var(--color-accent) 35%, transparent);
    --auth-accent-focus-ring: color-mix(in srgb, var(--color-accent) 13%, transparent);
    --auth-accent-chip-bg: color-mix(in srgb, var(--color-accent) 12%, transparent);
    --auth-accent-chip-border: color-mix(in srgb, var(--color-accent) 8%, rgba(255, 255, 255, 0.22));
    --auth-accent-progress-end: color-mix(in srgb, var(--color-accent) 65%, white);
    --auth-submit-bg: color-mix(in srgb, var(--color-accent) 76%, black);
    --auth-submit-bg-hover: color-mix(in srgb, var(--color-accent) 64%, black);
  }
}

.auth-stage,
.auth-form-panel {
  min-width: 0;
}

.auth-stage {
  background: linear-gradient(160deg, var(--color-auth-stage-2) 0%, var(--color-auth-stage) 65%);
  color: var(--color-sidebar-text);
  display: grid;
  flex: 1 1 56%;
  min-height: 100vh;
  overflow: hidden;
  padding: 56px 64px;
  place-items: center;
  position: relative;
}

.auth-stage::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  inset: 0;
  mask-image: radial-gradient(80% 80% at 50% 50%, black 30%, transparent 100%);
  pointer-events: none;
  position: absolute;
}

.auth-stage::after {
  background:
    radial-gradient(1200px 800px at 80% 110%, var(--auth-accent-stage-glow), transparent 60%),
    radial-gradient(900px 600px at -10% -20%, var(--auth-accent-stage-glow-faint), transparent 55%);
  content: "";
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  position: absolute;
}

@supports (color: color-mix(in srgb, black 50%, white)) {
  .auth-stage::after {
    opacity: 1;
  }
}

.auth-hero {
  max-width: 760px;
  position: relative;
  text-align: center;
  width: 100%;
  z-index: 2;
}

.auth-wordmark {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-bottom: 42px;
}

.auth-logo-tile {
  background: var(--color-card);
  border-radius: 13px;
  box-shadow: 0 8px 24px var(--auth-accent-shadow);
  display: grid;
  flex: 0 0 48px;
  height: 48px;
  overflow: hidden;
  place-items: center;
  width: 48px;
}

.auth-logo-tile img {
  height: 40px;
  object-fit: contain;
  width: 40px;
}

.auth-product-name,
.auth-kicker,
.auth-chip,
.auth-fhead,
.auth-rtag,
.auth-pbar-label b,
.auth-form-wrap h1 {
  font-family: var(--font-display);
}

.auth-product-name {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-kicker {
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.auth-headline {
  color: var(--color-sidebar-text);
  font-family: var(--font-display);
  font-size: 70px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0 0 30px;
}

.auth-headline em {
  color: var(--color-accent);
  font-style: normal;
}

.auth-copy {
  color: rgba(255, 255, 255, 0.62);
  font-size: 18px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 52ch;
}

.auth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 42px auto 0;
  max-width: 560px;
}

.auth-chip {
  background: var(--auth-accent-chip-bg);
  border: 1px solid var(--auth-accent-chip-border);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  padding: 10px 18px;
  text-transform: uppercase;
}

.auth-float-layer {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.auth-fcard {
  animation: drift 7s var(--motion-ease-standard) infinite alternate;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color: var(--color-sidebar-text);
  opacity: 0.3;
  padding: 18px;
  position: absolute;
  width: 256px;
}

@supports (backdrop-filter: blur(12px)) {
  .auth-fcard {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

@keyframes drift {
  from {
    transform: translateY(0) rotate(var(--tilt, 0deg));
  }

  to {
    transform: translateY(-12px) rotate(var(--tilt, 0deg));
  }
}

.auth-fcard-myday {
  --tilt: -3deg;
  left: 2%;
  top: 13%;
}

.auth-fcard-raci {
  --tilt: 2.5deg;
  animation-delay: -2.5s;
  right: 2%;
  top: 9%;
}

.auth-fcard-purchase {
  --tilt: 2deg;
  animation-delay: -4s;
  bottom: 9%;
  left: 2.5%;
}

.auth-fcard-project {
  --tilt: -2deg;
  animation-delay: -5.5s;
  bottom: 10%;
  right: 2%;
}

.auth-fhead {
  align-items: center;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  justify-content: space-between;
  letter-spacing: 0;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.auth-fhead i,
.auth-wrow i {
  background: var(--color-accent);
  border-radius: 999px;
  box-shadow: 0 0 10px var(--auth-accent-soft);
  flex: 0 0 auto;
}

.auth-fhead i {
  height: 8px;
  width: 8px;
}

.auth-wrow,
.auth-task,
.auth-rrow {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
}

.auth-wrow,
.auth-task {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 7px 0;
}

.auth-wrow i {
  height: 10px;
  width: 10px;
}

.auth-wrow-dim i {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.auth-wrow time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin-left: auto;
}

.auth-task-box {
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  flex: 0 0 auto;
  height: 20px;
  position: relative;
  width: 20px;
}

.auth-task-done .auth-task-box {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.auth-task-done .auth-task-box::after {
  border: solid var(--color-text-on-accent);
  border-width: 0 2px 2px 0;
  content: "";
  height: 10px;
  left: 6px;
  position: absolute;
  top: 2px;
  transform: rotate(45deg);
  width: 5px;
}

.auth-task-done span:last-child {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: line-through;
}

.auth-rrow {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.auth-rtag {
  border-radius: 7px;
  display: grid;
  font-size: 13px;
  font-weight: 800;
  height: 28px;
  place-items: center;
  width: 28px;
}

.auth-rtag-r {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}

.auth-rtag-a {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-auth-stage);
}

.auth-rtag-c {
  background: rgba(255, 255, 255, 0.18);
  color: var(--color-sidebar-text);
}

.auth-pbar-label {
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  font-size: 15px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.auth-pbar-label b {
  color: var(--color-sidebar-text);
}

.auth-pbar {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.auth-pbar span {
  background: linear-gradient(90deg, var(--color-accent), var(--auth-accent-progress-end));
  border-radius: 999px;
  box-shadow: 0 0 12px var(--auth-accent-soft);
  display: block;
  height: 100%;
  width: 72%;
}

.auth-pmeta {
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
  margin-top: 10px;
}

.auth-form-panel {
  background: var(--color-card);
  display: grid;
  flex: 1 1 44%;
  padding: 48px;
  place-items: center;
}

.auth-form-wrap {
  animation: rise var(--motion-duration-slow) var(--motion-ease-standard) both 100ms;
  max-width: 475px;
  width: 100%;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.auth-tenant {
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  display: inline-flex;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  gap: var(--space-xs);
  line-height: var(--line-height-sm);
  margin-bottom: 40px;
  max-width: 100%;
  padding: 7px 14px;
  text-transform: uppercase;
}

.auth-tenant i {
  background: var(--color-accent);
  border-radius: 999px;
  flex: 0 0 8px;
  height: 8px;
  width: 8px;
}

.auth-tenant span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-form-wrap h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 46px;
  margin: 0 0 10px;
}

.auth-sub {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
  margin: 0 0 42px;
}

.session-expired-notice {
  align-items: center;
  background: var(--color-warning-bg-subtle);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-card);
  color: var(--color-warning-fg);
  display: flex;
  gap: var(--space-sm);
  margin: 0 0 var(--space-lg);
  padding: var(--space-sm);
}

.session-clock-disc {
  align-items: center;
  background: var(--color-card);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.session-clock-disc svg {
  color: var(--color-accent);
  height: 24px;
  width: 24px;
}

.session-expired-notice h2 {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0 0 2px;
}

.session-expired-notice p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 0;
}

@keyframes spinHand {
  to {
    transform: rotate(360deg);
  }
}

.hand-minute {
  animation: spinHand 6s linear infinite;
  transform-origin: 12px 12px;
}

.hand-hour {
  animation: spinHand 72s linear infinite;
  transform-origin: 12px 12px;
}

.auth-form {
  gap: 22px;
}

.auth-field label {
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
  margin-bottom: 8px;
}

.auth-control {
  position: relative;
}

.auth-control input {
  background: var(--color-card);
  border-color: var(--color-border);
  border-radius: 14px;
  color: var(--color-text-primary);
  font-size: var(--font-size-lg);
  height: 60px;
  min-height: 60px;
  padding: 0 18px;
  transition: border-color var(--motion-duration-base) var(--motion-ease-standard),
    box-shadow var(--motion-duration-base) var(--motion-ease-standard);
}

.auth-control input[name="password"] {
  padding-right: 92px;
}

.auth-control input::placeholder {
  color: var(--color-text-disabled);
}

.auth-control input:hover {
  border-color: #C9CCD3;
}

.auth-control input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--auth-accent-focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.auth-password-toggle {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  padding: 10px 12px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  background: var(--color-surface-disabled);
  color: var(--color-text-primary);
}

.auth-options {
  align-items: center;
  display: flex;
  margin: 0 0 4px;
}

.auth-remember {
  align-items: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  gap: 10px;
  line-height: var(--line-height-sm);
}

.auth-remember input {
  flex-basis: 18px;
  height: 18px;
  min-height: 18px;
  width: 18px;
}

.auth-submit {
  background: var(--auth-submit-bg);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: var(--font-size-lg);
  height: 60px;
  min-height: 60px;
  position: relative;
  transition: background var(--motion-duration-base) var(--motion-ease-standard),
    box-shadow var(--motion-duration-base) var(--motion-ease-standard),
    transform var(--motion-duration-base) var(--motion-ease-standard);
  width: 100%;
}

.auth-submit:hover {
  background: var(--auth-submit-bg-hover);
  box-shadow: 0 8px 20px var(--auth-accent-shadow);
  transform: translateY(-1px);
}

.auth-submit:active {
  box-shadow: none;
  transform: none;
}

.auth-submit:disabled,
.auth-submit:disabled:hover {
  background: var(--auth-submit-bg);
  border-color: var(--button-primary-border);
  color: var(--button-primary-fg);
  cursor: wait;
}

.auth-submit[data-loading="true"]::after {
  animation: auth-spin 700ms linear infinite;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  border-top-color: var(--color-text-on-accent);
  content: "";
  height: 18px;
  margin-left: var(--space-xs);
  width: 18px;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-alert {
  align-items: flex-start;
  background: var(--color-danger-bg-subtle);
  border-color: #FECACA;
  border-radius: var(--radius-input);
  color: var(--color-danger-fg);
  display: flex;
  font-size: 13.5px;
  line-height: 20px;
  margin-bottom: 2px;
  padding: 12px 14px;
}

.auth-panel-foot {
  color: var(--color-text-disabled);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin-top: 48px;
  text-align: center;
}

.auth-panel-foot b {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-semibold);
}

.auth-legal {
  color: #C4C8CF;
  display: block;
  font-size: var(--font-size-xs);
  margin-top: 4px;
}

@media (max-width: 1280px) {
  .auth-headline {
    font-size: 56px;
  }

  .auth-copy {
    font-size: 16px;
    max-width: 44ch;
  }

  .auth-chips {
    max-width: 520px;
  }
}

@media (max-width: 1150px) {
  .auth-float-layer {
    display: none;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    flex-direction: column;
  }

  .auth-stage {
    flex-basis: auto;
    min-height: 300px;
    padding: 36px 28px;
    width: 100%;
  }

  .auth-headline {
    font-size: 42px;
  }

  .auth-form-panel {
    flex-basis: auto;
    padding: 40px 24px 56px;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .auth-wordmark {
    margin-bottom: 22px;
  }

  .auth-headline {
    font-size: 36px;
  }

  .auth-copy {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-md);
  }

  .auth-form-wrap {
    max-width: 380px;
  }

  .auth-tenant {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-xs);
    margin-bottom: 28px;
    padding: 6px var(--space-sm);
  }

  .auth-form-wrap h1 {
    font-size: 30px;
    line-height: var(--line-height-xl);
    margin-bottom: var(--space-xs);
  }

  .auth-sub {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-sm);
    margin-bottom: 34px;
  }

  .auth-form {
    gap: 18px;
  }

  .auth-field label,
  .auth-password-toggle {
    font-size: 12.5px;
  }

  .auth-control input {
    border-radius: var(--radius-input);
    font-size: 15px;
    height: 48px;
    min-height: 48px;
    padding: 0 14px;
  }

  .auth-control input[name="password"] {
    padding-right: 76px;
  }

  .auth-remember {
    font-size: 13px;
    gap: var(--space-xs);
  }

  .auth-remember input {
    flex-basis: 15px;
    height: 15px;
    min-height: 15px;
    width: 15px;
  }

  .auth-submit {
    border-radius: var(--radius-button);
    font-size: var(--button-font-size);
    height: 48px;
    min-height: 48px;
  }

  .session-expired-notice {
    align-items: flex-start;
  }
}

.sidebar-brand {
  align-items: center;
  display: flex;
  gap: var(--space-md);
}

.sidebar-brand p,
.topbar p,
.summary-card span,
.panel-header p,
.module-card span,
.field-help {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 0;
}

.product-history-link {
  color: inherit;
  display: inline-grid;
  gap: 2px;
  text-decoration: none;
}

.product-history-link strong {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.product-history-link:hover strong,
.product-history-link:focus-visible strong {
  color: var(--color-accent-strong);
  text-decoration-color: currentColor;
}

.product-history-link:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
}

.daily-refill-product-tags {
  align-items: center;
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.daily-refill-product-tags:empty {
  display: none !important;
}

.daily-refill-product-tags .line-save-status {
  flex-basis: 100%;
}

body.has-product-history-modal {
  overflow: hidden;
}

.product-history-modal-backdrop {
  align-items: center;
  background: rgba(17, 24, 39, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--space-lg);
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.product-history-modal {
  background: var(--color-card);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  max-height: min(760px, calc(100vh - 48px));
  max-width: 980px;
  overflow: hidden;
  width: min(100%, 980px);
  z-index: var(--z-modal);
}

.product-history-modal-body {
  max-height: inherit;
  overflow: auto;
}

.product-history-panel-modal {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.product-history-panel-state {
  min-height: 180px;
}

@media (max-width: 720px) {
  .product-history-modal-backdrop {
    align-items: stretch;
    padding: var(--space-sm);
  }

  .product-history-modal {
    max-height: calc(100vh - 24px);
  }
}

.topbar h1,
.panel-header h2 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-xl);
  margin: 0;
}

.form-stack {
  display: grid;
  gap: var(--space-md);
}

.recurring-schedule-form {
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
}

.form-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

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

.field-wide {
  grid-column: 1 / -1;
}

.form-actions {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
}

.task-create-switch {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.task-create-toolbar {
  display: grid;
  gap: var(--space-sm);
}

.task-create-toolbar .panel-header {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.task-create-option {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-button);
  color: var(--color-text-primary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  gap: var(--space-xs);
  justify-content: center;
  min-height: var(--button-height);
  padding: 0 var(--button-padding-x);
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard),
    opacity var(--motion-duration-fast) var(--motion-ease-standard);
}

.task-create-option:hover {
  background: var(--button-secondary-bg-hover);
  border-color: var(--button-secondary-border-hover);
}

.task-create-option:active {
  filter: brightness(0.94);
}

.task-create-option:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.task-create-option.is-selected {
  background: var(--color-surface);
  border-color: var(--color-border-strong-active);
  color: var(--color-text-primary);
}

.task-create-selected-icon {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  display: none;
  height: 10px;
  transform: rotate(45deg) translateY(-1px);
  width: 6px;
}

.task-create-option.is-selected .task-create-selected-icon {
  display: inline-block;
}

.button-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: flex-end;
}

.button-row form {
  margin: 0;
}

.checkbox-row {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  gap: var(--space-xs);
  min-height: var(--control-height-sm);
  width: fit-content;
}

.form-section {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-md);
  padding-top: var(--space-lg);
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-section-heading h3,
.schedule-preview h3,
.advanced-scheduling legend {
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
  margin: 0;
}

.field-help {
  max-width: 70ch;
}

.field-label {
  color: var(--label-color);
  display: block;
  font-size: var(--label-font-size);
  line-height: var(--label-line-height);
}

.required-indicator,
.conditional-required-indicator {
  color: var(--color-danger-fg);
  font-weight: var(--font-weight-semibold);
}

.form-error-summary {
  background: var(--color-danger-bg-subtle);
  border: 1px solid var(--color-danger-fg);
  border-radius: 8px;
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-md);
}

.form-error-summary:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.form-error-summary h3,
.form-error-summary p {
  margin: 0;
}

.form-error-summary h3 {
  color: var(--color-danger-fg);
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
}

.form-error-summary p,
.form-error-summary li {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.form-error-summary ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.25rem;
}

.form-error-summary a {
  color: var(--color-danger-fg);
}

.task-key-control {
  display: grid;
  gap: var(--space-xs);
  grid-template-columns: minmax(0, 1fr) auto;
}

.task-key-control input[readonly] {
  background: var(--input-disabled-bg);
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}

.inline-edit-button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  color: var(--color-accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  min-height: 44px;
  padding: 0 var(--space-xs);
}

.inline-edit-button:hover,
.inline-edit-button:focus-visible {
  background: var(--button-secondary-bg-hover);
  border-color: var(--button-secondary-border-hover);
}

.inline-edit-button:active {
  filter: brightness(0.94);
}

.weekday-picker {
  border: 0;
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

.weekday-picker legend {
  color: var(--label-color);
  font-size: var(--label-font-size);
  line-height: var(--label-line-height);
  margin-bottom: var(--space-xs);
}

.weekday-hidden-inputs {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.weekday-preset-row,
.weekday-chip-row,
.reminder-chip-row,
.reminder-custom-row,
.reminder-selected-row,
.reminder-selected-list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.weekday-preset,
.weekday-chip,
.reminder-chip,
.selected-reminder-chip {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-text-primary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  gap: var(--space-xs);
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-sm);
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard),
    opacity var(--motion-duration-fast) var(--motion-ease-standard);
}

.weekday-preset:hover,
.weekday-chip:hover,
.reminder-chip:hover,
.selected-reminder-chip:hover,
.advanced-scheduling-toggle:hover {
  background: var(--button-secondary-bg-hover);
  border-color: var(--color-border-strong-hover);
}

.weekday-preset:active,
.weekday-chip:active,
.reminder-chip:active,
.selected-reminder-chip:active,
.advanced-scheduling-toggle:active {
  filter: brightness(0.94);
}

.weekday-chip.is-selected,
.reminder-chip.is-selected,
.selected-reminder-chip {
  background: var(--color-info-bg-subtle);
  border-color: var(--color-info-fg);
  color: var(--color-info-fg);
}

.weekday-preset:focus-visible,
.weekday-chip:focus-visible,
.reminder-chip:focus-visible,
.selected-reminder-chip:focus-visible,
.radio-card input:focus-visible,
.pileup-checkbox-row input:focus-visible,
.task-active-toggle input:focus-visible + .task-active-toggle-visual {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.schedule-preview {
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.schedule-preview-message {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  gap: var(--space-xs);
  margin: 0;
}

.preview-info-icon {
  align-items: center;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  color: var(--color-text-secondary);
  display: inline-flex;
  flex: 0 0 22px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  height: 22px;
  justify-content: center;
  width: 22px;
}

.schedule-preview ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.25rem;
}

.schedule-preview li {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.reminder-builder {
  display: grid;
  gap: var(--space-xs);
}

.reminder-custom-row label,
.pileup-limit-row label {
  margin: 0;
}

.reminder-custom-row input {
  max-width: 140px;
  min-height: 44px;
}

.reminder-selected-row > span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.advanced-scheduling {
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  overflow: hidden;
}

.advanced-scheduling-toggle {
  align-items: center;
  background: var(--color-card);
  border: 0;
  color: var(--color-text-primary);
  cursor: pointer;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: auto minmax(160px, 1fr) auto;
  min-height: 44px;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    opacity var(--motion-duration-fast) var(--motion-ease-standard);
  width: 100%;
}

.advanced-scheduling-toggle:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: -2px;
}

.advanced-scheduling-chevron {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  height: 8px;
  transform: rotate(-45deg);
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  width: 8px;
}

.advanced-scheduling-toggle[aria-expanded="true"] .advanced-scheduling-chevron {
  transform: rotate(45deg);
}

.advanced-scheduling-title {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
}

.advanced-scheduling-summary {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  text-align: right;
}

.advanced-scheduling-body {
  border-top: 1px solid var(--color-border-strong);
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
}

.schedule-fieldset {
  border: 0;
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

.radio-card-grid {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.radio-card {
  align-items: flex-start;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: var(--space-xs);
  min-height: 96px;
  padding: var(--space-sm);
}

.radio-card:hover {
  background: var(--button-secondary-bg-hover);
}

.radio-card:has(input:checked) {
  background: var(--color-info-bg-subtle);
  border-color: var(--color-info-fg);
}

.radio-card input[type="radio"] {
  accent-color: var(--color-info-fg);
  flex: 0 0 18px;
  height: 18px;
  margin: 3px 0 0;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

.radio-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.radio-card strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.radio-card small {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.inline-number input {
  display: inline-block;
  margin: 0 4px;
  max-width: 72px;
  min-height: 44px;
  vertical-align: middle;
}

.radio-card:not(.is-active) .inline-number input {
  background: var(--input-disabled-bg);
  color: var(--color-text-muted);
}

.pileup-checkbox-row {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  min-height: 44px;
}

.pileup-limit-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.pileup-limit-row input {
  max-width: 96px;
  min-height: 44px;
}

.task-active-toggle {
  align-items: center;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-grid;
  gap: var(--space-sm);
  grid-template-columns: auto 1fr;
  min-height: 44px;
  width: fit-content;
}

.task-active-toggle input {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.task-active-toggle-visual {
  background: var(--color-border-strong);
  border-radius: 999px;
  display: inline-flex;
  height: 24px;
  padding: 3px;
  width: 44px;
}

.task-active-toggle-visual::before {
  background: var(--color-card);
  border-radius: 50%;
  content: "";
  height: 18px;
  transform: translateX(0);
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  width: 18px;
}

.task-active-toggle input:checked + .task-active-toggle-visual {
  background: var(--color-success-fg);
}

.task-active-toggle input:checked + .task-active-toggle-visual::before {
  transform: translateX(20px);
}

.task-active-toggle:hover .task-active-toggle-visual {
  filter: brightness(0.94);
}

.task-active-toggle strong,
.task-active-toggle small {
  display: block;
}

.task-active-toggle strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.task-active-toggle small {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  max-width: 70ch;
}

.form-sticky-actions {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  bottom: var(--space-md);
  box-shadow: var(--shadow-card);
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  padding: var(--space-sm);
  position: sticky;
  z-index: 3;
}

.schedule-submit-summary {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  min-width: 0;
}

.schedule-submit-warning {
  align-items: center;
  background: var(--color-warning-bg-subtle);
  border: 1px solid var(--color-warning-fg);
  border-radius: 999px;
  color: var(--color-warning-fg);
  display: inline-flex;
  font-weight: var(--font-weight-semibold);
  gap: 4px;
  padding: 1px 8px;
}

.schedule-submit-warning::before {
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "!";
  display: inline-flex;
  font-size: 10px;
  height: 14px;
  justify-content: center;
  line-height: 12px;
  width: 14px;
}

.scope-badge {
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  min-height: 24px;
  padding: 3px 9px;
  width: fit-content;
}

@media (max-width: 820px) {
  .radio-card-grid {
    grid-template-columns: 1fr;
  }

  .advanced-scheduling-toggle {
    grid-template-columns: auto 1fr;
  }

  .advanced-scheduling-summary {
    grid-column: 2;
    text-align: left;
  }

  .form-sticky-actions {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .form-sticky-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .advanced-scheduling-chevron,
  .task-active-toggle-visual::before {
    transition: none;
  }
}

div.choice-stack {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: grid;
  gap: var(--space-xs);
  max-height: 180px;
  overflow: auto;
  padding: var(--space-sm);
}

div.choice-stack-compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

div.choice-stack > div,
div.choice-stack label {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  gap: var(--space-xs);
  min-height: var(--control-height-sm);
}

.admin-split-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.admin-action-stack {
  display: grid;
  gap: var(--space-md);
}

.action-card,
.module-access-list {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: var(--space-md);
}

.action-card h3,
.module-access-list h3 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
  margin: 0 0 var(--space-sm);
}

.action-card form {
  margin: 0;
}

.module-access-row {
  align-items: center;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-md);
  grid-template-columns: minmax(0, 1fr) 220px;
  padding: var(--space-sm) 0;
}

.module-access-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.module-access-row:last-child {
  padding-bottom: 0;
}

.module-access-toggle {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
  min-width: 0;
}

.module-access-toggle label {
  color: var(--color-text-primary);
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: var(--line-height-sm);
  margin: 0;
}

.module-access-toggle span {
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 2px;
}

.module-access-role select {
  min-height: var(--control-height-sm);
}

.module-access-capabilities {
  border-top: 1px dashed var(--color-border);
  display: grid;
  gap: var(--space-sm);
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(160px, auto));
  padding-top: var(--space-sm);
}

.module-access-capabilities .field {
  margin: 0;
}

.module-access-capabilities .checkbox-row {
  align-self: end;
  min-height: 42px;
}

.field label {
  color: var(--label-color);
  display: block;
  font-size: var(--label-font-size);
  line-height: var(--label-line-height);
  margin-bottom: var(--label-margin-bottom);
}

.field-label-row {
  align-items: center;
  display: inline-flex;
  gap: var(--space-xs);
  margin-bottom: var(--label-margin-bottom);
}

.field-label-row label {
  margin-bottom: 0;
}

.field-error,
.form-alert {
  color: var(--field-error-color);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.field-error {
  margin: 6px 0 0;
}

.form-alert {
  background: var(--color-danger-bg-subtle);
  border: 1px solid var(--field-error-color);
  border-radius: var(--radius-input);
  padding: var(--space-sm);
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
  padding: var(--space-lg);
  position: sticky;
  top: 0;
  z-index: var(--z-sidebar);
}

.sidebar-brand {
  margin-bottom: var(--space-xl);
}

.sidebar-brand p {
  color: var(--color-sidebar-text-muted);
}

.sidebar-nav {
  display: grid;
  gap: var(--space-xs);
}

.sidebar-link {
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-button) var(--radius-button) 0;
  color: var(--color-sidebar-text-muted);
  display: grid;
  gap: 2px;
  min-height: var(--control-height);
  padding: 8px var(--space-sm);
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text);
}

.sidebar-link.is-active {
  border-left-color: var(--color-sidebar-active-border);
}

.sidebar-link small {
  font-size: var(--font-size-xs);
}

.sidebar-section-label {
  color: var(--color-sidebar-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  margin: var(--space-md) 0 var(--space-xs);
  text-transform: uppercase;
}

.main-shell {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: var(--space-md) var(--space-xl);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

.content-shell {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(0, 1fr);
  padding: var(--space-xl);
}

.summary-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card,
.content-panel,
.module-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.summary-card {
  display: grid;
  gap: 4px;
  padding: var(--space-md);
}

.summary-card .metric-label {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
}

.metric-help {
  display: inline-flex;
  flex: 0 0 auto;
  position: relative;
}

.metric-help-trigger {
  align-items: center;
  background: var(--color-info-bg-subtle);
  border: 1px solid color-mix(in srgb, var(--color-info-fg) 24%, transparent);
  border-radius: 999px;
  color: var(--color-info-fg);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  height: 18px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 18px;
}

.metric-help-trigger:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.metric-help-trigger[aria-expanded="true"] {
  background: var(--color-info-fg);
  border-color: var(--color-info-fg);
  color: var(--color-text-on-accent);
}

.metric-help-tooltip {
  background: var(--color-text-primary);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-card);
  color: var(--color-text-on-accent);
  display: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  left: 0;
  line-height: var(--line-height-sm);
  max-width: min(440px, calc(100vw - 48px));
  padding: var(--space-sm);
  position: absolute;
  top: calc(100% + 6px);
  width: max-content;
  white-space: normal;
  z-index: var(--z-dropdown);
}

.summary-card .metric-help-tooltip {
  color: var(--color-text-on-accent);
}

.metric-help.is-open .metric-help-tooltip {
  display: block;
}

.summary-card strong {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
}

.summary-card small {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.content-panel {
  padding: var(--space-lg);
}

body.has-structure-modal {
  overflow: hidden;
}

.structure-add-backdrop {
  background: color-mix(in srgb, var(--color-text-primary) 58%, transparent);
  inset: 0;
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.structure-create-panel {
  max-height: calc(100vh - var(--space-xl) - var(--space-xl));
  max-width: 880px;
  overflow: auto;
  width: min(880px, calc(100vw - var(--space-xl) - var(--space-xl)));
}

.structure-create-panel:not([hidden]) {
  left: 50%;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-modal);
}

.structure-add-status {
  border: 1px solid currentColor;
  border-radius: var(--radius-input);
  display: grid;
  gap: 4px;
  margin-bottom: var(--space-md);
  padding: var(--space-sm);
}

.structure-add-status[hidden] {
  display: none;
}

.structure-add-status strong,
.structure-add-status span {
  display: block;
}

.structure-add-status strong {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.structure-add-status span {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
}

.product-exclusion-table-toolbar {
  align-items: center;
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  margin: var(--space-md) 0 var(--space-sm);
}

.product-exclusion-table-toolbar .table-count {
  margin: 0;
}

.product-exclusion-counts {
  display: grid;
  gap: 2px;
}

.product-exclusion-counts span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.product-exclusion-table-toolbar .button-row {
  flex: 0 0 auto;
}

.product-exclusion-edit-form {
  margin: 0;
}

.product-exclusion-edit-button {
  box-shadow: 0 6px 14px rgba(194, 65, 12, 0.18);
}

.product-exclusion-status-tabs {
  margin: 0;
}

.product-exclusion-toggle {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: var(--space-xs);
  min-height: var(--button-height-sm);
  white-space: nowrap;
}

.product-exclusion-toggle span {
  background: var(--color-surface-disabled);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  padding: 3px var(--space-xs);
}

.product-exclusion-toggle input:checked + span {
  background: var(--color-danger-bg-subtle);
  border-color: var(--color-danger-fg);
  color: var(--color-danger-fg);
}

.product-exclusion-status-pill {
  background: var(--color-surface-disabled);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  padding: 4px var(--space-xs);
  white-space: nowrap;
}

.product-exclusion-status-pill.is-excluded {
  background: var(--color-danger-bg-subtle);
  border-color: var(--color-danger-fg);
  color: var(--color-danger-fg);
}

.product-exclusion-status-pill.is-allowed {
  background: var(--color-success-bg-subtle);
  border-color: var(--color-success-fg);
  color: var(--color-success-fg);
}

.product-exclusion-edit-note,
.product-exclusion-select-filtered-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 0 0 var(--space-sm);
}

.product-exclusion-select-filtered-note {
  color: var(--color-warning-fg);
  font-weight: var(--font-weight-semibold);
}

@media (max-width: 720px) {
  .product-exclusion-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .product-exclusion-table-toolbar .button-row {
    justify-content: flex-start;
  }
}

.module-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.module-card {
  display: grid;
  gap: 6px;
  padding: var(--space-md);
  text-decoration: none;
}

.module-card:hover {
  background: var(--table-row-hover);
  border-color: var(--input-border-hover);
}

.myday-task-list {
  display: grid;
  gap: var(--space-md);
}

.myday-today-panel {
  display: grid;
  gap: var(--space-md);
}

.myday-today-tiles {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.myday-today-tile {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  color: var(--color-text-primary);
  display: flex;
  gap: var(--space-sm);
  justify-content: space-between;
  min-height: 56px;
  padding: 10px var(--space-md);
  text-decoration: none;
}

.myday-today-tile:hover,
.myday-today-tile:focus-visible,
.myday-today-tile.is-active {
  border-color: var(--color-border-strong);
}

.myday-today-tile:focus-visible,
.myday-task-row-link:focus-visible,
.myday-task-row .button:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
}

.myday-today-tile.is-danger {
  background: var(--color-danger-bg-subtle);
}

.myday-today-tile.is-warning {
  background: var(--color-warning-bg-subtle);
}

.myday-today-tile.is-success {
  background: var(--color-success-bg-subtle);
}

.myday-today-tile.is-empty {
  background: var(--color-card);
}

.myday-today-tile span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
}

.myday-today-tile strong {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-xl);
}

.myday-task-sections {
  display: grid;
  gap: var(--space-md);
}

.myday-task-section {
  display: grid;
  gap: var(--space-sm);
}

.myday-task-section > h3 {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  font-size: var(--font-size-sm);
  gap: 8px;
  line-height: var(--line-height-sm);
  margin: 0;
}

.myday-task-section.is-danger > h3 {
  color: var(--color-danger-fg);
}

.myday-task-section.is-warning > h3 {
  color: var(--color-warning-fg);
}

.myday-task-section.is-success > h3 {
  color: var(--color-success-fg);
}

.myday-section-count {
  background: color-mix(in srgb, currentColor 12%, var(--color-card));
  border-radius: 999px;
  border: 1px solid currentColor;
  color: inherit;
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-xs);
  min-width: 24px;
  padding: 0 8px;
  justify-content: center;
}

.myday-task-list.is-compact {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  gap: 0;
  overflow: hidden;
}

.myday-task-row {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 68px;
  padding: 8px 12px 8px 14px;
}

.myday-task-row:last-child {
  border-bottom: 0;
}

.myday-task-row:hover {
  background: var(--table-row-hover);
}

.myday-task-row.is-overdue {
  box-shadow: inset 3px 0 0 var(--color-danger);
}

.myday-task-row-link {
  color: var(--color-text-primary);
  display: grid;
  gap: 2px;
  min-width: 0;
  text-decoration: none;
}

.myday-task-row-link:hover h3 {
  color: var(--color-accent-strong);
}

.myday-task-row .myday-task-title-row {
  flex-wrap: wrap;
  gap: 8px;
}

.myday-task-row .myday-task-title-row h3 {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.myday-task-row-link p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0;
}

.myday-task-action-form {
  margin: 0;
}

.myday-task-card {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: grid;
  gap: var(--space-md);
  grid-template-columns: minmax(0, 1fr) auto;
  padding: var(--space-md);
}

.myday-task-card.is-overdue {
  border-color: var(--color-danger);
}

.myday-task-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.myday-task-main h3,
.myday-task-main p {
  margin: 0;
}

.myday-task-main h3 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
}

.myday-task-main p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.myday-task-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
}

.myday-task-actions form {
  margin: 0;
}

.myday-task-title-row {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
  min-width: 0;
}

.myday-task-title-row h3 {
  min-width: 0;
}

.task-detail-breadcrumb {
  align-items: center;
  color: var(--color-text-primary);
  display: inline-flex;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  gap: 6px;
  text-decoration: none;
}

.task-detail-breadcrumb span {
  color: var(--color-text-secondary);
}

.task-detail-hero {
  display: grid;
  gap: var(--space-md);
}

.task-detail-hero-head {
  align-items: flex-start;
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
}

.task-detail-title-block {
  display: grid;
  flex: 1 1 auto;
  gap: var(--space-xs);
  min-width: 0;
}

.task-detail-title {
  color: var(--color-text-primary);
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  line-height: 32px;
  margin: 0;
  overflow-wrap: anywhere;
}

.task-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: 0;
}

.task-priority-pill.status-pill-critical {
  background: transparent;
  border-color: var(--priority-critical);
  color: var(--priority-critical) !important;
}

.task-priority-pill .icon {
  height: 14px;
  width: 14px;
}

.task-outcome-banner {
  align-items: center;
  border-radius: var(--radius-input);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-size-md);
  gap: 4px;
  padding: var(--space-md);
}

.task-outcome-banner.is-success {
  background: var(--status-done-bg);
  color: var(--status-done);
}

.task-outcome-banner.is-warning {
  background: var(--color-warning-bg-subtle);
  color: var(--color-warning-fg);
}

.task-outcome-banner.is-late {
  background: var(--status-late-bg);
  color: var(--status-late);
}

.task-outcome-banner.is-danger {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg);
}

.task-outcome-banner.is-info,
.task-outcome-banner.is-neutral {
  background: var(--color-info-bg-subtle);
  color: var(--color-info-fg);
}

.task-outcome-banner span {
  font-weight: var(--font-weight-medium);
}

.task-window-line {
  display: grid;
  gap: var(--space-sm);
}

.task-timeline-notice {
  align-items: center;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  gap: var(--space-xs);
  line-height: var(--line-height-sm);
  margin: 0;
  padding: 8px 10px;
  width: fit-content;
}

.task-timeline-notice .icon {
  color: var(--status-late);
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.task-window-track {
  background: var(--color-border);
  border-radius: 999px;
  height: 8px;
  overflow: visible;
  position: relative;
}

.task-window-segment {
  border-radius: inherit;
  display: block;
  height: 100%;
  left: var(--task-segment-left);
  position: absolute;
  top: 0;
  width: var(--task-segment-width);
}

.task-window-segment.is-on-time {
  background: var(--status-done);
}

.task-window-segment.is-late {
  background: var(--status-late);
}

.task-window-point {
  background: var(--color-card);
  border: 3px solid var(--color-card);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  height: 16px;
  left: var(--task-point-position);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
}

.task-window-point::after {
  background: var(--color-border-strong);
  border-radius: inherit;
  content: "";
  inset: 2px;
  position: absolute;
}

.task-window-point.is-done::after {
  background: var(--status-done);
}

.task-window-point.is-late::after,
.task-window-point.is-due::after {
  background: var(--status-late);
}

.task-window-point.is-info::after {
  background: var(--color-info-fg);
}

.task-window-labels {
  list-style: none;
  margin: 0;
  min-height: 96px;
  padding: 0;
  position: relative;
}

.task-window-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  left: var(--task-point-position);
  min-width: 0;
  overflow-wrap: anywhere;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: min(180px, 34vw);
}

.task-window-label.lane-1 {
  top: 48px;
}

.task-window-label.lane-2 {
  top: 72px;
}

.task-window-label.is-start {
  transform: none;
}

.task-window-label.is-end {
  text-align: right;
  transform: translateX(-100%);
}

.task-window-label strong,
.task-window-label span {
  display: block;
}

.task-window-label strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
}

.task-detail-layout {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
}

.task-detail-card,
.task-activity-card {
  align-self: start;
}

.task-detail-card .panel-header h2,
.task-activity-card .panel-header h2 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
}

.task-detail-list {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
}

.task-detail-list > div {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 76px minmax(0, 1fr);
}

.task-detail-list dt {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.task-detail-list dd {
  margin: 0;
  min-width: 0;
}

.task-detail-list .is-muted {
  color: var(--color-text-muted);
}

.task-detail-empty dd {
  color: var(--color-text-secondary);
}

.task-detail-empty.is-muted dd {
  color: var(--color-text-muted);
}

.task-detail-empty.is-warning dd {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
}

.task-detail-empty-line {
  align-items: center;
  display: inline-flex;
  gap: var(--space-xs);
  min-width: 0;
}

.task-detail-empty-line .icon {
  color: var(--status-late);
  flex: 0 0 auto;
  height: 14px;
  width: 14px;
}

.task-person-row {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
}

.task-avatar {
  align-items: center;
  background: var(--color-info-bg-subtle);
  border-radius: 999px;
  color: var(--color-info-fg);
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  height: 28px;
  justify-content: center;
  width: 28px;
}

.task-evidence-list {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-evidence-list li {
  display: grid;
  gap: 2px;
}

.task-evidence-list span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.task-activity-list {
  display: grid;
  gap: var(--space-md);
}

.task-activity-day {
  display: grid;
  gap: var(--space-sm);
  position: relative;
}

.task-activity-day:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-md);
}

.task-activity-day::before {
  background: var(--color-border);
  bottom: 0;
  content: "";
  left: 16px;
  position: absolute;
  top: 44px;
  width: 2px;
}

.task-activity-day h3 {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
  margin: 0;
}

.task-activity-item {
  align-items: flex-start;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 36px minmax(0, 1fr);
  padding: 0 0 var(--space-sm);
  position: relative;
}

.task-activity-item:last-child {
  padding-bottom: 0;
}

.task-activity-person {
  display: inline-flex;
  height: 36px;
  justify-content: center;
  position: relative;
  width: 36px;
  z-index: 1;
}

.task-activity-icon {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-card);
  border-radius: 999px;
  color: var(--color-border-strong);
  display: inline-flex;
  height: 16px;
  justify-content: center;
  position: absolute;
  right: 0;
  top: 18px;
  width: 16px;
}

.task-activity-icon .icon {
  height: 10px;
  width: 10px;
}

.task-activity-item.is-success .task-activity-icon {
  background: var(--status-done-bg);
  border-color: var(--color-card);
  color: var(--status-done);
}

.task-activity-item.is-warning .task-activity-icon {
  background: var(--status-late-bg);
  border-color: var(--color-card);
  color: var(--status-late);
}

.task-activity-item.is-info .task-activity-icon {
  background: var(--color-info-bg-subtle);
  border-color: var(--color-card);
  color: var(--color-info-fg);
}

.task-activity-avatar {
  height: 28px;
  margin-top: 2px;
  width: 28px;
}

.task-activity-item strong {
  display: block;
}

.task-activity-body {
  min-width: 0;
}

.task-activity-item p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 2px 0 0;
}

.task-activity-inline-reason {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.task-activity-item .task-activity-reason {
  background: var(--color-page);
  border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius-input);
  color: var(--color-text);
  margin-top: var(--space-xs);
  padding: 6px 8px;
}

.task-activity-item .task-activity-reason strong {
  display: inline;
}

.task-reopen-form .task-reopen-button {
  min-height: 44px;
}

.task-reopen-form[data-submitting="true"] .task-reopen-button:disabled {
  background: var(--button-secondary-bg);
  border-color: var(--button-secondary-border);
  color: var(--button-secondary-fg);
  opacity: 0.78;
}

.task-reopen-form[data-submitting="true"] .task-reopen-button::before {
  animation: page-loading-spin 800ms linear infinite;
  border: 2px solid currentColor;
  border-radius: 999px;
  border-top-color: transparent;
  content: "";
  height: 14px;
  width: 14px;
}

body.has-task-reopen-modal {
  overflow: hidden;
}

.task-reopen-modal-backdrop {
  align-items: center;
  background: rgba(17, 24, 39, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--space-md);
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.task-reopen-modal {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  display: grid;
  gap: var(--space-md);
  max-width: 460px;
  padding: var(--space-lg);
  width: min(100%, 460px);
  z-index: var(--z-modal);
}

.task-reopen-modal h2,
.task-reopen-modal p {
  margin: 0;
}

.task-reopen-modal h2 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
}

.task-reopen-modal p {
  color: var(--color-text-secondary);
}

@media (min-width: 821px) {
  .task-detail-card {
    position: sticky;
    top: var(--space-md);
  }
}

.team-pill {
  background: var(--color-info-bg-subtle);
  color: var(--color-info-fg) !important;
}

.module-placeholder,
.empty-state {
  color: var(--color-text-secondary);
}

.module-placeholder {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-input);
  display: grid;
  gap: 4px;
  padding: var(--space-lg);
}

.message-stack {
  display: grid;
  gap: var(--space-sm);
}

.flash-modal-stack {
  display: grid;
  gap: var(--space-sm);
  max-width: 420px;
  position: fixed;
  right: var(--space-lg);
  top: var(--space-lg);
  width: min(420px, calc(100vw - var(--space-xl)));
  z-index: var(--z-toast);
}

.flash-modal-stack[hidden] {
  display: none;
}

.page-loading-overlay {
  align-items: center;
  background: rgba(17, 24, 39, 0.34);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--space-lg);
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.page-loading-overlay[hidden] {
  display: none;
}

.page-loading-card {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  display: flex;
  gap: var(--space-md);
  max-width: 360px;
  padding: var(--space-lg);
  width: min(100%, 360px);
  z-index: var(--z-modal);
}

.page-loading-card > span:last-child {
  display: grid;
  gap: 2px;
}

.page-loading-card strong {
  color: var(--color-text-primary);
}

.page-loading-card span span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.page-loading-spinner {
  animation: page-loading-spin 800ms linear infinite;
  border: 3px solid var(--color-border);
  border-radius: 999px;
  border-top-color: var(--button-primary-bg);
  flex: 0 0 32px;
  height: 32px;
  width: 32px;
}

@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.flash-modal {
  border: 1px solid currentColor;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  display: grid;
  gap: 4px;
  padding: var(--space-md);
}

.flash-modal strong,
.flash-modal span {
  display: block;
}

.flash-modal strong {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.flash-modal span {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.status-message {
  border-radius: var(--radius-input);
  padding: var(--space-sm);
}

.status-success {
  background: var(--color-success-bg-subtle);
  color: var(--color-success-fg);
}

.status-info {
  background: var(--color-info-bg-subtle);
  color: var(--color-info-fg);
}

.status-error {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg);
}

.status-warning {
  background: var(--color-warning-bg-subtle);
  color: var(--color-warning-fg);
}

.confirm-modal-backdrop {
  align-items: center;
  background: color-mix(in srgb, var(--color-text-primary) 58%, transparent);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--space-lg);
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.confirm-modal {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  display: grid;
  gap: var(--space-md);
  max-width: 420px;
  padding: var(--space-lg);
  width: min(420px, 100%);
  z-index: var(--z-modal);
}

.confirm-modal h2 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
  margin: 0;
}

.confirm-modal p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0;
}

.confirm-modal-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .flash-modal-stack {
    left: var(--space-sm);
    right: var(--space-sm);
    top: var(--space-sm);
    width: auto;
  }

  .confirm-modal-backdrop {
    padding: var(--space-sm);
  }

  .structure-create-panel {
    max-height: calc(100vh - var(--space-md) - var(--space-md));
    width: calc(100vw - var(--space-md) - var(--space-md));
  }
}

.purchase-actions {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  padding: var(--space-lg);
}

.purchase-actions h2 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-xl);
  margin: 0;
}

.source-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.source-warning {
  background: var(--color-warning-bg-subtle);
  border: 1px solid var(--color-warning-fg);
  border-radius: var(--radius-input);
  color: var(--color-warning-fg) !important;
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  margin-top: var(--space-xs) !important;
  padding: 6px 10px;
}

.purchase-actions p,
.eyebrow {
  color: var(--color-text-muted);
  margin: 0;
}

.module-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.module-tab {
  align-items: center;
  border-bottom: 3px solid transparent;
  color: var(--color-text-secondary);
  display: inline-flex;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
}

.module-tab:hover,
.module-tab.is-active {
  color: var(--color-text-primary);
}

.module-tab.is-active {
  border-bottom-color: var(--color-accent-strong);
  font-weight: var(--font-weight-semibold);
}

.module-tab-setup {
  margin-left: auto;
}

.module-tab-badge {
  align-items: center;
  background: var(--color-accent-soft);
  border-radius: 999px;
  color: var(--color-accent-strong);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  justify-content: center;
  min-width: 1.35rem;
  padding: 1px 6px;
}

.run-view-tabs {
  align-items: center;
  background: var(--table-header-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.view-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  min-height: 34px;
  padding: 0 12px;
}

a.view-tab {
  align-items: center;
  display: inline-flex;
  text-decoration: none;
}

.view-tab:hover,
.view-tab.is-active {
  background: var(--color-card);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

.filter-bar {
  align-items: end;
  background: var(--table-header-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: grid;
  gap: var(--space-md);
  grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  margin-bottom: var(--space-md);
  padding: var(--space-md);
}

.supplier-run-filter-bar {
  align-items: end;
}

.product-detail-filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.product-detail-filter-bar .field:first-of-type {
  min-width: min(260px, 100%);
}

.product-exclusion-filter-bar {
  gap: var(--space-sm);
  grid-template-columns:
    minmax(260px, 1.8fr)
    minmax(160px, 1fr)
    minmax(160px, 1fr)
    minmax(130px, 0.75fr)
    auto;
}

.product-exclusion-filter-bar .filter-action-group {
  flex-wrap: nowrap;
}

.urgent-draft-filter-bar {
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
}

.urgent-draft-saved-suppliers {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.urgent-draft-saved-header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: space-between;
}

.urgent-draft-saved-header h3 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
  margin: 0;
}

.urgent-draft-saved-header span {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.urgent-draft-saved-table .is-selected td {
  background: var(--table-row-selected);
}

.urgent-draft-save-actions {
  justify-content: flex-end;
}

.filter-action-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.daily-refill-pick-filter-bar {
  gap: var(--space-sm);
  grid-template-columns:
    minmax(150px, 1.1fr)
    minmax(145px, 1fr)
    minmax(145px, 1fr)
    minmax(145px, 1fr)
    minmax(120px, 0.8fr);
}

.daily-refill-refill-filter-bar {
  gap: var(--space-sm);
  grid-template-columns:
    minmax(145px, 1fr)
    minmax(140px, 1fr)
    minmax(140px, 1fr)
    minmax(120px, 0.8fr)
    minmax(190px, 1.4fr)
    auto;
}

.manager-review-panel-header {
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.manager-review-panel-copy {
  display: grid;
  flex: 1 1 420px;
  gap: 4px;
  min-width: 280px;
}

.manager-review-control-row {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-bottom: var(--space-md);
}

.manager-review-excel-actions {
  align-items: center;
  background: var(--table-header-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-start;
  min-height: 0;
  padding: var(--space-sm);
}

.manager-review-import-form {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-xs);
  margin: 0;
}

.manager-review-import-form label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  white-space: nowrap;
}

.manager-review-import-form input[type="file"] {
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-input);
  font-size: var(--font-size-xs);
  min-height: 34px;
  padding: 6px;
  width: min(240px, 26vw);
}

.manager-review-history-link {
  white-space: nowrap;
}

.manager-review-import-notice {
  display: grid;
  gap: 3px;
  margin-bottom: var(--space-md);
}

.manager-review-import-notice strong,
.manager-review-import-notice span,
.manager-review-import-notice small {
  display: block;
}

@media (max-width: 920px) {
  .manager-review-control-row,
  .manager-review-excel-actions,
  .manager-review-import-form {
    flex-wrap: wrap;
  }

  .manager-review-import-form input[type="file"] {
    width: 100%;
  }
}

.table-column-heading,
.table-column-help {
  display: block;
}

.table-column-help-stack {
  display: inline-grid;
  gap: 2px;
  justify-items: start;
  line-height: var(--line-height-xs);
}

.numeric-heading .table-column-help-stack {
  justify-items: end;
}

.table-column-help {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-xs);
  margin-top: 2px;
}

.purchase-column-help-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--table-header-text);
  cursor: help;
  display: inline-flex;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  justify-content: inherit;
  line-height: var(--line-height-xs);
  margin: -8px 0 -6px;
  min-height: 32px;
  padding: 8px 0 6px;
  text-align: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.purchase-column-help-trigger:hover {
  color: var(--color-text-primary);
}

.purchase-column-help-trigger:focus-visible {
  border-radius: var(--radius-input);
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.table-header-with-info {
  align-items: flex-start;
  display: inline-flex;
  gap: 4px;
}

.threshold-info-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--color-accent-strong);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0;
  font-weight: var(--font-weight-semibold);
  height: 44px;
  justify-content: center;
  line-height: 1;
  margin: -11px;
  padding: 0;
  position: relative;
  width: 44px;
}

.threshold-info-button::before {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--color-text-muted);
  content: "i";
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  height: 20px;
  justify-content: center;
  left: 50%;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
}

.threshold-info-button:hover {
  color: var(--color-accent-strong-hover);
}

.threshold-info-button:hover::before {
  background: #FFF7ED;
  border-color: var(--color-accent-strong-hover);
  color: var(--color-accent-strong-hover);
}

.threshold-info-button:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.threshold-info-button[aria-expanded="true"]::before {
  background: #FFF7ED;
  border-color: var(--color-accent-strong);
  color: var(--color-accent-strong);
}

.quantity-help-popover {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-modal);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  left: 0;
  line-height: var(--line-height-xs);
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  position: fixed;
  top: 0;
  z-index: var(--z-modal-popover);
}

.quantity-help-popover::before {
  background: var(--color-card);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  content: "";
  height: 10px;
  left: var(--popover-arrow-left, 50%);
  position: absolute;
  top: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
}

.quantity-help-popover.is-above::before {
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  bottom: -6px;
  top: auto;
}

.quantity-help-popover strong,
.quantity-help-popover span {
  display: block;
}

.quantity-help-popover strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin-bottom: 2px;
}

.quantity-help-popover span + span {
  margin-top: 4px;
}

.purchase-help-popover {
  display: grid;
  gap: 6px;
}

.purchase-help-popover[hidden] {
  display: none;
}

.purchase-help-popover-link,
.purchase-help-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--color-accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  padding: 0;
  text-decoration-line: underline;
  text-underline-offset: 3px;
}

.purchase-help-popover-link {
  justify-self: start;
  margin-top: 2px;
}

.purchase-help-popover-link:hover,
.purchase-help-link:hover {
  color: var(--color-accent-strong-hover);
}

.purchase-help-popover-link:focus-visible,
.purchase-help-link:focus-visible {
  border-radius: var(--radius-input);
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.purchase-tag-chip {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

.purchase-tag-chip-row {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  max-width: 100%;
}

.purchase-tag-chip-row .purchase-tag-chip {
  max-width: 180px;
  white-space: nowrap;
}

.purchase-tag-more-chip {
  max-width: 64px;
}

.purchase-status-tag {
  align-items: center;
  background: var(--color-info-bg-subtle);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--color-info-fg) !important;
  display: inline-flex !important;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  max-width: 180px;
  min-height: 24px;
  overflow: hidden;
  padding: 2px 6px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.purchase-status-tag-success {
  background: var(--color-success-bg-subtle);
  color: var(--color-success-fg) !important;
}

.purchase-status-tag-warning {
  background: var(--color-warning-bg-subtle);
  color: var(--color-warning-fg) !important;
}

.purchase-status-tag-danger {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg) !important;
}

.purchase-status-tag-neutral {
  background: var(--color-surface-disabled);
  color: var(--color-text-secondary) !important;
}

.purchase-tag-chip:hover {
  border-color: currentColor;
}

.purchase-tag-chip:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.purchase-help-drawer-shell {
  align-items: stretch;
  background: color-mix(in srgb, var(--color-sidebar) 22%, transparent);
  display: flex;
  inset: 0;
  justify-content: flex-end;
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.purchase-help-drawer-shell[hidden] {
  display: none;
}

.purchase-help-drawer {
  background: var(--color-card);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-modal);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  max-width: calc(100vw - var(--space-xl));
  min-width: 360px;
  width: 420px;
}

.purchase-help-drawer:focus {
  outline: 0;
}

.purchase-help-drawer-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  padding: var(--space-lg);
}

.purchase-help-drawer-header h2,
.purchase-help-drawer-header p,
.purchase-help-drawer-body p,
.purchase-help-tag-group h3 {
  margin: 0;
}

.purchase-help-drawer-header h2 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
}

.purchase-help-drawer-header p,
.purchase-help-drawer-body > p,
.purchase-help-settings {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.purchase-help-drawer-body {
  display: grid;
  gap: var(--space-md);
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-lg);
}

.purchase-help-settings {
  background: var(--table-header-bg);
  border-left: 3px solid var(--color-info);
  padding: var(--space-sm);
}

.purchase-help-tag-group {
  display: grid;
  gap: var(--space-xs);
}

.purchase-help-tag-group h3 {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.purchase-help-tag-list {
  display: grid;
  gap: 6px;
}

.purchase-help-tag-row {
  align-items: start;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-xs);
  grid-template-columns: max-content minmax(0, 1fr);
  padding-top: 6px;
}

.purchase-help-tag-row p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.numeric-heading,
.numeric-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.numeric-cell {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.quantity-total-cell strong {
  color: var(--color-text-primary);
  display: block;
  font-weight: var(--font-weight-semibold);
}

.quantity-breakdown {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.supplier-run-summary {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0 0 var(--space-sm);
}

.supplier-run-summary strong {
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

.purchase-run-results-shell {
  min-width: 0;
}

.run-results-region {
  position: relative;
}

.run-results-region.is-loading .data-table-wrap,
.run-results-region.is-loading .product-list-toolbar,
.run-results-region.is-loading .transfer-table-toolbar,
.run-results-region.is-loading .redistribution-summary-grid,
.run-results-region.is-loading .redistribution-product-heading,
.run-results-region.is-loading .redistribution-band,
.run-results-region.is-loading .redistribution-basket-bar,
.run-results-region.is-loading .chip-row,
.run-results-region.is-loading .purchase-run-pagination,
.run-results-region.is-loading .purchase-supplier-pagination {
  opacity: 0.48;
}

.run-region-loading {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-card);
  color: var(--color-text-primary);
  display: flex;
  font-size: var(--font-size-sm);
  font-weight: 700;
  gap: var(--space-sm);
  left: 50%;
  padding: var(--space-sm) var(--space-md);
  position: absolute;
  top: var(--space-xl);
  transform: translateX(-50%);
  z-index: 2;
}

.run-region-loading::before {
  animation: spinner-rotate 0.8s linear infinite;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-accent);
  border-radius: 999px;
  content: "";
  height: 16px;
  width: 16px;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.run-region-error,
.supplier-detail-status {
  align-items: center;
  background: var(--color-danger-bg-subtle);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-input);
  color: var(--color-danger-fg);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
  gap: var(--space-sm);
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

.supplier-detail-status {
  background: var(--color-card);
  color: var(--color-text-primary);
  margin: 0;
}

.supplier-detail-error-row .supplier-detail-status {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg);
}

.daily-refill-pagination,
.purchase-run-pagination,
.purchase-supplier-pagination {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: space-between;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
}

.daily-refill-pagination > span,
.purchase-run-pagination > span,
.purchase-supplier-pagination > span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.daily-refill-pagination-actions,
.purchase-run-pagination-actions,
.purchase-supplier-pagination-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.purchase-run-pagination-actions {
  gap: var(--space-xs);
}

.daily-refill-page-label,
.purchase-run-page-label,
.purchase-supplier-page-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  line-height: var(--line-height-sm);
}

.purchase-run-page-numbers {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.purchase-run-page-number,
.purchase-run-page-gap {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  height: 2.125rem;
  justify-content: center;
  line-height: 1;
  min-width: 2.125rem;
  padding: 0 0.65rem;
}

.purchase-run-page-number {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.purchase-run-page-number:hover,
.purchase-run-page-number:focus-visible {
  border-color: var(--color-accent-strong);
  color: var(--color-accent-strong);
}

.purchase-run-page-number:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.purchase-run-page-number.is-current {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: var(--button-primary-fg);
  font-weight: var(--font-weight-bold);
}

.purchase-run-page-number.is-current:hover,
.purchase-run-page-number.is-current:focus-visible {
  color: var(--button-primary-fg);
}

.purchase-run-page-gap {
  color: var(--color-text-muted);
}

.outlet-coordination-table {
  min-width: 1120px;
}

.outlet-coordinate-input {
  min-width: 110px;
}

.outlet-coordination-table td:first-child {
  min-width: 220px;
}

.transfer-suggestions-table td {
  vertical-align: top;
}

.transfer-table-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  margin: var(--space-md) 0;
}

.transfer-table-toolbar .supplier-run-summary {
  margin: 0;
}

.transfer-summary-row.is-expanded td {
  background: var(--table-row-selected);
}

.transfer-detail-row > td {
  background: var(--table-row-hover);
  padding: 0;
}

.transfer-drilldown-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.transfer-drilldown-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(420px, 1.5fr) minmax(360px, 1fr);
}

.transfer-drilldown-grid h3 {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0 0 var(--space-sm);
}

.transfer-source-list {
  display: grid;
  gap: 0.75rem;
}

.transfer-source-item {
  display: grid;
  gap: 0.2rem;
}

.transfer-source-item-compact {
  gap: 0.15rem;
}

.transfer-source-item > span:not(.status-pill),
.transfer-source-divider,
.empty-state-inline {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.transfer-source-divider {
  border-top: 1px solid var(--color-border);
  padding-top: 0.55rem;
}

.redistribution-view-tabs {
  margin-bottom: var(--space-lg);
}

.redistribution-filter-bar {
  align-items: end;
}

.redistribution-outlet-filter-bar {
  gap: var(--space-sm);
  grid-template-columns:
    minmax(260px, 1.6fr)
    minmax(120px, 0.65fr)
    minmax(145px, 0.8fr)
    minmax(155px, 0.85fr)
    minmax(165px, 0.9fr)
    minmax(170px, 0.9fr)
    auto;
}

.redistribution-outlet-filter-bar .field {
  min-width: 0;
}

.redistribution-outlet-filter-bar .filter-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-xs);
}

.redistribution-summary-grid {
  margin-top: var(--space-lg);
}

.summary-card-link {
  color: inherit;
  text-decoration: none;
}

.summary-card-link:hover,
.summary-card-link:focus-visible,
.summary-card-link.is-active {
  border-color: var(--color-accent-strong);
  box-shadow: var(--focus-ring);
  outline: none;
}

.summary-card-help-wrap {
  display: block;
  min-width: 0;
  position: relative;
}

.summary-card-help-wrap > .summary-card {
  height: 100%;
  padding-right: calc(var(--space-md) + 28px);
}

.summary-card-overlay-help {
  position: absolute;
  right: var(--space-md);
  top: var(--space-md);
}

.summary-card-overlay-help .metric-help-tooltip {
  left: auto;
  right: 0;
}

.chip-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.chip-row a {
  text-decoration: none;
}

.redistribution-table td {
  vertical-align: top;
}

.redistribution-summary-row.is-expanded td,
.redistribution-detail-row > td {
  background: var(--table-row-selected);
}

.redistribution-detail-row > td {
  padding: 0;
}

.status-band-out_of_stock td {
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.status-band-short td,
.status-band-slow td,
.status-band-dead td {
  box-shadow: inset 4px 0 0 var(--color-warning);
}

.status-band-healthy td {
  box-shadow: inset 4px 0 0 var(--color-success);
}

.status-band-no_buyer td {
  box-shadow: inset 4px 0 0 var(--color-danger);
}

.redistribution-move-form {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-xs);
}

.redistribution-qty-input {
  max-width: 84px;
  min-width: 72px;
}

.redistribution-no-buyer-actions,
.redistribution-route-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.redistribution-basket-bar {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  bottom: var(--space-md);
  box-shadow: var(--shadow-md);
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  position: sticky;
  z-index: var(--z-grid-sticky);
}

.redistribution-basket-bar div,
.redistribution-product-heading div {
  display: grid;
  gap: var(--space-2xs);
}

.redistribution-basket-bar span,
.redistribution-product-heading span,
.redistribution-basket-bar small,
.redistribution-product-heading small {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.redistribution-basket-bar strong,
.redistribution-product-heading strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
}

.redistribution-product-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  margin: var(--space-lg) 0 var(--space-md);
}

.redistribution-band {
  margin-top: var(--space-lg);
}

.redistribution-band h3,
.redistribution-detail-row h3 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
  margin: 0 0 var(--space-sm);
}

@media (max-width: 1100px) {
  .transfer-drilldown-grid {
    grid-template-columns: 1fr;
  }

  .redistribution-basket-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

.button.is-disabled {
  background: var(--button-disabled-bg);
  border-color: var(--button-disabled-border);
  color: var(--button-disabled-fg);
  cursor: not-allowed;
  pointer-events: none;
}

.purchase-action-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
}

.purchase-action-buttons form {
  margin: 0;
}

.eyebrow {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.data-table-wrap {
  overflow-x: auto;
}

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

.data-table th {
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--table-header-border);
  color: var(--table-header-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  padding: var(--space-sm);
  position: sticky;
  text-align: left;
  top: 0;
  z-index: var(--z-grid-sticky);
}

.sort-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: inherit;
  gap: 6px;
  min-height: 28px;
  margin: -3px -6px;
  padding: 3px 6px;
  text-align: left;
  text-decoration: none;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard);
}

.sort-button::after {
  border-color: currentColor;
  border-style: solid;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  height: 6px;
  opacity: 0;
  transform: rotate(45deg) translateY(-1px);
  transition: opacity var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard);
  width: 6px;
}

.sort-button:hover,
.sort-button:focus-visible {
  background: var(--color-card);
  color: var(--color-text-primary);
}

.sort-button:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
}

.data-table th:hover .sort-button::after,
.sort-button:focus-visible::after {
  opacity: 0.45;
}

.data-table th[aria-sort] {
  background: #FFF7ED;
  box-shadow: inset 0 -2px 0 var(--color-accent-strong);
  color: var(--color-text-primary);
}

.data-table th[aria-sort="ascending"] .sort-button::after {
  color: var(--color-accent-strong);
  opacity: 1;
  transform: rotate(225deg) translate(-1px, -1px);
}

.data-table th[aria-sort="descending"] .sort-button::after {
  color: var(--color-accent-strong);
  opacity: 1;
}

@supports (color: color-mix(in srgb, black 50%, white)) {
  .data-table th[aria-sort] {
    background: color-mix(in srgb, var(--color-accent) 10%, var(--table-header-bg));
  }
}

.data-table td {
  border-bottom: 1px solid var(--color-border);
  min-height: var(--table-row-height);
  padding: var(--space-sm);
  vertical-align: top;
}

.data-table tr:hover td {
  background: var(--table-row-hover);
}

.data-table td span {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.status-pill {
  align-items: center;
  background: var(--color-info-bg-subtle);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--color-info-fg) !important;
  display: inline-flex !important;
  gap: 4px;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
  padding: 2px 8px;
}

.status-pill-success {
  background: var(--status-done-bg);
  color: var(--status-done) !important;
}

.status-pill-info {
  background: var(--color-info-bg-subtle);
  color: var(--color-info-fg) !important;
}

.status-pill-warning {
  background: var(--color-warning-bg-subtle);
  color: var(--color-warning-fg) !important;
}

.status-pill-late {
  background: var(--status-late-bg);
  color: var(--status-late) !important;
}

.status-pill-danger {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg) !important;
}

.status-pill-running,
.status-pill-queued {
  background: var(--color-info-bg-subtle);
  color: var(--color-info-fg) !important;
}

.status-pill-failed,
.status-pill-cancelled {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg) !important;
}

.status-pill-draft,
.status-pill-finalised {
  background: var(--color-warning-bg-subtle);
  color: var(--color-warning-fg) !important;
}

.status-pill-exported {
  background: var(--status-done-bg);
  color: var(--status-done) !important;
}

.status-pill-approved {
  background: var(--status-done-bg);
  color: var(--status-done) !important;
}

.status-pill-pending {
  background: var(--color-warning-bg-subtle);
  color: var(--color-warning-fg) !important;
}

.status-pill-submitted,
.status-pill-picking,
.status-pill-ready,
.status-pill-normal {
  background: var(--color-info-bg-subtle);
  color: var(--color-info-fg) !important;
}

.status-pill-partial,
.status-pill-high {
  background: var(--color-warning-bg-subtle);
  color: var(--color-warning-fg) !important;
}

.status-pill-waiting,
.status-pill-rejected,
.status-pill-critical {
  background: var(--priority-critical-bg);
  color: var(--priority-critical) !important;
}

.status-pill-low {
  background: var(--status-done-bg);
  color: var(--status-done) !important;
}

.status-pill-neutral {
  background: var(--color-surface);
  color: var(--color-text-muted) !important;
}

.error-text {
  color: var(--color-danger-fg) !important;
}

.warning-text {
  color: var(--color-warning-fg) !important;
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  margin-bottom: 4px;
}

.compact-table-wrap {
  margin-top: var(--space-md);
}

.drilldown-panel .compact-table-wrap {
  margin-top: 0;
}

.compact-table {
  min-width: 720px;
}

.compact-table td {
  min-height: var(--table-row-height-compact);
}

.supplier-summary-row > td {
  background: #FFF7ED;
}

.supplier-summary-row:hover > td {
  background: #FFEDD5;
}

.supplier-summary-row.is-expanded td {
  background: #FFE6D6;
}

.product-summary-row.is-expanded td {
  background: #FEF3C7;
}

.outlet-summary-row.is-expanded td,
.source-summary-row.is-expanded td {
  background: var(--table-row-selected);
}

.supplier-detail-row > td,
.outlet-detail-row > td,
.source-detail-row > td {
  background: var(--color-card);
  padding: 0 var(--space-sm) var(--space-md);
}

.supplier-detail-row:hover > td,
.outlet-detail-row:hover > td,
.source-detail-row:hover > td {
  background: var(--color-card);
}

.supplier-detail-row > td,
.supplier-detail-row:hover > td {
  background: #FFFBEB;
}

.product-detail-row > td,
.product-detail-row:hover > td {
  background: #DBEAFE;
  padding: 0 var(--space-md) var(--space-md);
}

.drilldown-panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent-strong);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.drilldown-panel-products {
  background: #FFFBEB;
  margin: var(--space-sm) 0 var(--space-md);
}

.drilldown-panel-outlets {
  background: #E0F2FE;
  border-left-color: var(--color-info-fg);
  box-shadow: none;
  margin: var(--space-sm) 0 var(--space-sm) var(--space-lg);
}

.drilldown-panel-products > .drilldown-panel-header {
  background: #FEF3C7;
}

.drilldown-panel-products > .compact-table-wrap {
  background: #FFFBEB;
}

.drilldown-panel-products > .compact-table-wrap > .data-table thead th {
  background: #FEF3C7;
}

.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row > td {
  background: #FFFBEB;
}

.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row:hover > td {
  background: #FFEDD5;
}

.data-table thead th.column-group-request,
.data-table tbody td.column-group-request,
.drilldown-panel-products > .compact-table-wrap > .data-table thead th.column-group-request,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row > td.column-group-request,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row:hover > td.column-group-request,
.drilldown-panel-outlets .data-table thead th.column-group-request,
.drilldown-panel-outlets .data-table tbody tr td.column-group-request,
.drilldown-panel-outlets .data-table tbody tr:hover td.column-group-request {
  background: #DBEAFE;
}

.data-table thead th.column-group-sales,
.data-table tbody td.column-group-sales,
.drilldown-panel-products > .compact-table-wrap > .data-table thead th.column-group-sales,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row > td.column-group-sales,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row:hover > td.column-group-sales,
.drilldown-panel-outlets .data-table thead th.column-group-sales,
.drilldown-panel-outlets .data-table tbody tr td.column-group-sales,
.drilldown-panel-outlets .data-table tbody tr:hover td.column-group-sales {
  background: #FEF3C7;
}

.data-table thead th.column-group-stock,
.data-table tbody td.column-group-stock,
.data-table tr:hover td.column-group-stock,
.drilldown-panel-products > .compact-table-wrap > .data-table thead th.column-group-stock,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row > td.column-group-stock,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row:hover > td.column-group-stock,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row.is-expanded > td.column-group-stock {
  background: #E0F2FE;
}

.drilldown-panel-products > .compact-table-wrap > .data-table thead th.column-group-hq-stock,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row > td.column-group-hq-stock,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row:hover > td.column-group-hq-stock,
.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row.is-expanded > td.column-group-hq-stock,
.drilldown-panel-outlets .data-table thead th.column-group-hq-stock,
.drilldown-panel-outlets .data-table tbody tr td.column-group-hq-stock,
.drilldown-panel-outlets .data-table tbody tr:hover td.column-group-hq-stock {
  background: #E9D5FF;
}

.drilldown-panel-outlets > .drilldown-panel-header {
  background: #DBEAFE;
}

.drilldown-panel-outlets .compact-table-wrap {
  background: #E0F2FE;
}

.drilldown-panel-outlets .data-table thead th {
  background: #DBEAFE;
}

.drilldown-panel-outlets .data-table tbody tr td {
  background: #EFF6FF;
}

.drilldown-panel-outlets .data-table tbody tr:hover td {
  background: #DBEAFE;
}

.product-detail-panel[hidden] {
  display: none;
}

.product-detail-panel .compact-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.drilldown-panel-sources {
  border-left-color: var(--color-warning-fg);
  box-shadow: none;
  margin: var(--space-sm) 0 var(--space-sm) var(--space-lg);
}

.drilldown-panel-header {
  align-items: center;
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
}

.drilldown-panel-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
}

.drilldown-panel-actions form {
  margin: 0;
}

.product-list-toolbar {
  align-items: center;
  background: var(--table-header-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
}

.product-batch-status {
  align-items: center;
  background: var(--color-surface-disabled);
  border: 1px solid var(--color-border-disabled);
  border-radius: 6px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  min-height: 28px;
  padding: 2px 8px;
}

.supplier-threshold-cell {
  min-width: 150px;
}

.supplier-threshold-caption,
.supplier-export-notice {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 4px;
  max-width: 170px;
}

.supplier-export-cell {
  min-width: 118px;
}

.supplier-export-cell form {
  margin: 0;
}

.supplier-export-cell .button {
  min-width: 86px;
}

.product-list-toolbar .purchase-help-link {
  margin-right: auto;
}

.product-list-toolbar .product-batch-status {
  margin-right: 0;
}

.drilldown-panel-header strong {
  display: block;
}

.drilldown-panel-header span,
.drilldown-count {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.drilldown-count {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  flex: 0 0 auto;
  font-weight: var(--font-weight-semibold);
  padding: 4px 10px;
}

.drilldown-panel .data-table th {
  position: static;
  z-index: var(--z-base);
}

.drilldown-panel.product-detail-panel .data-table th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

/* Purchase planning drilldown hierarchy: supplier -> product -> outlet. */
.supplier-summary-row > td {
  background: #FFE2D2 !important;
}

.supplier-summary-row:hover > td {
  background: #FFD2BD !important;
}

.supplier-summary-row.is-expanded > td {
  background: #FFC9B3 !important;
}

.supplier-summary-row.is-refreshing > td,
.supplier-detail-row.is-refreshing > td {
  opacity: 0.68;
}

.supplier-summary-row.is-refreshing > td:first-child::after {
  color: var(--color-text-muted);
  content: "Refreshing...";
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 700;
  margin-top: 2px;
}

.supplier-detail-row > td,
.supplier-detail-row:hover > td {
  background: #FFF1E6 !important;
}

.drilldown-panel-products {
  background: #FFF4CC !important;
  border-left-color: var(--color-accent-strong);
}

.drilldown-panel-products > .drilldown-panel-header {
  background: #FDE68A !important;
}

.drilldown-panel-products > .compact-table-wrap,
.drilldown-panel-products > .compact-table-wrap > .data-table {
  background: #FFF7D6 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table thead th {
  background: #FDE68A !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row > td {
  background: #FFF7D6 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row:hover > td {
  background: #FFEEC2 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-summary-row.is-expanded > td {
  background: #FFE4CC !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-notice-row > td {
  background: #FFF1E6 !important;
  border-top: 1px dashed #FDBA74;
}

.drilldown-panel-products > .compact-table-wrap > .data-table tbody > tr.product-notice-row:hover > td {
  background: #FFE7D6 !important;
}

.product-notice-row .notice-only-primary strong,
.product-notice-row .notice-only-primary span {
  display: block;
}

.product-notice-row .notice-only-primary span,
.product-notice-row .notice-only-help {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 2px;
}

.notice-only-status-cell .status-pill {
  width: fit-content;
}

.notice-only-signal-row {
  justify-content: flex-start;
}

.notice-only-action form {
  margin: 0;
}

.product-detail-row > td,
.product-detail-row:hover > td {
  background: #D7ECFF !important;
}

.drilldown-panel-outlets {
  background: #D7ECFF !important;
  border-left-color: #1D4ED8;
}

.drilldown-panel-outlets > .drilldown-panel-header {
  background: #BFDBFE !important;
}

.drilldown-panel-outlets .compact-table-wrap,
.drilldown-panel-outlets .data-table {
  background: #D7ECFF !important;
}

.drilldown-panel-outlets .data-table thead th {
  background: #BFDBFE !important;
}

.drilldown-panel-outlets .data-table tbody tr td {
  background: #EAF4FF !important;
}

.drilldown-panel-outlets .data-table tbody tr:hover td {
  background: #DCEBFF !important;
}

.purchase-run-panel .product-detail-row > td,
.purchase-run-panel .product-detail-row:hover > td {
  background: #DCFCE7 !important;
}

.purchase-run-panel .drilldown-panel-outlets {
  background: #DCFCE7 !important;
  border-left-color: var(--color-success-fg);
}

.purchase-run-panel .drilldown-panel-outlets > .drilldown-panel-header {
  background: #BBF7D0 !important;
}

.purchase-run-panel .drilldown-panel-outlets .compact-table-wrap,
.purchase-run-panel .drilldown-panel-outlets .data-table {
  background: #DCFCE7 !important;
}

.purchase-run-panel .drilldown-panel-outlets .data-table thead th {
  background: #BBF7D0 !important;
}

.purchase-run-panel .drilldown-panel-outlets .data-table tbody tr td {
  background: #ECFDF3 !important;
}

.purchase-run-panel .drilldown-panel-outlets .data-table tbody tr:hover td {
  background: #DCFCE7 !important;
}

.product-primary-cell {
  min-width: 190px;
}

.product-name-signal-row {
  align-items: flex-start;
  display: inline-flex;
  gap: 8px;
  max-width: 100%;
}

.product-name-signal-row .drilldown-toggle {
  min-width: 0;
}

.product-name-signal-row-static {
  align-items: center;
}

.notice-only-product-text strong,
.notice-only-product-text span {
  display: block;
}

.product-notice-row .notice-only-primary .notice-only-product-text {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  margin-top: 0;
}

.notice-only-product-text span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 2px;
}

.secondary-cell {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  min-width: 150px;
}

.secondary-cell strong {
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.secondary-cell span {
  color: var(--color-text-muted);
}

.transfer-hint-cell {
  min-width: 190px;
  vertical-align: top;
}

.transfer-hint-cell .status-pill {
  align-items: flex-start;
  display: inline-flex;
  max-width: 230px;
  white-space: normal;
}

.transfer-hint-cell > span:not(.status-pill) {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 4px;
}

.sales-month-value {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.sales-spike-dot {
  appearance: none;
  background: var(--color-warning);
  border: 2px solid var(--color-warning-fg);
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--color-warning-bg-subtle);
  cursor: pointer;
  display: inline-block;
  flex: 0 0 auto;
  height: 11px;
  padding: 0;
  transition:
    background var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard);
  width: 11px;
}

.sales-spike-dot:hover {
  background: #D97706;
  transform: scale(1.08);
}

.sales-spike-dot:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.qty-signal-row {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-width: max-content;
}

.review-action-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  column-gap: 6px;
  margin-top: 6px;
  row-gap: 6px;
}

.review-action-group .button {
  white-space: nowrap;
}

.review-action-group .review-remove-button:not([hidden]) {
  margin-left: 10px;
}

.bonus-hint {
  color: var(--color-text-muted);
  display: grid;
  font-size: 0.78rem;
  gap: 6px;
  line-height: 1.35;
  margin-top: 6px;
  max-width: 16rem;
}

.bonus-hint .button {
  justify-self: start;
}

@media (max-width: 720px) {
  .review-action-group .review-remove-button:not([hidden]) {
    margin-left: 0;
  }
}

.top-up-panel {
  background: var(--color-surface-subtle);
  border-block: 1px solid var(--color-border);
  display: grid;
  gap: 10px;
  margin: 0 -14px 14px;
  padding: 12px 14px;
}

.top-up-panel-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.top-up-panel-header > div {
  display: grid;
  gap: 2px;
}

.top-up-panel-header strong {
  color: var(--color-text);
  font-size: 0.9rem;
}

.top-up-panel-header span:not(.status-pill) {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.seasonal-qty-dot {
  height: 13px;
  width: 13px;
}

.seasonal-name-dot {
  margin-top: 4px;
}

.threshold-help-modal-backdrop {
  align-items: center;
  background: rgba(0, 0, 0, 0.68);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--space-lg);
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.threshold-help-modal-backdrop[hidden] {
  display: none;
}

.threshold-help-modal {
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-modal);
  box-shadow: 0 28px 72px rgba(17, 24, 39, 0.38), 0 2px 8px rgba(17, 24, 39, 0.18);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - var(--space-xl) - var(--space-xl));
  max-height: calc(100dvh - var(--space-xl) - var(--space-xl));
  max-width: 680px;
  overflow: hidden;
  padding: 0;
  width: min(680px, 100%);
  z-index: var(--z-modal);
}

.threshold-help-modal-header {
  align-items: center;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.threshold-help-title-block {
  min-width: 0;
}

.threshold-help-close-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

.threshold-help-close-button:hover {
  background: var(--table-row-hover);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.threshold-help-close-button span {
  display: block;
  line-height: 1;
}

.threshold-help-close-button:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.threshold-help-modal h2,
.threshold-help-modal p {
  margin: 0;
}

.threshold-help-modal h2 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-xl);
}

.threshold-help-modal-body {
  display: grid;
  gap: var(--space-md);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--space-lg) var(--space-md);
}

.threshold-help-modal-body > p {
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  line-height: var(--line-height-md);
  padding-bottom: var(--space-md);
}

.threshold-help-list {
  display: grid;
  gap: var(--space-sm);
}

.threshold-help-item {
  align-items: flex-start;
  background: #F9FAFB;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
}

.threshold-help-item .status-pill {
  justify-self: start;
  width: fit-content;
}

.threshold-help-item p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-sm);
}

.threshold-help-item strong {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.threshold-help-combined-card {
  background: #F9FAFB;
  border: 1px solid var(--color-border-strong);
  box-shadow: inset 4px 0 0 var(--color-warning);
  margin: 0;
}

.threshold-help-combined-card .status-pill {
  justify-self: start;
  width: fit-content;
}

.threshold-help-modal .confirm-modal-actions {
  border-top: 1px solid var(--color-border);
  justify-content: flex-end;
  padding: var(--space-md) var(--space-lg);
}

.sales-spike-modal-backdrop {
  align-items: center;
  background: rgba(50, 34, 60, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: var(--space-lg);
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.sales-spike-modal-backdrop[hidden] {
  display: none;
}

.sales-spike-modal {
  background: var(--color-card);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-modal);
  box-shadow: 0 24px 60px rgba(50, 34, 60, 0.22);
  display: grid;
  gap: var(--space-md);
  max-width: 620px;
  overflow: hidden;
  padding: 0;
  width: min(620px, 100%);
  z-index: var(--z-modal);
}

.sales-spike-modal-header {
  align-items: flex-start;
  background: var(--color-warning-bg-subtle);
  border-bottom: 1px solid #FDE68A;
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  padding: var(--space-lg);
}

.sales-spike-modal-title-block {
  align-items: flex-start;
  display: flex;
  gap: var(--space-sm);
}

.sales-spike-modal-icon {
  background: var(--color-warning);
  border: 2px solid var(--color-warning-fg);
  border-radius: 999px;
  box-shadow: 0 0 0 4px #FEF3C7;
  flex: 0 0 auto;
  height: 12px;
  margin-top: 8px;
  width: 12px;
}

.sales-spike-modal h2,
.sales-spike-modal p {
  margin: 0;
}

.sales-spike-modal-body {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.sales-spike-modal-body > p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-md);
}

.sales-spike-modal-note {
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  border-radius: var(--radius-card);
  color: var(--color-text-secondary);
  display: grid;
  gap: 4px;
  line-height: var(--line-height-sm);
  padding: var(--space-md);
}

.sales-spike-modal-note strong {
  color: var(--color-warning-fg);
}

.sales-spike-modal .confirm-modal-actions {
  border-top: 1px solid var(--color-border);
  padding: 0 var(--space-lg) var(--space-lg);
}

@media (forced-colors: active) {
  .sales-spike-dot {
    background: Highlight;
    border-color: CanvasText;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sales-spike-dot {
    transition: none;
  }

  .sales-spike-dot:hover {
    transform: none;
  }
}

.data-table th.column-request-30,
.data-table td.column-request-30,
.data-table tr:hover td.column-request-30 {
  background: #EDE9FE !important;
}

.data-table th.column-request-60,
.data-table td.column-request-60,
.data-table tr:hover td.column-request-60 {
  background: #DDD6FE !important;
}

.data-table th.column-request-90,
.data-table td.column-request-90,
.data-table tr:hover td.column-request-90 {
  background: #C4B5FD !important;
}

.data-table th.column-sales-l30,
.data-table td.column-sales-l30,
.data-table tr:hover td.column-sales-l30 {
  background: #FBCFE8 !important;
}

.data-table th.column-sales-month-1,
.data-table td.column-sales-month-1,
.data-table tr:hover td.column-sales-month-1 {
  background: #CCFBF1 !important;
}

.data-table th.column-sales-month-2,
.data-table td.column-sales-month-2,
.data-table tr:hover td.column-sales-month-2 {
  background: #CCFBF1 !important;
}

.data-table th.column-sales-month-3,
.data-table td.column-sales-month-3,
.data-table tr:hover td.column-sales-month-3 {
  background: #CCFBF1 !important;
}

.data-table th.column-sales-month-4,
.data-table td.column-sales-month-4,
.data-table tr:hover td.column-sales-month-4 {
  background: #CCFBF1 !important;
}

.data-table th.column-group-stock,
.data-table td.column-group-stock,
.data-table tr:hover td.column-group-stock {
  background: #E0F2FE !important;
}

.data-table th.column-group-hq-stock,
.data-table td.column-group-hq-stock,
.data-table tr:hover td.column-group-hq-stock {
  background: #E9D5FF !important;
}

/* Keep purchase metric columns visible even when row-level colours are active. */
.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-request.column-request-30,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-request.column-request-30 {
  background: #EDE9FE !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-request.column-request-60,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-request.column-request-60 {
  background: #DDD6FE !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-request.column-request-90,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-request.column-request-90 {
  background: #C4B5FD !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-sales.column-sales-l30,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-sales.column-sales-l30 {
  background: #FBCFE8 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-1,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-1 {
  background: #CCFBF1 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-2,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-2 {
  background: #CCFBF1 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-3,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-3 {
  background: #CCFBF1 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-4,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-sales.column-sales-month-4 {
  background: #CCFBF1 !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-stock,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-stock {
  background: #E0F2FE !important;
}

.drilldown-panel-products > .compact-table-wrap > .data-table.compact-table :is(th, td).column-group-hq-stock,
.drilldown-panel-outlets .data-table.compact-table :is(th, td).column-group-hq-stock {
  background: #E9D5FF !important;
}

.line-edit-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-edit-form {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.compact-line-edit-form {
  flex-wrap: nowrap;
}

.compact-line-edit-form .qty-input {
  width: 76px;
}

.product-edit-form .qty-input[readonly] {
  background: var(--input-disabled-bg);
  border-color: var(--input-disabled-border);
  color: var(--input-disabled-text);
  cursor: default;
}

.product-edit-form .qty-input:not([readonly]):not(:disabled) {
  background: var(--color-card);
  border-color: var(--color-accent-strong);
}

.qty-input {
  min-height: 34px;
  padding: 0 10px;
  width: 96px;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
}

.inline-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.inline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
}

.inline-actions form {
  margin: 0;
}

.inline-form input {
  min-height: 34px;
}

.inline-date-field {
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  font-size: var(--font-size-xs);
  gap: 4px;
  line-height: var(--line-height-xs);
}

.inline-date-field input {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
}

.plan-title-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.plan-title-line {
  align-items: center;
  display: flex;
  gap: var(--space-xs);
  max-width: 100%;
  min-width: 0;
  width: fit-content;
}

.plan-title-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-title-meta {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-size-xs);
  gap: var(--space-xs);
  line-height: var(--line-height-xs);
}

.plan-title-rename {
  display: grid;
  gap: var(--space-xs);
  max-width: 100%;
  width: fit-content;
}

.plan-title-rename > summary.plan-title-line {
  cursor: pointer;
  list-style: none;
}

.plan-title-rename > summary.plan-title-line:focus-visible {
  outline: none;
}

.plan-title-rename > summary::-webkit-details-marker {
  display: none;
}

.plan-title-rename-trigger {
  align-items: center;
  border-radius: 999px;
  color: var(--color-text-muted);
  display: inline-flex;
  flex: 0 0 22px;
  height: 22px;
  justify-content: center;
  padding: 0;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard);
  width: 22px;
}

.plan-title-rename > summary.plan-title-line:hover .plan-title-rename-trigger,
.plan-title-rename > summary.plan-title-line:focus-visible .plan-title-rename-trigger {
  background: var(--button-secondary-bg-hover);
  color: var(--color-text-primary);
}

.plan-title-rename > summary.plan-title-line:focus-visible .plan-title-rename-trigger {
  box-shadow: var(--focus-ring);
}

.plan-title-rename-trigger .icon {
  height: 13px;
  width: 13px;
}

.plan-title-rename-form {
  margin-top: 0;
}

.plan-title-rename-form input {
  max-width: 100%;
  min-width: 260px;
}

.purchase-drafts-toggle-row {
  display: flex;
  justify-content: center;
  margin-top: 0;
  padding-top: var(--space-sm);
}

.purchase-drafts-toggle-button {
  align-items: center;
  background: var(--table-header-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  gap: var(--space-xs);
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-md);
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard);
  width: 100%;
}

.purchase-drafts-toggle-button:hover {
  background: var(--button-secondary-bg-hover);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

.purchase-drafts-toggle-button:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.purchase-drafts-toggle-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.purchase-drafts-toggle-icon {
  align-items: center;
  background: var(--color-card);
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 28px;
  height: 28px;
  justify-content: center;
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  width: 28px;
}

.purchase-drafts-toggle-button[aria-expanded="true"] .purchase-drafts-toggle-icon {
  transform: rotate(180deg);
}

.purchase-drafts-toggle-button .icon {
  height: 18px;
  width: 18px;
}

.structure-lists-grid {
  align-items: start;
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.structure-list-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--space-xs);
  display: grid;
  gap: var(--space-sm);
  min-width: 0;
  padding: var(--space-sm);
}

.structure-list-card-header {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-sm);
  justify-content: space-between;
  min-width: 0;
  padding-bottom: var(--space-xs);
}

.structure-list-card-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: var(--space-xs);
}

.structure-list-card-header h3 {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--control-gap);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0;
  min-width: 0;
}

.structure-list-heading {
  display: grid;
  gap: var(--label-margin-bottom);
  min-width: 0;
}

.structure-list-count {
  align-items: center;
  background: var(--table-header-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  justify-content: center;
  line-height: var(--line-height-xs);
  min-width: var(--line-height-sm);
  padding: 0 var(--space-xs);
}

.structure-list-meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 0;
  overflow-wrap: anywhere;
}

.structure-list-add {
  align-items: center;
  border-radius: var(--radius-button);
  color: var(--color-text-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
  min-height: var(--control-height-sm);
  padding: 0 var(--space-xs);
  text-decoration: none;
}

.structure-list-add:hover,
.structure-list-add:focus-visible {
  background: var(--button-ghost-bg-hover);
  color: var(--color-accent-strong);
}

.structure-list-body {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}

.structure-bulk-form {
  align-items: center;
  background: var(--table-header-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--space-xs);
  display: flex;
  gap: var(--space-sm);
  justify-content: space-between;
  min-width: 0;
  padding: var(--space-sm);
}

.structure-bulk-form[hidden] {
  display: none;
}

.structure-bulk-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: flex-end;
}

.structure-bulk-count {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
}

.structure-list-item {
  border: 1px solid transparent;
  border-radius: var(--space-xs);
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  min-width: 0;
  padding: var(--space-sm);
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard);
}

.structure-list-item:hover,
.structure-list-item:focus-within {
  background: var(--table-row-hover);
  border-color: var(--color-border);
}

.structure-list-summary {
  align-items: start;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.structure-list-card.is-selecting .structure-list-summary {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.structure-select-box {
  align-items: center;
  display: inline-flex;
  min-height: var(--control-height-sm);
}

.structure-select-box[hidden] {
  display: none;
}

.structure-select-box input {
  margin: 0;
}

.structure-list-copy {
  min-width: 0;
}

.structure-list-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.structure-list-summary span {
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.structure-list-actions,
.structure-editor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: flex-end;
}

.structure-list-item .structure-action-edit {
  background: var(--button-ghost-bg);
  border-color: transparent;
  color: var(--button-ghost-fg);
}

.structure-list-item .structure-action-edit:hover,
.structure-list-item .structure-action-edit:focus-visible {
  background: var(--button-ghost-bg-hover);
  color: var(--color-text-primary);
}

.structure-list-item .structure-action-remove {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}

.structure-list-item .structure-action-remove:hover,
.structure-list-item .structure-action-remove:focus-visible {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg);
}

.structure-edit-fields {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-sm);
  min-width: 0;
  padding-top: var(--space-sm);
}

.structure-edit-fields[hidden] {
  display: none;
}

.structure-edit-field {
  color: var(--label-color);
  display: grid;
  font-size: var(--label-font-size);
  gap: var(--label-margin-bottom);
  line-height: var(--label-line-height);
  min-width: 0;
}

.structure-edit-field > span {
  color: var(--label-color);
  font-size: var(--label-font-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--label-line-height);
}

.structure-edit-fields input,
.structure-edit-fields select {
  min-width: 0;
}

.structure-edit-fields .checkbox-row {
  min-height: var(--control-height-sm);
}

.structure-empty-state {
  background: var(--table-header-bg);
  border: 1px dashed var(--color-text-muted);
  border-radius: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  padding: var(--space-sm);
}

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

@media (max-width: 720px) {
  .structure-lists-grid {
    grid-template-columns: 1fr;
  }
}

.daily-refill-run {
  margin-top: var(--space-md);
}

.daily-refill-meta {
  display: grid;
  gap: var(--space-xs);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: var(--space-md) 0;
}

.daily-refill-meta-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent-strong);
  border-radius: var(--radius-input);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--space-xs) var(--space-sm);
}

.daily-refill-meta-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.daily-refill-meta-value {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
}

.daily-refill-meta-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.daily-refill-run > summary {
  cursor: pointer;
  list-style: none;
}

.daily-refill-run > summary::-webkit-details-marker {
  display: none;
}

.daily-refill-run-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: flex-end;
}

.daily-refill-run-summary {
  align-items: stretch;
  flex-direction: column;
  gap: var(--space-sm);
}

.daily-refill-run-summary-main {
  align-items: center;
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
}

.daily-refill-run-blocker {
  align-items: center;
  background: var(--color-warning-bg-subtle);
  border: 1px solid var(--color-warning-fg);
  border-radius: var(--radius-input);
  color: var(--color-warning-fg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
}

.daily-refill-run-blocker > strong,
.daily-refill-run-blocker > span {
  color: inherit;
}

.daily-refill-run-blocker > .button {
  margin-left: auto;
}

.daily-refill-workflow-tabs {
  border-top: 1px solid var(--color-border);
  margin-top: 0;
  padding: var(--space-sm) var(--space-md) 0;
}

.daily-refill-workflow-panel[hidden] {
  display: none;
}

.daily-refill-step-panel {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md);
}

.daily-refill-step-header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.daily-refill-step-header > :first-child {
  flex: 1 1 260px;
}

.daily-refill-step-header h3 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
  margin: 0;
}

.daily-refill-step-header p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 2px 0 0;
}

.daily-refill-step-stats {
  align-items: stretch;
  display: grid;
  flex: 0 1 380px;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: var(--space-xs);
  justify-content: flex-end;
}

.daily-refill-step-stat {
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-left: 4px solid var(--color-border-strong);
  border-radius: var(--space-xs);
  color: var(--color-text-secondary);
  display: grid;
  font-size: var(--font-size-sm);
  gap: 2px;
  line-height: var(--line-height-sm);
  min-height: 62px;
  min-width: 0;
  padding: 9px var(--space-sm);
}

.daily-refill-step-stat-primary {
  border-left-color: var(--color-accent-strong);
}

.daily-refill-step-stats-three {
  flex-basis: 580px;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.daily-refill-step-stat strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-xl);
  font-variant-numeric: tabular-nums;
  line-height: var(--line-height-xl);
  overflow-wrap: anywhere;
}

.daily-refill-step-stat span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  overflow-wrap: anywhere;
}

.daily-refill-pick-totals .daily-refill-step-stat-primary strong {
  color: var(--color-accent-strong);
}

@media (max-width: 760px) {
  .daily-refill-step-stats {
    flex-basis: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .daily-refill-step-stat {
    min-width: 0;
  }
}

.daily-refill-print-actions {
  flex: 1 1 420px;
  justify-content: flex-end;
}

.daily-refill-print-sheet {
  display: none;
}

.daily-refill-actions,
.daily-refill-mini-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.daily-refill-actions {
  align-items: flex-start;
  flex-direction: column;
  min-width: 180px;
}

.daily-refill-action-form {
  display: inline-flex;
}

.daily-refill-pick-storage-warning,
.daily-refill-storage-decision {
  background: var(--color-warning-bg-subtle);
  border: 1px solid var(--color-warning);
  border-radius: var(--space-xs);
  color: var(--color-warning-fg);
  display: grid;
  gap: 4px;
  max-width: 320px;
  padding: var(--space-xs);
}

.daily-refill-pick-storage-warning-danger,
.daily-refill-storage-decision-danger {
  background: var(--color-danger-bg-subtle);
  border-color: var(--color-danger);
  color: var(--color-danger-fg);
}

.daily-refill-pick-storage-warning strong,
.daily-refill-storage-decision > strong {
  color: var(--color-warning-fg);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.daily-refill-pick-storage-warning-danger strong,
.daily-refill-storage-decision-danger > strong {
  color: var(--color-danger-fg);
}

.daily-refill-storage-decision {
  margin: 2px 0 var(--space-xs);
}

.daily-refill-pick-storage-options {
  min-width: 220px;
}

.daily-refill-decision-form {
  align-items: stretch;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr);
}

.daily-refill-decision-form input {
  width: 100%;
}

.purchase-insight-panel {
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  border-left: 4px solid var(--color-accent-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
}

.purchase-run-panel .purchase-insight-panel-inline {
  box-shadow: none;
  margin: var(--space-md) 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
}

.purchase-insight-panel h2,
.purchase-insight-panel p {
  margin: 0;
}

.purchase-insight-panel > p {
  color: var(--color-text-secondary);
  line-height: var(--line-height-sm);
}

.seasonal-notice-panel {
  align-content: start;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  gap: var(--space-md);
  max-width: 960px;
  width: min(100%, 960px);
}

.purchase-run-panel .seasonal-notice-panel.purchase-insight-panel-inline {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  justify-self: start;
  padding: var(--space-md);
}

.seasonal-notice-heading {
  align-items: flex-start;
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
}

.seasonal-notice-heading .eyebrow {
  color: var(--color-warning-fg);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  line-height: var(--line-height-xs);
  text-transform: uppercase;
}

.seasonal-notice-total {
  align-items: center;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  gap: 6px;
  white-space: nowrap;
}

.seasonal-notice-total-icon {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  height: 14px;
  justify-content: center;
  line-height: 1;
  width: 14px;
}

.seasonal-notice-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.seasonal-notice-filter {
  appearance: none;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  min-height: 32px;
  padding: 4px 12px;
}

.seasonal-notice-filter:hover {
  border-color: var(--color-border-strong-hover);
  color: var(--color-text-primary);
}

.seasonal-notice-filter.is-active {
  background: var(--color-warning-bg-subtle);
  border-color: transparent;
  color: var(--color-warning-fg);
}

.seasonal-notice-filter[data-seasonal-notice-filter="in-draft"].is-active {
  background: var(--color-success-bg-subtle);
  border-color: transparent;
  color: var(--color-success-fg);
}

.seasonal-notice-filter[data-seasonal-notice-filter="history-only"].is-active {
  background: var(--color-surface-disabled);
  border-color: transparent;
  color: var(--color-text-secondary);
}

.seasonal-notice-filter-group {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  display: inline-flex;
  min-height: 32px;
}

.seasonal-notice-filter-group:hover {
  border-color: var(--color-border-strong-hover);
}

.seasonal-notice-filter-group.is-active {
  background: var(--color-surface-disabled);
  border-color: transparent;
  color: var(--color-text-secondary);
}

.seasonal-notice-filter-group .seasonal-notice-filter {
  background: transparent;
  border: 0;
  min-height: 30px;
  padding-right: 6px;
}

.seasonal-notice-filter-group .seasonal-notice-filter:hover,
.seasonal-notice-filter-group .seasonal-notice-filter.is-active {
  background: transparent;
  border-color: transparent;
  color: inherit;
}

.seasonal-notice-filter-help {
  padding-right: 8px;
}

.seasonal-notice-filter-help .metric-help-tooltip {
  left: auto;
  right: 0;
}

.seasonal-notice-list {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.seasonal-notice-row {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-warning-fg);
  border-radius: var(--radius-card);
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 72px minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 10px 14px;
}

.seasonal-notice-row[hidden],
.seasonal-notice-row.is-hidden,
.seasonal-notice-empty[hidden],
.seasonal-notice-empty.is-hidden {
  display: none !important;
}

.seasonal-notice-row-in-draft {
  border-left-color: var(--color-success-fg);
}

.seasonal-notice-row-history-only {
  border-left-color: var(--color-border-strong);
}

.seasonal-notice-stat {
  color: var(--color-warning-fg);
  display: grid;
  gap: 0;
}

.seasonal-notice-row-in-draft .seasonal-notice-stat {
  color: var(--color-success-fg);
}

.seasonal-notice-row-history-only .seasonal-notice-stat {
  color: var(--color-text-secondary);
}

.seasonal-notice-stat strong {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-lg);
}

.seasonal-notice-stat span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.seasonal-notice-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.seasonal-notice-copy h3 {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-sm);
  margin: 0;
  overflow-wrap: anywhere;
}

.seasonal-notice-copy p {
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  line-height: var(--line-height-sm);
  margin: 0;
}

.seasonal-notice-signal {
  font-weight: var(--font-weight-semibold);
}

.seasonal-notice-signal-warning {
  color: var(--color-warning-fg);
  font-weight: var(--font-weight-semibold);
}

.seasonal-notice-signal-discount {
  color: var(--color-warning-fg);
  font-weight: var(--font-weight-semibold);
}

.seasonal-notice-action {
  justify-self: end;
}

.seasonal-notice-action form {
  margin: 0;
}

.seasonal-notice-action .button,
.seasonal-notice-action .status-pill {
  white-space: nowrap;
}

.seasonal-notice-footer,
.seasonal-notice-empty {
  color: var(--color-text-secondary);
  line-height: var(--line-height-sm);
  margin: 0;
}

.seasonal-notice-footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-sm);
}

.seasonal-notice-empty {
  background: var(--color-card);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-input);
  padding: var(--space-sm);
}

.purchase-insight-list {
  display: grid;
  gap: var(--space-sm);
}

.purchase-insight-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: grid;
  gap: 4px;
  padding: var(--space-sm);
}

.purchase-insight-item strong {
  color: var(--color-text-primary);
}

.purchase-insight-item span {
  color: var(--color-text-secondary);
}

.daily-refill-substitute-suggestion {
  background: color-mix(in srgb, var(--color-info-bg-subtle) 70%, white);
  border: 1px solid var(--color-border);
  border-radius: var(--space-xs);
  color: var(--color-text-muted);
  display: grid;
  gap: 2px;
  padding: 6px 8px;
}

.daily-refill-substitute-suggestion strong {
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.daily-refill-substitute-picker,
.daily-refill-substitute-search {
  display: grid;
  gap: 3px;
}

.daily-refill-substitute-picker > span,
.daily-refill-substitute-search > span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.daily-refill-substitute-picker select {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--space-xs);
  color: var(--color-text);
  min-height: 34px;
  padding: 0 10px;
  width: 100%;
}

.daily-refill-table-input,
.daily-refill-reason-input {
  min-height: 34px;
  padding: 0 10px;
}

.daily-refill-table-input {
  width: 76px;
}

.daily-refill-reason-input {
  min-width: 140px;
}

.daily-refill-mini-form input {
  min-height: 34px;
  padding: 0 10px;
  width: 82px;
}

.daily-refill-mini-form input[type="text"] {
  width: 112px;
}

.daily-refill-mini-form.daily-refill-decision-form input {
  width: 100%;
}

.daily-refill-source-list {
  margin-top: var(--space-sm);
  min-width: 360px;
}

.daily-refill-run-close {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.daily-refill-run-close input {
  max-width: 320px;
}

.daily-refill-bulk-form {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 var(--space-sm);
}

.daily-refill-bulk-form [data-bulk-pick-line] {
  display: none !important;
}

.daily-refill-problem-panel {
  display: grid;
  gap: var(--space-xs);
}

.daily-refill-problem-panel > summary {
  cursor: pointer;
  list-style: none;
  width: max-content;
}

.daily-refill-problem-panel > summary::-webkit-details-marker {
  display: none;
}

.daily-refill-last-update {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 128px;
}

.daily-refill-last-update strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.daily-refill-last-update > span:last-child:not(.status-pill) {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  overflow-wrap: anywhere;
}

.daily-refill-destination-panel {
  display: grid;
  gap: var(--space-xs);
}

.daily-refill-destination-panel > summary {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--space-xs);
  cursor: pointer;
  display: inline-grid;
  gap: var(--space-sm);
  grid-template-columns: minmax(0, 1fr) auto;
  list-style: none;
  max-width: 320px;
  min-height: 64px;
  padding: var(--space-xs) var(--space-sm);
  width: 100%;
}

.daily-refill-destination-panel.is-missing-destination > summary {
  background: var(--color-warning-bg-subtle);
  border-color: var(--color-warning);
}

.daily-refill-destination-panel > summary:hover,
.daily-refill-destination-panel > summary:focus-visible {
  background: var(--button-secondary-bg-hover);
  border-color: var(--button-secondary-border-hover);
}

.daily-refill-destination-panel > summary::-webkit-details-marker {
  display: none;
}

.daily-refill-readonly-location {
  background: var(--color-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--space-xs);
  display: inline-grid;
  max-width: 320px;
  min-height: 64px;
  padding: var(--space-xs) var(--space-sm);
  width: 100%;
}

.daily-refill-destination-value {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.daily-refill-destination-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.daily-refill-destination-heading > span:first-child {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  text-transform: uppercase;
}

.daily-refill-destination-empty {
  display: grid;
  gap: 2px;
}

.daily-refill-destination-empty strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.daily-refill-destination-empty span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.daily-refill-destination-row {
  align-items: baseline;
  display: grid;
  gap: var(--space-xs);
  grid-template-columns: 42px minmax(0, 1fr);
  min-width: 0;
}

.daily-refill-destination-row > :last-child {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  min-width: 0;
  overflow-wrap: anywhere;
}

.daily-refill-destination-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  text-transform: uppercase;
}

.daily-refill-destination-edit {
  align-items: center;
  color: var(--color-accent-strong);
  display: inline-flex;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  gap: 4px;
  justify-content: center;
  white-space: nowrap;
}

.daily-refill-destination-edit .icon {
  flex: 0 0 auto;
}

.daily-refill-destination-form {
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
  max-width: 320px;
}

.daily-refill-location-section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border);
  border-radius: var(--space-xs);
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
  padding: var(--space-xs);
}

.daily-refill-location-section-required {
  border-color: var(--color-border-strong);
}

.daily-refill-location-section legend {
  align-items: center;
  color: var(--color-text-primary);
  display: flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  gap: 6px;
  line-height: var(--line-height-xs);
  padding: 0 3px;
}

.daily-refill-location-section legend span:last-child {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-semibold);
}

.daily-refill-location-help,
.daily-refill-location-section label > span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
}

.daily-refill-location-section label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-refill-location-fields-two {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-refill-destination-form input {
  min-width: 0;
  width: 100%;
}

.daily-refill-destination-form .button {
  width: 100%;
}

.daily-refill-storage-shelf-form {
  display: grid;
  gap: var(--space-xs);
  margin-top: 6px;
  max-width: 320px;
}

.daily-refill-storage-shelf-form input {
  min-width: 0;
  width: 100%;
}

.daily-refill-storage-shelf-form .button {
  width: 100%;
}

.request-item-history {
  margin-top: var(--space-xs);
}

.request-item-history > summary {
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.request-item-history span {
  display: block;
  margin-top: 3px;
}

@media (max-width: 720px) {
  .daily-refill-step-panel .compact-table-wrap {
    overflow: visible;
  }

  .daily-refill-step-panel .data-table {
    display: block;
  }

  .daily-refill-step-panel .data-table thead {
    display: none;
  }

  .daily-refill-step-panel .data-table tbody {
    display: grid;
    gap: var(--space-sm);
  }

  .daily-refill-step-panel .data-table tr[data-daily-refill-line] {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: grid;
    padding: var(--space-xs);
  }

  .daily-refill-step-panel .data-table tr[data-daily-refill-line] td {
    border-bottom: 0;
    display: grid;
    gap: var(--space-xs);
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    padding: 7px 8px;
  }

  .daily-refill-step-panel .data-table tr[data-daily-refill-line] td::before {
    color: var(--color-text-muted);
    content: attr(data-label);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
  }

  .daily-refill-step-panel .data-table tr[data-daily-refill-line] td:first-child {
    grid-template-columns: 1fr;
  }

  .daily-refill-step-panel .data-table tr[data-daily-refill-line] td:first-child::before {
    display: none;
  }

  .daily-refill-mini-form {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-refill-mini-form input,
  .daily-refill-mini-form .button,
  .daily-refill-actions .button {
    width: 100%;
  }
}

@media print {
  @page {
    margin: 10mm;
    size: A4 landscape;
  }

  body.daily-refill-print-mode * {
    visibility: hidden !important;
  }

  body.daily-refill-print-mode [data-daily-pick-list].is-printing,
  body.daily-refill-print-mode [data-daily-pick-list].is-printing * {
    visibility: visible !important;
  }

  body.daily-refill-print-mode [data-daily-pick-list].is-printing {
    background: #fff;
    color: #111;
    left: 0;
    padding: 0;
    position: absolute;
    top: 0;
    width: 100%;
  }

  body.daily-refill-print-mode [data-daily-pick-list].is-printing > :not(.daily-refill-print-sheet),
  body.daily-refill-print-mode .daily-refill-screen-only {
    display: none !important;
  }

  body.daily-refill-print-mode .daily-refill-print-sheet {
    display: block !important;
    font-size: 9pt;
    line-height: 1.25;
  }

  body.daily-refill-print-mode .daily-refill-print-header {
    align-items: flex-end;
    border-bottom: 2px solid #111;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8mm;
    padding-bottom: 3mm;
  }

  body.daily-refill-print-mode .daily-refill-print-header h2,
  body.daily-refill-print-mode .daily-refill-print-header p {
    margin: 0;
  }

  body.daily-refill-print-mode .daily-refill-print-header p,
  body.daily-refill-print-mode .daily-refill-print-header span,
  body.daily-refill-print-mode .daily-refill-print-totals span {
    color: #333;
  }

  body.daily-refill-print-mode .daily-refill-print-totals {
    display: grid;
    gap: 1mm 5mm;
    grid-template-columns: auto auto;
    text-align: right;
  }

  body.daily-refill-print-mode .daily-refill-print-totals strong {
    font-size: 16pt;
  }

  body.daily-refill-print-mode .daily-refill-print-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
  }

  body.daily-refill-print-mode .daily-refill-print-table th,
  body.daily-refill-print-mode .daily-refill-print-table td {
    border: 1px solid #999;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;
  }

  body.daily-refill-print-mode .daily-refill-print-table th {
    background: #eee;
    color: #111;
    font-weight: 700;
  }

  body.daily-refill-print-mode .daily-refill-print-table th:nth-child(1) {
    width: 18mm;
  }

  body.daily-refill-print-mode .daily-refill-print-table th:nth-child(3) {
    width: 12mm;
  }

  body.daily-refill-print-mode .daily-refill-print-table th:nth-child(6) {
    width: 18mm;
  }

  body.daily-refill-print-mode .daily-refill-print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.manager-review-form {
  display: grid;
  gap: var(--space-md);
}

.manager-review-toolbar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.manager-review-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.manager-review-request-control {
  flex: 0 1 180px;
}

.manager-review-toolbar .manager-review-urgent-control {
  align-items: center;
  align-self: flex-end;
  display: flex;
  flex: 0 0 auto;
  gap: var(--space-xs);
  min-height: 34px;
  min-width: 0;
  padding: 0 var(--space-xs);
}

.manager-review-toolbar .manager-review-urgent-control input {
  min-height: 0;
}

.manager-review-filter-control {
  flex: 1 1 170px;
}

.manager-review-filter-control-wide {
  flex-basis: 220px;
}

.manager-review-toolbar-divider {
  align-self: stretch;
  background: var(--color-border);
  min-height: 54px;
  width: 1px;
}

.manager-review-toolbar input,
.manager-review-toolbar select {
  min-height: 34px;
}

@media (max-width: 920px) {
  .manager-review-toolbar-divider {
    display: none;
  }
}

.rack-setup-panel {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
}

.rack-setup-panel > summary {
  color: var(--color-accent-strong);
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
}

.product-save-status,
.line-save-status {
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 130px;
}

.product-edit-form[data-state="saving"] .qty-input {
  border-color: var(--color-info-fg);
}

.product-edit-form[data-state="saved"] .qty-input {
  border-color: var(--color-success-fg);
}

.product-edit-form[data-state="error"] .qty-input,
.product-edit-form[data-state="conflict"] .qty-input {
  border-color: var(--color-danger-fg);
}

.product-edit-form[data-state="dirty"] .qty-input {
  background: var(--color-warning-bg-subtle);
  border-color: var(--color-warning-fg);
}

.inline-action {
  background: transparent;
  border: 0;
  color: var(--color-accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-action:hover {
  color: var(--color-accent-strong-hover);
}

.inline-action.drilldown-toggle {
  align-items: start;
  display: inline-grid;
  gap: 8px;
  grid-template-columns: 16px minmax(0, 1fr);
  justify-items: start;
  text-align: left;
  text-decoration: none;
}

.drilldown-toggle::before {
  color: var(--color-text-muted);
  content: ">";
  font-size: var(--font-size-xs);
  line-height: var(--line-height-sm);
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
}

.drilldown-toggle[aria-expanded="true"]::before {
  color: var(--color-accent-strong);
  transform: rotate(90deg);
}

.drilldown-toggle-text {
  color: inherit !important;
  display: grid !important;
  gap: 2px;
}

.request-block {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.request-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.request-block-header {
  align-items: flex-start;
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
}

.request-block-header h3 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
  margin: 0;
}

.request-block-header p,
.export-history {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 0;
}

.history-section {
  gap: var(--space-sm);
}

.history-section-header {
  align-items: center;
  background: var(--color-info-bg-subtle);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-info-fg);
  border-radius: 8px;
  padding: var(--space-sm) var(--space-md);
}

.history-section-header h3 {
  color: var(--color-text-primary);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-xl);
}

.request-history-heading {
  margin-top: var(--space-sm);
}

.request-history-request {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: block;
  overflow: hidden;
  padding: 0;
  text-decoration: none;
}

.request-history-request + .request-history-request {
  margin-top: var(--space-sm);
}

.request-history-request > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 24px minmax(0, 1fr) auto;
  list-style: none;
  padding: var(--space-md);
}

.request-history-request > summary::-webkit-details-marker {
  display: none;
}

.request-history-request > summary::marker {
  content: "";
}

.request-history-request > summary::before {
  align-items: center;
  background: var(--color-info-bg-subtle);
  border: 1px solid var(--color-info-fg);
  border-radius: 50%;
  color: var(--color-info-fg);
  content: ">";
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  height: 24px;
  justify-content: center;
  line-height: 1;
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  width: 24px;
}

.request-history-request[open] > summary::before {
  transform: rotate(90deg);
}

.request-history-request > summary:hover {
  background: var(--color-info-bg-subtle);
}

.request-history-request > summary:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: -2px;
}

.request-history-summary-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: flex-end;
}

.request-history-expand-label {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  padding: 4px 10px;
  white-space: nowrap;
}

.request-history-request-body {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
}

.request-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.request-actions {
  justify-content: flex-start;
}

.approval-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.approval-form .date-input {
  min-height: 34px;
  width: 150px;
}

.export-history {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.project-tracker-table td > span {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 2px;
}

.project-tracker-risk-stack {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 120px;
}

.project-tracker-filter-bar {
  margin-bottom: var(--space-lg);
}

.project-tracker-date-presets {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  min-width: 0;
}

.project-tracker-date-presets-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.project-tracker-date-presets .project-tracker-segmented {
  max-width: 100%;
  min-width: 0;
}

.project-tracker-date-presets .project-tracker-segmented a {
  white-space: nowrap;
}

.project-tracker-filter-actions {
  align-items: flex-end;
  display: flex;
  gap: var(--space-sm);
}

.project-tracker-pagination {
  align-items: center;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
}

.project-tracker-pagination-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.project-tracker-page-label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
}

.project-tracker-leads-page {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1400px;
  width: 100%;
}

.project-tracker-leads-page > .content-panel,
.project-tracker-leads-split > .content-panel {
  border-radius: 16px;
  padding: 20px 22px;
}

.project-tracker-leads-page > .content-panel:first-child .panel-header {
  border-bottom: 0;
  margin-bottom: 16px;
  padding-bottom: 0;
}

.project-tracker-leads-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.project-tracker-leads-filter {
  align-items: center;
  display: grid;
  flex: 1 1 1100px;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(150px, 0.9fr)) auto;
  min-width: 0;
  width: 100%;
}

.project-tracker-leads-filter .field {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  display: inline-flex;
  gap: 4px;
  min-height: 34px;
  min-width: 0;
  padding: 0 10px;
}

.project-tracker-leads-filter .field:focus-within {
  border-color: var(--color-accent-strong);
  box-shadow: var(--focus-ring);
}

.project-tracker-leads-filter .field label {
  color: var(--color-text-muted);
  display: inline;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.project-tracker-leads-filter :is(select, input) {
  background: transparent;
  border: 0;
  color: var(--color-text);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  height: 32px;
  min-height: 32px;
  min-width: 0;
  padding: 0 4px;
}

.project-tracker-leads-filter select {
  width: 100%;
}

.project-tracker-leads-filter input[type="date"] {
  width: 100%;
}

.project-tracker-leads-filter :is(select, input):focus {
  box-shadow: none;
  outline: 0;
}

.project-tracker-leads-filter .project-tracker-filter-actions {
  align-items: center;
}

.project-tracker-leads-filter .button {
  min-height: 34px;
  padding: 7px 14px;
}

.project-tracker-attention-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-tracker-attention-card {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  text-decoration: none;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard);
}

.project-tracker-attention-card:hover {
  transform: translateY(-2px);
}

.project-tracker-attention-card strong {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.project-tracker-attention-card span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
}

.project-tracker-attention-card em {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-style: normal;
  line-height: var(--line-height-xs);
}

.project-tracker-attention-danger,
.project-tracker-attention-danger.is-active {
  background: #FEF2F2;
  border-color: #FECACA;
}

.project-tracker-attention-warning,
.project-tracker-attention-warning.is-active {
  background: #FFFBEB;
  border-color: #FDE68A;
}

.project-tracker-attention-info,
.project-tracker-attention-info.is-active {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.project-tracker-attention-danger :is(strong, span, em) {
  color: #991B1B;
}

.project-tracker-attention-warning :is(strong, span, em) {
  color: #92400E;
}

.project-tracker-attention-info :is(strong, span, em) {
  color: #1E40AF;
}

.project-tracker-attention-card.is-active {
  box-shadow: inset 0 0 0 1px currentColor;
}

.project-tracker-source-warning {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
}

.project-tracker-source-warning > div {
  display: grid;
  gap: 2px;
}

.project-tracker-source-warning strong {
  color: #9A3412;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-sm);
}

.project-tracker-source-warning span {
  color: #9A3412;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.project-tracker-source-warning ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-tracker-source-warning li {
  align-items: center;
  background: var(--color-card);
  border: 1px solid #FDBA74;
  border-radius: 999px;
  display: inline-flex;
  gap: 7px;
  max-width: 100%;
  padding: 6px 10px;
}

.project-tracker-source-warning li b {
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-xs);
}

.project-tracker-source-warning li span {
  color: var(--color-text-muted);
}

.project-tracker-funnel {
  align-items: end;
  display: flex;
  gap: 0;
  min-height: 224px;
  padding-top: 4px;
}

.project-tracker-funnel-stage {
  align-items: stretch;
  display: grid;
  gap: var(--space-xs);
  flex: 1 1 0;
  grid-template-rows: auto 150px auto auto;
  min-width: 0;
  padding-right: 26px;
  position: relative;
}

.project-tracker-funnel-stage:last-child {
  padding-right: 0;
}

.project-tracker-funnel-stage strong {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
}

.project-tracker-funnel-stage b {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.project-tracker-funnel-stage small {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.project-tracker-funnel-bar {
  align-items: end;
  background: transparent;
  border-radius: 10px 10px 0 0;
  display: flex;
  height: 150px;
  overflow: visible;
}

.project-tracker-funnel-bar span {
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-strong));
  border-radius: 10px 10px 0 0;
  display: block;
  min-height: 6px;
  width: 100%;
}

@supports (color: color-mix(in srgb, black 50%, white)) {
  .project-tracker-funnel-bar span {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-accent) 88%, white),
      color-mix(in srgb, var(--color-accent-strong) 86%, black)
    );
  }
}

.project-tracker-funnel-stage-appointment .project-tracker-funnel-bar span {
  background: linear-gradient(180deg, #FF8F5C, #DB5A1E);
}

.project-tracker-funnel-stage-site_measured .project-tracker-funnel-bar span {
  background: linear-gradient(180deg, #FFA77D, #E56B2E);
}

.project-tracker-funnel-stage-converted .project-tracker-funnel-bar span {
  background: linear-gradient(180deg, #22C55E, #15803D);
}

.project-tracker-funnel-change {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  padding: 4px 8px;
  position: absolute;
  right: 13px;
  top: 96px;
  transform: translate(50%, -50%);
  white-space: nowrap;
  z-index: 1;
}

.project-tracker-funnel-loss {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.project-tracker-funnel-gain,
.project-tracker-funnel-flat {
  background: #ECFDF3;
  border-color: #BBF7D0;
  color: #166534;
}

.project-tracker-leads-split {
  align-items: start;
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.55fr);
}

.project-tracker-leads-scoreboard {
  min-width: 760px;
}

.project-tracker-leads-source-table {
  min-width: 400px;
}

.project-tracker-lead-list-table {
  min-width: 1180px;
}

.project-tracker-scoreboard-table {
  min-width: 1040px;
}

.project-tracker-lead-funnel-scoreboard {
  min-width: 900px;
}

.project-tracker-scoreboard-table :is(th, td):not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.project-tracker-lead-funnel-scoreboard :is(th, td):last-child {
  font-variant-numeric: normal;
  min-width: 220px;
  text-align: left;
  white-space: normal;
}

.project-tracker-scoreboard-table :is(th, td):first-child {
  background: var(--color-card);
  box-shadow: 1px 0 0 var(--color-divider);
  left: 0;
  position: sticky;
  z-index: 1;
}

.project-tracker-scoreboard-table thead th:first-child,
.project-tracker-scoreboard-table tfoot td:first-child {
  background: var(--table-header-bg);
  z-index: calc(var(--z-grid-sticky) + 1);
}

.project-tracker-scoreboard-table tbody tr:hover td:first-child {
  background: var(--table-row-hover);
}

.project-tracker-scoreboard-table tfoot td {
  background: var(--table-header-bg);
  border-top: 2px solid var(--color-border);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-bold);
  vertical-align: middle;
}

.project-tracker-leads-scoreboard tfoot td {
  background: var(--table-header-bg);
  border-top: 2px solid var(--color-border);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-bold);
}

.project-tracker-scoreboard-detail-row td:first-child {
  box-shadow: none;
  position: static;
}

.project-tracker-scoreboard-detail-row td {
  background: var(--table-header-bg);
  text-align: left !important;
  white-space: normal !important;
}

.project-tracker-scoreboard-stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-tracker-scoreboard-stage-tag {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-xs);
  gap: 5px;
  line-height: var(--line-height-xs);
  padding: 4px 10px;
}

.project-tracker-scoreboard-stage-tag strong {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.project-tracker-scoreboard-stage-tag.is-unknown {
  background: var(--color-warning-bg-subtle);
  border-color: #FDE68A;
  color: var(--color-warning-fg);
}

.project-tracker-scoreboard-expander {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  height: 24px;
  justify-content: center;
  line-height: 1;
  width: 24px;
}

.project-tracker-scoreboard-expander:hover {
  border-color: var(--color-accent-strong);
  color: var(--color-accent-strong);
}

.project-tracker-scoreboard-expander:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.project-tracker-money {
  font-variant-numeric: tabular-nums;
}

.project-tracker-scoreboard-table .status-pill {
  justify-content: center;
  min-width: 34px;
}

.project-tracker-scoreboard-legend {
  align-items: center;
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
}

.project-tracker-scoreboard-legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.project-tracker-legend-dot {
  border-radius: 3px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.project-tracker-legend-danger {
  background: #FECACA;
}

.project-tracker-legend-warning {
  background: #FDE68A;
}

.project-tracker-legend-success {
  background: #BBF7D0;
}

.project-tracker-rate {
  align-items: center;
  display: inline-flex;
  gap: var(--space-xs);
  justify-content: flex-end;
  min-width: 120px;
}

.project-tracker-table td > .project-tracker-rate {
  color: inherit;
  display: inline-flex;
  font-size: inherit;
  line-height: inherit;
  margin-top: 0;
}

.project-tracker-rate > span {
  background: var(--color-surface);
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
  width: 64px;
}

.project-tracker-rate i {
  background: var(--color-success);
  border-radius: 999px;
  display: block;
  height: 100%;
}

.project-tracker-rate i.is-mid {
  background: var(--color-warning);
}

.project-tracker-rate i.is-low {
  background: var(--color-danger);
}

.project-tracker-rate b {
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  min-width: 42px;
  text-align: right;
}

.project-tracker-waiting-button {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-bold);
  min-width: 34px;
  padding: 5px 10px;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard);
}

.project-tracker-waiting-button:hover,
.project-tracker-waiting-button:focus-visible {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
  outline: 0;
}

.project-tracker-waiting-button:focus-visible {
  box-shadow: var(--focus-ring);
}

.project-tracker-waiting-table {
  min-width: 760px;
}

.project-tracker-waiting-table :is(th, td):last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.project-tracker-leads-scoreboard :is(th, td):not(:first-child),
.project-tracker-leads-source-table :is(th, td):not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.project-tracker-leads-scoreboard th,
.project-tracker-leads-source-table th {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-tracker-designer-cell {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-width: 190px;
}

.project-tracker-designer-avatar {
  align-items: center;
  background: var(--color-text-primary);
  border-radius: 999px;
  color: var(--color-text-on-accent) !important;
  display: inline-flex !important;
  flex: 0 0 28px;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  height: 28px;
  justify-content: center;
  line-height: 1;
  text-transform: uppercase;
  width: 28px;
}

.project-tracker-designer-cell > span:not(.project-tracker-designer-avatar) {
  display: block;
  min-width: 0;
}

.project-tracker-leads-scoreboard tbody tr:nth-child(2n) .project-tracker-designer-avatar {
  background: #0891B2;
}

.project-tracker-leads-scoreboard tbody tr:nth-child(3n) .project-tracker-designer-avatar {
  background: #DB2777;
}

.project-tracker-leads-scoreboard tbody tr:nth-child(4n) .project-tracker-designer-avatar {
  background: #CA8A04;
}

.project-tracker-leads-scoreboard tbody tr:nth-child(5n) .project-tracker-designer-avatar {
  background: #475569;
}

.project-tracker-designer-cell strong {
  display: block;
  font-weight: var(--font-weight-semibold);
}

.project-tracker-designer-cell > span:not(.project-tracker-designer-avatar) > span {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-xs);
  margin-top: 1px;
}

.project-tracker-bar-list {
  display: grid;
  gap: var(--space-sm);
}

.project-tracker-bar-row {
  align-items: center;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 90px minmax(0, 1fr) 44px;
}

.project-tracker-bar-row span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.project-tracker-bar-row b {
  background: var(--color-surface);
  border-radius: 6px;
  display: block;
  height: 20px;
  overflow: hidden;
}

.project-tracker-bar-row i {
  background: var(--color-border-strong);
  border-radius: 6px;
  display: block;
  height: 100%;
}

.project-tracker-bar-success i {
  background: var(--color-success);
}

.project-tracker-bar-warning i {
  background: var(--color-warning);
}

.project-tracker-bar-danger i {
  background: var(--color-danger);
}

.project-tracker-bar-info i {
  background: var(--color-info);
}

.project-tracker-bar-row strong {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.project-tracker-segmented {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: inline-flex;
  padding: 3px;
}

.project-tracker-segmented a {
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
  padding: 6px 12px;
  text-decoration: none;
}

.project-tracker-segmented a.is-active {
  background: var(--color-card);
  box-shadow: 0 1px 2px rgba(10, 7, 16, 0.08);
  color: var(--color-accent-strong);
}

.project-tracker-period-filter {
  flex: 0 0 auto;
}

.project-tracker-converted-link {
  color: var(--color-accent-strong);
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  margin-top: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.project-tracker-detail-page {
  display: grid;
  gap: var(--space-lg);
  margin: 0 auto;
  max-width: 1400px;
  width: 100%;
}

.project-tracker-update-layout {
  align-items: start;
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 400px);
}

.project-tracker-composer-form {
  gap: var(--space-lg);
}

.project-tracker-form-section {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-md);
  padding-top: var(--space-md);
}

.project-tracker-form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.project-tracker-form-section-header h3 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
  margin: 0;
}

.project-tracker-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.project-tracker-other-blocker-fields[hidden],
.project-tracker-source-correction-fields[hidden] {
  display: none;
}

body.has-project-tracker-update-modal {
  overflow: hidden;
}

body.has-project-tracker-waiting-modal {
  overflow: hidden;
}

.project-tracker-update-modal-backdrop {
  background: rgba(10, 7, 16, 0.58);
  display: grid;
  inset: 0;
  overflow: auto;
  padding: var(--space-xl);
  place-items: start center;
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.project-tracker-update-modal-backdrop[hidden] {
  display: none;
}

.project-tracker-waiting-modal-backdrop {
  background: rgba(10, 7, 16, 0.58);
  display: grid;
  inset: 0;
  overflow: auto;
  padding: var(--space-xl);
  place-items: start center;
  position: fixed;
  z-index: var(--z-modal-backdrop);
}

.project-tracker-waiting-modal-backdrop[hidden] {
  display: none;
}

.project-tracker-update-modal {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  display: grid;
  gap: var(--space-lg);
  max-height: calc(100vh - (var(--space-xl) * 2));
  max-width: 900px;
  overflow: auto;
  padding: var(--space-xl);
  width: min(900px, 100%);
  z-index: var(--z-modal);
}

.project-tracker-waiting-modal {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  display: grid;
  max-height: calc(100vh - (var(--space-xl) * 2));
  max-width: 960px;
  overflow: hidden;
  width: min(960px, 100%);
  z-index: var(--z-modal);
}

.project-tracker-update-modal-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  padding-bottom: var(--space-md);
}

.project-tracker-waiting-modal-header {
  align-items: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  display: flex;
  gap: var(--space-lg);
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
}

.project-tracker-update-modal-header p {
  margin: 0;
}

.project-tracker-waiting-modal-header p {
  margin: 0;
}

.project-tracker-waiting-modal-heading {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.project-tracker-waiting-modal-heading h2 {
  margin: 0;
}

.project-tracker-waiting-modal-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: var(--space-sm);
}

.project-tracker-waiting-modal-metric {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: grid;
  justify-items: center;
  min-width: 76px;
  padding: 8px 12px;
}

.project-tracker-waiting-modal-metric strong {
  color: var(--color-accent-strong);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-lg);
}

.project-tracker-waiting-modal-metric span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  text-transform: uppercase;
}

.project-tracker-waiting-modal > .data-table-wrap {
  margin: var(--space-xl);
  max-height: min(460px, calc(100vh - 250px));
  overflow: auto;
}

.project-tracker-waiting-table tbody tr:hover {
  background: var(--table-row-hover);
}

.project-tracker-modal-sort-button {
  justify-content: space-between;
  width: calc(100% + 12px);
}

.project-tracker-modal-project-link {
  border-radius: 6px;
  color: var(--color-accent-strong);
  display: inline-flex;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
  padding: 2px 4px;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.project-tracker-modal-project-link:hover,
.project-tracker-modal-project-link:focus-visible {
  background: var(--color-surface);
  outline: none;
}

.project-tracker-head-status {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.project-tracker-keyline {
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
}

.project-tracker-keyline > div {
  min-width: 0;
}

.project-tracker-keyline span {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  margin-bottom: 2px;
}

.project-tracker-keyline strong {
  color: var(--color-text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-md);
  overflow-wrap: anywhere;
}

.project-tracker-source-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.project-tracker-source-list > div {
  align-items: start;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.2fr);
  padding: 6px 0;
}

.project-tracker-source-list dt {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-xs);
  margin: 0;
}

.project-tracker-source-list dd {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.project-tracker-source-list dd.project-tracker-source-empty {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-regular);
  opacity: 0.52;
}

.project-tracker-source-flow {
  display: grid;
  gap: 0;
}

.project-tracker-source-group {
  border-bottom: 1px solid var(--color-border);
}

.project-tracker-source-group:last-child {
  border-bottom: 0;
}

.project-tracker-source-group summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: var(--space-xs);
  list-style: none;
  padding: var(--space-sm) 0;
  user-select: none;
}

.project-tracker-source-group summary::-webkit-details-marker {
  display: none;
}

.project-tracker-source-group summary::before {
  border-bottom: 1.5px solid var(--color-text-muted);
  border-right: 1.5px solid var(--color-text-muted);
  content: "";
  flex: 0 0 auto;
  height: 6px;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  width: 6px;
}

.project-tracker-source-group[open] summary::before {
  transform: rotate(45deg);
}

.project-tracker-source-group-title {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  line-height: var(--line-height-xs);
  text-transform: uppercase;
}

.project-tracker-source-dot {
  background: var(--color-border);
  border-radius: 50%;
  flex: 0 0 8px;
  height: 8px;
  margin-left: auto;
  width: 8px;
}

.project-tracker-source-dot-done {
  background: var(--color-success);
}

.project-tracker-source-dot-part {
  background: var(--color-warning);
}

.project-tracker-source-dot-none {
  background: var(--color-border-strong);
  opacity: 0.35;
}

.project-tracker-source-count {
  background: var(--color-surface);
  border-radius: 999px;
  color: var(--color-text-muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  padding: 1px 8px;
}

.project-tracker-source-group-body {
  padding: 0 0 var(--space-sm) var(--space-md);
}

.project-tracker-source-money-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  margin-top: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
}

.project-tracker-source-money-box .project-tracker-source-list > div {
  padding: 4px 0;
}

.project-tracker-source-money-box .project-tracker-source-list dd {
  justify-self: end;
  text-align: right;
}

.project-tracker-source-progress-heading {
  align-items: flex-start;
}

.project-tracker-source-progress-heading > .status-pill {
  flex: 0 0 auto;
  margin-top: 2px;
}

.project-tracker-source-progress {
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 0;
  margin: var(--space-sm) 0 var(--space-lg);
  padding: 0;
  list-style: none;
}

.project-tracker-source-progress-row {
  align-items: start;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: var(--space-sm) var(--space-md);
  grid-template-columns: 14px minmax(0, 1fr) auto;
  padding: var(--space-md) 0;
}

.project-tracker-source-progress-row::before {
  background: var(--color-info-bg-subtle);
  border: 2px solid var(--color-info);
  border-radius: 50%;
  content: "";
  height: 10px;
  margin-top: 5px;
  width: 10px;
}

.project-tracker-source-progress-copy {
  min-width: 0;
}

.project-tracker-source-progress-date {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
  justify-self: end;
  line-height: var(--line-height-xs);
  white-space: nowrap;
}

.project-tracker-source-progress-row strong {
  color: var(--color-text);
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-sm);
}

.project-tracker-source-progress-row div > span {
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  overflow-wrap: anywhere;
}

.project-tracker-app-activity-header {
  margin-top: var(--space-md);
}

.project-tracker-empty-action {
  align-items: flex-start;
  display: grid;
  gap: var(--space-sm);
  justify-items: start;
}

.project-tracker-empty-action p {
  margin: 0;
}

@media (max-width: 720px) {
  .project-tracker-source-progress-row {
    align-items: start;
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .project-tracker-source-progress-date {
    grid-column: 2;
    justify-self: start;
  }
}

.project-tracker-source-balance {
  border-top: 1px dashed var(--color-border);
  margin-top: var(--space-xs);
  padding-top: var(--space-xs) !important;
}

.project-tracker-source-balance dt {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.project-tracker-source-balance dd {
  color: var(--color-accent-strong);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

.project-tracker-reference {
  background: var(--color-surface);
  border: 0;
  border-left: 3px solid var(--color-border-strong);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  color: var(--color-text-secondary);
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
  padding: var(--space-md);
}

.project-tracker-reference strong {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  line-height: var(--line-height-xs);
  text-transform: uppercase;
}

.project-tracker-reference p {
  margin: 0;
  white-space: pre-wrap;
}

.project-tracker-timeline {
  display: block;
  padding-left: 96px;
  position: relative;
}

.project-tracker-timeline::before {
  background: var(--color-border);
  bottom: 8px;
  content: "";
  left: 77px;
  position: absolute;
  top: 8px;
  width: 2px;
}

.project-tracker-timeline-item {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  position: relative;
}

.project-tracker-timeline-item:first-child {
  border-top: 0;
}

.project-tracker-timeline-item::before {
  background: var(--color-card);
  border: 3px solid var(--color-border-strong);
  border-radius: 50%;
  content: "";
  height: 12px;
  left: -27px;
  position: absolute;
  top: 21px;
  width: 12px;
}

.project-tracker-timeline-item:first-child::before {
  top: 21px;
}

.project-tracker-timeline-item.is-latest::before {
  border-color: var(--color-accent);
}

.project-tracker-timeline-simple {
  margin-left: 6px;
  padding-left: var(--space-lg);
}

.project-tracker-timeline-simple::before {
  left: 0;
}

.project-tracker-timeline-simple .project-tracker-timeline-item::before {
  left: calc(-1 * var(--space-lg) - 7px);
}

.project-tracker-timeline-item p {
  margin: 0;
}

.project-tracker-timeline-title-block {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  min-width: 0;
}

.project-tracker-timeline-date {
  color: var(--color-text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-md);
}

.project-tracker-timeline-meta {
  color: var(--color-text-muted);
  display: inline;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.project-tracker-timeline-summary {
  color: var(--color-text);
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
  white-space: pre-wrap;
}

.project-tracker-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.project-tracker-chip {
  align-items: center;
  background: var(--color-surface);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-xs);
  gap: 5px;
  line-height: var(--line-height-xs);
  padding: 3px 10px;
}

.project-tracker-chip strong {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.project-tracker-temperature-dot {
  background: var(--color-text-muted);
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 7px;
  height: 7px;
  opacity: 0.75;
  width: 7px;
}

.project-tracker-temperature-hot,
.project-tracker-temperature-rejected {
  background: var(--color-danger-fg);
  opacity: 1;
}

.project-tracker-temperature-warm {
  background: var(--color-warning-fg);
  opacity: 1;
}

.project-tracker-temperature-cold {
  background: var(--color-info-fg);
  opacity: 1;
}

.project-tracker-next-action {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-card);
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

@supports (color: color-mix(in srgb, black 50%, white)) {
  .project-tracker-next-action {
    background: color-mix(in srgb, var(--color-accent) 9%, var(--color-card));
    border-color: color-mix(in srgb, var(--color-accent) 30%, var(--color-border));
  }
}

.project-tracker-next-action-arrow {
  color: var(--color-accent-strong);
  font-weight: var(--font-weight-bold);
}

.project-tracker-next-action-text {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  min-width: 0;
}

.project-tracker-next-action-text strong {
  font-weight: var(--font-weight-bold);
}

.project-tracker-next-action-due {
  background: var(--color-warning-bg-subtle);
  border-radius: 999px;
  color: var(--color-warning-fg);
  flex: 0 0 auto;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-xs);
  margin-left: auto;
  padding: 3px 9px;
  white-space: nowrap;
}

.project-tracker-next-action-due.is-overdue {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-fg);
}

.project-tracker-timeline-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.project-tracker-timeline-note strong {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
}

.project-tracker-timeline-gap {
  height: 34px;
  position: relative;
}

.project-tracker-timeline-gap span {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  left: -96px;
  line-height: 1.25;
  position: absolute;
  text-align: right;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
}

.project-tracker-timeline-gap em {
  display: block;
  font-size: 10.5px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.03em;
  opacity: 0.85;
  text-transform: uppercase;
}

.project-tracker-timeline-gap::after {
  background: repeating-linear-gradient(var(--color-border-strong) 0 3px, transparent 3px 7px);
  bottom: 0;
  content: "";
  left: -19px;
  position: absolute;
  top: 0;
  width: 2px;
}

.project-tracker-timeline-gap-long {
  height: 46px;
}

.project-tracker-timeline-gap-long span {
  color: var(--color-warning-fg);
}

.project-tracker-timeline-gap-long::after {
  background: repeating-linear-gradient(var(--color-warning) 0 3px, transparent 3px 7px);
}

.project-tracker-timeline-gap-stale {
  height: 62px;
}

.project-tracker-timeline-gap-stale span {
  color: var(--color-danger-fg);
  font-size: var(--font-size-sm);
}

.project-tracker-timeline-gap-stale::after {
  background: repeating-linear-gradient(var(--color-danger) 0 3px, transparent 3px 7px);
}

.project-tracker-timeline-system-item {
  gap: 0;
  padding: var(--space-sm) 0;
}

.project-tracker-timeline-system-item::before,
.project-tracker-timeline-system-item.is-latest::before {
  background: var(--color-card);
  border: 2px solid var(--color-border-strong);
  height: 9px;
  left: -24.5px;
  opacity: 0.65;
  top: 16px;
  width: 9px;
}

.project-tracker-timeline-lead-item::before,
.project-tracker-timeline-lead-item.is-latest::before {
  border-color: var(--color-info);
}

.project-tracker-timeline-phase {
  padding-bottom: var(--space-md);
  padding-top: var(--space-md);
}

.project-tracker-timeline-phase::before,
.project-tracker-timeline-phase.is-latest::before {
  background: var(--color-accent);
  border-color: var(--color-accent);
  height: 12px;
  left: -26px;
  opacity: 1;
  top: 18px;
  width: 12px;
}

.project-tracker-phase-gutter {
  color: var(--color-accent-strong);
  font-size: 10.5px;
  font-weight: var(--font-weight-bold);
  left: -96px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  position: absolute;
  text-align: right;
  top: 18px;
  width: 64px;
}

.project-tracker-system-line {
  align-items: center;
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
  gap: var(--space-xs);
  line-height: var(--line-height-sm);
}

.project-tracker-system-date,
.project-tracker-system-line strong {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.project-tracker-system-source {
  background: var(--color-surface);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  padding: 2px 8px;
}

.project-tracker-system-duration {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-left: auto;
}

.project-tracker-stage-toggle {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
}

.project-tracker-stage-toggle summary {
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.project-tracker-timeline-head {
  align-items: flex-start;
  display: flex;
  gap: var(--space-sm);
  justify-content: space-between;
}

.project-tracker-timeline-actions {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: flex-end;
}

.project-tracker-review-form {
  display: grid;
  gap: var(--space-xs);
  min-width: 220px;
}

.project-tracker-void {
  max-width: 260px;
}

.project-tracker-void summary {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-button);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  list-style: none;
  min-height: 34px;
  padding: 7px 12px;
  text-align: center;
}

.project-tracker-void summary::-webkit-details-marker {
  display: none;
}

.project-tracker-void form {
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

@media (min-width: 1281px) and (max-width: 1440px) {
  .project-tracker-leads-filter .field {
    align-items: stretch;
    flex-direction: column;
    padding: 6px 8px;
  }

  .project-tracker-leads-filter .project-tracker-filter-actions {
    align-self: end;
  }
}

@media (max-width: 1280px) {
  .project-tracker-leads-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .project-tracker-attention-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-tracker-leads-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .topbar {
    align-items: flex-start;
    gap: var(--space-md);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .myday-today-tiles {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid-4,
  .admin-split-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .module-access-row {
    grid-template-columns: 1fr;
  }

  .myday-task-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .myday-task-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .myday-task-row .button {
    width: 100%;
  }

  .task-detail-hero-head {
    flex-direction: column;
  }

  .task-detail-layout {
    grid-template-columns: 1fr;
  }

  .task-detail-card {
    order: 2;
  }

  .task-activity-card {
    order: 1;
  }

  .task-detail-list > div {
    grid-template-columns: 1fr;
  }

  .task-window-labels {
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .task-window-label,
  .task-window-label.is-start,
  .task-window-label.is-end {
    left: auto;
    position: static;
    right: auto;
    text-align: left;
    transform: none;
    white-space: normal;
  }

  .purchase-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-md);
  }

  .seasonal-notice-heading,
  .seasonal-notice-row {
    display: grid;
  }

  .seasonal-notice-total {
    white-space: normal;
  }

  .seasonal-notice-row {
    grid-template-columns: 1fr;
  }

  .seasonal-notice-action {
    justify-self: start;
  }

  .request-history-request > summary {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .request-history-summary-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .project-tracker-update-layout {
    grid-template-columns: 1fr;
  }

  .project-tracker-leads-filter,
  .project-tracker-funnel {
    grid-template-columns: 1fr;
  }

  .project-tracker-leads-header {
    align-items: stretch;
    flex-direction: column;
  }

  .project-tracker-leads-filter {
    align-items: stretch;
    flex-basis: auto;
  }

  .project-tracker-leads-filter .field {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .project-tracker-leads-filter :is(select, input),
  .project-tracker-leads-filter select,
  .project-tracker-leads-filter input[type="date"] {
    max-width: none;
    width: 100%;
  }

  .project-tracker-attention-grid {
    grid-template-columns: 1fr;
  }

  .project-tracker-funnel {
    display: grid;
    gap: var(--space-md);
    min-height: 0;
  }

  .project-tracker-funnel-stage {
    padding-right: 0;
  }

  .project-tracker-funnel-bar {
    height: 72px;
  }

  .project-tracker-funnel-change {
    position: static;
    transform: none;
    width: max-content;
  }

  .project-tracker-segmented {
    width: 100%;
  }

  .project-tracker-segmented a {
    flex: 1 1 0;
    text-align: center;
  }

  .project-tracker-date-presets {
    align-items: stretch;
    flex-direction: column;
  }

  .project-tracker-date-presets .project-tracker-segmented {
    width: 100%;
  }

  .project-tracker-update-modal-backdrop {
    padding: var(--space-md);
  }

  .project-tracker-waiting-modal-backdrop {
    padding: var(--space-md);
  }

  .project-tracker-update-modal {
    max-height: calc(100vh - (var(--space-md) * 2));
    padding: var(--space-md);
  }

  .project-tracker-waiting-modal {
    max-height: calc(100vh - (var(--space-md) * 2));
  }

  .project-tracker-update-modal-header {
    display: grid;
  }

  .project-tracker-waiting-modal-header {
    display: grid;
    padding: var(--space-md);
  }

  .project-tracker-waiting-modal-actions {
    align-items: stretch;
    justify-content: space-between;
  }

  .project-tracker-waiting-modal > .data-table-wrap {
    margin: var(--space-md);
    max-height: calc(100vh - 220px);
  }

  .project-tracker-timeline-head {
    align-items: stretch;
    display: grid;
  }

  .project-tracker-next-action {
    align-items: flex-start;
    display: grid;
  }

  .project-tracker-next-action-due {
    margin-left: 0;
    width: fit-content;
  }
}

@media (max-width: 640px) {
  .project-tracker-timeline {
    padding-left: 26px;
  }

  .project-tracker-timeline::before {
    left: 7px;
  }

  .project-tracker-timeline-gap,
  .project-tracker-timeline-gap-long,
  .project-tracker-timeline-gap-stale {
    height: auto;
    padding: 6px 0 10px;
  }

  .project-tracker-timeline-gap span {
    left: auto;
    position: static;
    text-align: left;
    transform: none;
    width: auto;
  }

  .project-tracker-timeline-gap em {
    display: inline;
    font-size: 11px;
  }

  .project-tracker-timeline-gap em::before {
    content: " - ";
  }

  .project-tracker-phase-gutter {
    display: block;
    left: auto;
    margin-bottom: 4px;
    position: static;
    text-align: left;
    width: auto;
  }

  .project-tracker-timeline-item::before {
    left: -25px;
  }

  .project-tracker-timeline-system-item::before,
  .project-tracker-timeline-system-item.is-latest::before {
    left: -22.5px;
  }

  .project-tracker-timeline-simple {
    padding-left: var(--space-lg);
  }

  .project-tracker-timeline-simple::before {
    left: 0;
  }

  .project-tracker-timeline-simple .project-tracker-timeline-item::before {
    left: calc(-1 * var(--space-lg) - 7px);
  }
}

/* Project Tracker Summary redesign */
.project-tracker-summary-page {
  display: grid;
  gap: 24px;
  margin: 0 auto;
  max-width: 1400px;
  min-width: 0;
  width: 100%;
}

.project-tracker-summary-header {
  align-items: center;
  display: flex;
  gap: var(--space-lg);
  justify-content: space-between;
  min-width: 0;
}

.project-tracker-summary-header h1 {
  font-size: 24px;
  line-height: 32px;
  margin: 0;
}

.project-tracker-summary-header > div:first-child {
  min-width: 0;
}

.project-tracker-summary-header .source-warning {
  margin: var(--space-sm) 0 0;
}

.project-tracker-summary-status {
  align-items: center;
  color: var(--color-text-muted);
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  font-size: var(--font-size-xs);
  gap: var(--space-xs);
  justify-content: flex-end;
  line-height: var(--line-height-xs);
  text-align: right;
}

.project-tracker-summary-status form {
  margin: 0;
}

.project-tracker-status-dot {
  background: var(--color-text-disabled);
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.project-tracker-status-dot.is-success {
  background: var(--color-success);
}

.project-tracker-status-dot.is-warning {
  background: var(--color-warning);
}

.project-tracker-status-dot.is-danger {
  background: var(--color-danger);
}

.project-tracker-refresh-button {
  min-height: 28px;
  padding: 5px 10px;
}

.project-tracker-summary-filter-bar {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  position: relative;
}

.project-tracker-summary-filter-bar .project-tracker-date-presets {
  gap: 0;
  margin: 0;
}

.project-tracker-summary-filter-bar .project-tracker-date-presets-label {
  display: none;
}

.project-tracker-summary-filter-bar .project-tracker-segmented {
  background: #F3F4F6;
  border: 0;
  border-radius: 8px;
  padding: 3px;
}

.project-tracker-summary-filter-bar .project-tracker-segmented a {
  padding: 5px 12px;
}

.project-tracker-period-stepper {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.project-tracker-period-stepper strong {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  min-width: 140px;
  text-align: center;
  white-space: nowrap;
}

.project-tracker-period-stepper .button {
  align-items: center;
  display: inline-flex;
  font-size: 18px;
  justify-content: center;
  line-height: 1;
  min-width: 30px;
  padding: 4px 7px;
}

.project-tracker-summary-filter-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.project-tracker-filter-chip {
  align-items: center;
  background: #FFF4ED;
  border: 1px solid #FBD5BF;
  border-radius: 999px;
  color: var(--color-accent-strong-hover);
  display: inline-flex;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  gap: 5px;
  height: 28px;
  max-width: 100%;
  padding: 0 6px 0 10px;
}

.project-tracker-filter-chip a {
  border-radius: 50%;
  color: inherit;
  display: inline-flex;
  font-size: 16px;
  height: 20px;
  justify-content: center;
  line-height: 18px;
  text-decoration: none;
  width: 20px;
}

.project-tracker-filter-chip a:hover,
.project-tracker-filter-chip a:focus-visible {
  background: rgba(154, 52, 18, 0.1);
  outline: 0;
}

.project-tracker-filter-count {
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
}

.project-tracker-filter-popover {
  position: relative;
}

.project-tracker-filter-popover > summary {
  list-style: none;
}

.project-tracker-filter-popover > summary::-webkit-details-marker {
  display: none;
}

.project-tracker-filter-popover-panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 16px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  z-index: var(--z-dropdown);
}

.project-tracker-filter-fields {
  display: grid;
  gap: 10px 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-tracker-filter-fields .field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-tracker-filter-fields label {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.project-tracker-filter-fields select,
.project-tracker-filter-fields input {
  min-width: 0;
  width: 100%;
}

.project-tracker-filter-popover-actions {
  border-top: 1px solid var(--color-divider);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
}

.button-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-muted);
}

.button-ghost:hover,
.button-ghost:focus-visible {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.project-tracker-summary-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.project-tracker-summary-section-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  min-width: 0;
}

.project-tracker-summary-section-heading > span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.project-tracker-summary-section-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  line-height: var(--line-height-xs);
  margin: 0;
  text-transform: uppercase;
}

.project-tracker-attention-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-tracker-attention-card {
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 12px 14px;
  text-decoration: none;
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard),
    box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}

.project-tracker-attention-card:hover {
  transform: translateY(-1px);
}

.project-tracker-attention-card > strong {
  color: var(--color-text-primary);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 32px;
}

.project-tracker-attention-card > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-tracker-attention-card b,
.project-tracker-attention-card em {
  display: block;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.project-tracker-attention-card b {
  font-weight: var(--font-weight-semibold);
}

.project-tracker-attention-card em {
  font-size: var(--font-size-xs);
  font-style: normal;
  line-height: var(--line-height-xs);
}

.project-tracker-attention-card > i {
  font-size: 22px;
  font-style: normal;
  opacity: 0.65;
}

.project-tracker-attention-danger {
  background: var(--color-danger-bg-subtle);
  border-color: #FECACA;
}

.project-tracker-attention-warning {
  background: var(--color-warning-bg-subtle);
  border-color: #FDE68A;
}

.project-tracker-attention-danger :is(strong, b, em, i) {
  color: var(--color-danger-fg);
}

.project-tracker-attention-warning :is(strong, b, em, i) {
  color: var(--color-warning-fg);
}

.project-tracker-attention-neutral {
  background: var(--color-card);
  color: var(--color-text-muted);
}

.project-tracker-attention-neutral > strong,
.project-tracker-attention-neutral b,
.project-tracker-attention-neutral em {
  color: var(--color-text-muted);
}

.project-tracker-attention-card.is-active {
  box-shadow: inset 0 0 0 1px currentColor;
}

.project-tracker-summary-split {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.project-tracker-summary-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-width: 0;
}

.project-tracker-summary-card-header {
  display: grid;
  gap: 2px;
  padding: 16px 16px 12px;
}

.project-tracker-summary-card-header h2,
.project-tracker-table-header h2 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
  margin: 0;
}

.project-tracker-summary-card-header p,
.project-tracker-table-header p {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 0;
}

.project-tracker-lead-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 16px 16px;
}

.project-tracker-lead-stage {
  border-left: 1px solid var(--color-divider);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0 16px;
}

.project-tracker-lead-stage:first-child {
  border-left: 0;
  padding-left: 0;
}

.project-tracker-lead-stage > span {
  color: var(--color-text-secondary);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
}

.project-tracker-lead-stage > strong {
  color: var(--color-text-primary);
  display: block;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 36px;
}

.project-tracker-lead-stage > small {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  min-height: 30px;
}

.project-tracker-lead-stage > i {
  background: var(--color-surface);
  border-radius: 3px;
  display: block;
  height: 6px;
  overflow: hidden;
}

.project-tracker-lead-stage > i > b {
  background: var(--color-accent);
  border-radius: 3px;
  display: block;
  height: 100%;
}

.project-tracker-summary-card-footer {
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--font-size-xs);
  gap: 20px;
  justify-content: space-between;
  line-height: var(--line-height-xs);
  padding: 12px 16px;
}

.project-tracker-summary-card-footer b {
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

.project-tracker-money-rows {
  display: grid;
  padding: 0 16px;
}

.project-tracker-money-row {
  align-items: baseline;
  border-bottom: 1px solid var(--color-divider);
  color: inherit;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 0;
  text-decoration: none;
}

.project-tracker-money-row:last-child {
  border-bottom: 0;
}

.project-tracker-money-row > span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
}

.project-tracker-money-row > strong {
  color: var(--color-text-primary);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: var(--line-height-md);
  white-space: nowrap;
}

.project-tracker-money-row > strong small {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  margin-right: 2px;
}

.project-tracker-money-row.is-hero > strong {
  color: var(--color-accent-strong);
  font-size: 26px;
}

.project-tracker-money-row.is-zero > strong {
  color: var(--color-text-disabled);
}

.project-tracker-money-row:hover > span,
.project-tracker-money-row:focus-visible > span {
  color: var(--color-accent-strong);
}

.project-tracker-pipeline-card {
  overflow: hidden;
}

.project-tracker-empty-state,
.project-tracker-pipeline-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-md);
}

.project-tracker-empty-state {
  margin: 16px;
}

.project-tracker-pipeline-note {
  margin: 12px 16px 16px;
}

.project-tracker-pipeline-table {
  min-width: 900px;
}

.project-tracker-pipeline-table :is(th, td):not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.project-tracker-pipeline-table th {
  white-space: nowrap;
}

.project-tracker-milestone-label strong,
.project-tracker-milestone-label span {
  display: block;
}

.project-tracker-milestone-label span {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin-top: 2px;
}

.project-tracker-milestone-label em {
  color: var(--color-warning-fg);
  font-style: normal;
}

.project-tracker-pipeline-bottleneck td {
  background: var(--color-warning-bg-subtle);
}

.project-tracker-pipeline-table .is-empty {
  color: var(--color-text-disabled);
}

.project-tracker-pipeline-modal-button {
  background: transparent;
  border: 0;
  color: var(--color-accent-strong);
  cursor: pointer;
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
  padding: 3px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-tracker-pipeline-modal-button:focus-visible {
  box-shadow: var(--focus-ring);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.project-tracker-designer-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.project-tracker-table-card {
  overflow: hidden;
}

.project-tracker-table-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 16px 12px;
}

.project-tracker-table-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-tracker-table-header .project-tracker-segmented {
  flex: 0 0 auto;
}

.project-tracker-lead-funnel-scoreboard {
  min-width: 900px;
}

.project-tracker-summary-page .project-tracker-scoreboard-table :is(th, td):not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.project-tracker-summary-page .project-tracker-scoreboard-table :is(th, td):last-child {
  min-width: 220px;
  text-align: left;
  white-space: normal;
}

.project-tracker-summary-page .project-tracker-scoreboard-table :is(th, td):first-child {
  min-width: 200px;
}

.project-tracker-summary-page .project-tracker-scoreboard-legend {
  margin: 0;
  padding: 10px 16px 12px;
}

.project-tracker-queue-card {
  overflow: hidden;
}

.project-tracker-queue-card .data-table {
  min-width: 1180px;
}

.project-tracker-queue-card .inline-actions {
  flex-wrap: nowrap;
  margin: 0;
  white-space: nowrap;
}

.project-tracker-nowrap {
  white-space: nowrap;
}

.project-tracker-stage-age {
  color: var(--color-text-muted) !important;
  display: inline !important;
  font-size: var(--font-size-xs) !important;
  margin-left: 4px;
  white-space: nowrap;
}

.project-tracker-summary-page .project-tracker-table td > span {
  margin-top: 2px;
}

@media (max-width: 960px) {
  .project-tracker-attention-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-tracker-summary-split {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {
  .project-tracker-summary-header,
  .project-tracker-table-header {
    align-items: stretch;
    flex-direction: column;
  }

  .project-tracker-summary-status {
    justify-content: flex-start;
    text-align: left;
  }

  .project-tracker-attention-grid {
    grid-template-columns: 1fr;
  }

  .project-tracker-summary-filter-bar {
    align-items: stretch;
  }

  .project-tracker-summary-filter-bar .project-tracker-date-presets,
  .project-tracker-summary-filter-bar .project-tracker-date-presets .project-tracker-segmented {
    width: 100%;
  }

  .project-tracker-summary-filter-bar .project-tracker-segmented a {
    flex: 1 1 0;
    text-align: center;
  }

  .project-tracker-period-stepper {
    justify-content: space-between;
    width: 100%;
  }

  .project-tracker-period-stepper strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .project-tracker-filter-popover {
    flex: 1 1 auto;
  }

  .project-tracker-filter-popover > summary {
    text-align: center;
    width: 100%;
  }

  .project-tracker-filter-popover-panel {
    left: 0;
    right: 0;
    width: auto;
  }

  .project-tracker-filter-fields {
    grid-template-columns: 1fr;
  }

  .project-tracker-lead-stages {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .project-tracker-lead-stage,
  .project-tracker-lead-stage:first-child {
    border-left: 0;
    border-top: 1px solid var(--color-divider);
    padding: 12px 0 0;
  }

  .project-tracker-lead-stage:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .project-tracker-summary-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

.myday-home {
  display: grid;
  gap: var(--space-lg);
}

.myday-home .myday-notice {
  margin: 0;
}

.myday-home-header {
  align-items: end;
  display: flex;
  gap: var(--space-lg);
  justify-content: space-between;
}

.myday-home-header h1 {
  font-size: 32px;
  line-height: 1.15;
  margin: 0;
}

.myday-date,
.myday-preview-note {
  color: var(--color-text-secondary);
  margin: var(--space-xs) 0 0;
}

.myday-date {
  font-size: var(--font-size-sm);
}

.myday-preview-note {
  color: var(--color-warning-fg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.myday-filter-chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.myday-filter-chip {
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  display: inline-flex;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  text-decoration: none;
}

.myday-filter-chip:hover,
.myday-filter-chip:focus-visible,
.myday-filter-chip.is-active {
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

.myday-filter-chip.is-active {
  background: var(--color-text-primary);
  color: var(--color-text-on-accent);
}

.myday-filter-chip span {
  font-variant-numeric: tabular-nums;
}

.myday-home-grid {
  align-items: start;
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(0, 1fr) 320px;
}

.myday-task-column,
.myday-rail {
  min-width: 0;
}

.myday-task-column {
  display: grid;
  gap: var(--space-md);
}

.myday-section-heading,
.myday-rail-card-heading,
.myday-task-section-heading {
  align-items: center;
  display: flex;
  gap: var(--space-sm);
  justify-content: space-between;
}

.myday-section-heading h2,
.myday-rail-card-heading h2 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-lg);
  margin: 0;
}

.myday-section-heading .section-eyebrow,
.myday-rail-card-heading .section-eyebrow {
  margin-bottom: 2px;
}

.text-link {
  color: var(--color-accent-strong);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
}

.myday-task-sections {
  display: grid;
  gap: var(--space-lg);
}

.myday-task-section {
  display: grid;
  gap: var(--space-sm);
}

.myday-task-section-heading {
  justify-content: flex-start;
}

.myday-task-section-heading h3 {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0;
}

.myday-task-section.is-danger .myday-task-section-heading h3 {
  color: var(--color-danger-fg);
}

.myday-section-count {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-bold);
}

.myday-task-list {
  display: grid;
  gap: 8px;
}

.myday-task-card {
  align-items: start;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 32px minmax(0, 1fr) auto;
  padding: 12px;
}

.myday-task-card:hover {
  border-color: var(--color-border-strong);
}

.myday-task-card.is-overdue {
  border-left: 3px solid var(--color-danger);
  padding-left: 10px;
}

.myday-task-card-control,
.myday-task-card-action {
  align-items: center;
  display: flex;
  min-height: 32px;
}

.myday-task-action-form,
.myday-reopen-form {
  margin: 0;
}

.myday-task-check {
  align-items: center;
  appearance: none;
  background: var(--color-card);
  border: 2px solid var(--input-border);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 24px;
}

.myday-task-check:hover,
.myday-task-check:focus-visible {
  box-shadow: var(--focus-ring);
  border-color: var(--color-accent-strong);
  outline: var(--focus-outline);
  outline-offset: var(--focus-outline-offset);
}

.myday-task-check:disabled {
  cursor: wait;
  opacity: 0.6;
}

.myday-task-check span {
  border-bottom: 2px solid var(--color-accent-strong);
  border-right: 2px solid var(--color-accent-strong);
  height: 11px;
  opacity: 0;
  transform: rotate(45deg) translate(-1px, -1px);
  width: 6px;
}

.myday-task-control-spacer {
  display: block;
  height: 24px;
  width: 24px;
}

.myday-task-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.myday-task-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.myday-task-title {
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-md);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.myday-task-title:hover,
.myday-task-title:focus-visible {
  color: var(--color-accent-strong);
  text-decoration: underline;
}

.myday-task-context,
.myday-task-flag {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  padding: 4px 7px;
}

.myday-task-flag.is-critical {
  border-color: var(--color-danger);
  color: var(--color-danger-fg);
}

.myday-task-meta,
.myday-task-why,
.myday-task-trigger,
.myday-task-late {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  margin: 0;
}

.myday-task-meta {
  color: var(--color-text-secondary);
}

.myday-task-why,
.myday-task-trigger {
  color: var(--color-text-muted);
}

.myday-task-late {
  color: var(--color-danger-fg);
  font-weight: var(--font-weight-semibold);
}

.myday-task-card-action {
  justify-content: flex-end;
}

.myday-later-line {
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  padding-top: var(--space-sm);
}

.myday-empty-state {
  background: var(--color-card);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-input);
  color: var(--color-text-secondary);
  margin: 0;
  padding: var(--space-lg);
  text-align: center;
}

.myday-rail {
  display: grid;
  gap: var(--space-md);
  position: sticky;
  top: var(--space-md);
}

.myday-rail-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
}

.myday-rail-count {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-bold);
}

.myday-approval-list,
.myday-project-list,
.myday-updates-list {
  display: grid;
  gap: 0;
}

.myday-approval-row,
.myday-project-row,
.myday-update-row {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 3px;
  padding: 11px 0;
  text-decoration: none;
}

.myday-approval-row:first-child,
.myday-project-row:first-child,
.myday-update-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.myday-approval-row:last-child,
.myday-project-row:last-child,
.myday-update-row:last-child {
  padding-bottom: 0;
}

.myday-approval-row strong,
.myday-project-row strong,
.myday-update-title-row strong {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  overflow-wrap: anywhere;
}

.myday-approval-row span,
.myday-project-row small,
.myday-update-row p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  margin: 0;
}

.myday-approval-row:hover strong,
.myday-project-row:hover strong {
  color: var(--color-accent-strong);
}

.myday-rail-footnote,
.myday-rail-empty {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  margin: 0;
}

.myday-project-metrics {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.myday-project-metrics span {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.myday-project-metrics strong {
  color: var(--color-text-primary);
  display: block;
  font-size: var(--font-size-md);
  line-height: var(--line-height-md);
}

.myday-project-row {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
}

.myday-project-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.myday-project-flags {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.myday-project-flags em {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-style: normal;
  white-space: nowrap;
}

.myday-project-flags em.is-danger {
  color: var(--color-danger-fg);
}

.myday-project-flags em.is-warning {
  color: var(--color-warning-fg);
}

.myday-update-row {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
}

.myday-update-title-row {
  align-items: start;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.myday-update-kind {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.myday-update-row.is-action .myday-update-kind {
  color: var(--color-warning-fg);
}

.myday-update-link {
  color: var(--color-accent-strong);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.myday-update-link:hover,
.myday-update-link:focus-visible {
  text-decoration: underline;
}

.myday-show-updates {
  justify-self: start;
}

.myday-toast {
  align-items: center;
  background: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-input);
  bottom: var(--space-lg);
  color: var(--color-text-on-accent);
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  left: 50%;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 12px;
  position: fixed;
  transform: translateX(-50%);
  width: max-content;
  z-index: 20;
}

.myday-toast-action {
  background: transparent;
  border: 0;
  color: var(--color-text-on-accent);
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-bold);
  padding: 2px 0;
  text-decoration: underline;
}

@media (max-width: 820px) {
  .myday-home-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .myday-filter-chips {
    justify-content: flex-start;
  }

  .myday-home-grid {
    grid-template-columns: 1fr;
  }

  .myday-rail {
    position: static;
  }
}

@media (max-width: 560px) {
  .myday-filter-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .myday-filter-chip {
    justify-content: center;
    min-width: 0;
    padding-inline: 8px;
  }

  .myday-task-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .myday-task-card-action {
    grid-column: 2;
    justify-content: flex-start;
  }

  .myday-project-metrics {
    gap: 8px;
  }
}
