/* Official palette: black / white / brand orange, plus a small grayscale
   ramp for surfaces and secondary text — no other hues appear anywhere in
   this stylesheet. The PAGE ITSELF (--page-plane, i.e. body's background)
   is black; every actual piece of content — the nav bar, the .wrap content
   sheet, cards, tables, forms, badges — stays on the original light
   ink-on-paper palette below, so text and status colors never had to be
   re-derived for a dark surface. --on-accent is the one token that only
   ever makes sense as literal black: text sitting on the brand-orange
   fill. */
:root {
  color-scheme: light;
  --ink: #000000;
  --paper: #ffffff;
  --on-accent: #000000;
  --accent: #f39800;
  --accent-dark: #cf8100; /* hover/active shade of the SAME accent color, not a new hue */
  --gray-50: #f7f7f6;
  --gray-100: #eeeeec;
  --gray-200: #e1e0db;
  --gray-300: #cfcecb;
  --gray-500: #8c8b87;
  --gray-700: #4a4946;

  --surface-1: var(--gray-50);
  /* Deliberately NOT tied to --gray-50 like the surfaces are — this is the
     black page canvas itself, everything else floats on top of it. */
  --page-plane: #000000;
  --surface-raised: var(--paper);
  --text-primary: var(--ink);
  --text-secondary: var(--gray-700);
  --text-muted: var(--gray-500);
  --gridline: var(--gray-200);
  --border: rgba(0, 0, 0, 0.14);

  /* Review-status 4-tier scale: 승인(approved)=orange, 거절(rejected)=black,
     보류(hold)=mid gray, 대기(pending)=light gray. A value/hue ramp instead
     of separate colors, so it works within the restricted palette. */
  --status-approved: var(--accent);
  --status-approved-ink: var(--on-accent);
  --status-hold: var(--gray-500);
  --status-hold-bg: var(--paper);
  --status-rejected: var(--ink);
  --status-rejected-ink: var(--paper);
  --status-pending: var(--gray-300);
  --status-pending-bg: var(--gray-100);

  /* Max corner rounding sitewide — buttons, cards, tiles, badges, inputs. */
  --radius: 5px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
  line-height: 1.5;
}

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin: 20px auto 40px;
  padding: 24px 20px 64px;
  background: var(--surface-raised);
  border-radius: var(--radius);
}

/* top nav bar */
.top-nav-bar {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.top-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.top-nav-brand {
  display: flex;
  align-items: center;
  margin-right: 8px;
  flex: none;
}
.top-nav-brand img { height: 26px; width: auto; display: block; }
.top-nav-btn {
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
}
.top-nav-btn:hover { background: var(--gray-100); color: var(--text-primary); }
.top-nav-btn.active {
  background: var(--ink);
  color: var(--paper);
}
.top-nav-logout {
  margin-left: auto;
  background: none;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
}
.top-nav-logout:hover { background: var(--gray-100); color: var(--text-primary); }

/* shared admin login screen (auth.js) */
.login-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.login-box-logo {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 0 16px;
  background: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
}
.login-box h1 { margin: 0 0 4px; font-size: 18px; }
.login-box .meta { font-size: 12px; color: var(--text-secondary); }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
}
.lang-btn {
  border: none;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--border); }
.lang-btn.active {
  background: var(--ink);
  color: var(--paper);
}
.top-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.topbar h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hero-logo {
  height: 48px;
  width: auto;
  flex: none;
  background: #fff;
  padding: 8px 12px;
  border-radius: var(--radius);
}
@media (max-width: 520px) {
  .hero-logo { height: 36px; }
}

.topbar .meta {
  color: var(--text-secondary);
  font-size: 13px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 12px;
}
.back-link:hover { color: var(--text-primary); }

.btn {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--gridline); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .btn-icon { width: 15px; height: 15px; flex: none; display: inline-flex; }
.btn .btn-icon svg { width: 100%; height: 100%; display: block; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: 0 4px 14px rgba(243, 152, 0, 0.32); }

/* stat tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.stat-tile {
  position: relative;
  background: var(--surface-1);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-tile .label {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.stat-tile .value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: proportional-nums;
}
.stat-tile .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Status-mapped fill variants — same hatch / solid-orange / solid-ink
   language as index.html's hero cards, applied selectively (not to every
   tile) so a 5-6-tile KPI row stays readable: the neutral "total" tile gets
   the hatch, the positive "approved" tile gets the solid orange fill, and
   the negative "rejected" tile gets the solid ink fill. Everything else
   (on hold / pending / royalty) keeps the plain bordered look. Reuses the
   same --status-* tokens the .dot colors already read from, so the fill
   always matches the status it represents. */
