/* Generated with design tokens as the single visual source. */
:root {
  --color-brand: #e34850;
  --color-brand-hover: #c9343d;
  --color-brand-soft: #fdebed;
  --color-topbar: #1f1f21;
  --color-topbar-raised: #2a2a2d;
  --color-surface: #ffffff;
  --color-surface-muted: #f6f6f7;
  --color-surface-elevated: #fbfbfc;
  --color-workspace: #e4e4e7;
  --color-workspace-deep: #d7d7db;
  --color-border: #d2d2d7;
  --color-border-strong: #b8b8bf;
  --color-text: #1d1d1f;
  --color-text-muted: #66666d;
  --color-text-on-dark: #f5f5f7;
  --color-selection: #1473e6;
  --color-selection-soft: #e6f0ff;
  --color-success: #12805c;
  --color-warning: #a65f00;
  --color-danger: #c9252d;
  --color-shadow: rgba(0, 0, 0, 0.18);
  --color-edit: #1473e6;
  --color-edit-soft: #e6f0ff;
  --color-modified: #6f4bd8;
  --color-modified-soft: #f0ebff;
  --color-font: #8a3ffc;
  --color-font-soft: #f2ecff;
  --radius-small: 6px;
  --radius-medium: 10px;
  --radius-large: 16px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --size-topbar: 56px;
  --size-commandbar: 52px;
  --size-statusbar: 30px;
  --size-sidebar: 238px;
  --size-inspector: 344px;
  --size-page-gap: 22px;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --motion-fast: 120ms;
  --motion-normal: 180ms;
}

* {
  box-sizing: border-box;
}

/* Author styles otherwise override the browser's built-in [hidden] rule. */
[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--color-workspace);
  color: var(--color-text);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-selection) 34%, transparent);
  outline-offset: 2px;
}

