/* Step A onboarding — A→C progressive (welcome modal + companion panel + sample row tint) */
/* Token source: DESIGN.md (Acid Lime #C8FF00, chalk #F5F3EE, sidebar #1A1A18, Pretendard + Instrument Serif). */

/* Instrument Serif loaded via index.html google font link (1분 hero only) */

/* ─────────────────────────────────────────────────────────────────────────
   Welcome modal (Layer 2 — variant A tone + B "1분" hero cherry-pick)
   ───────────────────────────────────────────────────────────────────────── */
.onb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
  animation: onb-fade-in 220ms ease-out;
}
.onb-modal-backdrop[hidden] { display: none !important; }

.onb-modal {
  width: 100%;
  max-width: 540px;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(20, 20, 18, 0.18);
  padding: 40px 36px 32px;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1A1A18;
}

.onb-modal-hero {
  font-family: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  font-style: italic;
  font-size: 88px;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: #1A1A18;
}
.onb-modal-subtitle {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  color: #1A1A18;
}
.onb-modal-body {
  font-size: 14px;
  line-height: 1.65;
  color: #5A5A55;
  margin: 0 0 28px;
}
.onb-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.onb-btn-primary {
  background: #C8FF00;
  color: #1A1A18;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  font-family: inherit;
  transition: filter 120ms ease;
}
.onb-btn-primary:hover { filter: brightness(0.96); }
.onb-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.onb-btn-text {
  background: transparent;
  color: #6B6B62;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.onb-btn-text:hover { color: #1A1A18; }

/* ─────────────────────────────────────────────────────────────────────────
   Companion panel (Layer 2.5 — variant C, permanent steady-state)
   ───────────────────────────────────────────────────────────────────────── */
.onb-companion {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: #FFFFFF;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  font-family: 'Pretendard', -apple-system, sans-serif;
  color: #1A1A18;
  z-index: 800;
  overflow: hidden;
  transform: translateX(0);
  transition: transform 240ms ease;
}
.onb-companion[hidden] { display: none !important; }
.onb-companion.onb-slide-in { animation: onb-slide-in 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.onb-companion-inner {
  padding: 24px 20px;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.onb-companion-header {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.onb-companion-sub {
  font-size: 12px;
  color: #6B6B62;
  margin-bottom: 18px;
}

.onb-step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.onb-step:last-of-type { border-bottom: none; }

.onb-step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.onb-step.done .onb-step-circle {
  background: #C8FF00;
  color: #1A1A18;
}
.onb-step.current .onb-step-circle {
  background: #FFFFFF;
  border: 2px solid #C8FF00;
  color: #1A1A18;
}
.onb-step.todo .onb-step-circle {
  background: #FFFFFF;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  color: #6B6B62;
}

.onb-step-body { flex: 1; min-width: 0; }
.onb-step-title {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A18;
  margin-bottom: 2px;
}
.onb-step.done .onb-step-title {
  color: #6B6B62;
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.2);
}
.onb-step.todo .onb-step-title { color: #6B6B62; font-weight: 500; }

.onb-step-desc {
  font-size: 12px;
  color: #6B6B62;
  line-height: 1.5;
  margin-top: 2px;
}
.onb-step-meta {
  font-size: 11px;
  color: #6B6B62;
  margin-top: 2px;
}
.onb-step-cta {
  margin-top: 8px;
}
.onb-step-cta-btn {
  background: #C8FF00;
  color: #1A1A18;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.onb-companion-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.onb-sample-notice {
  background: #FFF8E0;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 11px;
  color: #5C4A00;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.onb-sample-notice button {
  background: transparent;
  border: none;
  color: #5A8A00;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 4px;
}
.onb-sample-notice button:hover { text-decoration: underline; }

.onb-companion-help {
  font-size: 11px;
  color: #6B6B62;
  text-align: center;
  cursor: pointer;
  padding: 6px;
  background: transparent;
  border: none;
  font-family: inherit;
  width: 100%;
  margin-bottom: 4px;
}
.onb-companion-help:hover { color: #1A1A18; }
.onb-companion-close {
  font-size: 11px;
  color: #6B6B62;
  text-align: center;
  cursor: pointer;
  padding: 6px;
  background: transparent;
  border: none;
  font-family: inherit;
  width: 100%;
}
.onb-companion-close:hover { color: #1A1A18; }

/* Collapsed state — narrow icon strip */
.onb-companion-collapsed {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 36px;
  height: 88px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-right: none;
  border-radius: 6px 0 0 6px;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 800;
  font-family: 'Pretendard', sans-serif;
  font-size: 11px;
  color: #6B6B62;
  gap: 4px;
}
.onb-companion-collapsed[hidden] { display: none !important; }
.onb-companion-collapsed:hover { color: #1A1A18; background: #FAFAF7; }
.onb-companion-collapsed .onb-collapsed-pct {
  font-weight: 700;
  font-size: 13px;
  color: #1A1A18;
  font-variant-numeric: tabular-nums;
}

/* Body padding when companion is visible */
body.onb-has-companion { padding-right: 320px; }
body.onb-has-companion.onb-companion-collapsed-state { padding-right: 36px; }

/* ─────────────────────────────────────────────────────────────────────────
   Sample row tint (AG Grid integration)
   ───────────────────────────────────────────────────────────────────────── */
.ag-theme-alpine .ag-row.is-sample,
.ag-theme-balham .ag-row.is-sample,
.ag-row.is-sample {
  background-color: #FFF8E0 !important;
}
.ag-theme-alpine .ag-row.is-sample.ag-row-hover,
.ag-row.is-sample.ag-row-hover {
  background-color: #FFF1C2 !important;
}
.is-sample-tag {
  display: inline-block;
  font-size: 10px;
  color: #6B6B62;
  font-weight: 500;
  margin-right: 6px;
  letter-spacing: 0.01em;
}

/* ─────────────────────────────────────────────────────────────────────────
   Preview modal (Layer 4 — link-based v1, 3 sections)
   ───────────────────────────────────────────────────────────────────────── */
.onb-preview-modal {
  width: 100%;
  max-width: 560px;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(20, 20, 18, 0.18);
  padding: 32px;
  font-family: 'Pretendard', sans-serif;
  color: #1A1A18;
}
.onb-preview-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.onb-preview-sub {
  font-size: 13px;
  color: #6B6B62;
  margin: 0 0 24px;
}
.onb-preview-section {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.onb-preview-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
}
.onb-preview-section p {
  font-size: 12px;
  color: #6B6B62;
  margin: 0 0 12px;
  line-height: 1.5;
}
.onb-preview-section .onb-btn-primary { padding: 6px 14px; font-size: 12px; }
.onb-preview-section .onb-btn-text { padding: 6px 10px; font-size: 12px; }
.onb-preview-close {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

/* ─────────────────────────────────────────────────────────────────────────
   Animations
   ───────────────────────────────────────────────────────────────────────── */
@keyframes onb-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes onb-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes onb-step-flash {
  0%   { background: rgba(200, 255, 0, 0); box-shadow: 0 0 0 0 rgba(200, 255, 0, 0); }
  20%  { background: rgba(200, 255, 0, 0.28); box-shadow: 0 0 0 6px rgba(200, 255, 0, 0.18); }
  100% { background: rgba(200, 255, 0, 0); box-shadow: 0 0 0 0 rgba(200, 255, 0, 0); }
}
.onb-step.onb-step-flash {
  animation: onb-step-flash 1400ms ease-out;
  border-radius: 6px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .onb-modal-backdrop,
  .onb-companion.onb-slide-in,
  .onb-step.onb-step-flash { animation: none; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Mobile fallback (v1 — desktop-first; modal stays usable on small screens)
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  body.onb-has-companion,
  body.onb-has-companion.onb-companion-collapsed-state { padding-right: 0; }
  .onb-companion { width: 100%; }
  .onb-companion-collapsed {
    top: auto;
    bottom: 16px;
    transform: none;
    border-radius: 6px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    width: 64px;
    height: 36px;
    flex-direction: row;
  }
  .onb-modal-hero { font-size: 64px; }
}