.stat-tile--hatch {
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    135deg,
    var(--gray-200) 0px, var(--gray-200) 1px,
    transparent 1px, transparent 9px
  );
  border-color: var(--ink);
}
.stat-tile--solid-accent {
  background: var(--status-approved);
  border-color: var(--status-approved);
  color: var(--status-approved-ink);
}
.stat-tile--solid-accent .label,
.stat-tile--solid-accent .sub { color: var(--status-approved-ink); opacity: 0.72; }
.stat-tile--solid-accent .dot { display: none; }
.stat-tile--solid-dark {
  background: var(--status-rejected);
  border-color: var(--status-rejected);
  color: var(--status-rejected-ink);
}
.stat-tile--solid-dark .label,
.stat-tile--solid-dark .sub { color: var(--status-rejected-ink); opacity: 0.68; }
.stat-tile--solid-dark .dot { display: none; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 5px;
  display: inline-block;
  flex: none;
}
.dot-good { background: var(--status-approved); }
.dot-warning { background: var(--status-hold); }
.dot-critical { background: var(--status-rejected); }
.dot-neutral { background: var(--status-pending); }

/* progress bar */
.progress {
  height: 8px;
  border-radius: 5px;
  background: var(--gray-100);
  overflow: hidden;
  display: flex;
  margin: 10px 0 20px;
  border: 1px solid var(--border);
}
.progress > span { height: 100%; }
.progress .p-good { background: var(--status-approved); }
.progress .p-warning { background: var(--status-hold); }
.progress .p-critical { background: var(--status-rejected); }
.progress .p-pending { background: var(--status-pending); }

/* line chart */
.chart-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
}
.chart-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.chart-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  align-items: center;
}
.chart-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .line-swatch { width: 16px; height: 2px; border-radius: 1px; display: inline-block; }
.chart-tooltip {
  position: absolute;
  background: var(--text-primary);
  color: var(--paper);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 20;
  white-space: nowrap;
}
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip .row { display: flex; gap: 8px; align-items: center; }
.chart-tooltip .row + .row { margin-top: 4px; }
.chart-tooltip .swatch { width: 10px; height: 2px; display: inline-block; }
.chart-tooltip .val { font-weight: 700; margin-left: auto; }

/* royalty table page */
.royalty-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
table.royalty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
table.royalty-table th, table.royalty-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gridline);
  text-align: left;
}
table.royalty-table th {
  background: var(--gray-50);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.royalty-table tbody tr { transition: background 0.1s ease; }
table.royalty-table tbody tr:hover { background: var(--gray-50); }
table.royalty-table tr.applicant-group:hover td,
table.royalty-table tr.subtotal-row:hover td { background: var(--gray-100); }
table.royalty-table tr.applicant-group td {
  background: var(--gray-100);
  font-weight: 700;
}
table.royalty-table input.rate-input { width: 70px; }
/* Marks a rate that was auto-filled from the rights holder's own IP
   registration (request.html) and hasn't been touched by an admin yet —
   removed the moment the admin edits the field (see the input listener). */
table.royalty-table input.rate-input--auto {
  border-color: var(--accent);
  background: rgba(243, 152, 0, 0.08);
  color: var(--accent-dark);
  font-weight: 700;
}
table.royalty-table tr.subtotal-row td {
  font-weight: 700;
  border-top: 2px solid var(--border);
}
table.royalty-table .dim { color: var(--text-muted); font-size: 11px; }

/* landing page: compact top summary (replaces the old full stat-grid+chart) */
.summary-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.summary-tile {
  display: block;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text-primary);
}
.summary-tile:hover { border-color: var(--accent); }
.summary-tile .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 700; }
.summary-tile .value { font-size: 18px; font-weight: 700; font-variant-numeric: proportional-nums; }
.summary-tile .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 16px;
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* landing page phase cards */
.event-info-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.event-info-box .row { display: flex; gap: 8px; padding: 3px 0; }
.event-info-box .row b { color: var(--text-primary); width: 130px; flex: none; font-weight: 700; }

/* full event schedule box (index.html) — a vertical timeline: each phase is
   its own bordered card with an accent-colored left edge and a dot marker
   on a connecting line, so the 5 phases read as clear, separate steps
   rather than one long undifferentiated block of text. */
