/* unduck public theme — loaded after every legacy portal stylesheet. */
:root {
  --unduck-forest: #146B43;
  --unduck-yellow: #FFC928;
  --unduck-orange: #F27A00;
  --unduck-ivory: #FFF9EE;
  --xex-black: #146B43;
  --xex-red: #F27A00;
  --xex-white: #FFF9EE;
  --xex-red-dim: #146B43;
  --xex-red-faint: #146B43;
  --xex-ink: #146B43;
  --xex-ink-soft: #146B43;
  --xex-line: #146B43;
  --xex-line-strong: #146B43;
  --xex-surface: #FFF9EE;
  --xex-canvas: #FFF9EE;
  --xex-bar: #146B43;
  --xex-live: #F27A00;
  --xex-live-ink: #FFF9EE;
  --xex-soon: #FFC928;
  --xex-soon-ink: #146B43;
  --xex-soon-edge: #146B43;
  --xex-ended: #146B43;
  --xex-ended-ink: #FFF9EE;
  --xex-updated: #FFF9EE;
  --xex-updated-ink: #146B43;
  --xex-updated-edge: #F27A00;
  --kp-bg: #FFF9EE;
  --kp-surface: #FFF9EE;
  --kp-surface-soft: #FFF9EE;
  --kp-ink: #146B43;
  --kp-muted: #146B43;
  --kp-border: #146B43;
  --kp-primary: #146B43;
  --kp-primary-deep: #146B43;
  --kp-accent: #F27A00;
  --kp-teal: #FFC928;
  --kp-success: #146B43;
  --kp-danger: #F27A00;
  --rh-surface: #FFF9EE;
  --rh-canvas: #FFF9EE;
  --rh-line: #146B43;
  --rh-line-strong: #146B43;
  --rh-text: #146B43;
  --rh-muted: #146B43;
  --rh-red: #F27A00;
  --rh-red-dark: #146B43;
  --rh-tint: #FFF9EE;
}

