:root {
  --rf-ink: #191f28;
  --rf-muted: #6b7684;
  --rf-paper: #f5f7fa;
  --rf-panel: #ffffff;
  --rf-line: #e2e7ec;
  --rf-accent: #3182f6;
  --rf-accent-dark: #1b64da;
  --rf-success: #1f765b;
  --rf-shadow: 0 12px 34px rgba(25, 31, 40, 0.08);
  --rf-shadow-soft: 0 6px 20px rgba(25, 31, 40, 0.055);
  --rf-radius-sm: 10px;
  --rf-radius-md: 16px;
  --rf-radius-lg: 20px;
}

:is(html.home-page, html.cases-page, html.estimate-page, html.planner-page) body,
:is(body.home-page, body.cases-page, body.estimate-page, body.planner-page),
body.planner-app {
  color: var(--rf-ink);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  font-size: 17px;
}

:where(.home-page, .cases-page, .estimate-page, .planner-page) small,
.planner-app small {
  font-size: 16px;
}

/* Shared shell: restrained surfaces and one blue accent. */
.home-page .site-header,
:where(.cases-page, .estimate-page, .planner-page) .tool-header {
  border-bottom-color: rgba(25, 31, 40, 0.09);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.home-page .hero {
  background:
    linear-gradient(115deg, rgba(49, 130, 246, 0.055), transparent 44%),
    linear-gradient(#fff 0%, #f6f8fa 100%);
}

.home-page .hero-visual {
  border-color: var(--rf-line);
  border-radius: var(--rf-radius-lg);
  box-shadow: 0 22px 56px rgba(25, 31, 40, 0.12);
}

.home-page .product-card,
.home-page .case-card {
  border-color: var(--rf-line);
  border-radius: var(--rf-radius-md);
  box-shadow: none;
}

.home-page .product-card:hover,
.home-page a.case-card:hover {
  border-color: #cbd3da;
  box-shadow: var(--rf-shadow-soft);
}

.home-page .contact {
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius-lg);
  background: #f2f5f7;
}

:where(.home-page, .cases-page, .estimate-page, .planner-page) .button {
  border-radius: 12px;
}

:where(.home-page, .cases-page, .estimate-page, .planner-page) .header-cta,
.home-page .trust-row span,
.home-page .product-media strong {
  border-radius: var(--rf-radius-sm);
}

.cases-page .subpage,
:where(.estimate-page, .planner-page) .tool-page {
  background: var(--rf-paper);
}

:where(.estimate-page, .planner-page) .tool-notice {
  color: #315b8f;
  border-color: #cbdcf2;
  border-radius: 12px;
  background: #eef5fd;
}

:where(.estimate-page, .planner-page) .tool-frame {
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius-md) var(--rf-radius-md) 0 0;
  background: var(--rf-panel);
  box-shadow: var(--rf-shadow);
}

.cases-page .empty-state {
  border-color: #cbd3da;
  border-radius: var(--rf-radius-md);
  background: #fff;
}

/* Estimate tool: shared typography plus a compact product-visual system. */
body.estimator-app {
  --ink: var(--rf-ink);
  --muted: var(--rf-muted);
  --line: var(--rf-line);
  --paper: var(--rf-paper);
  --blue: var(--rf-accent);
  --blue-dark: var(--rf-accent-dark);
  --green: var(--rf-success);
  color: var(--rf-ink);
  background: var(--rf-paper);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  font-size: 17px;
}

.estimator-app small {
  font-size: 16px;
}

.estimator-app .card {
  border-color: var(--rf-line);
  border-radius: var(--rf-radius-md);
  box-shadow: var(--rf-shadow-soft);
}

.estimator-app :is(.tab, .security, .primary, .secondary) {
  border-radius: var(--rf-radius-sm);
}

.estimator-app .tab.active {
  border-color: var(--rf-ink);
  background: var(--rf-ink);
  box-shadow: 0 6px 16px rgba(25, 31, 40, 0.14);
}

