:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --ink-1: #1f2a44;
  --ink-2: #55627a;
  --line: #d6deed;
  --line-soft: #e9eef8;
  --brand: #2463eb;
  --brand-strong: #1f54c7;
  --ok: #1d8546;
  --warn: #9a6111;
  --danger: #cb3d2f;
  --shadow: 0 12px 28px rgba(21, 38, 71, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Pretendard', sans-serif;
  color: var(--ink-1);
  background:
    radial-gradient(circle at 10% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 45%),
    radial-gradient(circle at 90% -20%, #eef4ff 0%, rgba(238, 244, 255, 0) 40%),
    var(--bg);
  min-height: 100vh;
}

.top-links {
  max-width: 1100px;
  margin: 20px auto 0;
  padding: 0 24px;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  font-size: 12px;
}

.top-links a {
  color: #5b6476;
  text-decoration: none;
}

.top-links a:hover {
  color: var(--brand);
}

.app {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 28px;
  display: grid;
  gap: 10px;
}

.hero {
  text-align: center;
  margin-bottom: 4px;
  padding: 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #d8e2f5;
  border-radius: 999px;
  background: #f8fbff;
  color: #4f5f83;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.hero h1 {
  margin: 8px 0 0;
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a2846;
}

.hero-sub {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: #556586;
}

.input-zone,
.result-zone,
.request-zone {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.section-head h2,
.result-head h2,
.request-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.section-head p,
.request-sub {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.btn {
  border: 1px solid var(--line);
  background: #f8faff;
  color: var(--ink-1);
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  border-color: #bcc8e3;
  background: #f1f5ff;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-small {
  padding: 8px 12px;
  font-size: 12px;
}

.carrier-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.remong-grid-zone {
  margin-top: 14px;
}

.tracking-grid-wrap {
  margin-top: 10px;
}

.tracking-grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.tracking-grid-input {
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

.tracking-grid-status {
  color: var(--ink-2);
  font-size: 12px;
}

.tracking-grid-table {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
}

.carrier-row label {
  margin: 0;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-1);
}

.carrier-row select {
  height: 38px;
  padding: 0 30px 0 12px;
  box-sizing: border-box;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #60708f 50%),
    linear-gradient(135deg, #60708f 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.progress-text {
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--ink-2);
  background: #f9fbff;
}

.progress-text.error {
  border-color: #efb3aa;
  color: #a12214;
  background: #fff6f5;
}

#input-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

#input-table:hover {
  border-color: #b8c5e4;
}

#input-table.is-clicked {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

#input-table .tabulator {
  border: 0;
  background: transparent;
}

#input-table .tabulator-header {
  background: #f4f7ff;
  border-bottom: 1px solid var(--line);
}

#input-table .tabulator-col,
#input-table .tabulator-col-title {
  color: #3d4b67;
  font-size: 12px;
  font-weight: 700;
}

#input-table .tabulator-row {
  border-bottom: 1px solid #f0f3fa;
}

#input-table .tabulator-cell {
  padding: 10px;
  border-right: 1px solid #f0f3fa;
}

#input-table .tabulator-editing {
  background: #edf3ff !important;
}

.summary-zone {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.summary-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
}

