:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --line: #d7dee9;
  --line-strong: #c7d2e5;
  --text: #172033;
  --muted: #68758a;
  --blue: #2563eb;
  --blue-dark: #1e4fc0;
  --blue-soft: #eff6ff;
  --head: #f8fafc;
  --input: #fffdf0;
  --input-strong: #fff7d6;
  --shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", Arial, sans-serif;
  font-size: 14px;
}
button, input { font: inherit; }
input:not([type="date"]) { -webkit-appearance: none; appearance: none; }
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
input[type="date"] {
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .75;
}

.ips-page {
  max-width: 1500px;
  min-width: 1120px;
  margin: 0 auto;
  padding: 8px 8px 14px;
}
.common-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 12px;
  padding: 6px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.common-grid {
  display: grid;
  grid-template-columns: 138px minmax(300px, 1fr) minmax(170px, 220px) minmax(130px, 160px) minmax(145px, 165px);
  gap: 5px 8px;
  align-items: stretch;
}
.common-label {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0;
}
.common-label span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.2;
}
.common-label strong {
  font-size: 15px;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.top-status {
  grid-column: 2 / span 1;
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-tools {
  grid-column: 3 / span 3;
  display: grid;
  grid-template-columns: auto 118px 122px 56px 62px 66px;
  gap: 5px;
  align-items: center;
  justify-content: end;
  min-width: 0;
}
.version-badge {
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cdd8ec;
  border-radius: 8px;
  background: #f5f8fd;
  color: #617089;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.mini-cell,
.meta-cell {
  display: grid;
  grid-template-columns: auto 1fr;
  min-width: 0;
  height: 27px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}
.mini-cell span,
.meta-cell span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 0 7px;
  background: var(--head);
  border-right: 1px solid var(--line);
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.mini-cell input,
.meta-cell input {
  width: 100%;
  min-width: 0;
  height: 25px;
  border: 0;
  outline: 0;
  padding: 0 7px;
  text-align: center;
  background: var(--input-strong);
  color: #111827;
}
.required-field input { background: var(--input-strong); }
.project-cell input { text-align: left; }
.required-field input:focus,
.meta-cell input:focus,
.mini-cell input:focus,
.pressure-cell input:focus,
.stage-cell input:focus {
  box-shadow: inset 0 0 0 2px rgba(37,99,235,.22);
  background: #fffbe8;
}
.required-field.missing { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.12); }
.top-btn {
  height: 27px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}
.top-btn:hover { border-color: var(--blue); color: var(--blue); }
.top-btn.reset:hover { border-color: #ef4444; color: #dc2626; }
.top-btn.steel:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.project-cell { grid-column: 1 / span 2; }
.company-cell { grid-column: 3 / span 1; }
.writer-cell { grid-column: 4 / span 1; }
.date-cell { grid-column: 5 / span 1; }
.date-cell input { letter-spacing: -0.01em; }

.pressure-strip {
  display: grid;
  grid-template-columns: 138px 84px 1fr;
  gap: 6px;
  align-items: stretch;
  padding-top: 7px;
  margin-top: 7px;
  border-top: 1px solid var(--line);
}
.pressure-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 38px;
}
.pressure-head span { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.pressure-head strong { margin-top: 2px; font-size: 15px; letter-spacing: -0.03em; }
.pressure-head em { color: var(--muted); font-style: normal; font-size: 12px; font-weight: 600; }
.pressure-cell, .stage-cell {
  min-width: 0;
  height: 39px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  display: grid;
  grid-template-rows: 17px 1fr;
}
.pressure-cell span, .stage-cell span {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--head);
  border-bottom: 1px solid var(--line);
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}
.max-cell span { background: var(--blue-soft); color: var(--blue-dark); }
.pressure-cell input, .stage-cell input {
  width: 100%;
  min-width: 0;
  height: 21px;
  border: 0;
  outline: 0;
  padding: 0 3px;
  text-align: center;
  background: var(--input-strong);
  color: #111827;
  font-size: 12px;
}
.max-cell input { font-weight: 900; color: var(--blue); background: var(--input-strong); }
.pressure-stages {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1.18fr 1fr;
  gap: 12px;
}
.action-card {
  position: relative;
  min-height: 488px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.action-card h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.03em; }
.step-no {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: #dbe3f1;
}
.lead { margin: 0 0 8px; line-height: 1.48; font-weight: 800; }
.muted { margin: 0 0 14px; color: var(--muted); line-height: 1.45; font-size: 12.5px; }
.primary, .secondary {
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
  line-height: 1.1;
}
.primary { background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(37,99,235,.20); }
.primary:hover { background: var(--blue-dark); }
.primary:disabled,
.primary.disabled {
  background: #d1d5db;
  color: #7b8494;
  box-shadow: none;
  cursor: not-allowed;
}
.secondary { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }
.secondary.enabled { background: #0f172a; color: #fff; cursor: pointer; }
.full { width: 100%; }
.steel-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.steel-box h3, .work-row h3, .planned-box h3, .estimate-box h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: -0.02em; }
.steel-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); }
.steel-table th, .steel-table td { height: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; font-size: 12px; }
.steel-table th { background: #e9eef6; color: #334155; font-weight: 900; }
.steel-table tr:last-child td { border-bottom: 0; }
.steel-table th:last-child, .steel-table td:last-child { border-right: 0; }
.note-line { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid #b9d3ff;
  border-radius: 10px;
  background: #f8fbff;
}
.work-row p, .planned-box p, .estimate-box p, .planned-box li { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.planned-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed #c7ceda;
  border-radius: 10px;
  background: #fafafa;
}
.planned-box span { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: #94a3b8; color: #fff; font-size: 10px; vertical-align: 1px; }
.planned-box ul { margin: 4px 0 0 16px; padding: 0; }
.estimate-box { margin-top: 14px; padding: 14px; border: 1px dashed #c7ceda; border-radius: 10px; background: #fafafa; }
.estimate-box .secondary { margin-top: 10px; }
.status-box { margin-top: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #334155; font-size: 12px; }

.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, .18);
}
.steel-popup {
  position: fixed;
  top: 48px;
  right: 24px;
  z-index: 100;
  width: 350px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
}
.steel-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.steel-popup-head strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}
.steel-popup-head button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.steel-popup-head button:hover {
  border-color: #ef4444;
  color: #dc2626;
}
.popup-table th, .popup-table td {
  height: 27px;
}


@media (max-width: 1200px) {
  .ips-page { min-width: 0; }
  .common-strip { position: static; }
  .common-grid { grid-template-columns: 1fr; }
  .top-status { text-align: left; }
  .top-tools { grid-column: auto; justify-content: start; grid-template-columns: auto 118px 122px 56px 62px 66px; }
  .top-status { grid-column: auto; }
  .project-cell, .company-cell, .writer-cell, .date-cell { grid-column: auto; }
  .pressure-strip { grid-template-columns: 1fr; }
  .pressure-stages { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .action-grid { grid-template-columns: 1fr; }
  .action-card { min-height: auto; }
}
@media print {
  @page { size: A4 landscape; margin: 7mm; }
  body { background: #fff; }
  .ips-page { max-width: none; min-width: 0; padding: 0; }
  .common-strip { position: static; box-shadow: none; border-radius: 0; padding: 5px; break-inside: avoid; }
  .common-grid { grid-template-columns: 82px 1fr 132px 110px 120px; gap: 3px 4px; }
  .common-label span { font-size: 8px; }
  .common-label strong { font-size: 11px; }
  .top-tools { grid-column: 3 / span 3; grid-template-columns: 58px 72px 78px 0 0 0; gap: 3px; justify-content: end; }
  .version-badge { height: 20px; padding: 0 4px; border-radius: 0; font-size: 8px; }
  .mini-cell, .meta-cell { height: 23px; border-radius: 0; }
  .mini-cell span, .meta-cell span { min-width: 34px; padding: 0 3px; font-size: 8px; }
  .mini-cell input, .meta-cell input { height: 21px; padding: 0 2px; font-size: 9px; }
  .project-cell { grid-column: 1 / span 2; }
  .company-cell { grid-column: 3 / span 1; }
  .writer-cell { grid-column: 4 / span 1; }
  .date-cell { grid-column: 5 / span 1; }
  .pressure-strip { grid-template-columns: 105px 70px 1fr; gap: 3px; padding-top: 4px; margin-top: 4px; }
  .pressure-head { min-height: 31px; }
  .pressure-head span { font-size: 7px; }
  .pressure-head strong { font-size: 10px; }
  .pressure-head em { font-size: 8px; }
  .pressure-cell, .stage-cell { height: 31px; border-radius: 0; }
  .pressure-cell span, .stage-cell span { font-size: 7px; }
  .pressure-cell input, .stage-cell input { height: 17px; font-size: 8px; padding: 0 1px; }
  .pressure-stages { gap: 2px; }
  .action-grid { grid-template-columns: 1fr 1.15fr 1fr; gap: 6px; margin-top: 6px; }
  .action-card { min-height: 0; padding: 8px; box-shadow: none; border-radius: 0; break-inside: avoid; }
  .action-card h2 { font-size: 12px; margin-bottom: 4px; }
  .step-no { font-size: 22px; }
  .lead, .muted, .work-row p, .planned-box p, .planned-box li, .estimate-box p, .note-line { font-size: 8.5px; }
  .primary, .secondary { min-height: 24px; font-size: 8.5px; white-space: nowrap; }
  .steel-table th, .steel-table td { height: 17px; font-size: 8px; }
  .work-row, .planned-box, .estimate-box { padding: 6px; margin-top: 5px; border-radius: 0; }
  .work-row { grid-template-columns: minmax(0, 1fr) 74px; gap: 4px; }
  .steel-box { margin-top: 7px; padding-top: 6px; }
  .no-print, .status-box, .top-btn, .popup-backdrop, .steel-popup { display: none !important; }
}