button {
  border: 0;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.visually-hidden {
  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;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  left: 16px;
  top: -56px;
  padding: 10px 14px;
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 8px 30px var(--color-shadow);
  transition: top var(--motion-fast) ease;
}

.skip-link:focus {
  top: 12px;
}

.app-shell {
  display: grid;
  grid-template-rows: var(--size-topbar) var(--size-commandbar) minmax(0, 1fr) var(--size-statusbar);
  width: 100%;
  height: 100dvh;
  min-height: 480px;
}

.topbar {
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
  padding: 0 var(--space-4);
  background: linear-gradient(180deg, #252527, var(--color-topbar));
  color: var(--color-text-on-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 190px;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.brand-mark:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.brand-mark img {
  width: 23px;
  height: 23px;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-company {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.brand-title strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.product-nav {
  display: flex;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.product-nav::-webkit-scrollbar {
  display: none;
}

.product-nav a {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.product-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
}

.product-nav a.is-active {
  color: #fff;
}

.product-nav a.is-active::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--color-brand);
  content: "";
}

.topbar-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  margin-left: auto;
}

.document-state {
  max-width: 220px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.local-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #35c58a;
  box-shadow: 0 0 0 3px rgba(53, 197, 138, 0.16);
}

.commandbar {
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  background: rgba(250, 250, 251, 0.97);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(18px) saturate(1.2);
}

.command-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.command-divider {
  width: 1px;
  height: 24px;
  flex: 0 0 auto;
  margin: 0 2px;
  background: var(--color-border);
}

.command-spacer {
  min-width: 6px;
  flex: 1 1 auto;
}

.command-button,
.icon-button,
.zoom-value,
.search-control button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: transparent;
  color: #38383d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.command-button {
  gap: 6px;
  padding: 0 10px;
}

.command-button.compact {
  padding-inline: 8px;
  font-size: 11px;
}

.icon-button {
  width: 34px;
  padding: 0;
  font-size: 19px;
  font-weight: 500;
}

.zoom-value {
  min-width: 54px;
  padding: 0 7px;
  font-variant-numeric: tabular-nums;
}

.command-button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.zoom-value:hover:not(:disabled),
.search-control button:hover:not(:disabled) {
  background: #ebebee;
  border-color: #dedee2;
}

.command-button:active:not(:disabled),
.icon-button:active:not(:disabled),
.zoom-value:active:not(:disabled),
.search-control button:active:not(:disabled) {
  transform: translateY(1px);
}

.command-button.is-active,
.icon-button.is-active {
  background: var(--color-selection-soft);
  border-color: color-mix(in srgb, var(--color-selection) 24%, var(--color-border));
  color: var(--color-selection);
}

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

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

.command-accent {
  border-color: color-mix(in srgb, var(--color-brand) 28%, var(--color-border));
  color: var(--color-brand-hover);
}

.button-icon {
  font-size: 16px;
  font-weight: 500;
}

.page-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--color-text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.page-control input {
  width: 42px;
  height: 25px;
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  color: var(--color-text);
  text-align: right;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.page-control input:focus {
  background: var(--color-selection-soft);
}

.page-control input::-webkit-outer-spin-button,
.page-control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.search-control {
  display: flex;
  align-items: center;
  min-width: 176px;
  max-width: 320px;
  height: 34px;
  flex: 1 1 250px;
  padding-left: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--color-text-muted);
}

.search-control:focus-within {
  border-color: color-mix(in srgb, var(--color-selection) 58%, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-selection) 12%, transparent);
}

.search-control input {
  min-width: 70px;
  height: 100%;
  flex: 1 1 auto;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 12px;
  outline: none;
}

.search-count {
  flex: 0 0 auto;
  padding-right: 3px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.search-control button {
  width: 28px;
  min-height: 28px;
  padding: 0;
}

.viewer-main {
  position: relative;
  display: grid;
  grid-template-columns: var(--size-sidebar) minmax(0, 1fr) var(--size-inspector);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--color-workspace);
}

.app-shell.sidebar-hidden .viewer-main {
  grid-template-columns: 0 minmax(0, 1fr) var(--size-inspector);
}

.app-shell.inspector-hidden .viewer-main {
  grid-template-columns: var(--size-sidebar) minmax(0, 1fr) 0;
}

.app-shell.sidebar-hidden.inspector-hidden .viewer-main {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.sidebar,
.inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface-muted);
  transition: opacity var(--motion-normal) ease, transform var(--motion-normal) ease;
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
}

.app-shell.sidebar-hidden .sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-12px);
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  padding: 8px;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.sidebar-tab {
  height: 32px;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.sidebar-tab:hover {
  background: #ececef;
}

.sidebar-tab.is-active {
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
}

.sidebar-panel {
  display: none;
  min-height: 0;
  flex: 1 1 auto;
}

.sidebar-panel.is-active {
  display: block;
}

.thumbnail-list,
.outline-list {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.thumbnail-list {
  padding: 14px 12px 30px;
}

.thumbnail-item {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-medium);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.thumbnail-item:hover {
  background: #ededf0;
}

.thumbnail-item.is-current {
  border-color: color-mix(in srgb, var(--color-selection) 38%, var(--color-border));
  background: var(--color-selection-soft);
  color: var(--color-selection);
}

.thumbnail-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 144px;
  min-height: 64px;
  overflow: hidden;
  border: 1px solid #c8c8cd;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.11);
}

.thumbnail-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.thumbnail-item span {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.outline-list {
  padding: 10px 8px 30px;
}

.outline-item {
  display: block;
}

.outline-button {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  overflow: hidden;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--color-text);
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.outline-button:hover {
  background: #e9e9ec;
}

.panel-empty {
  margin: 18px 12px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.viewer-scroll {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.38), transparent 42%),
    linear-gradient(180deg, var(--color-workspace), var(--color-workspace-deep));
  scrollbar-gutter: stable;
}

.viewer-scroll.is-dragover {
  cursor: copy;
}

.viewer-scroll.is-dragover::after {
  position: fixed;
  z-index: 80;
  inset: calc(var(--size-topbar) + var(--size-commandbar) + 16px) calc(var(--size-inspector) + 16px) calc(var(--size-statusbar) + 16px) calc(var(--size-sidebar) + 16px);
  display: grid;
  place-items: center;
  border: 3px dashed var(--color-selection);
  border-radius: var(--radius-large);
  background: color-mix(in srgb, var(--color-selection) 10%, rgba(255, 255, 255, 0.86));
  color: var(--color-selection);
  content: "PDF 파일을 여기에 놓으세요";
  font-size: 20px;
  font-weight: 760;
  pointer-events: none;
}

.empty-state,
.error-state {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 48px 24px;
}

.drop-zone,
.error-card {
  width: min(720px, 100%);
  padding: 44px 36px 34px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 55px rgba(30, 30, 36, 0.16), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  text-align: center;
  backdrop-filter: blur(24px) saturate(1.12);
  cursor: pointer;
  transition: transform var(--motion-normal) ease, box-shadow var(--motion-normal) ease, border-color var(--motion-normal) ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
  border-color: color-mix(in srgb, var(--color-brand) 50%, #fff);
  box-shadow: 0 24px 70px rgba(30, 30, 36, 0.2), 0 0 0 4px color-mix(in srgb, var(--color-brand) 9%, transparent);
  transform: translateY(-2px);
}

.mobile-copy {
  display: none;
}

.error-card {
  max-width: 560px;
  cursor: default;
}

.error-symbol {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--color-danger) 12%, #fff);
  color: var(--color-danger);
  font-size: 28px;
  font-weight: 800;
}

.error-card h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(25px, 3.6vw, 36px);
  letter-spacing: -0.035em;
}

.error-message {
  max-width: 470px;
  margin: 16px auto 0;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.65;
}

.empty-symbol {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  border-radius: 17px;
  background: var(--color-brand-soft);
}

.empty-symbol img {
  width: 40px;
  height: 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--color-brand-hover);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.drop-zone h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(29px, 4vw, 44px);
  font-weight: 760;
  letter-spacing: -0.042em;
  line-height: 1.13;
}

.empty-description {
  max-width: 540px;
  margin: 18px auto 0;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.65;
}