.summary-card h3 {
  margin: 0 0 2px 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.summary-total p {
  color: #3e4e6e;
}

.summary-urgent p {
  color: var(--danger);
}

.summary-review p {
  color: var(--warn);
}

.summary-penalty p {
  color: #b45309;
}

.summary-normal p {
  color: var(--ok);
}

.summary-penalty {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.summary-penalty:hover {
  border-color: #f59e0b;
}

.summary-penalty.fine-risk-active {
  background: #fffbeb;
  border-color: #fcd34d;
}

.summary-penalty.fine-risk-clear {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.result-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.last-updated {
  color: var(--ink-2);
  font-size: 12px;
}

.result-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
  border-top: 1px solid var(--line-soft);
}

.result-table th,
.result-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.result-table th {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  background: #f8faff;
}

.sort-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.sort-btn .sort-indicator {
  color: #8b97b1;
  font-size: 12px;
  line-height: 1;
}

.sort-btn.is-active .sort-indicator,
.sort-btn:hover .sort-indicator {
  color: #3f5280;
}

.result-table .col-bl {
  width: 11%;
}

.result-table .col-tracking {
  width: 11%;
}

.badge-done {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.result-table .col-customs {
  width: 14%;
}

.result-table .col-delivery {
  width: 15%;
}

.result-table .col-risk {
  width: 8%;
}

.result-table .col-delay {
  width: 19%;
}

.result-table .col-next {
  width: 22%;
}

.cell-main {
  color: #2f3b55;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.col-tracking {
  vertical-align: middle;
}

.col-tracking .cell-main,
.col-tracking .cell-sub {
  display: block;
  line-height: 1.4;
}

.result-table .col-tracking .cell-main {
  font-size: 12px;
}

.result-table .col-tracking .cell-sub {
  font-size: 10px;
}

/* 결과 테이블 모든 td 기본 세로 정렬 통일 */
#result-table td {
  vertical-align: middle;
  word-break: break-all;
  padding: 8px 10px;
  box-sizing: border-box;
}

/* 박스/송장 없을 때 빈 셀 높이 유지 */
.col-tracking:empty::after,
.col-tracking .cell-main:empty::after {
  content: '-';
  color: #aab0bc;
}

.cell-main-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.customs-main-text {
  min-width: 0;
  word-break: break-word;
}

.inline-complete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8f6ed;
  color: #1d8546;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.cell-sub {
  margin-top: 3px;
  color: #64718a;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.cell-urgent {
  margin-top: 4px;
  color: #a63a2d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.stack {
  display: grid;
  gap: 4px;
}

.bl-detail-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #2456c5;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.bl-detail-btn:hover {
  text-decoration: underline;
}

.bl-text {
  color: #2f3b55;
}

.tracking-detail-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #2456c5;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  word-break: break-all;
}

.tracking-detail-btn:hover {
  text-decoration: underline;
}

.tracking-plain {
  color: #2f3b55;
  word-break: break-all;
}

.penalty-box {
  border: 1px solid #ffdcb2;
  border-radius: 10px;
  background: #fff8ef;
}

.row-retry-btn {
  border: 1px solid #cfd9ee;
  background: #f7faff;
  color: #274686;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  padding: 6px 8px;
  cursor: pointer;
  width: fit-content;
}

.row-retry-btn:hover {
  background: #edf3ff;
}

.penalty-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 6px 8px;
  color: #844a0f;
  font-size: 12px;
  font-weight: 700;
}

.penalty-toggle:hover {
  background: #fff2df;
}

.penalty-detail {
  border-top: 1px solid #ffe6c9;
  padding: 6px 8px;
  font-size: 12px;
  color: #63462a;
  line-height: 1.4;
  display: grid;
  gap: 3px;
}

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

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot-pending {
  background: #9aa8c6;
}

.dot-running {
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(36, 99, 235, 0.45);
  animation: pulse 1.2s infinite;
}

.dot-done {
  background: var(--ok);
}

.dot-cached {
  background: #4b7ef5;
}

.dot-error {
  background: var(--danger);
}

.risk-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.risk-low {
  color: var(--ok);
  background: #e8f6ed;
}

.risk-mid {
  color: var(--warn);
  background: #fff5df;
}

.risk-high {
  color: var(--danger);
  background: #feeceb;
}

.empty-row {
  text-align: center;
  color: var(--ink-2);
  padding: 26px 8px !important;
}

.request-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.request-link {
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
}

.request-link:hover {
  text-decoration: underline;
}

.request-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.request-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.request-item a {
  color: #2d4169;
  text-decoration: none;
  font-weight: 600;
}

.request-item a:hover {
  color: var(--brand);
}

.request-meta {
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}

