/* =============================================================================
   경영계획캔버스 — style.css
   PVH(Personal Vision House) 계열 디자인 토큰 기반. maker-card.css / lang-toggle.css는
   각자 자기 영역(메이커 카드·라이트박스·언어 토글)을 소유하므로 여기서 다루지 않는다.
   한국어 줄바꿈 안전(word-break: keep-all)은 lang-toggle.css의 :root/body 베이스라인 +
   아래 :root에서 이중으로 보장한다. (rules/cjk-rendering-safety §5)
   ============================================================================= */

:root {
  /* Palette (PVH resolved) */
  --surface: #ffffff;
  --surface-2: #f8fafc;      /* navy-50 */
  --surface-3: #f1f5f9;
  --bg: #eef2f7;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --sky: #0ea5e9;
  --sky-600: #0284c7;
  --indigo: #4f46e5;
  --teal: #0d9488;
  --teal-50: #f0fdfa;
  --amber: #d97706;
  --rose: #e11d48;
  --header-bg: #0f172a;
  --header-bg-2: #1e293b;

  /* ABC accent */
  --a-color: #0284c7;   /* Action - sky */
  --b-color: #7c3aed;   /* Business - violet */
  --c-color: #d97706;   /* Cost - amber */
  --keep: #0d9488;      /* 지속 */
  --stop: #e11d48;      /* 중단 */
  --try: #7c3aed;       /* 도전 */

  /* Type scale (fluid) */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.25rem, 1.05rem + 1vw, 1.6rem);
  --fs-2xl: clamp(1.5rem, 1.2rem + 1.6vw, 2.15rem);

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 26px; --r-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(15,23,42,.06);
  --shadow-sm: 0 1px 4px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.05);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);

  --t-fast: 120ms ease;
  --t: 200ms ease;
  --header-h: 116px;

  word-break: keep-all;
  overflow-wrap: break-word;
}

@font-face {
  font-family: 'Pretendard Variable';
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/PretendardVariable.woff2') format('woff2-variations');
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font-family: inherit; }
a { color: inherit; }

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

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  background: var(--primary); color: #fff; padding: 10px 16px;
  border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform var(--t);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* =========================== 헤더 =========================== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, var(--header-bg), var(--header-bg-2));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), var(--shadow-sm);
}
.header-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 12px clamp(12px, 3vw, 24px);
}
.header-brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: #fff; flex-shrink: 0;
}
.brand-mark { display: inline-flex; filter: drop-shadow(0 2px 6px rgba(56,189,248,.35)); }
.brand-name { font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.01em; }

.step-nav {
  display: flex; align-items: center; gap: 4px;
  margin: 0 auto; flex: 1 1 auto; justify-content: center; min-width: 0;
}
.step-item { display: inline-flex; align-items: center; gap: 7px; opacity: .55; transition: opacity var(--t); }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255,255,255,.10); border: 1.5px solid rgba(255,255,255,.22);
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.85);
  transition: background var(--t), border-color var(--t);
}
.step-label { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; color: rgba(255,255,255,.9); }
.step-connector { width: 18px; height: 1.5px; background: rgba(255,255,255,.18); flex-shrink: 0; }
.step-item.is-active { opacity: 1; }
.step-item.is-active .step-dot { background: var(--primary); border-color: var(--sky); box-shadow: 0 0 0 3px rgba(37,99,235,.28); color: #fff; }
.step-item.is-done { opacity: .95; }
.step-item.is-done .step-dot { background: var(--teal); border-color: var(--teal); color: #fff; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.save-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: var(--r-full);
  background: rgba(45,212,191,.14); color: #5eead4;
  font-size: var(--fs-xs); font-weight: 700;
  opacity: 0; transition: opacity var(--t);
}
.save-badge.show { opacity: 1; }
.save-badge.saving { background: rgba(148,163,184,.18); color: #cbd5e1; }
.btn-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff;
  transition: background var(--t-fast);
}
.btn-icon:hover { background: rgba(255,255,255,.16); }

.progress-track { height: 3px; background: rgba(255,255,255,.10); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--sky));
  transition: width 400ms cubic-bezier(.4,0,.2,1);
}