.empty-open-button {
  min-width: 164px;
  height: 44px;
  margin-top: 26px;
  padding: 0 22px;
  border-radius: var(--radius-medium);
  background: var(--color-brand);
  color: #fff;
  font-weight: 720;
  cursor: pointer;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--color-brand) 28%, transparent);
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.empty-open-button:hover {
  background: var(--color-brand-hover);
  transform: translateY(-1px);
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
}

.empty-capabilities {
  display: grid;
  width: min(720px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.empty-capabilities article {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  gap: 7px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(10px);
}

.empty-capabilities strong {
  color: var(--color-text);
  font-size: 13px;
}

.empty-capabilities span {
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.page-stack {
  width: max-content;
  min-width: 100%;
  padding: var(--size-page-gap) max(24px, calc((100% - var(--viewer-page-width, 800px)) / 2)) 80px;
}

.pdf-page {
  position: relative;
  margin: 0 auto var(--size-page-gap);
  scroll-margin: 22px 0 80px;
}

.pdf-page-surface {
  position: relative;
  overflow: hidden;
  border: 1px solid #c6c6ca;
  background: #fff;
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.13);
  transform: translateZ(0);
}

.pdf-page.is-current .pdf-page-surface {
  border-color: color-mix(in srgb, var(--color-selection) 58%, #bfc0c5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22), 0 0 0 2px color-mix(in srgb, var(--color-selection) 14%, transparent);
}

.pdf-page.is-search-result .pdf-page-surface {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22), 0 0 0 3px color-mix(in srgb, #f2b705 48%, transparent);
}

.pdf-page canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.page-skeleton {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(100deg, #fafafa 15%, #f0f0f2 35%, #fafafa 55%) 0 0 / 240% 100%;
  color: #a1a1a7;
  font-size: 12px;
  animation: skeleton-slide 1.5s linear infinite;
}

.pdf-page.is-rendered .page-skeleton {
  display: none;
}

@keyframes skeleton-slide {
  to { background-position: -240% 0; }
}

.text-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
  line-height: 1;
  text-size-adjust: none;
  transform-origin: 0 0;
}

.text-layer span {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0 0;
}

.text-layer span::selection {
  background: color-mix(in srgb, var(--color-selection) 35%, transparent);
  color: transparent;
}

.text-layer span.is-search-hit {
  border-radius: 2px;
  background: rgba(255, 211, 48, 0.46);
  box-shadow: 0 0 0 1px rgba(176, 120, 0, 0.18);
}

.page-label {
  position: absolute;
  right: 0;
  bottom: -20px;
  left: 0;
  color: #6b6b71;
  font-size: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.loading-overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(228, 228, 231, 0.8);
  color: var(--color-text);
  backdrop-filter: blur(10px);
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(29, 29, 31, 0.12);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

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

.loading-overlay strong {
  font-size: 14px;
}

.loading-overlay span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.inspector {
  overflow: auto;
  border-left: 1px solid var(--color-border);
}

.app-shell.inspector-hidden .inspector {
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
}

.inspector-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 49px;
  padding: 0 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 750;
}

.version-badge {
  max-width: 136px;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: var(--radius-pill);
  background: var(--color-brand-soft);
  color: var(--color-brand-hover);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-info {
  margin: 0;
  padding: 10px 14px 14px;
  border-bottom: 1px solid var(--color-border);
}

.document-info > div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
}

.document-info dt,
.document-info dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}

.document-info dt {
  color: var(--color-text-muted);
}

.document-info dd {
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-weight: 600;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-bottom: 1px solid var(--color-border);
}

.inspector-section h2 {
  margin: 0 0 6px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspector-section a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border-radius: var(--radius-small);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
}

.inspector-section a:hover {
  background: #e9e9ec;
  color: var(--color-brand-hover);
}

.inspector-principle p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.statusbar {
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 0 11px;
  border-top: 1px solid var(--color-border);
  background: #f6f6f7;
  color: var(--color-text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.statusbar > span {
  white-space: nowrap;
}

#status-message {
  max-width: min(48vw, 520px);
  overflow: hidden;
  color: #424247;
  text-overflow: ellipsis;
}

.status-spacer {
  flex: 1 1 auto;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 46px;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-medium);
  background: rgba(31, 31, 33, 0.94);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  font-size: 12px;
  line-height: 1.45;
  backdrop-filter: blur(16px);
  animation: toast-in var(--motion-normal) ease both;
}

.toast.is-error {
  background: rgba(143, 24, 32, 0.96);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1320px) {
  .viewer-main {
    grid-template-columns: var(--size-sidebar) minmax(0, 1fr);
  }

  .inspector {
    display: none;
  }

  .command-edit .command-button:not(.command-accent) {
    display: none;
  }
}

@media (max-width: 1030px) {
  .product-nav a:not(.is-active) {
    display: none;
  }

  .document-state,
  .command-zoom .compact,
  .command-file .command-button:not(.command-primary) span:last-child {
    display: none;
  }

  .command-file .command-button:not(.command-primary) {
    width: 34px;
    padding: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --size-topbar: 52px;
    --size-commandbar: 48px;
    --size-statusbar: 28px;
  }

  .topbar {
    gap: 8px;
    padding-inline: 10px;
  }

  .topbar-brand {
    min-width: 0;
  }

  .product-nav,
  .local-chip {
    display: none;
  }

  .brand-company {
    margin-bottom: 2px;
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .brand-title strong {
    font-size: 14px;
  }

  .commandbar {
    gap: 4px;
    overflow-x: auto;
    padding-inline: 6px;
    scrollbar-width: none;
  }

  .commandbar::-webkit-scrollbar {
    display: none;
  }

  .command-divider,
  .command-spacer,
  .command-edit {
    display: none;
  }

  .search-control {
    min-width: 170px;
    flex: 0 0 190px;
  }

  .viewer-main,
  .app-shell.sidebar-hidden .viewer-main {
    display: block;
  }

  .sidebar {
    position: absolute;
    z-index: 50;
    inset: 0 auto 0 0;
    width: min(78vw, 290px);
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.22);
  }

  .app-shell.sidebar-hidden .sidebar {
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
  }

  .viewer-scroll {
    width: 100%;
    height: 100%;
  }

  .viewer-scroll.is-dragover::after {
    inset: calc(var(--size-topbar) + var(--size-commandbar) + 10px) 10px calc(var(--size-statusbar) + 10px);
  }

  .empty-state,
  .error-state {
    padding: 28px 14px;
  }

  .desktop-copy {
    display: none;
  }

  .mobile-copy {
    display: inline;
  }

  .drop-zone {
    padding: 32px 18px 26px;
  }

  .empty-capabilities {
    grid-template-columns: 1fr;
  }

  .page-stack {
    padding-top: 12px;
    padding-bottom: 60px;
  }

  .statusbar {
    gap: 8px;
    overflow: hidden;
  }

  #render-status,
  #status-zoom,
  .statusbar > span:last-child {
    display: none;
  }
}

@media (max-width: 520px) {
  .command-file #download-file,
  .command-file #print-file,
  .command-navigation #previous-page,
  .command-navigation #next-page,
  .zoom-value {
    display: none;
  }

  .search-control {
    min-width: 150px;
    flex-basis: 170px;
  }

  .page-control {
    padding-inline: 5px;
  }

  .page-control input {
    width: 35px;
  }

  #status-message {
    max-width: 58vw;
  }
}

@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;
  }
}

