:root {
  --ac: #60a5fa;
  --ac-2: #b9d6fb;
  --ac-soft: rgba(96, 165, 250, 0.14);
  --ac-glow: rgba(96, 165, 250, 0.14);
  --ac-ink: #07111f;
  --pl: #60a5fa;
  --product-bar-height: 3.75rem;
  --product-workbar-height: 3.5rem;
}

* {
  scrollbar-color: #334155 #111827;
}

body {
  overflow: hidden;
}

.product-bar {
  position: relative;
  z-index: 30;
  display: grid;
  box-sizing: border-box;
  width: 100%;
  height: var(--product-bar-height);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid #dbe5f0;
  background: #ffffff;
  color: #172033;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.product-work-status {
  justify-self: end;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

.product-workbar {
  position: relative;
  z-index: 24;
  display: flex;
  box-sizing: border-box;
  height: var(--product-workbar-height);
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem clamp(0.75rem, 2vw, 1.5rem);
  border-bottom: 1px solid #263244;
  background: #172130;
  color: #dbe7f5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.product-workbar button {
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
}

.product-workbar button:hover:not(:disabled) {
  border-color: #40506a;
  background: #202d3f;
}

.product-workbar button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.product-workbar button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.product-workbar .product-export {
  padding-inline: 1.1rem;
  background: #2563eb;
  color: #fff;
}

.product-workbar .product-export:hover:not(:disabled) {
  border-color: #60a5fa;
  background: #1d4ed8;
}

.product-workbar-divider {
  width: 1px;
  height: 1.5rem;
  margin-inline: 0.25rem;
  background: #334155;
}

.product-workbar-spacer {
  flex: 1;
}

.product-back {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 750;
  text-shadow: none;
}

.product-back {
  justify-self: start;
  padding: 0.35rem 0.2rem;
}

.product-back:hover {
  color: #1d4ed8;
  text-shadow: none;
}

.product-identity {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
}

.product-identity > span:last-child {
  display: grid;
  gap: 0.05rem;
}

.product-identity strong {
  color: #172033;
  font-size: 0.96rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.product-identity small {
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.product-mark {
  display: flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 0.55rem;
  background: #2563eb;
}

.product-mark i {
  display: block;
  width: 2px;
  border-radius: 999px;
  background: white;
}

.product-mark i:nth-child(1),
.product-mark i:nth-child(5) { height: 0.45rem; }
.product-mark i:nth-child(2),
.product-mark i:nth-child(4) { height: 0.8rem; }
.product-mark i:nth-child(3) { height: 1.15rem; }

#app {
  width: 100%;
  height: calc(100dvh - var(--product-bar-height) - var(--product-workbar-height));
}

.pk_hdr,
.pk_tb,
.pk_mt_on .pk_tbc {
  background: #121923;
}

.pk_hdr .pk_btn.pk_act > button,
.pk_hdr .pk_btn:hover > button {
  box-shadow: none;
}

.pk_btn:focus-visible,
.pk_hdr button:focus-visible,
.pk_modal button:focus-visible,
.pk_modal input:focus-visible,
.pk_modal select:focus-visible,
.pk_mt_clip:focus-visible,
.sot-empty-open:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.pk_tmpMsg {
  width: min(34rem, calc(100vw - 4rem));
  margin-left: max(-17rem, calc((4rem - 100vw) / 2));
  color: #dce8f8;
  font-size: 1rem;
  line-height: 1.7;
  text-shadow: none;
}

.sot-empty-open {
  min-height: 2.5rem;
  margin-left: 0.45rem;
  padding: 0 1rem;
  border: 1px solid #60a5fa;
  border-radius: 0.35rem;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

.pk_mt_empty .sot-empty-open {
  pointer-events: auto;
}

#k03,
#k03 + label,
#frmtex-flac,
.pk_amss {
  display: none !important;
}

.product-export-dialog {
  width: min(32rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #f8fbff;
  color: #172033;
  box-shadow: 0 1.5rem 4rem rgba(15, 23, 42, 0.3);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.product-export-dialog::backdrop {
  background: rgba(8, 15, 27, 0.72);
}

.product-export-dialog form {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
}

.product-export-dialog header,
.product-export-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-export-dialog header span {
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.product-export-dialog h2 {
  margin: 0.2rem 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.product-export-dialog label:not(fieldset label) {
  display: grid;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 750;
}

.product-export-dialog input[type="text"],
.product-export-dialog select {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
  color: #172033;
  font: inherit;
}

.product-export-dialog fieldset {
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  flex-wrap: wrap;
}

.product-export-dialog legend {
  width: 100%;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 750;
}

.product-export-dialog fieldset label {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
}

.product-export-dialog button {
  min-height: 2.65rem;
  padding: 0 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
  color: #172033;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.product-export-dialog button.product-export {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.product-export-dialog button:focus-visible,
.product-export-dialog input:focus-visible,
.product-export-dialog select:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.45);
  outline-offset: 2px;
}

.product-tool-dialog {
  width: min(44rem, calc(100vw - 2rem));
  max-height: min(48rem, calc(100dvh - 2rem));
  padding: 0;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #f8fbff;
  color: #172033;
  box-shadow: 0 1.5rem 4rem rgba(15, 23, 42, 0.3);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.product-tool-dialog::backdrop {
  background: rgba(8, 15, 27, 0.72);
}

.product-tool-dialog form {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
}

.product-tool-dialog header,
.product-tool-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.product-tool-dialog header {
  padding-bottom: 1rem;
  border-bottom: 1px solid #dbe5f0;
}

.product-tool-dialog header span {
  color: #2563eb;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.product-tool-dialog h2 {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.product-tool-dialog button,
.product-tool-dialog input,
.product-tool-dialog select {
  font: inherit;
}

.product-tool-dialog header > button {
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 1.45rem;
}

.product-action-list {
  display: grid;
  border-block: 1px solid #dbe5f0;
}

.product-action-list > button {
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) 1fr;
  gap: 1.25rem;
  min-height: 4.5rem;
  align-items: center;
  padding: 0.9rem 0.25rem;
  border: 0;
  border-bottom: 1px solid #dbe5f0;
  background: transparent;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.product-action-list > button:last-child {
  border-bottom: 0;
}

.product-action-list > button:hover {
  background: #eef6ff;
}

.product-action-list strong {
  font-size: 0.92rem;
}

.product-action-list span {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.55;
}

.product-batch-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.product-file-field,
.product-batch-options label {
  display: grid;
  gap: 0.45rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 750;
}

.product-file-field input,
.product-batch-options select {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.8rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
  color: #172033;
}

.product-file-field small {
  color: #64748b;
  font-weight: 650;
}

.product-check-options {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
  flex-wrap: wrap;
}

.product-check-options legend {
  width: 100%;
  margin-bottom: 0.35rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 750;
}

.product-check-options label {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.product-batch-progress {
  display: grid;
  gap: 0.5rem;
}

.product-batch-progress[hidden] {
  display: none;
}

.product-batch-progress progress {
  width: 100%;
  height: 0.7rem;
  accent-color: #2563eb;
}

.product-batch-progress p {
  margin: 0;
  color: #475569;
  font-size: 0.8rem;
}

.product-tool-dialog footer {
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #dbe5f0;
}

.product-tool-dialog footer button {
  min-height: 2.7rem;
  padding: 0 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
  color: #172033;
  cursor: pointer;
  font-weight: 750;
}

.product-tool-dialog footer .product-export {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.product-tool-dialog button:focus-visible,
.product-tool-dialog input:focus-visible,
.product-tool-dialog select:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.45);
  outline-offset: 2px;
}

.product-chapter-dialog ol {
  display: grid;
  max-height: 21rem;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border-block: 1px solid #dbe5f0;
}

.product-chapter-dialog li {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: 0.25rem;
  border-bottom: 1px solid #dbe5f0;
}

.product-chapter-dialog li:last-child {
  border-bottom: 0;
}

.product-chapter-dialog li span,
.product-chapter-dialog > form > p {
  color: #64748b;
  font-size: 0.8rem;
}

.unsupported {
  box-sizing: border-box;
  width: min(100% - 2rem, 38rem);
  min-height: calc(100dvh - var(--product-bar-height));
  margin: 0 auto;
  align-content: center;
  padding: 3rem 1rem;
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.unsupported:not([hidden]) {
  display: grid;
}

.unsupported-icon {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  place-items: center;
  border-radius: 1.1rem;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 2rem;
}

.unsupported h1 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  letter-spacing: -0.04em;
}

.unsupported p {
  margin: 1rem auto 0;
  color: #a9b8cc;
  line-height: 1.75;
}

.unsupported-actions {
  display: flex;
  margin-top: 1.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.unsupported a,
.unsupported-actions button {
  display: inline-flex;
  box-sizing: border-box;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.4rem;
  background: #2563eb;
  color: white;
  font: inherit;
  font-weight: 750;
  text-shadow: none;
  cursor: pointer;
}

.unsupported-actions a {
  background: transparent;
  border: 1px solid #3b4a63;
  color: #dbe5f2;
}

.unsupported-actions button[hidden] {
  display: none;
}

.unsupported #unsupported-reload[hidden] + a {
  background: #2563eb;
  border: 1px solid transparent;
  color: white;
}

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

@media (max-width: 48rem) {
  :root {
    --product-workbar-height: 7.5rem;
  }

  .product-bar {
    grid-template-columns: auto 1fr;
  }

  .product-identity {
    justify-self: end;
  }

  .product-back span:last-child,
  .product-identity small,
  .product-work-status {
    display: none;
  }

  .product-workbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
  }

  .product-workbar button {
    min-width: 0;
    height: 100%;
    padding-inline: 0.4rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .product-workbar-divider,
  .product-workbar-spacer {
    display: none;
  }

  .product-batch-options,
  .product-action-list > button {
    grid-template-columns: 1fr;
  }

  .product-action-list > button {
    gap: 0.25rem;
  }
}

@media (hover: hover) and (max-width: 48rem),
  (hover: hover) and (max-height: 32rem) {
  body {
    min-width: 48rem;
    min-height: 36rem;
    overflow: auto;
  }

  #app {
    min-width: 48rem;
    min-height: 30rem;
  }
}

/* 좁은 화면 안내가 떠 있을 때는 뷰포트 기준으로 가운데 정렬한다 */
body:has(> #unsupported:not([hidden])) {
  min-width: 0;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
