:root {
  --green: #1f6f54;
  --green-dark: #185942;
  --green-soft: #e4efe9;
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1d2522;
  --muted: #7b837f;
  --line: #e7e6e0;
  --danger: #b5483b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 40, 30, 0.04), 0 4px 16px rgba(20, 40, 30, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

/* ── 헤더 ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-text strong {
  font-size: 16px;
  font-weight: 900;
}
.brand-text span {
  font-size: 12px;
  color: var(--muted);
}
.header-user {
  font-size: 13px;
  color: var(--muted);
}

/* ── 레이아웃 ── */
.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 60px;
  align-items: start;
}

.panel {
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

/* ── 폼 요소 ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
textarea {
  resize: vertical;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 9px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-dark);
}
.btn-primary.recording {
  background: var(--danger);
}
.btn-soft {
  background: var(--green-soft);
  color: var(--green-dark);
}
.btn-soft:hover {
  background: #d4e6dd;
}
.btn-outline {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-outline:hover:not(:disabled) {
  border-color: #cfd6d2;
  background: #fafaf8;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-ghost-danger {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--danger);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost-danger:hover {
  background: #fbeceb;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green);
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
  font-size: 12.5px;
  margin: 4px 0 0;
}

/* ── 좌측 회의 목록 ── */
.meeting-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.meeting-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  background: var(--card);
  transition: border-color 0.15s, background 0.15s;
}
.meeting-item:hover {
  border-color: #cfd6d2;
}
.meeting-item.active {
  border-color: var(--green);
  background: var(--green-soft);
}
.meeting-item strong {
  display: block;
  font-size: 14px;
}
.meeting-item .mi-sub,
.meeting-item .mi-date {
  font-size: 11.5px;
  color: var(--muted);
}
.meeting-item .mi-sub {
  margin-top: 3px;
}
.list-empty {
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 2px;
}

/* ── 중앙 스테이지 ── */
.empty-stage {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 60px 30px;
  text-align: center;
  color: var(--muted);
}
.empty-stage h2 {
  color: var(--ink);
  margin: 0 0 8px;
}

.stage-head {
  position: relative;
  margin-bottom: 8px;
}
.stage-head h1 {
  font-size: 34px;
  font-weight: 900;
  margin: 4px 0 6px;
  color: var(--green-dark);
}
.stage-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
#deleteMeetingBtn {
  position: absolute;
  top: 0;
  right: 0;
}

.author-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.author-edit {
  display: flex;
  gap: 8px;
  align-items: center;
}
.author-edit input {
  width: 150px;
}

.voice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.voice-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
}
.rec-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c7ccc9;
}
.rec-dot.live {
  background: var(--danger);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.rec-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--muted);
}
.voice-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.audio-preview {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 14px;
}
.rec-status {
  margin: 10px 0 0;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.entry-hint {
  margin: 14px 0 8px;
}
.entry-card textarea {
  margin-bottom: 12px;
}

/* ── 타임라인 ── */
.timeline-card h3,
.timeline-card {
  margin-top: 0;
}
.timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-empty {
  color: var(--muted);
  font-size: 13px;
}
.tl-item {
  border-left: 3px solid var(--line);
  padding: 4px 0 4px 14px;
  position: relative;
}
.tl-item.type-decision { border-color: #d9a531; }
.tl-item.type-action { border-color: var(--green); }
.tl-item.type-note { border-color: #6b8cce; }
.tl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}
.tl-author {
  font-weight: 700;
  color: var(--ink);
}
.tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--green-soft);
  color: var(--green-dark);
}
.tag.decision { background: #fbf0d6; color: #8a6712; }
.tag.action { background: var(--green-soft); color: var(--green-dark); }
.tag.note { background: #e6ecf8; color: #3f5a96; }
.tl-content {
  font-size: 14px;
  color: var(--ink);
  white-space: pre-wrap;
}
.tl-extra {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.tl-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  margin-left: auto;
}
.tl-del:hover { color: var(--danger); }

/* ── 우측 요약 ── */
.sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 88px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stat {
  text-align: center;
}
.stat span {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: var(--green-dark);
}
.stat label {
  font-size: 11px;
  color: var(--muted);
}
.summary-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
}
.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.summary-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13px;
}
.summary-list .si-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.summary-empty {
  color: var(--muted);
  font-size: 12.5px;
}

/* ── 토스트 ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  z-index: 50;
}
.toast.error { background: var(--danger); }

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar-right {
    position: static;
  }
  .entry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