/* Viewer V2.1 unified view/text workspace */
.workspace-mode {
  display: inline-flex;
  align-items: center;
  height: 34px;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ededf0;
}

.mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 72px;
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.mode-button:hover:not(:disabled) {
  color: var(--color-text);
}

.mode-button.is-active {
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.mode-button#mode-text.is-active {
  color: var(--color-edit);
}

.mode-icon {
  font-size: 13px;
  line-height: 1;
}

.mode-icon-text {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 800;
}

.mode-count,
.edit-count {
  display: inline-flex;
  min-width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--color-edit-soft);
  color: var(--color-edit);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.mode-count:empty,
.edit-count:empty {
  display: none;
}

.command-edit .command-accent:not(:disabled) {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}

.command-edit .command-accent:hover:not(:disabled) {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
}

.app-shell.has-unsaved-edits .document-state::after {
  margin-left: 6px;
  color: #ffb7bd;
  content: "• 수정됨";
}

.pdf-page-surface {
  isolation: isolate;
}

.app-shell.is-text-mode .text-layer {
  z-index: 4;
}

.app-shell.is-text-mode .text-layer span[data-run-id] {
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.app-shell.is-text-mode .text-layer span[data-run-id].is-editable:hover {
  border-color: color-mix(in srgb, var(--color-edit) 72%, transparent);
  background: color-mix(in srgb, var(--color-edit-soft) 35%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-edit) 10%, transparent);
}

.app-shell.is-text-mode .text-layer span[data-run-id].is-locked {
  cursor: not-allowed;
}

.app-shell.is-text-mode .text-layer span[data-run-id].is-locked:hover {
  border-color: color-mix(in srgb, var(--color-warning) 55%, transparent);
  background: color-mix(in srgb, #fff3d5 38%, transparent);
}

.text-layer span.is-selected-run {
  border-color: var(--color-edit) !important;
  background: color-mix(in srgb, var(--color-edit-soft) 44%, transparent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-edit) 16%, transparent) !important;
}

.text-layer span.is-modified-run {
  z-index: 3;
  overflow: visible;
  min-width: max-content;
  padding: 0 2px;
  border-color: color-mix(in srgb, var(--color-modified) 65%, transparent) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--color-modified) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 2px color-mix(in srgb, var(--color-modified) 12%, transparent) !important;
  font-family: inherit;
  line-height: 1;
}

.text-layer span.is-modified-run::after {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 7px;
  height: 7px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--color-modified);
  content: "";
}

.inspector-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inspector-close {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 20px;
  cursor: pointer;
}

.inspector-close:hover {
  background: #e8e8eb;
  color: var(--color-text);
}

.text-inspector {
  min-height: 100%;
  background: var(--color-surface-muted);
}

.text-analysis-card {
  padding: 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.text-analysis-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.text-analysis-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.text-analysis-heading span,
.text-run-info dt,
.text-field > span {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.03em;
}

.text-analysis-heading strong {
  color: var(--color-text);
  font-size: 13px;
}


.analysis-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.analysis-retry {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--color-edit) 35%, var(--color-border));
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-edit);
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}