.request-empty {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.request-empty p {
  margin: 0;
}

.request-empty p + p {
  margin-top: 6px;
}

.request-empty a {
  color: var(--brand);
}

.fine-risk-zone {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

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

.fine-risk-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.fine-risk-count {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.fine-risk-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border-top: 1px solid var(--line-soft);
}

.fine-risk-table th,
.fine-risk-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 12px;
  vertical-align: middle;
}

.fine-risk-table th {
  background: #f8faff;
  color: var(--ink-2);
  font-weight: 700;
}

body.modal-open {
  overflow: hidden;
}

.bl-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
}

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

.bl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 56, 0.45);
}

.bl-modal-panel {
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 44px));
  max-height: calc(100vh - 80px);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(12, 24, 49, 0.2);
}

.bl-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: move;
  user-select: none;
  touch-action: none;
}

.bl-modal-title {
  margin: 0;
  font-size: 16px;
}

.bl-modal-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #5d6880;
}

.bl-modal-meta {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: #4b5871;
  font-size: 12px;
}

.bl-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  overflow: auto;
}

.bl-modal-section {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  background: #fcfdff;
}

.bl-modal-subtitle {
  margin: 0;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: #41506d;
}

.bl-history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11.5px;
}

.bl-history-table th,
.bl-history-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 6px;
  text-align: left;
}

.bl-history-table th:first-child,
.bl-history-table td:first-child {
  width: 52px;
  text-align: center;
}

.bl-history-table th:nth-child(2),
.bl-history-table td:nth-child(2) {
  width: 15%;
}

.bl-history-table th:nth-child(3),
.bl-history-table td:nth-child(3) {
  width: 47%;
}

.bl-history-table th:nth-child(4),
.bl-history-table td:nth-child(4) {
  width: 30%;
}

.bl-history-table th {
  color: #4b5871;
  background: #f7f9fe;
}

.bl-empty {
  text-align: center;
  color: #6a7791;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(36, 99, 235, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(36, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(36, 99, 235, 0);
  }
}

@media (max-width: 960px) {
  .app {
    width: min(1100px, calc(100% - 20px));
    padding-top: 20px;
  }

  .section-head {
    flex-direction: column;
  }

  .control-row {
    width: 100%;
    justify-content: flex-start;
  }

  .summary-zone {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-head,
  .request-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-head-right {
    justify-content: flex-start;
  }

  .result-table {
    font-size: 12px;
  }

  .result-table th,
  .result-table td {
    padding: 10px 7px;
  }

  .bl-modal-grid {
    grid-template-columns: 1fr;
  }

  .request-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .top-links {
    padding: 0 12px;
    margin-top: 12px;
    gap: 10px;
  }

  .hero h1 {
    font-size: 1.45rem;
  }

  .summary-zone {
    grid-template-columns: 1fr;
  }

  .control-row {
    flex-wrap: wrap;
  }

  .control-row .btn {
    flex: 1 1 auto;
  }

  .bl-modal-panel {
    width: calc(100% - 16px);
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    max-height: calc(100vh - 16px);
  }
}

.embedded-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
}

.embedded-modal.is-open {
  display: block;
}

.embedded-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(11, 16, 32, 0.56);
  backdrop-filter: blur(2px);
}

.embedded-panel {
  position: absolute;
  inset: 20px;
  z-index: 2;
  background: #fff;
  border: 1px solid #d8e0f2;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(23, 42, 89, 0.25);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.embedded-viewport {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.embedded-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e6ecf8;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7ff 100%);
}

.embedded-title {
  font-size: 15px;
  color: #1f2a44;
}

.embedded-close {
  border: 1px solid #d6dfef;
  background: #fff;
  color: #1f2a44;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  cursor: pointer;
}

.embedded-iframe {
  display: block;
  position: relative;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 960px) {
  .embedded-panel {
    inset: 8px;
    border-radius: 12px;
  }
}

/* React Migration Additions (append only) */
.remong-row-memo {
  width: 100%;
  min-height: 36px;
  max-height: 90px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid #d1d9e0;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  font-size: 12px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.remong-row-memo::placeholder {
  color: #94a3b8;
}

.remong-row-memo:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.remong-row-memo:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.remong-row-summary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 7px 10px;
  border: 1px solid #d1d9e0;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.remong-row-summary-link:hover {
  color: #0f172a;
  border-color: #94a3b8;
  background: #f8fafc;
}

