/* 회의록 요약 (MeetingNotes) — mobile-first, 560px base, SlowAcorn 토큰셋 공용.
   가로 스크롤은 어떤 폭에서도 생기지 않는다: 텍스트를 담는 flex 자식은 전부
   min-width:0, 모든 줄은 wrap, body의 overflow-x는 마지막 안전장치일 뿐이다.
   입력 글자는 16px 아래로 내려가지 않는다 — iOS 사파리가 확대해버린다. */

:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel2: #1e222b;
  --line: #2a2f3a;
  --ink: #e7e9ee;
  --muted: #8b93a5;
  --accent: #6aa6e0;      /* 업무 도구 쪽 파랑 */
  --accent2: #59e0b8;
  --warn: #f0b354;
  --danger: #f2705f;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

img, svg, canvas, video { max-width: 100%; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px
           calc(env(safe-area-inset-bottom, 0px) + 48px);
}

/* -- 맨 윗줄: 돌아가기 + 언어 토글 --------------------------------------- */
.topRow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
}
.langbar { display: flex; gap: 5px; }
.langBtn {
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; border-radius: 999px;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  min-height: 32px; cursor: pointer; font-family: inherit;
}
.langBtn:hover { border-color: var(--accent); }
.langBtn.active { background: var(--accent); color: #0d1016; border-color: var(--accent); }

html[lang="ko"] body { word-break: keep-all; }
html[lang="ko"] h1 { letter-spacing: -.02em; }

/* keep-all은 한국어 줄바꿈을 자연스럽게 만들지만, 공백 없이 길게 이어진
   문자열(URL, 붙여서 나온 전사 한 덩어리)을 아예 끊지 않아 화면을 넘긴다.
   가로 스크롤은 어떤 폭에서도 안 된다는 규칙이 우선이라, 넘칠 때만 끊는
   overflow-wrap을 텍스트를 담는 것 전부에 마지막 안전장치로 깐다. */
.wrap p, .wrap li, .wrap h1, .wrap h2, .wrap h3, .wrap h4, .wrap summary,
.wrap span, .wrap strong, .wrap small, .wrap .headline, .wrap .live,
.wrap .transcript { overflow-wrap: anywhere; }

/* -- 게이트웨이로 돌아가기 ------------------------------------------------ */
a.back {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink);
  text-decoration: none; font-size: 15px; font-weight: 600;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); transition: border-color .15s ease, transform .05s ease;
}
a.back:hover { border-color: var(--accent); transform: translateX(-2px); }

/* -- 머리글 --------------------------------------------------------------- */
.appHeader { margin: 0 0 16px; }
h1 {
  margin: 0 0 8px; font-size: 26px; line-height: 1.25; letter-spacing: -.01em;
}
h1 .sub {
  display: inline-block; font-size: 15px; font-weight: 600;
  color: var(--muted); margin-left: 6px;
}
.topNotice {
  margin: 0; padding: 12px 14px; font-size: 14px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 10px;
}
.topNotice strong { color: var(--accent); }
.capNotice {
  margin: 8px 0 0; padding: 10px 14px; font-size: 13px; line-height: 1.6;
  color: var(--muted); background: rgba(240, 179, 84, .06);
  border: 1px solid rgba(240, 179, 84, .2); border-radius: 10px;
}
.capNotice strong { color: var(--warn); }

/* -- 패널 ---------------------------------------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 14px 0;
}
.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 14px; }

.label {
  display: block; font-size: 13px; font-weight: 700; color: var(--muted);
  letter-spacing: .02em; margin-bottom: 8px;
}
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.warn {
  margin: 0 0 14px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  color: var(--warn); background: rgba(240, 179, 84, .08);
  border: 1px solid rgba(240, 179, 84, .25); border-radius: 10px;
}

/* -- 선택 버튼 ----------------------------------------------------------- */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  text-align: left; padding: 12px 14px; font-size: 15px; color: var(--ink);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; font-family: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.choice strong { font-size: 15px; font-weight: 700; }
.choice small { font-size: 12px; color: var(--muted); }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice.on { border-color: var(--accent); background: rgba(106, 166, 224, .12); }
.choice:disabled, .choice.off { opacity: .45; cursor: not-allowed; }
.choices.tight .choice { flex: 0 1 auto; text-align: center; align-items: center; }