/* =========================== 바디 레이아웃 =========================== */
.app-body { padding: clamp(16px, 3vw, 32px) clamp(12px, 3vw, 24px) 80px; }
.app-body-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(16px, 2.4vw, 32px);
  align-items: start;
}

/* ------ 사이드바: 캔버스 대시보드 ------ */
.preview-sidebar { position: sticky; top: calc(var(--header-h) + 12px); }
.preview-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs); color: var(--text);
}
.preview-toggle-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-sm); color: var(--text-2); }
.preview-toggle-title svg { color: var(--primary); }
.preview-chevron { transition: transform var(--t); color: var(--text-3); }
.preview-sidebar.is-collapsed .preview-chevron { transform: rotate(-90deg); }
.preview-card {
  margin-top: 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.preview-sidebar.is-collapsed .preview-card { display: none; }

.mini-canvas { display: flex; flex-direction: column; gap: 8px; }
.mc-band {
  padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px;
}
.mc-mission { background: linear-gradient(180deg, var(--primary-50), var(--surface)); border-color: var(--primary-200); }
.mc-cap { font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.mc-text { font-size: var(--fs-sm); font-weight: 600; color: var(--text); min-height: 1.2em; }
.mc-text:empty::before { content: attr(data-empty); color: var(--text-3); font-weight: 500; }
.mc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mc-cell {
  padding: 9px 11px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
}
.mc-count { font-size: var(--fs-lg); font-weight: 800; color: var(--primary); }
.mc-count-inline { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.mc-count-inline #mc-okr { font-weight: 800; color: var(--primary); font-size: var(--fs-md); }
.mc-band .mc-cap + .mc-dots, .mc-band .mc-cap + .mc-count-inline { margin-top: 2px; }
.mc-dots { display: inline-flex; gap: 5px; }
.mc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); transition: background var(--t); }
.mc-dot.on { background: var(--sky); }

.preview-progress { margin-top: 12px; }
.preview-progress-label { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; margin-bottom: 5px; }
.preview-progress-label strong { color: var(--primary); }
.preview-bar { height: 6px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.preview-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--sky)); border-radius: var(--r-full); transition: width 400ms ease; }

/* =========================== 메인 / 페이즈 =========================== */
.main-content { min-width: 0; }
.phase { display: none; }
.phase.is-active { display: block; animation: phase-in .38s ease both; }
@keyframes phase-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.phase-hero { text-align: center; padding: clamp(12px, 4vw, 36px) 0 var(--sp-6); }
.phase-hero-icon { display: inline-flex; filter: drop-shadow(0 8px 20px rgba(37,99,235,.28)); margin-bottom: var(--sp-4); }
.phase-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; color: var(--text); }
.phase-desc { margin-top: var(--sp-3); color: var(--text-2); font-size: var(--fs-md); line-height: 1.65; }
.phase-desc strong { color: var(--text); font-weight: 700; }

/* Journey */
.journey {
  display: flex; align-items: stretch; justify-content: center; gap: 6px;
  flex-wrap: wrap; margin: 0 auto var(--sp-6); max-width: 640px;
}
.journey-step {
  flex: 1 1 150px; min-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 16px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.journey-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; margin-bottom: 2px; }