.schedule-box {
  position: relative;
  margin-bottom: 20px;
  padding-left: 26px;
  font-size: 13px;
  color: var(--text-secondary);
}
.schedule-box::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gridline);
}
.schedule-phase {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px 12px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.schedule-phase:last-child { margin-bottom: 0; }
.schedule-phase::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: var(--accent);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--accent);
}
.schedule-phase-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gridline);
}
.schedule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  flex-wrap: wrap;
  border-bottom: 1px dashed var(--gridline);
}
.schedule-phase .schedule-row:last-of-type { border-bottom: none; }
.schedule-row .schedule-label { color: var(--text-primary); font-weight: 600; min-width: 260px; flex: none; }
.schedule-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--gridline);
}
.dday-chip {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  background: var(--gray-100);
  color: var(--text-secondary);
}
.dday-chip.upcoming { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.dday-chip.today { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dday-chip.active { background: var(--paper); color: var(--ink); border: 1px solid var(--ink); }
.dday-chip.ended { background: var(--gray-100); color: var(--text-muted); }
.intro-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 720px;
}
.phase-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 32px 0 14px;
  /* So an in-page anchor jump (top nav's 예비심사/본심사 links on
     company-review.html) doesn't land with the heading tucked under the
     sticky .top-nav-bar. */
  scroll-margin-top: 64px;
}
.phase-section-head:first-of-type { margin-top: 8px; }
.phase-section-head .step {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.phase-section-head h2 { margin: 0 0 4px; font-size: 18px; }
.phase-section-head p { margin: 0; font-size: 13px; color: var(--text-secondary); max-width: 640px; line-height: 1.5; }
.phase-section-head .btn { flex: none; text-decoration: none; }

.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.phase-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
  transition: border-color 0.15s;
}
.phase-card:hover { border-color: var(--accent); }
.phase-card .step {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.phase-card h2 { margin: 0 0 8px; font-size: 20px; }
.phase-card p { margin: 0 0 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.phase-card .phase-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.phase-card .phase-stats .mini {
  font-size: 12px;
  color: var(--text-secondary);
}
.phase-card .phase-stats .mini b { font-size: 16px; color: var(--text-primary); display: block; }
.phase-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}
.phase-card.final .cta { color: var(--ink); }

.ref-chip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ref-chip .badge { flex: none; }

.badge-exception {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--accent);
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

/* applicant cards */
.applicant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.applicant-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.applicant-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}
.applicant-card .name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.applicant-card .id {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-good { background: var(--status-approved); color: var(--status-approved-ink); }
.badge-warning { background: var(--status-hold-bg); color: var(--ink); border: 1px solid var(--status-hold); }
.badge-critical { background: var(--status-rejected); color: var(--status-rejected-ink); }
.badge-neutral { background: var(--status-pending-bg); color: var(--text-secondary); }
.rights-company-link { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.rights-company-link:hover { opacity: 0.8; }

.applicant-card .royalty {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}
.applicant-card .royalty b { color: var(--text-primary); }

/* product cards on detail page */
.product-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.product-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.product-head h3 { margin: 0 0 4px; font-size: 16px; }
.product-head .cat { font-size: 12px; color: var(--text-muted); }

.product-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}
@media (max-width: 640px) {
  .product-body { grid-template-columns: 1fr; }
}

.img-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
@media (max-width: 640px) {
  .img-gallery { grid-template-columns: repeat(5, minmax(0,1fr)); }
}
.img-slot {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--gray-100);
  position: relative;
}
.img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.img-slot.empty {
  border: 1px dashed var(--gridline);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 10px;
}
.img-gallery-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}
.img-empty {
  width: 100%;
  min-height: 100px;
  border: 1px dashed var(--gridline);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

dl.info { margin: 0; font-size: 13px; }
dl.info div { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--gridline); }
dl.info dt { flex: none; width: 72px; color: var(--text-muted); }
dl.info dd { margin: 0; color: var(--text-primary); white-space: pre-line; }

.stage-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}
.stage-flow .arrow { color: var(--gridline); font-weight: 400; }

.review-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gridline);
}
.review-block.disabled {
  opacity: 0.55;
}
.stage-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage-title .stage-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
}