.analysis-retry:hover:not(:disabled) {
  background: var(--color-edit-soft);
}

.analysis-retry:disabled {
  cursor: wait;
  opacity: 0.55;
}

.analysis-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-edit-soft);
  color: var(--color-edit) !important;
  font-size: 10px !important;
  font-variant-numeric: tabular-nums;
}

#text-analysis-detail {
  margin: 9px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.text-selection-empty {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 22px;
  text-align: center;
}

.selection-empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 13px;
  border: 1px solid color-mix(in srgb, var(--color-edit) 24%, var(--color-border));
  border-radius: 13px;
  background: var(--color-edit-soft);
  color: var(--color-edit);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 800;
}

.text-selection-empty strong {
  font-size: 13px;
}

.text-selection-empty p {
  max-width: 240px;
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.55;
}

.text-edit-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 14px;
}

.text-support-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-text-muted);
  font-size: 10px;
}

.support-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: #ececef;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 720;
}

.support-badge.is-supported {
  background: #e4f5ee;
  color: var(--color-success);
}

.support-badge.is-blocked {
  background: #fff0df;
  color: var(--color-warning);
}

.text-run-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.text-run-info > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
}

.text-run-info dt,
.text-run-info dd {
  margin: 0;
}

.text-run-info dd {
  overflow: hidden;
  margin-top: 4px;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.text-run-info dd[data-fit-level="safe"] {
  color: var(--color-success);
}

.text-run-info dd[data-fit-level="warning"] {
  color: var(--color-warning);
}

.text-run-info dd[data-fit-level="risk"] {
  color: var(--color-danger);
}

.app-shell.is-saving .commandbar button,
.app-shell.is-saving .text-edit-form textarea {
  cursor: wait;
}

.text-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.text-field > span {
  display: flex;
  justify-content: space-between;
}

.text-field > span b {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 600;
}

.text-field textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}

.text-field textarea:focus {
  border-color: color-mix(in srgb, var(--color-edit) 68%, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-edit) 12%, transparent);
}

.text-original-field textarea {
  background: #f0f0f2;
  color: var(--color-text-muted);
}

.text-edit-warning {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.text-edit-warning.is-error {
  color: var(--color-danger);
}

.text-edit-warning.is-warning {
  color: var(--color-warning);
}

.text-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}

.text-edit-actions button {
  min-height: 36px;
  border-radius: var(--radius-small);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.secondary-action {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
}

.primary-action {
  background: var(--color-edit);
  color: #fff;
}

.primary-action:hover:not(:disabled) {
  background: #0d66d0;
}

.text-edit-limitation {
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-small);
  background: #f0f0f2;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.5;
}

.app-shell.is-text-mode #edit-status {
  color: var(--color-edit);
  font-weight: 680;
}

@media (max-width: 1320px) {
  .app-shell.is-text-mode.has-text-selection .inspector,
  .app-shell.is-text-mode.text-inspector-open .inspector {
    position: absolute;
    z-index: 70;
    right: 16px;
    bottom: 16px;
    display: block;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100% - 32px);
    overflow: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    background: var(--color-surface-muted);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  }

  .app-shell.is-text-mode.has-text-selection .inspector-close,
  .app-shell.is-text-mode.text-inspector-open .inspector-close {
    display: inline-grid;
    place-items: center;
  }

  .app-shell.is-text-mode.has-text-selection .version-badge,
  .app-shell.is-text-mode.text-inspector-open .version-badge {
    display: none;
  }
}

@media (max-width: 1030px) {
  .mode-button {
    min-width: 58px;
    padding-inline: 7px;
  }

  .mode-count {
    display: none;
  }
}

@media (max-width: 820px) {
  .workspace-mode {
    order: -1;
  }

  .mode-button {
    min-width: 48px;
  }

  .mode-button span:not(.mode-icon) {
    display: none;
  }

  .app-shell.is-text-mode .command-edit {
    display: flex;
  }

  .app-shell.is-text-mode #undo-edit,
  .app-shell.is-text-mode #redo-edit {
    display: none;
  }

  .app-shell.is-text-mode #save-edited-file {
    min-width: 38px;
    padding-inline: 8px;
  }

  .app-shell.is-text-mode #save-edited-file > span:nth-child(2) {
    display: none;
  }

  .app-shell.is-text-mode.has-text-selection .inspector,
  .app-shell.is-text-mode.text-inspector-open .inspector {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(52vh, 480px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .text-edit-form {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  #edit-status {
    display: inline !important;
  }
}

@media (max-width: 520px) {
  .workspace-mode {
    height: 32px;
  }

  .mode-button {
    min-width: 40px;
    height: 26px;
  }

  .text-analysis-card {
    padding: 12px 14px;
  }

  .text-selection-empty {
    min-height: 190px;
  }
}

.text-layer span.is-draft-run {
  z-index: 4;
  overflow: visible;
  min-width: max-content;
  padding: 0 2px;
  border-color: var(--color-edit) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  color: var(--color-edit) !important;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15), 0 0 0 3px color-mix(in srgb, var(--color-edit) 15%, transparent) !important;
  line-height: 1;
}