.estimator-app :is(input, select) {
  border-color: #cfd6dd;
}

.estimator-app :is(input, select):focus {
  border-color: var(--rf-accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.15);
}

.estimator-app .visual-card {
  padding: 0;
  overflow: hidden;
}

.estimator-app .visual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--rf-line);
}

.estimator-app .visual-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.estimator-app :is(.visual-kicker, .material-kicker) {
  margin: 0 0 6px;
  color: var(--rf-accent-dark);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.estimator-app .visual-toolbar {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d4dbe2;
  border-radius: var(--rf-radius-sm);
  background: #eef1f4;
}

.estimator-app .visual-toolbar button {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  color: var(--rf-muted);
  background: transparent;
  font-size: 15px;
  font-weight: 800;
}

.estimator-app .visual-toolbar button.active {
  color: #fff;
  background: var(--rf-ink);
  box-shadow: 0 2px 6px rgba(25, 31, 40, 0.14);
}

.estimator-app .visual-toolbar button:focus-visible {
  outline: 3px solid rgba(49, 130, 246, 0.28);
  outline-offset: 2px;
}

.estimator-app .visual-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 390px;
  overflow: hidden;
  background:
    linear-gradient(rgba(25, 31, 40, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 31, 40, 0.035) 1px, transparent 1px),
    #eef2f5;
  background-size: 24px 24px;
}

.estimator-app .visual-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.estimator-app .visual-canvas:active {
  cursor: grabbing;
}

.estimator-app .visual-loading {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  display: grid;
  gap: 5px;
  min-width: 230px;
  padding: 18px 20px;
  border: 1px solid rgba(25, 31, 40, 0.1);
  border-radius: 12px;
  color: var(--rf-ink);
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--rf-shadow-soft);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.estimator-app .visual-loading span {
  color: var(--rf-muted);
  font-size: 15px;
}

.estimator-app .visual-loading[hidden],
.estimator-app .material-card[hidden] {
  display: none !important;
}

.estimator-app .visual-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 15px 22px 0;
}

.estimator-app .visual-specs span {
  padding: 7px 10px;
  border: 1px solid #d7dee5;
  border-radius: 8px;
  color: #4e5968;
  background: #f7f9fb;
  font-size: 15px;
  font-weight: 750;
}

.estimator-app .visual-note {
  margin: 12px 22px 20px;
  color: var(--rf-muted);
  font-size: 15px;
  line-height: 1.6;
}

.estimator-app .material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.estimator-app .material-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius-md);
  background: #fff;
  box-shadow: var(--rf-shadow-soft);
}

.estimator-app .material-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #edf1f4;
}

.estimator-app .material-copy {
  padding: 18px 19px 20px;
}

.estimator-app .material-copy h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.04em;
  line-height: 1.35;
}

.estimator-app .material-copy > p:not(.material-kicker) {
  margin: 9px 0 0;
  color: var(--rf-muted);
  font-size: 16px;
  line-height: 1.65;
}

.estimator-app .material-meta {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rf-line);
  color: #4e5968;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.5;
}

/* Explicit +3px increase for compact estimate text. */
.estimator-app .fine {
  font-size: 14px;
}

.estimator-app
  :is(.eyebrow, .security, label > span, .unit b, .privacy, .result-label, .status, .toast) {
  font-size: 15px;
}

.estimator-app :is(.planner-transfer, .result-supply, .summary div) {
  font-size: 16px;
}

.estimator-app .hero p:last-child {
  font-size: 17px;
}

/* Explicit +3px increase for compact shared text. */
:where(.home-page, .cases-page, .estimate-page, .planner-page)
  :is(
    .brand-lockup small,
    .header-cta,
    .eyebrow,
    .trust-row span,
    .hero-preview-head,
    .hero-preview-head strong,
    .hero-preview-summary small,
    .step-grid b,
    .product-number,
    .product-media strong,
    .card-link,
    .load-disclaimer,
    .case-photo,
    .case-card-body p,
    .case-card-body span,
    .blog-grid span,
    .site-footer > div:last-child,
    .admin-dot,
    .tool-notice,
    .case-gallery figcaption,
    .case-facts dt,
    .case-story section > span
  ) {
  font-size: 15px;
}