.journey-ico--sky { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.journey-ico--indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.journey-ico--teal { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.journey-label { font-weight: 700; font-size: var(--fs-base); color: var(--text); }
.journey-sub { font-size: var(--fs-xs); color: var(--text-2); }
.journey-arrow { align-self: center; color: var(--text-3); font-weight: 700; }

/* Coaching card */
.coaching-card {
  margin: var(--sp-4) 0 0; padding: 14px 16px;
  background: var(--primary-50); border: 1px solid var(--primary-200);
  border-left: 3px solid var(--primary); border-radius: var(--r);
  font-size: var(--fs-sm); color: var(--text-2); line-height: 1.6;
}
.coaching-card strong { color: var(--primary-hover); font-weight: 700; }
.coaching-card--lead { max-width: 600px; margin: var(--sp-2) auto var(--sp-6); text-align: center; border-left: 0; border-top: 3px solid var(--primary); }

/* Forms */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--sp-5); }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.input-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.input-group--full { grid-column: 1 / -1; }
.period-detail { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-detail select { flex: 1 1 auto; min-width: 120px; }
.period-detail select.period-sub { flex: 0 1 auto; min-width: 110px; }
.period-detail input { flex: 1 1 auto; min-width: 160px; }
.period-dash { color: var(--text-3); font-weight: 700; flex: 0 0 auto; }
.input-label { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.optional-mark { font-weight: 500; color: var(--text-2); font-size: var(--fs-xs); }
.input-field {
  width: 100%; font-family: inherit; font-size: max(16px, var(--fs-base)); color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r);
  padding: 11px 13px; transition: border-color var(--t-fast), box-shadow var(--t-fast);
  line-height: 1.5;
}
.input-field::placeholder { color: var(--text-3); }
.input-field:hover { border-color: var(--border-2); }
.input-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.input-field--highlight { border-color: var(--primary-200); background: linear-gradient(180deg, var(--primary-50), var(--surface)); }
textarea.input-field { resize: vertical; min-height: 62px; }
select.input-field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px; cursor: pointer; }

