/* 클로바노트를 참조한 톤: 쿨그레이 바탕(#EBEFF5) + 흰 카드 + 네이버 그린 포인트 */
:root {
  --bg: #ebeff5;
  --surface: #ffffff;
  --line: #e3e8ef;
  --line-strong: #d3dae5;
  --ink: #1a1d21;
  --ink-mid: #4b5563;
  --ink-mute: #8b94a3;
  --green: #03c75a;
  --green-deep: #02a349;
  --green-wash: #eafaf1;
  --blue: #3b6fd4;
  --blue-wash: #edf2fd;
  --amber: #c88a2a;
  --coral: #e0483c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 29, 33, .04), 0 4px 16px rgba(26, 29, 33, .05);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --content-max: 1240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
               system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- 브랜드 */

.brand { display: flex; align-items: center; gap: 9px; }

.brand__mark {
  width: 20px; height: 20px; border-radius: 7px;
  background: var(--green);
  position: relative; flex: none;
}
.brand__mark::after {
  content: ""; position: absolute; inset: 6px 6px auto 6px; height: 8px;
  border-radius: 2px; background: #fff;
  clip-path: polygon(0 40%, 22% 40%, 22% 0, 44% 0, 44% 100%, 66% 100%, 66% 25%, 88% 25%, 88% 60%, 100% 60%, 100% 100%, 0 100%);
}
.brand__name { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- 로그인 */

.signin {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 24px;
}
.signin__card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px 36px 32px;
}
.signin__title {
  margin: 26px 0 12px;
  font-size: 27px; line-height: 1.35; font-weight: 700; letter-spacing: -.03em;
}
.signin__lead {
  margin: 0 0 30px;
  font-size: 14.5px; line-height: 1.65; color: var(--ink-mid);
}
.btn-google {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 15px; font-weight: 600;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.btn-google:hover { background: #f7f9fc; border-color: var(--ink-mute); }
.btn-google:disabled { opacity: .55; cursor: default; }
.signin__error {
  margin: 14px 0 0; font-size: 13.5px; color: var(--coral); line-height: 1.5;
}
.signin__note {
  margin: 18px 0 0; font-size: 12.5px; color: var(--ink-mute); text-align: center;
}

/* ---------------------------------------------------------------- 레이아웃 */

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100%;
}

.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 14px 16px;
  display: flex; flex-direction: column;
}
.brand--side { padding: 0 8px 22px; }

.side__nav { display: flex; flex-direction: column; gap: 2px; }
.navitem {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--ink-mid);
  font-size: 14px; font-weight: 500;
  text-align: left;
}
.navitem:hover { background: #f2f5f9; }
.navitem.is-active { background: var(--green-wash); color: var(--green-deep); font-weight: 700; }
.navitem em { font-style: normal; font-size: 12.5px; color: var(--ink-mute); }
.navitem.is-active em { color: var(--green-deep); }

.side__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.account { display: flex; flex-direction: column; gap: 4px; padding: 0 8px; }
.account__mail {
  font-size: 12.5px; color: var(--ink-mid);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.linkbtn {
  border: 0; background: none; padding: 0;
  color: var(--ink-mute); font-size: 12.5px; text-align: left;
}
.linkbtn:hover { color: var(--ink); text-decoration: underline; }
.linkbtn--back { font-size: 14px; color: var(--ink-mid); font-weight: 500; }

.main { min-width: 0; overflow-y: auto; }
.view { min-height: 100%; }

/* ---------------------------------------------------------------- 상단바 */

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(235, 239, 245, .88);
  backdrop-filter: saturate(180%) blur(8px);
  /* 배경은 전폭으로 두되 안쪽 내용은 본문과 같은 폭에 맞춘다 */
  padding-block: 18px;
  padding-inline: max(28px, calc((100% - var(--content-max)) / 2 + 28px));
  border-bottom: 1px solid transparent;
}
.topbar--detail { padding-bottom: 10px; }

.search {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  color: var(--ink-mute);
}
.search:focus-within { border-color: var(--green); color: var(--green-deep); }
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  height: 50px;
  font: inherit; font-size: 15.5px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-mute); }
.search--inline { max-width: 300px; flex: none; width: 300px; }
.search--inline input { height: 42px; font-size: 14.5px; }

/* ---------------------------------------------------------------- 목록 */

.list { max-width: var(--content-max); margin-inline: auto; padding: 6px 28px 48px; }

.daygroup { margin-top: 22px; }
.daygroup:first-child { margin-top: 6px; }
.daygroup__label {
  margin: 0 0 10px 2px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-mute);
}

.note {
  display: block; width: 100%; text-align: left;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 8px;
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.note:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(26, 29, 33, .04), 0 12px 28px -14px rgba(26, 29, 33, .22);
}
.note:active { transform: translateY(0) scale(.995); }