/* Viewer V2.2 practical inline text editing */
.text-selection-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.text-selection-navigation button {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 680;
  cursor: pointer;
}

.text-selection-navigation button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--color-edit) 45%, var(--color-border));
  background: var(--color-edit-soft);
  color: var(--color-edit);
}

.text-advanced-info {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #f1f1f3;
}

.text-advanced-info summary {
  padding: 8px 10px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.text-advanced-info[open] summary {
  border-bottom: 1px solid var(--color-border);
}

.text-advanced-info .text-run-info {
  padding: 8px;
  background: transparent;
}

.inline-edit-guide {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--color-edit) 24%, var(--color-border));
  border-radius: var(--radius-small);
  background: color-mix(in srgb, var(--color-edit-soft) 55%, #fff);
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.5;
}

.inline-edit-guide::before {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--color-edit);
  color: #fff;
  content: "T";
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 800;
}

.inline-text-editor {
  position: absolute;
  z-index: 12;
  min-width: 36px;
  max-width: min(520px, calc(100% - 8px));
  min-height: 28px;
  overflow: hidden;
  resize: none;
  padding: 3px 6px;
  border: 1.5px solid var(--color-edit);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--color-text);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--color-edit) 16%, transparent),
    0 7px 22px rgba(0, 0, 0, 0.17);
  line-height: 1.15;
  outline: 0;
  white-space: pre;
  transform-origin: 0 0;
  pointer-events: auto;
}

.inline-text-editor:focus {
  border-color: var(--color-edit);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--color-edit) 19%, transparent),
    0 9px 26px rgba(0, 0, 0, 0.2);
}

.text-layer span.is-inline-editing {
  opacity: 0;
  pointer-events: none;
}

.text-layer span.is-font-replaced {
  border-color: color-mix(in srgb, var(--color-font) 68%, transparent) !important;
  background: color-mix(in srgb, var(--color-font-soft) 48%, rgba(255, 255, 255, 0.95)) !important;
  color: var(--color-font) !important;
}

.text-layer span.is-font-replaced::after {
  background: var(--color-font);
}

.font-control {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.font-toggle {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.font-toggle:hover:not(:disabled),
.font-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--color-font) 48%, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-font) 9%, transparent);
}

.font-toggle > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.font-toggle small {
  color: var(--color-text-muted);
  font-size: 8px;
  font-weight: 650;
}

.font-toggle strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-toggle b {
  flex: 0 0 auto;
  color: var(--color-font);
  font-size: 9px;
}

.font-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--color-font) 24%, var(--color-border));
  border-radius: var(--radius-medium);
  background: #f7f5fb;
}

.font-panel-heading,
.font-selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.font-panel-heading > div,
.font-selected-card > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.font-panel-heading strong,
.font-selected-card strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-panel-heading span,
.font-selected-card span {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-panel button {
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--color-text);
  font-size: 9px;
  font-weight: 690;
  cursor: pointer;
}

.font-panel button:hover:not(:disabled),
.font-panel button.is-active {
  border-color: color-mix(in srgb, var(--color-font) 48%, var(--color-border));
  background: var(--color-font-soft);
  color: var(--color-font);
}

.font-selected-card {
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--color-font) 28%, var(--color-border));
  border-radius: var(--radius-small);
  background: #fff;
}

.font-search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.font-search-field > span {
  color: var(--color-text-muted);
  font-size: 8px;
  font-weight: 650;
}

.font-search-field input {
  width: 100%;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--color-text);
  font-size: 10px;
  outline: none;
}

.font-search-field input:focus {
  border-color: var(--color-font);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-font) 10%, transparent);
}

.font-catalog-status,
.font-license-note,
.font-results-empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 8px;
  line-height: 1.45;
}

.font-results {
  display: flex;
  max-height: 226px;
  overflow: auto;
  flex-direction: column;
  gap: 5px;
  padding-right: 2px;
}

.font-results article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: #fff;
}

.font-results article > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.font-results article strong,
.font-results article span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-results article strong {
  font-size: 9px;
}

.font-results article span {
  color: var(--color-text-muted);
  font-size: 7px;
}

.font-results article > div:last-child {
  display: flex;
  max-width: 116px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.font-results article button {
  min-height: 23px;
  padding-inline: 6px;
  font-size: 7px;
}

.font-upload {
  width: 100%;
  border-style: dashed !important;
  color: var(--color-font) !important;
}

@media (max-width: 820px) {
  .inline-text-editor {
    min-height: 34px;
    padding: 5px 7px;
    font-size: max(14px, 1em) !important;
  }

  .font-results {
    max-height: 180px;
  }

  .font-panel {
    margin-bottom: 8px;
  }
}

.inline-text-mask {
  position: absolute;
  z-index: 11;
  border-radius: 1px;
  background: #fff;
  pointer-events: none;
}

/* Viewer V2.3 universal text-block controls. Contract-owned values are inherited
   from the existing design-token layer; this section changes function, not the
   approved product visual direction. */
.text-block-control {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-surface-muted);
}