/* -- 버튼 ---------------------------------------------------------------- */
button.primary, button.ghost {
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  border-radius: 12px; padding: 13px 18px; border: 1px solid var(--line);
  transition: border-color .15s ease, background .15s ease, transform .05s ease;
}
button.primary {
  color: #0d1016; background: var(--accent); border-color: var(--accent);
}
button.primary:hover:not(:disabled) { filter: brightness(1.07); }
button.primary:active:not(:disabled) { transform: translateY(1px); }
button.primary.stop { background: var(--danger); border-color: var(--danger); color: #1a0d0b; }
button.ghost { color: var(--ink); background: var(--panel2); }
button.ghost:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.big { display: block; width: 100%; }
button.wide { display: block; width: 100%; margin-top: 14px; }

/* -- 녹음 중 ------------------------------------------------------------- */
.recTop { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.recDot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--danger);
  flex: 0 0 auto; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .recDot { animation: none; } }

.times { display: flex; flex-direction: column; min-width: 0; }
.times strong { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.times small { font-size: 12px; color: var(--muted); }

.meter {
  flex: 1 1 80px; min-width: 60px; height: 8px; border-radius: 999px;
  background: var(--panel2); overflow: hidden;
}
.meter span {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: var(--accent2); transition: width .12s linear;
}

.liveWrap { margin-bottom: 14px; }
.liveHead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.liveHead .label { margin-bottom: 6px; }
.liveHead small { font-size: 12px; color: var(--muted); }
.live {
  max-height: 260px; overflow-y: auto; padding: 12px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; line-height: 1.65; overflow-wrap: anywhere;
}
.live:empty::before { content: 'Once someone speaks, it appears here.'; color: var(--muted); font-size: 14px; }
html[lang="ko"] .live:empty::before { content: '말을 시작하면 여기에 쌓입니다.'; }
.live p { margin: 0 0 8px; }
.live .ts { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* -- 붙여넣기 ------------------------------------------------------------ */
details summary {
  cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink);
  padding: 2px 0; list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸ '; color: var(--accent); }
details[open] summary::before { content: '▾ '; }

textarea {
  display: block; width: 100%; margin: 10px 0; padding: 12px;
  font-family: inherit; font-size: 16px; line-height: 1.6;
  color: var(--ink); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 10px; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

/* -- 진행 막대 ----------------------------------------------------------- */
.bar {
  height: 10px; border-radius: 999px; background: var(--panel2);
  overflow: hidden; margin: 10px 0 0;
}
.bar span {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .3s ease;
}

/* -- 결과 ---------------------------------------------------------------- */
.headline {
  margin: 0 0 16px; padding: 14px; font-size: 17px; font-weight: 700; line-height: 1.5;
  background: var(--panel2); border-left: 3px solid var(--accent2); border-radius: 10px;
}
.sum { margin: 0 0 18px; }
.sum h3 {
  margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .04em;
  color: var(--accent); text-transform: uppercase;
}
.sum h4 { margin: 12px 0 6px; font-size: 15px; font-weight: 700; }
.sum ul { margin: 0; padding-left: 20px; }
.sum li { margin-bottom: 6px; overflow-wrap: anywhere; }
.sum ul.actions { list-style: none; padding-left: 0; }
.sum ul.actions li {
  padding: 10px 12px; margin-bottom: 8px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 10px; font-size: 15px;
}
.sum .who {
  display: inline-block; padding: 1px 8px; margin-right: 2px; font-size: 12px;
  font-weight: 700; color: var(--accent2); background: rgba(89, 224, 184, .1);
  border-radius: 999px;
}
.sum .due {
  display: inline-block; margin-left: 6px; padding: 1px 8px; font-size: 12px;
  color: var(--warn); background: rgba(240, 179, 84, .1); border-radius: 999px;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions button { flex: 1 1 110px; min-width: 0; }

.transcriptBox { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.transcript {
  max-height: 340px; overflow-y: auto; margin-top: 10px; padding: 12px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* -- 고지 ---------------------------------------------------------------- */
.disclaimer {
  margin: 22px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted);
}

@media (min-width: 520px) {
  h1 { font-size: 30px; }
  .panel { padding: 20px; }
}