.note__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.note__who { font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; }
.note__time { font-size: 12.5px; color: var(--ink-mute); flex: none; }
.note__topic {
  margin: 7px 0 0;
  font-size: 14px; line-height: 1.6; color: var(--ink-mid);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note__foot { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.note__dur { font-size: 12.5px; color: var(--ink-mute); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip--done { background: var(--green-wash); color: var(--green-deep); }
.chip--pending { background: #fdf4e3; color: var(--amber); }
.chip--failed { background: #fdeceb; color: var(--coral); }

.empty {
  margin: 64px auto; max-width: 340px; text-align: center;
}
.empty h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.empty p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-mute); }

/* ---------------------------------------------------------------- 상세 */

/* 넓은 화면에서도 한쪽으로 쏠리지 않게 가운데 정렬한다 */
.detail {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 6px 28px 64px;
}
.detail__title { margin: 4px 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.detail__meta { margin: 0 0 12px; font-size: 15px; color: var(--ink-mute); }
.statusline { margin-bottom: 20px; }

/* ------- AI 정리: 대화 위, 더블베젤로 한 단계 올려 시선을 먼저 잡는다 ------- */
.summary {
  background: linear-gradient(180deg, #e7edf6, #dfe7f2);
  border-radius: 20px;
  padding: 6px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(26, 29, 33, .04), 0 10px 30px -12px rgba(26, 29, 33, .16);
}
.summary__inner {
  background: var(--surface);
  border-radius: 15px;
  padding: 24px 26px 26px;
  box-shadow: inset 0 1px 0 #fff;
}
.summary__lede {
  margin: 0;
  font-size: 18px; line-height: 1.62; font-weight: 500;
  letter-spacing: -.01em; word-break: keep-all;
}
.summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(226px, 1fr));
  gap: 22px 28px;
  margin-top: 22px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.block__label {
  margin: 0 0 11px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--green-deep); text-transform: uppercase;
}
.block ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.block li {
  position: relative; padding-left: 16px;
  font-size: 15.5px; line-height: 1.6; word-break: keep-all;
}
.block li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
}
.summary--empty { background: #e4eaf3; }
.summary--empty p {
  margin: 0; padding: 20px 24px;
  background: var(--surface); border-radius: 15px;
  font-size: 15px; color: var(--ink-mute);
}

/* ------- 대화 ------- */

.tscript {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 28px;
}
.tscript__head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 18px;
}
.tscript__head h2 { margin: 0; font-size: 16px; font-weight: 700; }
/* 검색창과 나란히 놓이므로 눌리지 않게 고정한다 */
#copyFullBtn { flex: 0 0 auto; white-space: nowrap; }

/* 같은 화자가 이어 말하면 한 덩어리로 묶는다 — 짧은 맞장구가 반복돼도 여백이 늘지 않는다 */
.turns { display: flex; flex-direction: column; gap: 18px; }
.turn__tag {
  display: inline-block; margin-bottom: 7px;
  font-size: 13px; font-weight: 700;
  padding: 3px 9px; border-radius: 7px;
}
.turn--a .turn__tag { background: var(--green-wash); color: var(--green-deep); }
.turn--b .turn__tag { background: var(--blue-wash); color: var(--blue); }

.line {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px;
  align-items: baseline;          /* 시각과 본문을 같은 기준선에 맞춘다 */
}
.line + .line { margin-top: 6px; }
.line__at {
  font-size: 13px; color: var(--ink-mute);
  font-variant-numeric: tabular-nums; text-align: right;
}
.line__text {
  margin: 0;                      /* p 기본 마진이 줄마다 33px씩 붙던 것을 제거 */
  font-size: 16.5px; line-height: 1.62; color: var(--ink); word-break: keep-all;
}
.line.is-dim { opacity: .3; }
.line mark { background: #fff3bf; color: inherit; border-radius: 3px; padding: 0 2px; }
.tscript__empty { margin: 0; font-size: 15px; color: var(--ink-mute); }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  .side {
    flex-direction: row; align-items: center; gap: 14px;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    overflow-x: auto; scrollbar-width: none;
    position: sticky; top: 0; z-index: 20;
  }
  .side::-webkit-scrollbar { display: none; }
  /* 가로 배치에서는 어떤 항목도 줄바꿈·축소되지 않게 한다 */
  .side > *, .side__nav > *, .account > * { flex: none; }
  .brand--side { padding: 0; }
  .brand__name { white-space: nowrap; }
  .side__nav { flex-direction: row; gap: 4px; }
  .navitem { gap: 6px; padding: 7px 11px; white-space: nowrap; }
  .side__foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .account { flex-direction: row; align-items: center; gap: 10px; }
  .account__mail { max-width: 120px; }
  .topbar { padding: 14px 16px; }
  .list, .detail { padding-left: 16px; padding-right: 16px; }
  .detail { gap: 14px; }
  .detail__title { font-size: 21px; }
  .tscript { padding: 16px 14px 20px; }
  /* 제목·전문복사는 한 줄, 검색창은 아래 줄로 내린다 */
  .tscript__head { flex-wrap: wrap; gap: 10px; }
  .search--inline { flex: 1 1 100%; max-width: none; }
  .turn { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
  .turn__text { font-size: 14.5px; }
}

/* 공유 · 복사 — 상세 헤더 우측 */
.topbar--detail { display: flex; align-items: center; gap: 12px; }
.sharerow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;   /* 우측 정렬 */
}
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background .18s cubic-bezier(.16,1,.3,1),
              border-color .18s, color .18s;
}
.iconbtn:hover { background: #f5f7fa; border-color: var(--ink-mute); color: var(--ink); }
.iconbtn--primary {
  background: var(--green);
  border-color: var(--green);
  color: #06301b;
}
.iconbtn--primary:hover { background: var(--green-deep); border-color: var(--green-deep); color: #06301b; }
.sharetoast {
  font-size: 13px;
  color: var(--green-deep);
  background: var(--green-wash);
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.linkbtn--sm { font-size: 13.5px; margin-left: auto; }

@media (max-width: 760px) {
  /* 아이콘은 좁은 화면에서도 그대로 둔다 — 이미 36px로 작다 */
  .sharetoast { display: none; }   /* 좁은 화면에선 버튼 자리를 우선한다 */
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