.remong-row-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 7px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.remong-row-save-btn:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.remong-row-save-btn.saved {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.remong-summary-overlay {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.remong-summary-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d1d9e0;
  border-radius: 12px;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.26);
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.remong-summary-title {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.remong-summary-text {
  width: 100%;
  min-height: 230px;
  max-height: calc(100vh - 180px);
  resize: vertical;
  border: 1px solid #d1d9e0;
  border-radius: 10px;
  padding: 11px 12px;
  background: #ffffff;
  color: #1e293b;
  font-family: "Pretendard", "Inter", sans-serif;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  outline: none;
}

.remong-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.remong-summary-btn {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.remong-summary-btn:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.remong-summary-btn.secondary {
  border-color: #d1d9e0;
  background: #ffffff;
  color: #475569;
}

.remong-summary-btn.secondary:hover {
  border-color: #94a3b8;
  color: #0f172a;
  background: #f8fafc;
}

@media (max-width: 720px) {
  .remong-summary-overlay {
    padding: 10px;
  }

  .remong-summary-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 10px;
    padding: 12px;
    gap: 8px;
  }

  .remong-summary-text {
    min-height: 180px;
    max-height: calc(100vh - 150px);
  }
}

/* =====================================================
   PHASE-1 UI 이식 — App.tsx 레이아웃 클래스
   style.css 끝에 추가 (기존 내용 삭제 금지)
   ===================================================== */

/* ── 전체 배경 ── */
body {
  background: #F1F5F9;
  font-family: 'Pretendard', 'Inter', sans-serif;
}

/* ── TopNav ── */
.top-nav {
  background: #ffffff;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-nav-brand {
  font-size: 15px;
  font-weight: 800;
  color: #1D4ED8;
  letter-spacing: -0.03em;
}
.top-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-nav-links a {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: color 0.15s;
}
.top-nav-links a:hover { color: #0F172A; }
.top-nav-user {
  font-size: 12px;
  font-weight: 600;
  color: #1E293B;
}
.top-nav-updated {
  font-size: 11px;
  color: #94A3B8;
  margin-left: 8px;
}
.top-nav-updated strong { color: #64748B; font-weight: 600; }

/* ── 로딩 바 ── */
.loading-bar {
  height: 2px;
  background: #DBEAFE;
  overflow: hidden;
}
.loading-bar-inner {
  height: 100%;
  background: #1D4ED8;
  width: 0%;
  animation: loading-bar-anim 1.6s ease-in-out forwards;
}
@keyframes loading-bar-anim {
  0%   { width: 0%; }
  20%  { width: 40%; }
  60%  { width: 72%; }
  90%  { width: 92%; }
  100% { width: 100%; }
}

/* ── 페이지 메인 ── */
.page-main {
  padding: 24px 0 48px;
}
.content-max {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero 섹션 ── */
.hero-section {
  margin-bottom: 24px;
}
.hero-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #1D4ED8;
  margin-bottom: 6px;
}
.hero-section h1 {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 13px;
  color: #64748B;
  line-height: 1.6;
}
.hero-sub small {
  font-size: 11px;
  opacity: 0.75;
}

/* ── 섹션 구분선 ── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-divider-label {
  font-size: 12px;
  font-weight: 700;
  color: #1E293B;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.section-divider-badge {
  padding: 1px 6px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.section-divider-line {
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}
.section-divider-sub {
  font-size: 11px;
  font-weight: 500;
  color: #94A3B8;
  white-space: nowrap;
}

/* ── Summary Zone (순서 변경: input 위로) ── */
.summary-zone {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.summary-card {
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  transition: box-shadow 0.15s;
}
.summary-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.summary-card h3 {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 6px;
}
.summary-card p {
  font-size: 24px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.03em;
}
.summary-urgent p { color: #DC2626; }
.summary-penalty { cursor: pointer; }
.summary-penalty p { color: #D97706; }

/* ── Input Card (InputZone.tsx 스타일) ── */
.input-card {
  background: #ffffff;
  border: 1px solid #D1D9E0;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.input-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #E8ECF0;
  background: #F8FAFC;
}
.input-card-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-card-icon { color: #334155; }
.input-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
}
.input-card-badge {
  padding: 2px 6px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.input-card-head-right {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #64748B;
}
.input-info-icon { color: #94A3B8; }
.input-hint { font-size: 12px; color: #64748B; }

.input-card-body {
  padding: 20px;
}
.progress-text {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 12px;
}
.progress-text.error { color: #DC2626; }

/* 하단 액션 바 */
.input-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.input-action-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 행추가 버튼 (dashed) */
.btn-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  background: transparent;
  border: 1px dashed #94A3B8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-add-row:hover {
  color: #0F172A;
  border-color: #475569;
  background: #F8FAFC;
}
.btn-add-row svg { flex-shrink: 0; }

/* 보조 버튼 */
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  background: #ffffff;
  border: 1px solid #D1D9E0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover {
  color: #0F172A;
  border-color: #94A3B8;
}

/* 주 버튼 */
.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  background: #1D4ED8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.btn-primary:hover { background: #1E40AF; }
.btn-primary:active { background: #1E3A8A; }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Result Zone 헤더 업데이트 ── */
.result-zone { margin-bottom: 20px; }
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.result-head h2 {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
}
.result-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── 푸터 ── */
.page-footer {
  margin-top: 32px;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-footer > span {
  font-size: 11px;
  color: #94A3B8;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-links a {
  font-size: 11px;
  color: #94A3B8;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: #475569; }

/* ── 반응형 ── */
@media (max-width: 900px) {
  .summary-zone { grid-template-columns: repeat(3, 1fr); }
  .content-max { padding: 0 16px; }
  .top-nav-inner { padding: 0 16px; }
}
@media (max-width: 600px) {
  .summary-zone { grid-template-columns: repeat(2, 1fr); }
  .input-card-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .input-action-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .input-action-right { justify-content: flex-end; }
  .page-footer { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── STEP 5 ResultTable 이식 클래스 ── */

/* 숨김 컬럼 */
.col-hidden { display: none !important; }

/* 행 강조 */
.row-urgent { background: #FFF8F8; }
.row-urgent:hover { background: #FEF2F2; }

/* 판정 pill */
.label-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.label-high   { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }
.label-medium { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
.label-low    { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.label-done   { background: #DCFCE7; color: #166534; border-color: #86EFAC; }

/* 과태료 의심 배지 */
.penalty-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 4px;
  color: #B91C1C;
  font-size: 12px;
  font-weight: 700;
}
.text-muted { color: #CBD5E1; font-size: 12px; }

/* 안내 메시지 */
.guide-message { font-size: 12px; color: #334155; line-height: 1.4; }

/* 트래킹 셀 */
.cell-tracking-main { font-size: 10.5px; font-weight: 600; color: #334155; line-height: 1.4; word-break: break-all; }
.carrier-auto  { color: #94A3B8; }
.carrier-name  { color: inherit; }

/* 메모 textarea (React: remong-row-memo) */
.remong-row-memo {
  width: 100%;
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 12px;
  color: #334155;
  resize: vertical;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.remong-row-memo:focus { border-color: #93C5FD; box-shadow: 0 0 0 2px #DBEAFE; }
.remong-row-memo:disabled { background: #F8FAFC; color: #94A3B8; cursor: not-allowed; }

/* 화물요약 버튼 (React: remong-row-summary-link) */
.remong-row-summary-link {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #1D4ED8;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 4px;
}
.remong-row-summary-link:hover { background: #DBEAFE; }

/* 저장 버튼 (React: remong-row-save-btn) */
.remong-row-save-btn {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #D1D9E0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.remong-row-save-btn:hover { color: #0F172A; border-color: #94A3B8; }
.remong-row-save-btn.saved { color: #166534; background: #DCFCE7; border-color: #86EFAC; }
.remong-row-save-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* col-copy 셀 세로 정렬 */
.col-copy { vertical-align: middle; }
.col-memo { vertical-align: middle; }