body.approval-page-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

.approval-page {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(14px, 2.5vh, 24px) 24px 24px;
}

.approval-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.approval-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.approval-brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  fill: #e7f1fb;
  stroke: var(--primary-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.approval-brand-copy {
  min-width: 0;
}

.approval-brand-copy h1 {
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(23px, 2.3vw, 27px);
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.approval-brand-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.approval-current-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  white-space: nowrap;
}

.approval-current-user-label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.approval-current-user-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.approval-logout-button {
  white-space: nowrap;
}

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

.approval-date-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.approval-date-field > span {
  line-height: 1;
  white-space: nowrap;
}

.approval-date-field input {
  box-sizing: border-box;
  width: 200px;
  height: 48px;
  min-height: 48px;
  padding: 8px 12px;
  border-color: var(--line-strong);
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
  text-align: center;
}

#productionDate::-webkit-date-and-time-value,
#productionDate::-webkit-datetime-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
}

.approval-operation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.approval-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.approval-navigation .quiet-button,
.approval-logout-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #eef6fc;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.approval-line-panel,
.approval-overview-panel,
.approval-summary-panel,
.approval-details {
  margin-bottom: 8px;
}

.approval-line-panel {
  padding: 10px 14px;
}

.approval-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.approval-section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.approval-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.approval-line-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.approval-line-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.line-status-indicator {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 1px currentColor;
}

.line-status-indicator.approval-target {
  color: #17663b;
  background: #46a76a;
}

.line-status-indicator.in-progress {
  color: #9f1d1d;
  background: #d9554f;
}

.approval-line-panel .line-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.approval-line-panel .line-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 8px 12px;
  border-width: 1px;
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

.line-option-name {
  min-width: 0;
}

.line-status-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 20px;
}

