/* IdeaStep의 차분하고 따뜻한 인상을 유지하기 위한 공통 디자인 토큰입니다. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-muted: #f1f0eb;
  --ink: #20231f;
  --muted: #73766e;
  --line: #e5e3db;
  --accent: #dbff64;
  --accent-strong: #b9e72f;
  --purple: #7256d8;
  --purple-soft: #eee9ff;
  --danger: #b64646;
  --shadow: 0 18px 55px rgba(31, 35, 27, 0.09);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 8%, rgba(219, 255, 100, 0.18), transparent 24rem),
    var(--bg);
  font-family: "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 22px 22px;
  border-right: 1px solid var(--line);
  background: rgba(250, 249, 245, 0.9);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 43px; height: 43px; display: grid; place-items: center;
  border-radius: 13px; background: var(--ink); color: var(--accent);
  font: 700 14px "DM Sans", sans-serif; letter-spacing: -0.02em;
}
.brand strong { display: block; font: 700 20px "DM Sans", sans-serif; letter-spacing: -0.04em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.main-nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px 13px;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  color: #62655e; font-size: 14px; font-weight: 600; text-align: left;
}
.nav-item:hover { background: var(--surface-muted); }
.nav-item.active { background: var(--ink); color: white; }
.nav-icon { width: 20px; color: var(--purple); font-size: 18px; text-align: center; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-count { margin-left: auto; color: #a4a79e; font: 600 12px "DM Sans", sans-serif; }

.sidebar-guide { margin-top: auto; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.eyebrow { color: var(--purple); font: 700 10px "DM Sans", sans-serif; letter-spacing: 0.13em; }
.sidebar-guide p { margin: 9px 0 0; color: #585b54; font-size: 12px; line-height: 1.7; }

.primary-button, .secondary-button, .text-button, .danger-button {
  min-height: 44px; padding: 0 17px; border-radius: 12px; cursor: pointer; font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; box-shadow: 0 7px 18px rgba(32, 35, 31, .12); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(32, 35, 31, .18); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); }
.secondary-button:hover { border-color: #c8c6bc; background: #fbfaf7; }
.text-button { border: 0; background: transparent; color: var(--muted); }
.danger-button { border: 1px solid #efd1d1; background: #fff7f7; color: var(--danger); }
.new-idea-button { width: 100%; margin-top: 12px; }
.new-idea-button span { margin-right: 6px; color: var(--accent); font-size: 19px; }
.storage-note { display: flex; align-items: center; gap: 7px; margin: 15px auto 0; color: #92958c; font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #72b54c; box-shadow: 0 0 0 3px rgba(114, 181, 76, .12); }

.main-content { min-width: 0; padding: 55px clamp(28px, 5vw, 78px) 72px; }
.view { display: none; max-width: 1180px; margin: 0 auto; }
.view.active { display: block; animation: viewIn .28s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.page-header h1 { max-width: 720px; margin: 10px 0 8px; font-size: clamp(30px, 4vw, 48px); line-height: 1.2; letter-spacing: -.055em; }
.page-header p { margin: 0; color: var(--muted); font-size: 14px; }
.compact-header { align-items: center; }
.header-new-button { flex: 0 0 auto; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 38px; }
.summary-card {
  min-height: 142px; padding: 22px; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, .72);
}
.summary-card.accent-card { background: var(--accent); border-color: #cdeb62; }
.summary-label { color: #676a62; font-size: 12px; font-weight: 600; }
.summary-card strong { margin-top: 8px; font: 700 34px "DM Sans", sans-serif; letter-spacing: -.04em; }
.summary-caption { margin-top: auto; color: #777a72; font-size: 11px; }
.accent-card .summary-label, .accent-card .summary-caption { color: #535c35; }

.idea-section { padding-top: 6px; }
.section-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-toolbar h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.03em; }
.section-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; gap: 9px; }
.search-box { min-width: 210px; height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.search-box span { color: #9a9d95; font-size: 18px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.stage-filter { min-width: 115px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: #62655e; font-size: 12px; outline: 0; }

.idea-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.idea-card {
  min-height: 247px; padding: 21px; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  cursor: pointer; box-shadow: 0 3px 0 transparent; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.idea-card:hover { transform: translateY(-3px); border-color: #d0cec4; box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: #f2f1ec; color: #5f625a; font-size: 10px; font-weight: 700; }
.stage-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.stage-shape { background: var(--purple-soft); color: var(--purple); }
.stage-validate { background: #e7f5f1; color: #2b806b; }
.stage-build { background: #fff0d9; color: #a86513; }
.stage-done { background: #e8f4dc; color: #527f32; }
.card-date { color: #a0a39b; font: 500 10px "DM Sans", sans-serif; }
.idea-card h3 { margin: 19px 0 9px; font-size: 18px; line-height: 1.45; letter-spacing: -.035em; }
.idea-card p { margin: 0; color: #72756d; font-size: 12px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; gap: 7px; min-height: 27px; margin-top: auto; padding-top: 17px; }
.tag { padding: 5px 8px; border-radius: 7px; background: var(--surface-muted); color: #72756d; font-size: 9px; }
.more-tags { color: #a0a39b; font-size: 10px; }
.coach-shortcut { margin-left: auto; border: 0; background: transparent; color: var(--purple); font-size: 16px; cursor: pointer; }

.empty-state { padding: 72px 20px; text-align: center; border: 1px dashed #d2d0c7; border-radius: var(--radius-lg); background: rgba(255, 255, 255, .45); }
.empty-illustration { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 18px; background: var(--purple-soft); color: var(--purple); font-size: 23px; }
.empty-state h3 { margin: 0; font-size: 17px; }
.empty-state p { margin: 8px 0 20px; color: var(--muted); font-size: 12px; }

/* 코치 결과와 행동 버튼을 명확히 구분해 AI가 원문을 자동 변경하지 않도록 합니다. */
.coach-workspace { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr); gap: 20px; }
.coach-panel { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.coach-panel h2 { margin: 10px 0 7px; font-size: 22px; letter-spacing: -.04em; }
.coach-panel > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.coach-selector { width: 100%; height: 45px; margin-top: 23px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: white; outline: 0; }
.coach-actions { display: grid; gap: 9px; margin-top: 18px; }
.coach-action {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #fbfaf7; text-align: left; cursor: pointer;
}
.coach-action:hover { border-color: var(--purple); background: #faf8ff; }
.coach-action-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--purple-soft); color: var(--purple); }
.coach-action strong { display: block; font-size: 12px; }
.coach-action small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.coach-output { min-height: 480px; position: relative; overflow: hidden; }
.coach-output::after { content: ""; position: absolute; right: -70px; top: -70px; width: 170px; height: 170px; border-radius: 50%; background: rgba(219,255,100,.2); pointer-events: none; }
.coach-placeholder { min-height: 390px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.coach-placeholder div { max-width: 280px; }
.coach-placeholder span { display: block; margin-bottom: 13px; color: var(--purple); font-size: 28px; }
.coach-placeholder p { font-size: 12px; line-height: 1.75; }
.result-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; position: relative; z-index: 1; }
.result-header h3 { margin: 0; font-size: 17px; }
.demo-badge { padding: 5px 8px; border-radius: 999px; background: #f0efea; color: var(--muted); font-size: 9px; font-weight: 700; }
.result-intro { position: relative; z-index: 1; margin: 14px 0 18px; color: #62655e; font-size: 12px; line-height: 1.7; }
.result-list { position: relative; z-index: 1; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.result-list li { padding: 13px 14px; border-left: 3px solid var(--accent-strong); border-radius: 0 10px 10px 0; background: #f8f8f3; font-size: 12px; line-height: 1.65; }
.result-footnote { position: relative; z-index: 1; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: #999c94; font-size: 10px; line-height: 1.6; }

/* dialog 기본 스타일을 통제해 브라우저마다 동일한 편집 경험을 제공합니다. */
.idea-dialog { width: min(680px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 24px; background: var(--surface); box-shadow: 0 30px 90px rgba(29, 31, 27, .24); }
.idea-dialog::backdrop { background: rgba(31, 34, 29, .5); backdrop-filter: blur(4px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 27px 28px 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 7px 0 0; font-size: 23px; letter-spacing: -.04em; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; background: white; color: #74776f; cursor: pointer; font-size: 22px; }
.form-body { display: grid; gap: 20px; padding: 25px 28px 28px; }
.field-group { display: grid; gap: 8px; color: #555850; font-size: 11px; font-weight: 700; }
.field-group input, .field-group textarea, .field-group select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; color: var(--ink); outline: 0; font-size: 13px; font-weight: 400; }
.field-group input, .field-group select { height: 45px; padding: 0 13px; }
.field-group textarea { padding: 12px 13px; line-height: 1.7; resize: vertical; }
.field-group input:focus, .field-group textarea:focus, .field-group select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(114,86,216,.1); background: white; }
.field-group small { justify-self: end; color: #a0a39b; font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-footer { display: flex; align-items: center; gap: 8px; padding: 18px 28px; border-top: 1px solid var(--line); background: #fbfaf7; }
.footer-spacer { flex: 1; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; padding: 11px 17px; border-radius: 10px; background: var(--ink); color: white; font-size: 11px; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 86px minmax(0, 1fr); }
  .sidebar { align-items: center; padding: 24px 13px 18px; }
  .brand > span:last-child, .nav-item:not(.active) .nav-count, .nav-item { font-size: 0; }
  .main-nav { width: 100%; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-icon { font-size: 19px; }
  .nav-count { font-size: 9px; margin-left: 0; }
  .sidebar-guide, .storage-note { display: none; }
  .new-idea-button { width: 44px; padding: 0; font-size: 0; }
  .new-idea-button span { margin: 0; font-size: 21px; }
  .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; justify-content: space-between; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand > span:last-child { display: block; }
  .brand small { display: none; }
  .main-nav, .sidebar-guide, .storage-note { display: none; }
  .new-idea-button { width: 42px; margin: 0; }
  .main-content { padding: 32px 18px 54px; }
  .page-header { align-items: flex-start; }
  .page-header h1 { font-size: 32px; }
  .header-new-button { display: none; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:last-child { grid-column: 1 / -1; min-height: 112px; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions, .search-box { width: 100%; }
  .search-box { min-width: 0; }
  .stage-filter { flex: 0 0 112px; }
  .idea-grid { grid-template-columns: 1fr; }
  .idea-card { min-height: 220px; }
  .coach-workspace { grid-template-columns: 1fr; }
  .compact-header .secondary-button { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .dialog-header, .form-body, .dialog-footer { padding-left: 19px; padding-right: 19px; }
  .danger-button { padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