.royalty-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--gridline);
  font-size: 13px;
}
.royalty-line label { font-weight: 700; }
.royalty-line input.rate-input {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px;
  width: 80px;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.royalty-line .amount {
  font-weight: 700;
  color: var(--accent-dark);
}
.royalty-line .hint {
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.decision-buttons { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.decision-btn {
  border: 1.5px solid var(--border);
  background: var(--surface-raised);
  border-radius: 5px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.decision-btn[data-kind="승인"].active { background: var(--status-approved); border-color: var(--status-approved); color: var(--status-approved-ink); }
.decision-btn[data-kind="보류"].active { background: var(--status-hold-bg); border-color: var(--status-hold); color: var(--ink); }
.decision-btn[data-kind="거절"].active { background: var(--status-rejected); border-color: var(--status-rejected); color: var(--status-rejected-ink); }

textarea.comment {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.save-state { font-size: 11px; color: var(--text-muted); margin-top: 4px; height: 14px; }

.note-box {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--gray-100);
  border-radius: 5px;
  padding: 10px 12px;
}
.prelim-ref {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--gray-100);
  border-radius: 5px;
  padding: 8px 10px;
}

.royalty-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.royalty-box label { font-size: 13px; font-weight: 700; }
.royalty-box input {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 14px;
  width: 160px;
  font-variant-numeric: tabular-nums;
}

footer.hint {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

/* resubmission (재신청) */
.badge.resubmit-badge {
  background: var(--accent);
  color: var(--on-accent);
}
.resubmit-block { margin-top: 12px; }
.resubmit-toggle-btn { font-size: 12px; }
.resubmit-panel {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--accent);
  background: var(--paper);
  border-radius: var(--radius);
}
.resubmit-panel .hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}
/* Groups one IP entry's fields together inside admin.html's submission
   detail panel — a company can have several of these side by side, so each
   needs a clear boundary of its own rather than blurring into one long list. */
.admin-entry-block {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-1);
  padding: 10px 14px 4px;
  margin: 10px 0;
}
.admin-entry-block-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gridline);
}
.resubmit-field-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.resubmit-field { flex: 1; min-width: 160px; }
.resubmit-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.resubmit-field textarea,
.resubmit-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface-raised);
}
.resubmit-field textarea { min-height: 56px; resize: vertical; }
.resubmit-images {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
@media (max-width: 640px) {
  .resubmit-images { grid-template-columns: repeat(2, 1fr); }
}
.resubmit-images input {
  font-size: 11px;
  padding: 6px 8px;
  background: var(--surface-raised);
}
.resubmit-actions { display: flex; gap: 8px; margin-top: 4px; }

.resubmit-history {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--gridline);
}
.resubmit-history summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.resubmit-history-entry {
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12px;
}
.resubmit-history-entry .round {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.resubmit-history-delete-btn {
  font-size: 11px;
  padding: 4px 10px;
  font-weight: 600;
  color: var(--ink);
  border-color: var(--ink);
  background: var(--surface-raised);
}
.resubmit-history-delete-btn:hover { background: var(--gray-100); }
.resubmit-history-delete-btn.resubmit-history-delete-armed {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.resubmit-history-entry dl { margin: 0; }
.resubmit-history-entry dl div { display: flex; gap: 6px; padding: 2px 0; }
.resubmit-history-entry dt { flex: none; width: 92px; color: var(--text-muted); }
.resubmit-history-entry dd { margin: 0; white-space: pre-line; color: var(--text-secondary); }

/* resubmission image attach (file upload, not URL) */
.resubmit-images {
  grid-template-columns: repeat(5, 1fr);
}
.resubmit-image-slot {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-raised);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.resubmit-image-preview {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  background: var(--gray-100);
  border: 1px dashed var(--gridline);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
  position: relative;
}
.resubmit-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.resubmit-image-preview.uploading { color: var(--accent-dark); font-weight: 700; }
/* Empty state (a bare <span> placeholder, no <img> yet) gets the same bold
   accent-orange dashed "add" look as .dashed-add-box — consistent across
   request.html's style-guide upload and preliminary/final-applicant.html's
   resubmission image slots, all of which share this exact markup shape. */
.resubmit-image-preview:has(span) {
  border: 1.5px dashed var(--accent);
  background: rgba(243, 152, 0, 0.05);
  color: var(--accent-dark);
  font-weight: 700;
}
.resubmit-image-actions { display: flex; gap: 4px; }
.resubmit-image-actions .btn {
  flex: 1;
  padding: 5px 4px;
  font-size: 10px;
  text-align: center;
}
@media (max-width: 640px) {
  .resubmit-images { grid-template-columns: repeat(2, 1fr); }
}

/* stat tiles that open a jump-to-detail popup */
.stat-tile-clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.stat-tile-clickable:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.stat-tile-clickable.stat-tile--solid-accent:hover,
.stat-tile-clickable.stat-tile--solid-dark:hover { border-color: transparent; }
.stat-tile-clickable:active { transform: scale(0.98); }

/* generic list modal (stat-tile drilldown) */
.ip-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  z-index: 60;
}
.ip-modal-overlay.open { display: flex; }
.ip-modal {
  background: var(--surface-raised);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.ip-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.ip-modal-title { font-size: 15px; font-weight: 700; }
.ip-modal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ip-modal-close {
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  flex: none;
}
.ip-modal-close:hover { color: var(--text-primary); }
.ip-modal-body { overflow-y: auto; padding: 8px; }
.ip-modal-empty { padding: 24px 12px; text-align: center; color: var(--text-muted); font-size: 13px; }
.ip-modal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--text-primary);
}
.ip-modal-item:hover { background: var(--gray-100); }
.ip-modal-item-main { flex: 1; min-width: 0; }
.ip-modal-item-label { font-size: 13px; font-weight: 600; }
.ip-modal-item-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ip-modal-item-arrow { flex: none; color: var(--text-muted); font-size: 13px; }

/* jump-to highlight when arriving from a modal link */
.jump-highlight {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  animation: jump-highlight-fade 2s ease-out;
}
@keyframes jump-highlight-fade {
  0% { background-color: var(--gray-100); }
  100% { background-color: transparent; }
}