.approval-line-panel .line-option.selected {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.approval-overview-panel {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
}

.approval-target {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.approval-target-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.approval-target strong {
  color: var(--text);
  font-size: 16px;
}

.approval-decision-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 10px;
}

.approval-status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.approval-status-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.approval-status-item strong {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 22px;
}

.approval-status-item strong small {
  font-size: 12px;
  font-weight: 700;
}

.approval-status-item.in-progress {
  color: #9f1d1d;
  background: #fff0f0;
  border-color: #e4a0a0;
}

.approval-status-item.unapproved {
  color: #17663b;
  background: #edfaf1;
  border-color: #91caa6;
}

.approval-status-item.approved {
  color: #1d4f91;
  background: #edf5ff;
  border-color: #9ebfe6;
}

.approval-action-panel {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(130px, 1fr);
  align-items: center;
  gap: 12px;
}

.approval-action-panel .save-button {
  width: 100%;
  min-height: 54px;
  font-size: 17px;
}

.approval-readiness {
  display: flex;
  align-items: center;
  min-height: 54px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.approval-readiness.is-ready {
  color: var(--success);
  border-color: #91caa6;
  background: #edfaf1;
}

.approval-readiness.is-blocked {
  color: #9a3412;
  border-color: #e9a16f;
  background: #fff4e8;
}

.approval-message {
  min-height: 0;
  margin: 0;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.approval-message[hidden],
.approval-auth-loading[hidden] {
  display: none;
}

.approval-app-message {
  margin: 0 0 14px;
}

.approval-summary-panel {
  padding: 10px 14px;
}

.approval-summary-table {
  min-width: 780px;
}

.approval-summary-table th,
.approval-summary-table td {
  text-align: center;
}

.approval-summary-table th:nth-child(2),
.approval-summary-table td:nth-child(2) {
  text-align: left;
}

.approval-details {
  padding: 10px 14px;
}

.approval-details summary {
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.approval-details[open] summary {
  margin-bottom: 8px;
}

.approval-detail-table {
  min-width: 0;
  table-layout: fixed;
}

.approval-detail-table th,
.approval-detail-table td {
  padding: 7px 6px;
  overflow-wrap: anywhere;
}

.approval-detail-table th:nth-child(1),
.approval-detail-table td:nth-child(1),
.approval-detail-table th:nth-child(3),
.approval-detail-table td:nth-child(3),
.approval-detail-table th:nth-child(5),
.approval-detail-table td:nth-child(5),
.approval-detail-table th:nth-child(6),
.approval-detail-table td:nth-child(6),
.approval-detail-table th:nth-child(7),
.approval-detail-table td:nth-child(7) {
  text-align: center;
}

.approval-detail-table th:nth-child(2),
.approval-detail-table td:nth-child(2) {
  text-align: left;
}

.approval-detail-table th:nth-child(4),
.approval-detail-table td:nth-child(4) {
  text-align: right;
}

.approval-product-cell,
.approval-shipment-cell,
.approval-wip-cell {
  display: grid;
  gap: 4px;
}

.approval-shipment-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.approval-product-cell strong,
.approval-wip-cell strong {
  color: var(--text);
}

.approval-product-cell small,
.approval-wip-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shipment-button,
.restriction-reason-button {
  width: auto;
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
  white-space: nowrap;
}

.restriction-reason-button.has-reason {
  color: #9a3412;
  border-color: #e9a16f;
  background: #fff4e8;
}

.restriction-reason-button.missing-reason {
  color: #9f1d1d;
  border-color: #e4a0a0;
  background: #fff0f0;
}

.approval-readonly-value {
  color: var(--text);
  font-weight: 700;
}

.approval-record-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.approval-record-state.in-progress {
  color: #9f1d1d;
  border-color: #e4a0a0;
  background: #fff0f0;
}

.approval-record-state.unapproved {
  color: #17663b;
  border-color: #91caa6;
  background: #edfaf1;
}

.approval-auth-loading,
.approval-page-body > .approval-message {
  align-self: center;
  justify-self: center;
  width: min(100% - 48px, 520px);
}

.approval-auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.approval-loading-indicator {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: approval-loading-spin 0.8s linear infinite;
}

.approval-footer {
  padding: 0 24px 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.approval-confirm-dialog {
  width: min(500px, calc(100% - 32px));
}

.approval-reason-dialog {
  width: min(460px, calc(100% - 32px));
}

.approval-confirm-dialog h2,
.approval-reason-dialog h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
}

.approval-confirm-dialog > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.approval-reason-dialog > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.approval-reason-dialog textarea {
  width: 100%;
  min-height: 112px;
  margin: 16px 0;
  resize: vertical;
}

.approval-confirm-details {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.approval-confirm-details > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.approval-confirm-details dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.approval-confirm-details dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.approval-confirm-actions {
  justify-content: flex-end;
}

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

@media (max-width: 900px) {
  .approval-page {
    padding: 28px 16px;
  }

  .approval-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 18px;
  }

  .approval-operation-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-operation-actions {
    margin-left: 0;
  }

  .approval-navigation {
    justify-content: flex-start;
  }

  .approval-line-panel .line-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .approval-decision-row,
  .approval-action-panel {
    grid-template-columns: 1fr;
  }

  .approval-detail-table {
    min-width: 760px;
  }
}

@media (max-width: 600px) {
  .approval-brand {
    gap: 10px;
  }

  .approval-brand-copy h1 {
    font-size: 27px;
    white-space: normal;
  }

  .approval-logout-button,
  .approval-navigation .quiet-button {
    width: 100%;
  }

  .approval-navigation {
    display: grid;
    grid-template-columns: 1fr;
  }

  .approval-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-line-panel .line-list,
  .approval-status-row {
    grid-template-columns: 1fr;
  }

  .approval-line-panel,
  .approval-overview-panel,
  .approval-summary-panel,
  .approval-details {
    padding: 20px;
  }

  .approval-confirm-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .approval-confirm-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .approval-loading-indicator {
    animation: none;
  }
}