.text-block-heading,
.text-block-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-block-heading > div {
  display: grid;
  gap: 2px;
}

.text-block-heading small,
.text-block-heading span,
.text-block-grid label > span,
.text-block-note {
  color: var(--color-text-muted);
  font-size: 12px;
}

.text-block-heading strong {
  color: var(--color-text);
  font-size: 14px;
}

.text-block-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.text-block-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.text-block-grid input[type="number"],
.text-block-grid select {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.text-block-grid input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
}

.text-block-wide {
  grid-column: 1 / -1;
}

.text-block-range input {
  width: 100%;
  accent-color: var(--color-brand);
}

.text-block-actions button {
  flex: 1;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font: inherit;
  cursor: pointer;
}

.text-block-actions button:disabled {
  opacity: .45;
  cursor: default;
}

.text-block-note {
  margin: 0;
  line-height: 1.55;
}

.text-layer span.is-visual-block {
  box-sizing: border-box;
  white-space: pre-wrap !important;
  overflow: hidden;
  word-break: break-word;
}

.inline-text-mask {
  position: absolute;
  z-index: 22;
  pointer-events: none;
  box-sizing: border-box;
}

.inline-text-editor {
  z-index: 24;
  min-width: 28px;
  min-height: 28px;
  resize: both;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}

@media (max-width: 820px) {
  .text-block-control {
    padding: 12px;
  }

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

  .text-block-actions {
    flex-direction: column;
  }

  .text-block-actions button {
    width: 100%;
  }
}

/* PDF3001 V3 Alpha 1 structural analysis */
.structural-analysis-card {
  padding: 14px;
  border-bottom: 1px solid var(--color-border);
  background: #f8f8fa;
}

.structural-analysis-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.structural-analysis-heading > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.structural-analysis-heading span {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.03em;
}

.structural-analysis-heading strong {
  color: var(--color-text);
  font-size: 13px;
}

.analysis-report {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}

.analysis-report:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--color-edit) 35%, var(--color-border));
  color: var(--color-edit);
}

.analysis-report:disabled {
  cursor: default;
  opacity: 0.45;
}

#structural-analysis-detail {
  margin: 9px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.structural-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.structural-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
}