:where(.home-page, .cases-page, .estimate-page, .planner-page)
  :is(
    .site-header nav,
    .tool-header nav,
    .hero-preview-summary strong,
    .hero-preview-summary a,
    .section-heading.split > a,
    .product-card p
  ) {
  font-size: 16px;
}

:where(.home-page, .cases-page, .estimate-page, .planner-page)
  :is(.brand-lockup b, .brand-mark, .button) {
  font-size: 17px;
}

/* Planner tool: align its former beige/orange treatment with the site shell. */
body.planner-app {
  --ink: var(--rf-ink);
  --muted: var(--rf-muted);
  --paper: var(--rf-paper);
  --panel: var(--rf-panel);
  --line: var(--rf-line);
  --accent: var(--rf-accent);
  --accent-dark: var(--rf-accent-dark);
  --rack: #315b8f;
  --rack-edge: #244867;
  --buffer: #c7d8ea;
  --ok: var(--rf-success);
  --shadow: var(--rf-shadow);
  background:
    linear-gradient(rgba(25, 31, 40, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 31, 40, 0.025) 1px, transparent 1px),
    var(--rf-paper);
  background-size: 24px 24px;
}

.planner-app .topbar .brand-mark {
  display: none;
}

.planner-app .panel,
.planner-app .metric {
  border-color: var(--rf-line);
  background: #fff;
  box-shadow: var(--rf-shadow-soft);
}

.planner-app .panel {
  border-radius: var(--rf-radius-md);
}

.planner-app :is(.input-wrap input, .buffer-grid .input-wrap, .mirror-toggle, .undo-button) {
  border-color: #cfd6dd;
  background: #fff;
}

.planner-app :is(.input-wrap input:focus, .buffer-grid .input-wrap:focus-within) {
  border-color: var(--rf-accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.15);
}

.planner-app .buffer-grid > div:not(.buffer-center) {
  border-color: var(--rf-line);
  background: #f7f9fb;
}

.planner-app :is(.segment, .view-presets) {
  border-color: #cfd6dd;
  background: #edf1f4;
}

.planner-app :is(.segment button:focus-visible, .reset-button:focus-visible, .view-presets button:focus-visible) {
  outline-color: rgba(49, 130, 246, 0.3);
}

.planner-app .mirror-toggle.active {
  border-color: var(--rf-accent);
  background: var(--rf-accent-dark);
  box-shadow: 0 3px 10px rgba(49, 130, 246, 0.18);
}

.planner-app .estimate-handoff {
  background: var(--rf-accent);
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.24);
}

.planner-app .estimate-handoff:hover {
  background: var(--rf-accent-dark);
}

.planner-app .live-dot {
  background: var(--rf-accent);
  box-shadow: 0 0 0 4px rgba(49, 130, 246, 0.12);
}

.planner-app .undo-button:hover:not(:disabled),
.planner-app .undo-button:focus-visible:not(:disabled) {
  border-color: var(--rf-accent);
  color: var(--rf-accent-dark);
  outline-color: rgba(49, 130, 246, 0.14);
}

.planner-app .canvas-scroller {
  background: #eef3f8;
  scrollbar-color: #64748b #eef3f8;
}

.planner-app :is(.control-panel, .workspace, .free-space-hero, .planning-scope-note) {
  border-color: #d7e1ee !important;
  color: #0f172a;
  background: #fff !important;
}

.planner-app .workspace-area-item {
  border-color: #d7e1ee !important;
  background: #f8fafc !important;
}

.planner-app .buffer-grid > div {
  border-color: #d7e1ee;
  background: #f8fafc;
}