/* Phase header (작성 단계) */
.phase-header { margin-bottom: var(--sp-5); }
.phase-tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .01em; margin-bottom: 10px;
}
.phase-tag--sky { background: #e0f2fe; color: #0369a1; }
.phase-tag--indigo { background: var(--primary-100); color: var(--primary-hover); }
.phase-tag--teal { background: var(--teal-50); color: #0f766e; }
.phase-tag--a { background: #e0f2fe; color: var(--a-color); }
.phase-tag--b { background: #ede9fe; color: var(--b-color); }
.phase-tag--c { background: #fef3c7; color: #b45309; }
.phase-header .phase-title { font-size: var(--fs-xl); text-align: left; }
.phase-header .phase-desc { text-align: left; margin-top: 8px; font-size: var(--fs-base); }

.field-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.field-hint { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }

/* Section block */
.section-block { margin-bottom: var(--sp-6); }
.section-block-header { margin-bottom: var(--sp-3); }
.section-block-title { font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.section-block-desc { font-size: var(--fs-sm); color: var(--text-2); margin-top: 3px; }

/* Intro */
.phase-intro .intro-hero { text-align: center; padding: clamp(8px, 3vw, 24px) 0 var(--sp-5); }
.phase-intro .phase-tag { margin-bottom: var(--sp-3); }
.intro-story {
  max-width: 620px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: clamp(18px, 4vw, 28px);
}
.intro-line { color: var(--text-2); font-size: var(--fs-md); line-height: 1.75; margin-bottom: var(--sp-4); }
.intro-line:last-child { margin-bottom: 0; }
.intro-line strong { color: var(--text); font-weight: 700; }
.intro-line--key { color: var(--text); font-weight: 500; padding: 14px 16px; background: var(--primary-50); border-radius: var(--r); border-left: 3px solid var(--primary); }
.intro-line--key strong { color: var(--primary-hover); }

/* ABC legend */
.abc-legend { display: flex; flex-direction: column; gap: 10px; margin: var(--sp-4) 0; }
.abc-legend-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.abc-legend-item div { display: flex; flex-direction: column; }
.abc-legend-item strong { font-size: var(--fs-base); color: var(--text); }
.abc-legend-item span { font-size: var(--fs-sm); color: var(--text-3); }
.abc-badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: var(--fs-md); color: #fff; flex-shrink: 0; }
.abc-badge--a { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.abc-badge--b { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.abc-badge--c { background: linear-gradient(135deg, #fbbf24, #d97706); }

/* Canvas legend */
.canvas-legend { display: flex; flex-direction: column; gap: 8px; margin: var(--sp-4) 0; }
.canvas-legend-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.canvas-legend-item div { display: flex; flex-direction: column; }
.canvas-legend-item strong { font-size: var(--fs-base); color: var(--text); }
.canvas-legend-item span { font-size: var(--fs-sm); color: var(--text-3); }
.cl-num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--sky)); flex-shrink: 0; }

/* Apply block (지속/중단/도전) */
.apply-block { margin-top: var(--sp-5); }
.apply-head { font-size: var(--fs-sm); font-weight: 800; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.apply-head::before { content: ""; width: 14px; height: 2px; background: var(--text-3); border-radius: 2px; }
.apply-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.apply-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.apply-item-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 800; }
.apply-item-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.apply-item--keep { border-top: 3px solid var(--keep); }
.apply-item--keep .apply-item-label { color: var(--keep); }
.apply-item--keep .apply-item-label::before { background: var(--keep); }
.apply-item--stop { border-top: 3px solid var(--stop); }
.apply-item--stop .apply-item-label { color: var(--stop); }
.apply-item--stop .apply-item-label::before { background: var(--stop); }
.apply-item--try { border-top: 3px solid var(--try); }
.apply-item--try .apply-item-label { color: var(--try); }
.apply-item--try .apply-item-label::before { background: var(--try); }
.apply-item textarea { min-height: 54px; font-size: max(16px, var(--fs-sm)); }

/* "하나하나 추가" 리스트 (ABC 유도질문·적용점) */
.add-list { display: flex; flex-direction: column; gap: 6px; }
.add-item { display: flex; align-items: center; gap: 6px; }
.add-item > .input-field { flex: 1 1 auto; min-width: 0; }
.add-row { display: flex; align-items: center; gap: 6px; }
.add-row > .add-input { flex: 1 1 auto; min-width: 0; }
.btn-add-item {
  flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  border-radius: var(--r); background: var(--primary-50); color: var(--primary); border: 1px solid var(--primary-200);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.btn-add-item:hover { background: var(--primary-100); border-color: var(--primary); }
.apply-item .add-row .add-input { font-size: max(16px, var(--fs-sm)); }

/* Repeatable rows (목표/계기판) */
.repeat-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.repeat-row { display: flex; gap: 8px; align-items: flex-start; }
.repeat-row .repeat-fields { flex: 1 1 auto; display: grid; gap: 8px; min-width: 0; }
.repeat-row.two .repeat-fields { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.repeat-index { flex-shrink: 0; width: 26px; height: 26px; margin-top: 10px; border-radius: 7px; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 800; color: var(--primary); background: var(--primary-50); border: 1px solid var(--primary-100); }
.btn-remove { flex-shrink: 0; width: 34px; height: 44px; margin-top: 0; display: grid; place-items: center; border-radius: var(--r-sm); cursor: pointer; background: transparent; border: 1px solid var(--border); color: var(--text-3); transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.btn-remove:hover { color: var(--rose); border-color: #fecdd3; background: #fff1f2; }
.repeat-empty { padding: 16px; text-align: center; font-size: var(--fs-sm); color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: var(--r); }

.btn-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; border-radius: var(--r); cursor: pointer;
  background: var(--surface); border: 1.5px dashed var(--border-2); color: var(--primary);
  font-weight: 700; font-size: var(--fs-sm); transition: border-color var(--t-fast), background var(--t-fast);
}
.btn-add:hover { border-color: var(--primary); background: var(--primary-50); }
.btn-add:disabled { opacity: .45; cursor: not-allowed; }

/* OKR */
.okr-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.okr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); padding: 14px; }
.okr-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.okr-team-input { flex: 1 1 auto; font-weight: 700; }
.okr-obj { margin-bottom: 10px; }
.okr-kr-list { display: flex; flex-direction: column; gap: 8px; }
.okr-kr-row { display: flex; gap: 6px; align-items: center; }
.okr-kr-row .okr-kr-mark { flex-shrink: 0; font-size: var(--fs-xs); font-weight: 800; color: var(--sky-600); background: #e0f2fe; border-radius: 6px; padding: 3px 7px; }
.okr-kr-add { align-self: flex-start; margin-top: 2px; font-size: var(--fs-xs); padding: 6px 11px; }

/* Actions */
.phase-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: var(--sp-8); }
.phase-actions--intro { margin-top: var(--sp-6); }
.action-row { display: flex; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--r); cursor: pointer;
  font-family: inherit; font-size: var(--fs-base); font-weight: 700;
  border: 1.5px solid transparent; transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-complete { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.28); }
.btn-complete:hover { background: var(--primary-hover); box-shadow: 0 6px 18px rgba(37,99,235,.34); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* =========================== 결과 캔버스 =========================== */
.phase-result .result-head { text-align: center; margin-bottom: var(--sp-5); }
.phase-result .result-head .phase-desc { max-width: 560px; margin-left: auto; margin-right: auto; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: var(--sp-6); }
.result-nav { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: var(--sp-4); }
.result-nav-hint { font-size: var(--fs-xs); color: var(--text-3); }
/* 헤더 단계 네비를 눌러 해당 섹션으로 점프(수정) */
.step-item[role="button"] { cursor: pointer; border-radius: var(--r-full); padding: 2px 6px; margin: -2px -2px; }
.step-item[role="button"]:hover { opacity: 1; background: rgba(255,255,255,.09); }
.step-item[role="button"]:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; opacity: 1; }

.canvas-frame { background: linear-gradient(135deg, #eef2ff, #f0f9ff); border-radius: var(--r-xl); padding: clamp(10px, 2.5vw, 22px); border: 1px solid var(--border); }
.canvas-sheet {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: clamp(16px, 3vw, 28px); overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
}
.cv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--surface-3); }
.cv-head-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: var(--fs-md); color: var(--text); }
.cv-head-meta { text-align: right; display: flex; flex-direction: column; }
.cv-year { font-weight: 800; color: var(--primary); font-size: var(--fs-lg); }
.cv-org { font-size: var(--fs-sm); color: var(--text-2); }

.cv-label { display: block; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }
.cv-mission { text-align: center; padding: 16px; border-radius: var(--r); background: linear-gradient(180deg, var(--primary-50), var(--surface)); border: 1px solid var(--primary-100); }
.cv-slogan { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.01em; color: var(--primary-hover); line-height: 1.35; }
.cv-mission-text { margin-top: 6px; font-size: var(--fs-base); color: var(--text-2); }
.cv-mission-text:empty, .cv-slogan:empty { display: none; }

.cv-goals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cv-goal-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.cv-goal-list { display: flex; flex-direction: column; gap: 7px; }
.cv-goal-list li { font-size: var(--fs-sm); color: var(--text); display: flex; gap: 3px 8px; align-items: baseline; line-height: 1.5; flex-wrap: wrap; }
.cv-goal-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; transform: translateY(-1px); margin-top: 3px; }
.cv-goal-list li > span:first-of-type { flex: 1 1 46%; min-width: 46%; }
.cv-goal-list .cv-goal-target { color: var(--sky-600); font-weight: 700; margin-left: auto; white-space: normal; text-align: right; flex: 1 1 auto; }
.cv-goal-list .cv-empty { color: var(--text-3); }
.cv-goal-list .cv-empty::before { background: var(--border-2); }

.cv-gauge-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.cv-gauge { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 10px; text-align: center; position: relative; }
.cv-gauge-arc { width: 46px; height: 26px; margin: 0 auto 6px; }
.cv-gauge-name { font-size: var(--fs-sm); font-weight: 700; color: var(--text); line-height: 1.35; }
.cv-gauge-target { font-size: var(--fs-xs); color: var(--sky-600); font-weight: 700; margin-top: 3px; }
.cv-gauge.cv-empty { border-style: dashed; }
.cv-gauge.cv-empty .cv-gauge-name { color: var(--text-3); font-weight: 500; }

.cv-okr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cv-okr-card { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--r); padding: 12px 14px; }
.cv-okr-team { font-size: var(--fs-xs); font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .03em; }
.cv-okr-obj { font-size: var(--fs-base); font-weight: 700; color: var(--text); margin: 4px 0 8px; line-height: 1.4; }
.cv-okr-krs { display: flex; flex-direction: column; gap: 5px; }
.cv-okr-krs li { font-size: var(--fs-sm); color: var(--text-2); display: flex; gap: 7px; align-items: baseline; }
.cv-okr-krs li::before { content: "KR"; font-size: 9px; font-weight: 800; color: var(--sky-600); background: #e0f2fe; border-radius: 4px; padding: 1px 4px; flex-shrink: 0; }
.cv-okr-empty { grid-column: 1/-1; text-align: center; color: var(--text-3); font-size: var(--fs-sm); padding: 12px; }

.cv-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 2px solid var(--surface-3); font-size: var(--fs-xs); color: var(--text-2); }
.cv-foot-brand { font-weight: 700; }

/* ABC summary */
.abc-summary { margin-top: var(--sp-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.abc-summary summary { cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: var(--fs-base); color: var(--text-2); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.abc-summary summary::-webkit-details-marker { display: none; }
.abc-summary summary::after { content: "▾"; color: var(--text-3); transition: transform var(--t); }
.abc-summary[open] summary::after { transform: rotate(180deg); }
.abc-summary-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.abc-sum-axis-title { font-weight: 800; font-size: var(--fs-sm); color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.abc-sum-apply { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.abc-sum-cell { font-size: var(--fs-sm); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; }
.abc-sum-cell b { display: block; font-size: var(--fs-xs); margin-bottom: 3px; }
.abc-sum-cell--keep b { color: var(--keep); }
.abc-sum-cell--stop b { color: var(--stop); }
.abc-sum-cell--try b { color: var(--try); }
.abc-sum-cell span { color: var(--text-2); }
.abc-sum-cell span:empty::before { content: "—"; color: var(--text-3); }
.abc-sum-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.abc-sum-items li { color: var(--text-2); position: relative; padding-left: 10px; line-height: 1.45; }
.abc-sum-items li::before { content: "·"; position: absolute; left: 2px; color: var(--text-3); font-weight: 700; }

/* Hub backlink (completion page, directly above maker profile card) */
.hub-cta--quiet {
  display: flex; justify-content: center; margin: var(--sp-7) 0 10px;
}
.hub-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 12px;
  border: 1px solid rgba(37, 99, 235, .22); border-radius: var(--r-full);
  background: #fff; color: #1d4ed8;
  font-size: var(--fs-sm); font-weight: 800; text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.hub-link:hover { transform: translateY(-1px); border-color: rgba(37, 99, 235, .48); box-shadow: 0 14px 30px rgba(37, 99, 235, .14); }
.hub-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hub-link svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* =========================== 토스트 / 시트 =========================== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  z-index: 300; padding: 12px 20px; border-radius: var(--r-full);
  background: var(--text); color: #fff; font-size: var(--fs-sm); font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity var(--t), transform var(--t);
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast--error { background: var(--rose); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 250; background: rgba(15,23,42,.5); display: grid; place-items: end center; padding: 16px; }
.sheet-backdrop[hidden] { display: none; }
.sheet { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) var(--r-lg) var(--r-lg); box-shadow: var(--shadow-lg); animation: sheet-in .24s ease; overflow: hidden; margin-bottom: env(safe-area-inset-bottom, 0); }
@keyframes sheet-in { from { transform: translateY(30px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.sheet-head h3 { font-size: var(--fs-md); font-weight: 800; }
.sheet-close { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-3); cursor: pointer; font-size: 20px; line-height: 1; color: var(--text-2); }
.sheet-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sheet-item { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: var(--fs-base); font-weight: 600; color: var(--text); text-align: left; transition: background var(--t-fast), border-color var(--t-fast); }
.sheet-item:hover { background: var(--primary-50); border-color: var(--primary-200); }
.sheet-hint { margin: 2px 4px 10px; font-size: var(--fs-sm); color: var(--text-2); text-align: center; }
.share-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.share-channel {
  display: inline-flex; align-items: center; gap: 9px; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
  cursor: pointer; font-family: inherit; font-size: var(--fs-base); font-weight: 700; color: var(--text);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.share-channel:hover { background: var(--surface-2); border-color: var(--border-2); }
.share-channel:active { transform: translateY(1px); }
.share-channel .ch-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.share-channel--kakao .ch-ico { background: #fee500; color: #191600; }
#share-x .ch-ico { background: #0f172a; color: #fff; }
#share-linkedin .ch-ico { background: #0a66c2; color: #fff; }
#share-email .ch-ico { background: var(--primary-100); color: var(--primary-hover); }
.sheet-divider { height: 1px; background: var(--border); margin: 12px 2px; }

/* =========================== 사이트 푸터 =========================== */
.app-footer {
  padding: var(--sp-6) var(--sp-5);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.hub-backlink-row { width: 100%; display: flex; justify-content: flex-start; margin-bottom: 10px; }
.hub-backlink {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 12px; border: 1px solid rgba(37,99,235,.24);
  border-radius: 999px; background: #fff; color: #1d4ed8;
  font-size: 13px; font-weight: 800; text-decoration: none;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.hub-backlink:hover { border-color: rgba(37,99,235,.48); box-shadow: 0 14px 30px rgba(37,99,235,.14); transform: translateY(-1px); text-decoration: none; }
.hub-backlink:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hub-backlink svg { width: 15px; height: 15px; flex: 0 0 auto; }
.app-footer-privacy {
  max-width: 640px; margin: 0 auto var(--sp-2);
  font-size: 11px; color: #94a3b8; line-height: 1.6;
}
.app-footer-meta {
  margin: 0; font-size: 11px; color: #94a3b8;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
}
.app-footer-meta a { color: var(--text-2); text-decoration: none; }
.app-footer-meta a:hover { color: var(--primary); text-decoration: underline; }

/* =========================== 반응형 =========================== */
@media (max-width: 1023px) {
  .app-body-inner { grid-template-columns: 1fr; }
  .preview-sidebar { position: static; order: -1; }
  .step-nav { display: none; }
  .result-nav-hint { display: none; }
}

@media (max-width: 560px) {
  .header-inner { gap: 8px; }
  .brand-name { font-size: var(--fs-base); }
  .save-badge .save-text { display: none; }
  .input-row { grid-template-columns: 1fr; }
  .apply-grid { grid-template-columns: 1fr; }
  .cv-goals { grid-template-columns: 1fr; }
  .repeat-row.two .repeat-fields { grid-template-columns: 1fr; }
  .journey { flex-direction: column; }
  .journey-arrow { transform: rotate(90deg); }
  .phase-actions { flex-wrap: wrap; }
  .phase-actions .btn-next, .phase-actions .btn-complete { flex: 1 1 auto; }
  .result-actions .btn { flex: 1 1 calc(50% - 5px); }
}

/* =========================== 다크 스킴(입력 필드 네이티브) =========================== */
@media (prefers-color-scheme: dark) {
  /* 콘텐츠는 라이트 유지(브랜드 일관성). 네이티브 컨트롤만 라이트로 고정 */
  :root { color-scheme: light; }
}

/* =========================== 모션 축소 =========================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* =========================== 인쇄 =========================== */
@media print {
  .app-header, .preview-sidebar, .result-actions, .phase-actions, .maker, .hub-cta--quiet, .abc-summary, .skip-link, .toast, .sheet-backdrop { display: none !important; }
  body { background: #fff; }
  .app-body { padding: 0; }
  .app-body-inner { grid-template-columns: 1fr; }
  .phase-result .result-head { margin-bottom: 12px; }
  .canvas-frame { background: #fff; border: 0; padding: 0; }
  .canvas-sheet { box-shadow: none; border: 1px solid var(--border); }
  .phase { display: none !important; }
  .phase-result.is-active { display: block !important; }
}