.structural-summary span {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structural-summary strong {
  color: var(--color-text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.structural-summary [data-grade="A"] strong { color: #26734d; }
.structural-summary [data-grade="B"] strong { color: #775600; }
.structural-summary [data-grade="C"] strong { color: #a64031; }
.structural-summary [data-grade="D"] strong { color: #666a73; }

.structural-object-details {
  margin-top: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.structural-object-details summary {
  padding: 9px 10px;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 740;
  cursor: pointer;
}

.structural-object-details dl {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 10px 9px;
}

.structural-object-details dl > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 66%, transparent);
}

.structural-object-details dt {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.structural-object-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.45;
}

.structural-alpha-note {
  margin: 10px 0 0;
  padding: 8px 9px;
  border-radius: 7px;
  background: #fff5dd;
  color: #6e520c;
  font-size: 10px;
  line-height: 1.45;
}

.structural-alpha-note strong {
  margin-right: 4px;
}

@media (max-width: 820px) {
  .structural-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .structural-summary > div {
    min-height: 45px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
  }
}

@media (max-width: 520px) {
  .structural-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* PDF3001 V3 Alpha 4 structural Writer plan and memory candidate */
.structural-writer-plan-card {
  margin-top: 11px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--color-edit) 24%, var(--color-border));
  border-radius: 9px;
  background: color-mix(in srgb, #fff 94%, var(--color-edit));
}

.structural-writer-plan-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.structural-writer-plan-heading > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.structural-writer-plan-heading span {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .03em;
}

.structural-writer-plan-heading strong {
  color: var(--color-text);
  font-size: 13px;
}

#structural-writer-plan-detail {
  margin: 9px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.structural-writer-plan-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.structural-writer-plan-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
}

.structural-writer-plan-summary span {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.structural-writer-plan-summary strong {
  overflow: hidden;
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structural-writer-plan-summary strong[data-status="ready"] { color: #26734d; }
.structural-writer-plan-summary strong[data-status="review"] { color: #8a6100; }
.structural-writer-plan-summary strong[data-status="blocked"] { color: #a64031; }

.structural-writer-plan-details {
  margin-top: 9px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.structural-writer-plan-details summary {
  padding: 9px 10px;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 740;
  cursor: pointer;
}

.structural-writer-plan-list {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.structural-writer-plan-list + .structural-writer-plan-list {
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}

.structural-writer-plan-list h4 {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 9px;
  letter-spacing: .03em;
}

.structural-writer-plan-list article {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7f7f9;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.structural-writer-plan-list article strong {
  color: var(--color-text);
  font-size: 10px;
}

.structural-writer-plan-list article[data-severity="high"],
.structural-writer-plan-list article[data-severity="blocking"] {
  background: #fff0ed;
  color: #873729;
}

.structural-writer-plan-list article[data-severity="medium"] {
  background: #fff7e7;
  color: #75540a;
}

.structural-writer-plan-boundary {
  margin: 9px 0 0;
  padding: 8px 9px;
  border-radius: 7px;
  background: #eef5ff;
  color: #28527c;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .structural-writer-plan-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .structural-writer-plan-summary > div {
    min-height: 48px;
  }
}

@media (max-width: 520px) {
  .structural-writer-plan-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .structural-writer-plan-heading .analysis-actions {
    justify-content: flex-start;
  }

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


/* PDF3001 V3 Alpha 4 memory-only candidate verification */
.structural-candidate-card {
  margin-top: 11px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, #2277cc 25%, var(--color-border));
  border-radius: 9px;
  background: color-mix(in srgb, #fff 94%, #dcecff);
}

.structural-candidate-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.structural-candidate-heading > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.structural-candidate-heading span {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .03em;
}

.structural-candidate-heading strong {
  color: var(--color-text);
  font-size: 13px;
}

#structural-candidate-detail {
  margin: 9px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.structural-candidate-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.structural-candidate-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
}

.structural-candidate-summary span {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.structural-candidate-summary strong {
  overflow: hidden;
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structural-candidate-summary strong[data-status="pass"] { color: #26734d; }
.structural-candidate-summary strong[data-status="fail"] { color: #a64031; }
.structural-candidate-summary strong[data-status="pending"] { color: #8a6100; }

.structural-candidate-details {
  margin-top: 9px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.structural-candidate-details summary {
  padding: 9px 10px;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 740;
  cursor: pointer;
}

.structural-candidate-list {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.structural-candidate-list article {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7f7f9;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.structural-candidate-list article strong {
  color: var(--color-text);
  font-size: 10px;
}

.structural-candidate-list article[data-severity="fail"] {
  background: #fff0ed;
  color: #873729;
}

.structural-candidate-boundary {
  margin: 9px 0 0;
  padding: 8px 9px;
  border-radius: 7px;
  background: #eef5ff;
  color: #28527c;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .structural-candidate-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .structural-candidate-summary > div { min-height: 48px; }
}

@media (max-width: 520px) {
  .structural-candidate-heading { align-items: stretch; flex-direction: column; }
  .structural-candidate-heading .analysis-actions { justify-content: flex-start; }
  .structural-candidate-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* PDF3001 V3 Beta 1 verified candidate download gate */
.structural-candidate-download-gate {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, #26734d 32%, var(--color-border));
  border-radius: 9px;
  background: color-mix(in srgb, #ffffff 91%, #dff5e8);
}

.candidate-approval-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 9px;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.5;
  cursor: pointer;
}

.candidate-approval-check input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #26734d;
}

.candidate-approval-check strong {
  color: var(--color-text);
}

.candidate-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.candidate-download-actions button {
  flex: 1 1 148px;
  min-height: 34px;
}

.candidate-download-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.5;
}

.structural-candidate-download-gate[data-approved="true"] {
  border-color: color-mix(in srgb, #26734d 64%, var(--color-border));
  box-shadow: 0 0 0 2px color-mix(in srgb, #26734d 10%, transparent);
}

@media (max-width: 520px) {
  .candidate-download-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* PDF3001 V3 RC1 operational compatibility gate */
.structural-compatibility-card {
  margin-top: 11px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, #6b55c9 28%, var(--color-border));
  border-radius: 9px;
  background: color-mix(in srgb, #ffffff 94%, #eeeaff);
}

.structural-compatibility-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.structural-compatibility-heading > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.structural-compatibility-heading span {
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .03em;
}

.structural-compatibility-heading strong {
  color: var(--color-text);
  font-size: 13px;
}

#structural-compatibility-detail {
  margin: 9px 0 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.structural-compatibility-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.structural-compatibility-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: #fff;
}

.structural-compatibility-summary span {
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
}

.structural-compatibility-summary strong {
  overflow: hidden;
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structural-compatibility-summary strong[data-status="operational-ready"],
.structural-compatibility-summary strong[data-status="pass"] { color: #26734d; }
.structural-compatibility-summary strong[data-status="candidate-ready"],
.structural-compatibility-summary strong[data-status="pending"] { color: #8a6100; }
.structural-compatibility-summary strong[data-status="blocked"],
.structural-compatibility-summary strong[data-status="fail"] { color: #a64031; }

.structural-compatibility-details {
  margin-top: 9px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.structural-compatibility-details summary {
  padding: 9px 10px;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.structural-compatibility-list {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.structural-compatibility-list article {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7f9fb;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.structural-compatibility-list article strong {
  color: var(--color-text);
  font-size: 10px;
}

.structural-compatibility-list article[data-severity="blocking"] {
  background: #fff0ed;
  color: #873729;
}

.structural-compatibility-boundary {
  margin: 9px 0 0;
  padding: 8px 9px;
  border-radius: 7px;
  background: #f4f1ff;
  color: #4d3b8e;
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .structural-compatibility-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .structural-compatibility-heading { align-items: stretch; flex-direction: column; }
  .structural-compatibility-heading .analysis-actions { justify-content: flex-start; }
  .structural-compatibility-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