.planner-app .live-dot {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.planner-app .scale-canvas {
  border-color: #aeb8c1;
  background-color: #f5f7f8;
  box-shadow: 0 10px 26px rgba(25, 31, 40, 0.1);
}

.planner-app .aisle-marker {
  border-color: rgba(49, 130, 246, 0.72);
  color: var(--rf-accent-dark);
  background: rgba(213, 229, 250, 0.78);
}

.planner-app .swatch.aisle {
  border-color: var(--rf-accent);
  background: #d5e5fa;
}

.planner-app .rack-unit {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

/* Keep the larger labels readable instead of letting flex items collapse letter-by-letter. */
.planner-app .control-title {
  align-items: flex-start;
}

.planner-app :is(.control-title label, .control-title .label) {
  flex: 0 0 auto;
  white-space: nowrap;
}

.planner-app .control-hint {
  max-width: 68%;
  white-space: normal;
  line-height: 1.35;
  text-align: right;
}

.planner-app :is(.undo-button, .view-presets, .view-presets button) {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Explicit +3px increase for compact planner text. */
.planner-app
  :is(
    .eyebrow,
    .range-scale,
    .area-chip small,
    .segment button small,
    .quantity-line span,
    .estimate-handoff small,
    .view-presets button,
    .rack-unit,
    .aisle-marker,
    .dimension-x,
    .dimension-y
  ) {
  font-size: 15px;
}

.planner-app .mirror-toggle::after,
.planner-app .warehouse::before,
.planner-app .usable-area::before {
  font-size: 15px;
}

.planner-app
  :is(
    .reset-button,
    .control-hint,
    .unit,
    .mini-label,
    .sync-note,
    .mirror-toggle,
    .pallet-load-note,
    .status-box,
    .quantity-result small,
    .bottom-quantity .quantity-copy p,
    .pallet-hero-stat span,
    .three-empty-state,
    .rack-unit.deleted-slot,
    .empty-state,
    .metric-sub
  ) {
  font-size: 16px;
}

.planner-app
  :is(
    .top-note,
    .control-title label,
    .control-title .label,
    .segment button,
    .free-space-hero .hero-copy p,
    .hero-area-stat > span,
    .undo-button,
    .canvas-foot,
    .metric-label
  ) {
  font-size: 17px;
}

@media (max-width: 900px) {
  .home-page .site-header nav,
  .home-page .site-header .header-cta,
  :where(.cases-page, .estimate-page, .planner-page) .tool-header nav {
    display: none;
  }

  .home-page .site-header,
  :where(.cases-page, .estimate-page, .planner-page) .tool-header {
    width: calc(100% - 28px);
    min-height: 66px;
  }
}

@media (max-width: 820px) {
  .estimator-app .visual-stage {
    height: 300px;
  }

  .estimator-app .material-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .estimator-app .visual-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .estimator-app .visual-toolbar {
    width: 100%;
  }

  .estimator-app .visual-toolbar button {
    flex: 1;
  }

  .estimator-app .visual-specs {
    padding-inline: 16px;
  }

  .estimator-app .visual-note {
    margin-inline: 16px;
  }
}

/* 기진앵글 통합 디자인 시스템 */
:root {
  --rf-ink: #0F172A;
  --rf-muted: #475569;
  --rf-paper: #F8FAFC;
  --rf-panel: #FFFFFF;
  --rf-line: #E2E8F0;
  --rf-accent: #1D4ED8;
  --rf-accent-dark: #1E40AF;
  --rf-success: #16A34A;
  --rf-shadow: 0 12px 32px rgba(15, 23, 42, .08);
  --rf-shadow-soft: 0 1px 2px rgba(15, 23, 42, .06);
  --rf-radius-sm: 14px;
  --rf-radius-md: 20px;
  --rf-radius-lg: 20px;
}
@font-face {
  font-family: "Pretendard";
  src: url("PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
body.estimator-app,
body.planner-app {
  word-break: keep-all;
  overflow-wrap: break-word;
}
body.estimator-app :is(h1, h2, h3),
body.planner-app :is(h1, h2, h3) {
  text-wrap: balance;
}
body.estimator-app :focus-visible,
body.planner-app :focus-visible {
  outline: 2px solid #1D4ED8 !important;
  outline-offset: 2px !important;
}
.estimator-app :is(button, a, input, select),
.planner-app :is(button, a, input, select) {
  min-height: 44px;
}
.estimator-app .tab.active,
.estimator-app .primary,
.estimator-app .type-btn.active,
.estimator-app .board-btn.active,
.estimator-app .option-btn.active,
.estimator-app .visual-toolbar button.active {
  border-color: #1D4ED8 !important;
  color: #fff !important;
  background: #1D4ED8 !important;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .18) !important;
}
.estimator-app .primary:hover {
  background: #1E40AF !important;
}
.planner-app {
  --ink: #0F172A;
  --muted: #475569;
  --paper: #F8FAFC;
  --panel: #FFFFFF;
  --line: #E2E8F0;
  --accent: #1D4ED8;
  --accent-dark: #1E40AF;
  --rack: #2457A6;
  --rack-edge: #173A70;
  --buffer: #BFDBFE;
  --ok: #16A34A;
  --shadow: 0 12px 32px rgba(15, 23, 42, .08);
}
.planner-app .estimate-handoff,
.planner-app .mirror-toggle.active {
  color: #fff;
  border-color: #1D4ED8;
  background: #1D4ED8;
  box-shadow: 0 10px 24px rgba(29, 78, 216, .22);
}
.planner-app .estimate-handoff:hover {
  background: #1E40AF;
}
.planner-app .canvas-scroller {
  background: #E9EEF5;
}
body.estimator-app,
body.planner-app,
.estimator-app :is(.visual-stage, .three-viz-shell),
.planner-app .free-space-hero {
  background: #F8FAFC !important;
}

/* Planner button system mirrors the estimator: blue selection, detailed white rest state. */
.planner-app :is(.segment,.view-presets){
  gap:6px;
  padding:4px;
  border:1px solid #d6e0ee;
  background:#eef3f9;
}
.planner-app
  :is(
    .segment button,
    .view-presets button,
    .mirror-toggle,
    .undo-button,
    .collapse-button,
    .reset-button
  ){
  border:1px solid #ccd8e8;
  border-radius:10px;
  color:#334155;
  background:linear-gradient(180deg,#fff 0%,#f7faff 100%);
  box-shadow:inset 0 1px rgba(255,255,255,.96),0 2px 5px rgba(30,64,175,.07);
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease,color .16s ease,transform .16s ease;
}
.planner-app
  :is(
    .segment button,
    .view-presets button,
    .mirror-toggle,
    .undo-button,
    .collapse-button,
    .reset-button
  ):hover:not(:disabled){
  border-color:#7fa6ed;
  color:#1d4ed8;
  background:linear-gradient(180deg,#fff 0%,#eef5ff 100%);
  box-shadow:inset 0 1px #fff,0 7px 16px rgba(37,84,201,.13);
  transform:translateY(-1px);
}
.planner-app :is(.segment button.active,.view-presets button.active,.mirror-toggle.active),
.planner-app .estimate-handoff{
  border-color:#2b5fd4 !important;
  color:#fff !important;
  background:linear-gradient(145deg,#4b80e5 0%,#2858d1 100%) !important;
  box-shadow:inset 0 1px rgba(255,255,255,.3),0 8px 18px rgba(37,84,201,.22) !important;
}
.planner-app :is(.segment button.active,.view-presets button.active,.mirror-toggle.active):hover,
.planner-app .estimate-handoff:hover{
  border-color:#1e4db8 !important;
  background:linear-gradient(145deg,#3f73dc 0%,#214bbb 100%) !important;
  box-shadow:inset 0 1px rgba(255,255,255,.24),0 10px 22px rgba(37,84,201,.27) !important;
}
.planner-app :is(.segment button:disabled,.mirror-toggle:disabled,.undo-button:disabled){
  color:#64748b;
  border-color:#dce3ec;
  background:#f1f5f9;
  box-shadow:none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