/* rights-holder material request page (request.html) */
.request-toolbar {
  max-width: 800px;
  margin: 0 auto 16px;
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.request-toolbar .label { font-size: 12px; font-weight: 700; color: var(--ink); flex: none; }
.request-toolbar input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 13px;
}
.request-toolbar .url-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.request-toolbar .url-row code {
  flex: 1;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 12px;
}
.request-actions {
  max-width: 800px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: flex-end;
}
.request-doc {
  max-width: 800px;
  margin: 0 auto 48px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px;
  line-height: 1.8;
}
.request-doc-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px;
}
.request-doc-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.request-doc-date {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 24px;
}
.request-salutation {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}
.request-intro {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 26px;
  white-space: pre-line;
}
.request-section {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--surface-1);
}
.request-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.request-section-title .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  flex: none;
}
.section-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  flex: none;
}
.section-badge.required {
  background: var(--accent);
  color: var(--on-accent);
}
.section-badge.optional {
  background: var(--gray-100);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.request-section ul { margin: 0; padding-left: 20px; font-size: 13px; }
.request-section li { margin-bottom: 4px; }
.request-section li .sub { color: var(--text-secondary); font-size: 12px; }
.request-closing {
  font-size: 13px;
  margin: 26px 0 0;
  white-space: pre-line;
}
.request-signature-row {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--gridline);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.request-signature {
  font-size: 13px;
  color: var(--text-secondary);
}
.request-contact-email {
  font-size: 13px;
  color: var(--text-secondary);
}
.request-contact-email a {
  color: inherit;
}
.request-placeholder {
  display: inline-block;
  background: var(--paper);
  border: 1px dashed var(--accent);
  border-radius: 5px;
  padding: 1px 8px;
  color: var(--ink);
  font-weight: 600;
}

.lang-switch { display: flex; gap: 4px; margin-right: auto; }
.lang-btn {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-secondary);
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn:hover { background: var(--gridline); }
.lang-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.ip-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex: none;
}
.confirm-field-list .resubmit-history-entry { margin-bottom: 8px; }
.confirm-field-list .resubmit-history-entry:last-child { margin-bottom: 0; }

@media print {
  .top-nav-bar, .request-toolbar, .request-actions, .ip-modal-overlay { display: none !important; }
  body { background: #fff; }
  .request-doc { border: none; padding: 0; max-width: 100%; }
}

/* =========================================================
   2027 OPERATIONS UI — navigation and workspace redesign
   Brand palette remains black / white / #f39800.
   ========================================================= */
@media screen and (min-width: 961px) {
  body:not(:has(.login-wrap:not([style*="display: none"]))) {
    padding-left: 224px;
  }
  .top-nav-bar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: 224px;
    height: 100vh;
    padding: 24px 16px;
    background: var(--ink);
    border: 0;
    box-shadow: 12px 0 32px rgba(0,0,0,.08);
  }
  .top-nav-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .top-nav-brand {
    width: 44px;
    height: 44px;
    margin: 0 0 25px 8px;
    border-radius: 8px;
    background: var(--paper);
    display: grid;
    place-items: center;
  }
  .top-nav-brand img { width: 30px; height: 30px; object-fit: contain; }
  .top-nav-btn {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    color: rgba(255,255,255,.68);
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
  }
  .top-nav-btn:hover {
    color: var(--paper);
    background: rgba(255,255,255,.08);
  }
  .top-nav-btn.active {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
  }
  .top-nav-inner .logout-btn,
  .top-nav-inner button:last-child {
    margin-top: auto;
    color: var(--paper);
    background: transparent;
    border: 1px solid rgba(255,255,255,.25);
  }
  .wrap { max-width: 1480px; padding: 34px 42px 64px; }
}

body {
  background:
    linear-gradient(90deg, rgba(0,0,0,.018) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,.018) 1px, transparent 1px),
    var(--gray-50);
  background-size: 28px 28px;
}
.wrap { min-height: 100vh; }
.topbar {
  padding: 0 0 25px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}
.hero-brand { align-items: center; gap: 18px; }
.hero-logo {
  max-width: 172px;
  padding: 11px 13px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.hero-brand h1 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 36px);
  line-height: 1.12;
  letter-spacing: -.04em;
}
.hero-brand .meta { margin-top: 7px; color: var(--text-muted); }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 34px 0 12px;
  font-size: 18px;
  letter-spacing: -.02em;
}
.section-title::before {
  content: "";
  width: 5px;
  height: 19px;
  flex: none;
  background: var(--accent);
  border-radius: 2px;
}
.schedule-box,
.royalty-table-wrap,
.chart-card,
.applicant-card,
.resubmit-box {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,.045);
}
.royalty-table-wrap { overflow: auto; }
.royalty-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 13px;
  padding-bottom: 13px;
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.royalty-table tbody tr { transition: background .14s ease; }
.royalty-table tbody tr:hover { background: rgba(243,152,0,.075); }
.royalty-table td { padding-top: 13px; padding-bottom: 13px; }
.btn {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,0,0,.11); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
input, select, textarea {
  min-height: 42px;
  border-radius: 6px !important;
  background: var(--paper);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(243,152,0,.22);
  border-color: var(--accent) !important;
}
.summary-compact,
.stat-grid { gap: 14px; }
.summary-tile,
.stat-card,
.stat-tile {
  min-height: 132px;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(0,0,0,.045);
}