/* Legacy selectors remain as technical contracts, but their old paint is neutralized here. */
.xex-shell :where(*),
.koco-auth-page :where(*),
.koco-profile-page :where(*),
.redhands-board :where(*) {
  color: #146B43 !important;
  background-color: transparent !important;
  border-color: #146B43 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.xex-shell :where(*):not([style*="background-image"]),
.koco-auth-page :where(*),
.koco-profile-page :where(*),
.redhands-board :where(*) { background-image: none !important; }

.xex-globalbar :where(*),
.xex-nav :where(*),
.xex-panel__head :where(*),
.xex-sec__title :where(*),
.xex-left__title :where(*),
.xex-widget__title :where(*),
.redhands-board__head :where(*),
.redhands-read > header :where(*),
.koco-noticebar :where(*),
.koco-home-hero :where(*) { color: #FFF9EE !important; }

:where(.xex-shell, .koco-auth-page, .koco-profile-page, .redhands-board)
  :where(h1, h2, h3, h4, h5, h6, p, li, a, span, small, strong, em, label, input, button, select, textarea, td, th, summary, dt, dd, [class*="title"]) {
  font-size: max(1em, 15px) !important;
  line-height: 1.5 !important;
}

html,
body,
.xex-shell,
.xex-body,
.xex-panel,
.xex-left__block,
.xex-widget,
.xex-sec,
.xex-hotcard,
.xex-slot,
.redhands-board,
.redhands-read,
.redhands-write,
.redhands-comments,
.koco-portal,
.koco-portal-card,
.koco-page-content,
.koco-search-panel {
  color: #146B43 !important;
  background-color: #FFF9EE !important;
}

html,
body,
.xex-shell {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  font-size:15px !important;
  line-height: 1.65;
}

.xex-globalbar,
.xex-nav,
.xex-panel__head,
.xex-sec__title,
.xex-left__title,
.xex-widget__title,
.redhands-board__head,
.redhands-read > header,
.koco-noticebar,
.koco-home-hero {
  color: #FFF9EE !important;
  background: #146B43 !important;
  border-color: #FFC928 !important;
  box-shadow: none !important;
}

.xex-globalbar { border-bottom: 4px solid #FFC928 !important; }
.xex-brand__logo { width: 155px; height: 56px; object-fit: contain; }
.xex-nav { border-bottom: 3px solid #F27A00 !important; }
.xex-nav__link,
.xex-member__login,
.xex-langpick > summary,
.xex-member__account > summary { color: #FFF9EE !important; font-size:16px !important; }
.xex-nav__link:hover,
.xex-nav li.is-active > .xex-nav__link { color: #146B43 !important; background: #FFC928 !important; }
.xex-nav__sub,
.xex-member__account > div,
.xex-langpick > ul { background: #FFF9EE !important; border-color: #146B43 !important; }
.xex-nav__sub a,
.xex-member__account a,
.xex-langpick a { color: #146B43 !important; font-size:15px !important; }

.xex-search input[type="search"],
input,
textarea,
select {
  min-width: 0;
  max-width: 100%;
  color: #146B43 !important;
  background: #FFF9EE !important;
  border-color: #146B43 !important;
  font-size:16px !important;
}
.xex-search button,
button,
.xex-button,
.redhands-button,
.koco-login-link,
.koco-search-panel button {
  color: #FFF9EE !important;
  background: #F27A00 !important;
  border-color: #F27A00 !important;
  font-size:15px !important;
}
.xex-search button:hover,
button:hover,
.xex-button:hover,
.redhands-button:hover {
  color: #146B43 !important;
  background: #FFC928 !important;
  border-color: #146B43 !important;
}

a { color: #146B43; }
a:hover,
.xex-panel__more:hover,
.xex-sec__more:hover { color: #F27A00 !important; }

.xex-content,
.xex-list a,
.xex-left__block li a,
.xex-linklist li a,
.xex-ranklist li a,
.xex-widget__text,
.xex-widget__cta,
.xex-secgrid .xex-list a,
.redhands-board,
.redhands-board a,
.redhands-read,
.redhands-read__body,
.redhands-read__body p,
.redhands-read__body li,
.redhands-comment .xe_content,
.koco-portal,
.koco-portal a,
.koco-page-content {
  font-size:max(1em, 15px) !important;
  line-height: 1.65 !important;
}

.xex-left__title,
.xex-widget__title,
.xex-sec__title,
.xex-panel__title { font-size:18px !important; line-height: 1.5 !important; }
.xex-list .xex-cat,
.xex-list .xex-cnt,
.xex-list .xex-date,
.xex-chip,
.xex-tag,
.xex-badge,
.redhands-row__type,
.redhands-row__category,
.redhands-board__meta,
.redhands-comment header,
.redhands-comment footer a,
.koco-portal small { font-size:15px !important; line-height: 1.5 !important; }

.xex-badge--live,
.xex-badge--updated,
.redhands-button.is-primary { color: #FFF9EE !important; background: #F27A00 !important; border-color: #F27A00 !important; }
.xex-badge--soon { color: #146B43 !important; background: #FFC928 !important; border-color: #146B43 !important; }
.xex-badge--ended { color: #FFF9EE !important; background: #146B43 !important; border-color: #146B43 !important; }

.xex-panel,
.xex-sec,
.xex-widget,
.xex-left__block,
.xex-hotcard,
.xex-slot,
.redhands-board,
.redhands-read,
.redhands-comments,
.koco-portal-card {
  border-color: #146B43 !important;
  box-shadow: none !important;
}

img,
video,
iframe,
table { max-width: 100%; }
.xex-content,
.xex-panel,
.xex-main,
.redhands-read__body,
.koco-page-content { min-width: 0; overflow-wrap: anywhere; }

/* RoyBaby Viewer artwork keeps its own blue; this theme does not target its banner classes or images. */
@media (max-width: 767px) {
  html,
  body,
  .xex-shell { width: 100%; max-width: 100%; overflow-x: clip; }
  .xex-globalbar__inner { height: auto; min-height: 76px; flex-wrap: wrap; padding: 8px 0; }
  .xex-brand__logo { width: 133px; height: 48px; }
  .xex-search { flex: 1 1 100%; width: 100%; }
  .xex-body,
  .xex-body.is-wide { grid-template-columns: minmax(0, 1fr) !important; padding-inline: 8px; }
  .xex-left,
  .xex-right { min-width: 0; max-width: 100%; }
  .xex-nav__list { max-width: 100%; overflow-x: auto; }
  .redhands-row,
  .xex-secgrid,
  .koco-home-dashboard,
  .koco-menu-grid,
  .koco-topic-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ============================================================
   2026-08-26 v5 polish
   공개 기술 식별자는 유지하고 화면의 폭·계층·터치 크기만 정돈한다.
   ============================================================ */

.xex-shell {
  --xex-max: 1440px;
  --xex-edge: 16px;
  --xex-rail: 208px;
  --xex-side: 288px;
  --xex-gap: 16px;
}

.xex-globalbar__inner {
  display: grid;
  grid-template-columns: auto minmax(280px, 430px) auto;
  min-height: 76px;
  height: auto;
  gap: 16px;
}
.xex-brand { margin: 0; min-width: 0; }
.xex-brand::before { width: 146px; height: 48px; }
.xex-search { width: 100%; margin: 0; }
.xex-member { margin-left: 0; justify-self: end; }

.xex-search input[type="search"],
.xex-search button,
.xex-nav__toggle { min-height: 44px; }
.xex-search button,
.xex-search button:hover,
.xex-search button:focus-visible {
  color: #146B43 !important;
  background: #FFC928 !important;
  border-color: #F27A00 !important;
}

.xex-nav__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  line-height: 1.5 !important;
}

.xex-left,
.xex-center,
.xex-right { gap: 16px; }
.xex-widget,
.xex-left__block { height: auto; overflow: visible; }

/* 메인 패널만 포레스트 바를 유지하고 보조 제목은 가벼운 밑줄로 구분한다. */
.xex-left__title,
.xex-widget__title,
.xex-sec__title {
  display: flex !important;
  align-items: center;
  min-width: 0;
  margin: 0 0 9px !important;
  padding: 0 0 8px !important;
  color: #146B43 !important;
  background: #FFF9EE !important;
  border: 0 !important;
  border-bottom: 3px solid #FFC928 !important;
  white-space: normal !important;
  overflow: visible !important;
}
.xex-sec__title small {
  flex: 0 0 auto;
  margin-inline-start: 8px !important;
  padding: 1px 7px;
  color: #146B43 !important;
  background: #FFC928 !important;
  border: 1px solid #F27A00;
  border-radius: 999px;
  font-size: 15px !important;
  line-height: 1.5 !important;
}

.xex-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.xex-strip__bar {
  display: flex;
  align-items: center;
  height: auto !important;
  min-height: 48px;
  line-height: 1.5 !important;
}
.xex-strip__meta {
  min-height: 36px;
  line-height: 1.5 !important;
}

.xex-right .xex-widget__text { margin-bottom: 10px; }
.xex-right .xex-linklist li a,
.xex-right .xex-ranklist li a { min-height: 40px; }

.xex-footer {
  padding: 24px 0;
  color: #FFF9EE !important;
  background: #146B43 !important;
  border-top: 4px solid #F27A00 !important;
}
.xex-footer__inner,
.xex-footer__brand,
.xex-footer__brand span,
.xex-footer nav,
.xex-footer nav a,
.xex-footer small {
  color: #FFF9EE !important;
  background: #146B43 !important;
}
.xex-footer__inner { gap: 12px; }
.xex-footer__brand::before {
  color: #FFF9EE !important;
  background: #146B43 !important;
}
.xex-footer small {
  max-width: 75ch;
  line-height: 1.6 !important;
}

@media (max-width: 1023px) {
  .xex-right {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 767px) {
  .xex-shell { --xex-edge: 8px; --xex-gap: 10px; }
  .xex-globalbar__inner {
    width: calc(100% - 24px);
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 0;
    gap: 8px 12px;
  }
  .xex-brand { grid-column: 1; grid-row: 1; }
  .xex-brand::before { width: 118px; height: 43px; }
  .xex-member { grid-column: 2; grid-row: 1; }
  .xex-search { grid-column: 1 / -1; grid-row: 2; }
  .xex-nav__toggle { display: flex; align-items: center; }
  .xex-nav__list,
  .xex-nav__list.is-open {
    max-width: 100%;
    overflow-x: visible;
    flex-direction: column;
  }
  .xex-nav__link { min-height: 44px; }
  .xex-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xex-right { grid-template-columns: minmax(0, 1fr); }
  .xex-footer { padding: 20px 0; }
  .xex-footer__inner { width: calc(100% - 24px); }
}