/* Login — intentionally distinct from the working dashboard. */
.login-wrap {
  min-height: 100vh;
  padding: 28px;
  background:
    linear-gradient(120deg, var(--ink) 0 48%, transparent 48%),
    var(--gray-50);
  display: grid;
  place-items: center;
}
.login-box {
  width: min(460px, 100%);
  margin-left: min(36vw, 430px);
  padding: 36px;
  border: 1px solid var(--border);
  border-top: 7px solid var(--accent);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(0,0,0,.2);
}
.login-box-logo { width: min(220px, 70%); margin-bottom: 24px; }
.login-event-name {
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.login-language { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.company-periods {
  margin: 0 0 24px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
}
.company-periods-title { margin-bottom: 12px; font-weight: 800; }
.company-periods-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 10px; }
.company-periods article { padding: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px; }
.company-periods article>b { display: block; margin-bottom: 7px; }
.company-periods article span { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 12px; }
.company-periods article span strong { font-weight: 600; color: var(--text-secondary); }

.company-header-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.schedule-open-btn { min-height: 42px; padding: 0 18px; border: 2px solid #000; border-radius: 8px; background: var(--orange); color: #000; font: inherit; font-weight: 900; line-height: 1; box-shadow: 3px 3px 0 #000; cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease; }
.schedule-open-btn:hover { background: #ffab1a; box-shadow: 3px 3px 0 #000; }
.schedule-open-btn:active { background: #ed8d00; }
.schedule-open-btn:focus-visible { outline: 3px solid rgba(247,148,0,.35); outline-offset: 3px; }
html.modal-open, body.modal-open { overflow: hidden !important; overscroll-behavior: none; }
.schedule-dialog { width: min(920px, calc(100vw - 32px)); height: min(82vh, 760px); max-height: min(82vh, 760px); padding: 0; border: 0; border-radius: 16px; background: #fff; color: #111; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; flex-direction: column; }
.schedule-dialog[open] { display: flex; }
.schedule-dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.schedule-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 28px 20px; border-top: 6px solid var(--orange); border-bottom: 1px solid var(--gray-200); background: #fff; }
.schedule-dialog-head span { display: block; margin-bottom: 5px; color: #b96500; font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.schedule-dialog-head h2 { margin: 0; font-size: 26px; }
.schedule-dialog-close { width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--gray-300); border-radius: 50%; background: #fff; color: #111; font-size: 26px; line-height: 1; cursor: pointer; }
.schedule-dialog-close:hover { background: #000; color: #fff; border-color: #000; }
.schedule-dialog-body { min-height: 0; flex: 1 1 auto; padding: 24px 28px 30px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: grid; align-content: start; gap: 12px; scrollbar-color: var(--orange) #eee; scrollbar-width: thin; }
.schedule-dialog-body::-webkit-scrollbar { width: 10px; }
.schedule-dialog-body::-webkit-scrollbar-track { background: #eee; }
.schedule-dialog-body::-webkit-scrollbar-thumb { background: var(--orange); border: 2px solid #eee; border-radius: 999px; }
.schedule-step { display: grid; grid-template-columns: 86px minmax(0,1fr); border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; background: #fff; }
.schedule-step-number { padding: 20px 14px; background: #000; color: var(--orange); font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.schedule-step-content { padding: 18px 20px; }
.schedule-step-content h3 { margin: 0 0 10px; font-size: 18px; }
.schedule-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0,1.5fr); gap: 20px; padding: 8px 0; border-top: 1px solid var(--gray-100); font-size: 14px; line-height: 1.55; }
.schedule-row strong { color: var(--text-secondary); }
@media (max-width: 640px) {
  .schedule-dialog { width: calc(100vw - 20px); height: 88vh; max-height: 88vh; border-radius: 12px; }
  .schedule-dialog-head { padding: 18px 18px 15px; }
  .schedule-dialog-head h2 { font-size: 22px; }
  .schedule-dialog-body { padding: 16px; }
  .schedule-step { grid-template-columns: 1fr; }
  .schedule-step-number { padding: 9px 14px; }
  .schedule-step-content { padding: 15px; }
  .schedule-row { grid-template-columns: 1fr; gap: 2px; }
}
.comment-thread { display: grid; gap: 8px; margin: 0 0 12px; }
.comment-message { max-width: 78%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--paper); }
.comment-message.admin { border-left: 4px solid var(--accent); }
.comment-message.company { justify-self: end; background: var(--gray-100); }
.comment-message b { display: block; margin-bottom: 3px; font-size: 11px; }
.comment-message p { margin: 0; white-space: pre-wrap; }
.comment-message time { display: block; margin-top: 5px; color: var(--text-muted); font-size: 10px; }
.catalog-upload-panel { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:16px 0 24px; padding:18px; border:1px solid var(--border); border-left:5px solid var(--accent); border-radius:8px; background:var(--paper); }
.catalog-upload-panel>div { flex:1; min-width:240px; }
.catalog-upload-panel p { margin:4px 0 0; color:var(--text-secondary); font-size:12px; }
.translation-tools { display:flex; align-items:center; gap:10px; margin:8px 0 18px; }
.login-box h1 { font-size: 28px; letter-spacing: -.04em; }
.login-box .meta { line-height: 1.65; color: var(--text-secondary); }

/* Admin: clearer separation between access management and submissions. */
#adminContent .resubmit-field-row {
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 7px 20px rgba(0,0,0,.04);
}
#adminContent #statGrid { margin-top: 16px; }

@media screen and (max-width: 960px) {
  .login-wrap { background: var(--ink); }
  .login-box { margin-left: 0; }
  .top-nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
  }
  .top-nav-inner {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .top-nav-inner::-webkit-scrollbar { display: none; }
  .wrap { padding: 22px 16px 48px; }
}
@media screen and (max-width: 620px) {
  .login-wrap { padding: 14px; }
  .login-box { padding: 26px 20px; }
  .topbar { align-items: flex-start; }
  .hero-brand { align-items: flex-start; }
  .hero-logo { max-width: 130px; }
  .summary-compact, .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* v43 corrective pass: centered authentication, intact logo, no hatching. */
body {
  padding-left: 0 !important;
  background: var(--gray-50) !important;
  background-image: none !important;
}
@media screen and (min-width: 961px) {
  body .wrap {
    width: calc(100% - 224px);
    max-width: none;
    margin: 0 0 0 224px;
    padding: 34px 42px 64px;
    border-radius: 0;
  }
}
.login-wrap {
  width: 100%;
  min-height: 100vh;
  margin: 0 !important;
  padding: 24px !important;
  display: grid !important;
  place-items: center !important;
  background: var(--gray-50) !important;
  background-image: none !important;
}
.login-box {
  width: min(420px, 100%) !important;
  max-width: 420px !important;
  margin: 0 !important;
  padding: 34px !important;
}
.login-box-logo {
  width: auto !important;
  max-width: min(220px, 76%) !important;
  height: auto !important;
  max-height: 72px !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: left center;
}
.stat-tile--hatch,
.page-home .summary-tile--hatch {
  background: var(--paper) !important;
  background-image: none !important;
}
.summary-tile,
.stat-tile,
.stat-card,
.schedule-box,
.applicant-card,
.royalty-table-wrap {
  background-image: none !important;
}
@media screen and (max-width: 960px) {
  body .wrap {
    width: 100%;
    margin: 0;
  }
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}
.lightbox.open { display: flex; }

/* ==========================================================================
   Site-wide visual refresh — referenced from a SaaS dashboard design (rounded
   pill buttons, bold stat cards with a trend readout, softer list rows,
   diagonal-hatch / solid-fill card variants). Pill buttons and the table
   refresh now live in the base .btn / table.royalty-table rules above, so
   they apply everywhere automatically. What's still scoped here: .page-home
   (index.html's hero 3-card summary, unique to that page), the reusable
   .stat-tile variants (preliminary/final/royalty/company-review/admin),
   .applicant-card polish, and the dashed "add" box + pill tag-chip
   components used on request.html. Same palette throughout (ink / paper /
   brand orange) — only roundness, shadow and fill treatment change. */

/* stat cards (예비심사/본심사/자료 제출 summary) — three cards, each given a
   DIFFERENT fill treatment (diagonal hatch / solid orange / solid ink) the
   way the reference alternates a hatched card, a solid-color card and a
   solid-dark card side by side, rather than three identical tiles. A bold
   2px border (not the sitewide hairline) and a bottom progress bar reading
   the same rate as the trend text are the other two borrowed details. */
.page-home .summary-compact { gap: 14px; }
.page-home .summary-tile {
  position: relative;
  border-radius: 16px;
  border: 2px solid var(--ink);
  padding: 18px 18px 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.page-home .summary-tile:hover {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
}

/* variant 1 — light card, subtle 45° hatch fill, ink border */
.page-home .summary-tile--hatch {
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    135deg,
    var(--gray-200) 0px, var(--gray-200) 1px,
    transparent 1px, transparent 9px
  );
}
.page-home .summary-tile--hatch .tile-trend { color: var(--accent-dark); }
.page-home .summary-tile--hatch .tile-progress { background: rgba(0, 0, 0, 0.08); }
.page-home .summary-tile--hatch .tile-progress > span { background: var(--accent); }

/* variant 2 — solid brand-orange fill (on-accent = black, per the sitewide token) */
.page-home .summary-tile--solid-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.page-home .summary-tile--solid-accent .tile-trend { color: var(--on-accent); }
.page-home .summary-tile--solid-accent .label,
.page-home .summary-tile--solid-accent .sub { color: var(--on-accent); opacity: 0.72; }
.page-home .summary-tile--solid-accent .tile-progress { background: rgba(0, 0, 0, 0.18); }
.page-home .summary-tile--solid-accent .tile-progress > span { background: var(--ink); }

/* variant 3 — solid ink fill, paper text */
.page-home .summary-tile--solid-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.page-home .summary-tile--solid-dark .tile-trend { color: var(--accent); }
.page-home .summary-tile--solid-dark .label,
.page-home .summary-tile--solid-dark .sub { color: var(--paper); opacity: 0.68; }
.page-home .summary-tile--solid-dark .tile-progress { background: rgba(255, 255, 255, 0.18); }
.page-home .summary-tile--solid-dark .tile-progress > span { background: var(--accent); }

.page-home .summary-tile .tile-trend {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.page-home .summary-tile .label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-home .summary-tile .value {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.page-home .summary-tile .sub {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-bottom: 12px;
}
.page-home .summary-tile .tile-progress {
  margin-top: auto;
  height: 5px;
  border-radius: 999px;
  background: var(--gray-100);
  overflow: hidden;
}
.page-home .summary-tile .tile-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* entity-avatar — initial-letter circle used before a company/applicant name
   in a table row or card, on index.html's roster and reused on admin.html's
   submissions table. */
.company-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.company-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
/* Keeps the name on one line so the flex row (avatar + name) never crunches
   down to a per-character stack when the table column is narrower than the
   name — the table wrap's overflow-x:auto then scrolls instead. */
.company-name-cell b { white-space: nowrap; }
/* Pill-shaped search boxes (index.html roster search, admin.html submissions
   search) — scoped by id rather than sitewide, since a pill radius on every
   ordinary form field (contact info, password resets) would look odd there. */
#companySearchInput,
#searchInput {
  border-radius: 999px;
  padding: 9px 16px;
}

/* dashed "add" box — the "＋ Додати" / "＋ Додати фото" pattern: a button
   that reads as an empty upload slot rather than a plain action button.
   Used for request.html's "새 타이틀 등록" entry-list add action and its
   style-guide file picker. */
.dashed-add-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  background: rgba(243, 152, 0, 0.05);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dashed-add-box:hover { background: rgba(243, 152, 0, 0.1); border-color: var(--accent-dark); }
.dashed-add-box .plus-icon {
  width: 16px;
  height: 16px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

/* pill tag-chip — a removable tag, e.g. an "×"-dismissible list entry.
   Neutral gray by default; .tag-chip-cover marks the one currently in a
   "primary/cover" role (matching the "Обкладинка" cover-photo tag). */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.tag-chip button {
  width: 16px;
  height: 16px;
  border: none;
  background: var(--gray-200);
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tag-chip button:hover { background: var(--gray-300); color: var(--text-primary); }
.tag-chip-cover {
  border-color: var(--accent);
  background: rgba(243, 152, 0, 0.08);
  color: var(--accent-dark);
}

.lightbox img { max-width: 100%; max-height: 100%; border-radius: 5px; }
.comment-composer{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.comment-composer textarea{min-height:76px}.comment-composer .btn{height:42px}
.product-table-cell{display:flex;align-items:center;gap:12px}.product-table-cell img,.product-thumb-empty{width:58px;height:58px;border-radius:8px;border:1px solid #ddd;object-fit:cover;display:grid;place-items:center;background:#f3f3f3;font-weight:800}
.royalty-overview{margin:26px 0}.royalty-summary-total{font-size:30px;font-weight:900;color:#f39800;margin:10px 0 14px}.royalty-formula-list{border:1px solid #ddd;border-radius:12px;overflow:hidden}.royalty-formula-list>div{display:flex;justify-content:space-between;gap:20px;padding:14px 16px;border-bottom:1px solid #eee}.royalty-formula-list>div:last-child{border-bottom:0}.royalty-formula-list span{font-variant-numeric:tabular-nums}
@media(max-width:700px){.comment-composer{grid-template-columns:1fr}.royalty-formula-list>div{display:block}.royalty-formula-list span{display:block;margin-top:6px}.product-table-cell img,.product-thumb-empty{width:44px;height:44px}}

/* v45: clean admin login canvas and higher-legibility review/royalty rows. */
body:has(#loginScreen:not([style*="display: none"])) .wrap {
  width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
}
body:has(#loginScreen:not([style*="display: none"])) { background: var(--gray-50) !important; }
.royalty-table th { white-space: nowrap; letter-spacing: .01em; }
.royalty-table td { vertical-align: middle; font-size: 14px; }
.royalty-table tbody tr:not(.applicant-group):not(.subtotal-row) td { padding-top: 16px; padding-bottom: 16px; }
.royalty-product { display:flex; align-items:center; gap:12px; min-width:220px; }
.royalty-product img { width:52px; height:52px; border:1px solid var(--gray-200); border-radius:8px; object-fit:cover; }
.comment-thread { padding: 14px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--gray-50); }
.comment-message { max-width: 72%; padding: 13px 15px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.comment-message.admin { background:#fff7e8; border-color:#f3b44b; justify-self:start; }
.comment-message.company { background:#fff; border-color:#c9c9c9; justify-self:end; }
.comment-message.admin b { color:#b56800; }.comment-message.company b { color:#333; }
.comment-message details { margin-top:8px; font-size:11px; color:var(--text-muted); }.comment-message summary { cursor:pointer; }
.decision-history { margin: 10px 0 12px; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--paper); }
.decision-history summary { padding: 10px 12px; cursor: pointer; font-weight: 700; }
.decision-history > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; border-top: 1px solid var(--gray-100); font-size: 12px; }
.decision-history > div span:last-child { color: var(--text-muted); text-align: right; }
@media(max-width:620px){.decision-history > div{display:block}.decision-history > div span:last-child{display:block;margin-top:4px;text-align:left}}
