/* 색과 모서리는 lemonTalk 화면과 맞춘다: 레몬 노랑, 네이비 글자, 크림 바탕, 따뜻한 선. */
:root {
  color-scheme: light;
  --lemon: #FFC629;
  --lemon-deep: #F2AE00;
  --lemon-ink: #7A5A00;
  --lemon-100: #FFF1C2;
  --lemon-50: #FFF8E3;
  --navy: #16233F;
  --ink: #1F2C46;
  --muted: #46536E;
  --faint: #8A93A6;
  --cream: #FBF7EF;
  --cream-2: #F6F0E4;
  --surface: #FDFAF4;
  --line: #ECE6D8;
  --line-strong: #E4DCC9;
  --success: #2EA24C;
  --warning: #E8973B;
  --error: #E8607A;
  --accent: var(--lemon-ink);
  --radius: 14px;
  --shadow: 0 1px 2px #16233f0a, 0 12px 32px -12px #16233f1f;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  font-family: "Noto Sans JP", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% -120px, #ffc62938, transparent 70%),
    radial-gradient(700px 380px at 96% -80px, #3f7bd614, transparent 70%),
    var(--cream);
  background-repeat: no-repeat;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #ffc62999; outline-offset: 2px; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* 위쪽 띠 */
.topbar {
  position: sticky; top: 0; z-index: 10; height: 64px;
  padding: 0 max(22px, calc((100vw - 1240px) / 2));
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fbf7efd9; backdrop-filter: saturate(1.4) blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--navy); font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.brand small { margin-left: 2px; padding: 3px 8px; border-radius: 99px; color: var(--lemon-ink); background: var(--lemon-100); font-size: 10px; font-weight: 800; letter-spacing: .6px; }
.brand-mark {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; gap: 2.5px;
  background: var(--lemon); border-radius: 11px; box-shadow: 0 4px 12px -4px #f2ae00b3;
}
.brand-mark i { width: 3px; border-radius: 3px; background: var(--navy); }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 11px; }
.brand-mark i:nth-child(4) { height: 6px; }
.health { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--surface); font-size: 12.5px; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9c0cc; }
.health-dot.ok { background: var(--success); box-shadow: 0 0 0 4px #2ea24c24; }
.health-dot.error { background: var(--error); box-shadow: 0 0 0 4px #e8607a24; }
.link-button { padding: 0; border: 0; color: var(--lemon-ink); background: transparent; font-weight: 700; }
.link-button:hover { text-decoration: underline; }

/* 첫 화면 */
.page { max-width: 1240px; margin: auto; padding: 52px 22px 80px; }
.intro { margin-bottom: 28px; }
.intro h1 { max-width: 760px; margin: 14px 0 12px; color: var(--navy); font-size: clamp(28px, 4.2vw, 44px); line-height: 1.22; letter-spacing: -1.4px; text-wrap: balance; }
.intro h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--lemon) 62%); }
.intro > p:last-child { margin: 0; color: var(--muted); font-size: 15px; }
.eyebrow, .section-label { display: inline-block; padding: 4px 10px; border-radius: 99px; color: var(--lemon-ink); background: var(--lemon-100); font-size: 10.5px; font-weight: 800; letter-spacing: 1px; }
.eyebrow { margin: 0; }
.card { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }

/* 화면 선택과 상담 목록 */
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.view-tab { padding: 9px 18px; border: 0; border-radius: 99px; color: var(--muted); background: transparent; font-size: 13.5px; font-weight: 800; transition: .15s ease; }
.view-tab.active { color: var(--navy); background: var(--lemon); box-shadow: 0 6px 14px -8px #f2ae00cc; }
.call-list { padding: 20px 22px 8px; margin-bottom: 18px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; }
.crumb { padding: 6px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 700; }
button.crumb:hover { color: var(--navy); background: var(--cream-2); }
.crumb.here, .breadcrumb .crumb:last-child { color: var(--navy); font-weight: 800; }
.crumb-sep { color: var(--faint); }
#callList.loading { opacity: .5; transition: opacity .15s ease; }
.period-row { display: grid; grid-template-columns: 150px 1fr 80px 84px 18px; align-items: center; gap: 14px; width: 100%; padding: 13px 8px; border: 0; border-top: 1px solid var(--line); border-radius: 10px; background: transparent; text-align: left; font-size: 14px; transition: background .12s ease; }
.period-row:first-child { border-top: 0; }
.period-row:hover { background: var(--cream); }
.period-row strong { color: var(--navy); }
.period-bar { height: 8px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.period-bar i { display: block; height: 100%; min-width: 3px; border-radius: 99px; background: #c9d6f2; overflow: hidden; }
.period-bar b { display: block; height: 100%; background: var(--error); }
.period-total { color: var(--navy); font: 700 13px var(--mono); text-align: right; }
.period-red { color: var(--faint); font-size: 12.5px; font-weight: 700; }
.period-red.on { color: #c23b57; }
.period-go { color: var(--faint); font-size: 18px; }
.more-calls { width: 100%; margin: 10px 0 14px; padding: 11px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; }
.more-calls:hover { border-color: var(--lemon-deep); background: var(--lemon-50); }
.list-options { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.company-pick { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.company-pick select { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--navy); background: #fff; font-weight: 700; }
.red-only { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.red-only input { width: 16px; height: 16px; accent-color: var(--error); }
#callList { max-height: 520px; overflow: auto; }
.call-row { display: grid; grid-template-columns: 30px 52px 118px 64px 1fr 48px; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-top: 1px solid var(--line); border-radius: 10px; background: transparent; text-align: left; font-size: 13.5px; transition: background .12s ease; }
.call-row:hover { background: var(--cream); }
.call-row.opened { background: var(--lemon-50); box-shadow: inset 3px 0 0 var(--lemon); }
.call-face { display: flex; }
.call-time, .call-length { color: var(--muted); font: 12.5px var(--mono); }
.call-length { text-align: right; color: var(--faint); }
.call-id { color: var(--navy); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-agent { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-words { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.opened-call { margin: 6px 2px 14px; color: var(--muted); font-size: 14px; scroll-margin-top: 80px; }
.opened-call strong { margin-right: 8px; color: var(--navy); font-size: 17px; }

/* 한 달을 모아 본 분석. 통화 수는 한 가지 푸른 색, 문제 상담은 붉은 색으로만 쓴다. 글자는 늘 글자 색이다. */
.fold > summary { padding: 13px 4px; color: var(--navy); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.fold > summary:hover { color: var(--ink); }
.page-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.page-links a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: .15s ease; }
.page-links a:hover { border-color: var(--lemon); box-shadow: 0 8px 18px -12px #f2ae00cc; }
.page-links strong { display: block; color: var(--navy); font-size: 14.5px; }
.page-links span { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; }
a.crumb { text-decoration: none; }
.crumb.back { margin-right: 10px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.call-back { margin-bottom: 12px; }
.month-report { padding: 8px 2px 14px; }
.month-compare { width: 100%; border-collapse: collapse; font-size: 13px; }
.month-compare th, .month-compare td { padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.month-compare thead th { border-top: 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.month-compare .number { color: var(--navy); font: 700 12.5px var(--mono); white-space: nowrap; }
.month-compare .bar { width: 22%; min-width: 90px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-tile { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.stat-tile span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.stat-tile strong { display: block; margin: 6px 0 4px; color: var(--navy); font-size: 26px; letter-spacing: -.6px; }
.stat-tile small { color: var(--faint); font-size: 12px; }
.report-block { margin-top: 22px; min-width: 0; }
.report-block h4 { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; color: var(--navy); font-size: 14.5px; }
.report-block h5 { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
.report-how, .report-note { margin: 0 0 10px; color: var(--faint); font-size: 12px; line-height: 1.6; }
.report-note { margin-top: 10px; }
.report-note i, .stat-rate i { margin-left: 2px; color: var(--warning); font-style: normal; font-weight: 800; }
.report-none { color: var(--faint); font-size: 12.5px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.report-grid .wide { grid-column: 1 / -1; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.swatch { display: inline-block; width: 11px; height: 11px; margin-left: 8px; border-radius: 3px; }
.swatch.calls { background: #9db2de; }
.swatch.red { background: var(--error); }
.swatch.risk-low { border-radius: 50%; background: rgb(246, 229, 233); border: 1px solid #e5c9d0; }
.swatch.risk-high { border-radius: 50%; background: rgb(184, 50, 78); }
.day-chart { display: flex; align-items: flex-end; gap: 2px; height: 132px; padding-top: 6px; }
.day-bar { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; }
.day-bar:disabled { cursor: default; }
.day-stack { display: flex; flex-direction: column; justify-content: flex-end; min-height: 2px; border-radius: 4px 4px 0 0; background: #9db2de; overflow: hidden; transition: filter .12s ease; }
.day-bar:disabled .day-stack { background: var(--cream-2); }
.day-stack b { display: block; background: var(--error); border-top: 2px solid var(--surface); }
.day-bar:not(:disabled):hover .day-stack { filter: brightness(.9); }
.day-bar small { margin-top: 5px; color: var(--faint); font: 10px var(--mono); text-align: center; }
.stat-row { display: grid; grid-template-columns: 112px 1fr 54px 78px; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.stat-row.few .stat-name, .stat-row.few .stat-rate { color: var(--faint); }
.stat-name { color: var(--navy); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-count { color: var(--navy); font: 700 12.5px var(--mono); text-align: right; }
.stat-rate { color: var(--muted); font-size: 12px; text-align: right; }
.period-bar i { background: #9db2de; }
.keyword.notable { border-width: 2px; border-color: var(--navy); }
.risk-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.week-row { display: grid; grid-template-columns: 110px 46px 1fr; align-items: start; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.week-name { color: var(--navy); font-weight: 700; }
.week-count { color: var(--muted); font: 12.5px var(--mono); text-align: right; }
.week-words { display: flex; flex-wrap: wrap; gap: 6px; }
.network { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.network line { stroke-linecap: round; }
.network .node circle { stroke: #fff; stroke-width: 2; }
.network .node.place circle { stroke: var(--navy); }
.network .node text { fill: var(--ink); font-size: 12px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; }

/* 올리기 */
.uploader { padding: 22px; }
.drop-zone {
  min-height: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; padding: 24px; border: 1.5px dashed var(--line-strong); border-radius: 16px;
  color: var(--muted); background: var(--cream); text-align: center; transition: .18s ease; cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--lemon-deep); background: var(--lemon-50); }
.drop-zone:hover .upload-icon, .drop-zone.dragging .upload-icon { transform: translateY(-3px) rotate(90deg); }
.drop-zone.has-file { border-style: solid; border-color: var(--lemon); background: var(--lemon-50); }
.drop-zone input { display: none; }
.drop-zone strong { color: var(--navy); font-size: 15.5px; }
.drop-zone > span:last-child { font-size: 12px; color: var(--faint); letter-spacing: .3px; }
.upload-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--navy); background: var(--lemon); font-size: 24px; box-shadow: 0 6px 16px -6px #f2ae00cc; transition: transform .25s ease; }
.options { display: grid; grid-template-columns: minmax(250px, 1.4fr) 150px 1fr 170px; align-items: end; gap: 16px; margin-top: 18px; }
.options label > span:first-child { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.options input[type="number"], .options input[type="datetime-local"], .options select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; transition: .15s ease; }
.options input[type="number"]:focus, .options input[type="datetime-local"]:focus, .options select:focus { border-color: var(--lemon-deep); outline: none; box-shadow: 0 0 0 4px #ffc62940; }
.options small { display: block; margin-top: 6px; }
.primary-button { height: 46px; border: 0; border-radius: var(--radius); color: var(--navy); background: var(--lemon); font-weight: 800; box-shadow: 0 8px 18px -8px #f2ae00cc; transition: .15s ease; }
.primary-button:hover { background: var(--lemon-deep); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.status { min-height: 48px; padding: 16px 4px 10px; color: var(--muted); font-size: 14px; }
.status.error { color: #c23b57; }
/* 뒤에 오는 규칙(.results의 grid 등)이 display를 다시 켜지 못하게 한다. */
.hidden { display: none !important; }
.dashboard { padding: 22px 24px 14px; margin-bottom: 18px; }
.dashboard-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dashboard-head h3 { margin: 0; color: var(--navy); font-size: 17px; }
.dashboard-head span { color: var(--muted); font-size: 12.5px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; margin-top: 30px; padding-top: 10px; border-top: 1px solid var(--line); }
.dashboard .report-note { margin-top: 26px; }
.dashboard-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard h5.spaced { margin-top: 16px; }
/* 좁은 칸(한눈에 보기의 세 칸)에서도 범례 글자가 잘리지 않게 그림 아래로 내린다. */
.donut { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.donut svg { align-self: center; }
.donut svg { flex: 0 0 132px; width: 132px; height: 132px; }
.donut-value { fill: var(--navy); font-size: 22px; font-weight: 800; text-anchor: middle; }
.donut-note { fill: var(--muted); font-size: 10.5px; font-weight: 700; text-anchor: middle; }
.donut-legend { flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.donut-legend li { display: grid; grid-template-columns: 12px 1fr auto 38px; align-items: center; gap: 8px; padding: 4px 0; }
.donut-legend i { width: 11px; height: 11px; border-radius: 3px; }
.donut-legend span { color: var(--navy); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend b { color: var(--navy); font: 700 12px var(--mono); }
.donut-legend em { color: var(--muted); font-style: normal; text-align: right; }
.month-chart { gap: 10px; }
.month-chart .day-bar { max-width: 64px; }
.month-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.month-card { display: block; padding: 18px 20px 14px; border: 1px solid var(--line); border-top: 4px solid var(--tone); border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 7%, #fff), #fff 60%); text-decoration: none; transition: .18s ease; }
.month-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -22px color-mix(in srgb, var(--tone) 70%, transparent); }
.month-card h4 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.month-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 0; }
.month-card dt { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.month-card dd { margin: 3px 0 0; color: var(--navy); font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
.month-card em { margin-left: 4px; color: var(--muted); font-size: 11px; font-style: normal; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.compare-lines { width: 100%; height: auto; border-radius: 18px; background: linear-gradient(180deg, #fff, var(--cream)); }
.compare-lines .grid { stroke: var(--line); stroke-dasharray: 3 5; }
.compare-lines .axis { fill: var(--faint); font: 11px var(--mono); }
.side-bars { display: flex; align-items: stretch; gap: 6px; height: 170px; padding: 14px 14px 0; border-radius: 18px; background: linear-gradient(180deg, #fff, var(--cream)); }
.side-group { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.side-set { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.side-set i { flex: 1 1 0; max-width: 16px; border-radius: 5px 5px 0 0; transition: filter .12s ease; }
.side-set i:hover { filter: brightness(.88); }
.side-group small { padding: 6px 0 8px; color: var(--faint); font: 10.5px var(--mono); text-align: center; white-space: nowrap; }
.strip-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; padding: 6px 0; }
.strip-name { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-size: 13px; font-weight: 700; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.strip { display: flex; gap: 2px; height: 30px; border-radius: 99px; overflow: hidden; }
.strip i { display: flex; align-items: center; justify-content: center; min-width: 4px; font-style: normal; }
.strip b { color: #fff; font: 700 11.5px var(--mono); text-shadow: 0 1px 2px #0005; }
.strip-legend { margin-top: 8px; }
.shift-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.shift-row { display: grid; grid-template-columns: 1fr 150px 1fr; align-items: center; gap: 10px; padding: 4px 0; }
.shift-word { color: var(--navy); font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-bar { display: flex; align-items: center; gap: 8px; }
.shift-bar.left { justify-content: flex-end; }
.shift-bar i { height: 16px; min-width: 3px; border-radius: 99px; }
.shift-bar em { color: var(--muted); font: 700 11px var(--mono); font-style: normal; white-space: nowrap; }
/* 관리자: 운영 감시 */
.admin-panel { padding: 20px 22px; margin-bottom: 18px; }
.admin-panel h3 { margin: 0 0 6px; color: var(--navy); font-size: 17px; }
.space-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.space-card { padding: 16px 18px; border: 1px solid var(--line); border-top: 4px solid #9db2de; border-radius: 16px; background: var(--surface); text-align: left; transition: .15s ease; }
.space-card.warn { border-top-color: var(--error); }
.space-card:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -20px #16233f; }
.space-card h4 { margin: 0 0 10px; color: var(--navy); font-size: 15px; }
.space-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.space-card dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.space-card dd { margin: 2px 0 0; color: var(--navy); font: 800 16px var(--mono); }
.space-card dd.bad { color: var(--error); }
.space-card dd.hot { color: var(--warning); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th, .admin-table td { padding: 8px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table thead th { border-top: 0; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.admin-table tbody tr[data-job] { cursor: pointer; }
.admin-table tbody tr[data-job]:hover { background: var(--cream); }
.admin-table tr.bad td { color: #b8324e; }
.admin-table .number { font-family: var(--mono); white-space: nowrap; }
.trace-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.trace-actions { display: flex; gap: 8px; }
.trace-error { color: #b8324e; }
.timeline-list { margin: 14px 0 6px; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.timeline-list li { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 6px 0 6px 18px; font-size: 13px; }
.timeline-list li::before { content: ''; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: #9db2de; }
.timeline-list li.bad::before { background: var(--error); }
.timeline-list li.bad span { color: #b8324e; }
.timeline-list time { color: var(--muted); font: 12px var(--mono); }
.view-pick { margin: 6px 0 10px; }
.view-editor { width: 100%; min-height: 180px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; font: 12.5px var(--mono); }
.view-actions { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.view-actions .primary-button { width: 120px; }

.system-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.system-strip span { padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--surface); font-size: 12.5px; font-weight: 700; }
.system-strip span.bad { border-color: #f4c3cd; color: #b8324e; background: #fff5f7; }
.space-card h4 small { margin-left: 8px; color: var(--faint); font-size: 11px; font-weight: 700; }
.space-card dl { grid-template-columns: repeat(3, 1fr); }
.space-card p { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; }
.space-card p.hot { color: var(--warning); font-weight: 700; }
.admin-search { height: 38px; min-width: 230px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 99px; background: #fff; font-size: 13px; }
.admin-panel > #jobsMore { margin-top: 12px; }
.crumb.back.small { margin: 0 0 0 8px; padding: 3px 10px; font-size: 11.5px; }
.crumb.back:disabled { opacity: .45; cursor: default; }
.view-field { display: block; margin: 12px 0; }
.view-field > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.view-field input[type="text"] { width: 320px; max-width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.view-hide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; }
.view-hide b { display: block; margin-bottom: 6px; color: var(--navy); font-size: 12.5px; }
.view-hide label { display: flex; align-items: center; gap: 7px; padding: 2px 0; color: var(--ink); font-size: 13px; }
.view-field .view-editor { min-height: 90px; }

/* 다른 서비스의 화면 안에 넣었을 때: 머리글과 회사 선택을 빼고 여백을 줄인다. */
body.embed .topbar, body.embed .company-pick, body.embed #reportCompany { display: none; }
body.embed .page { max-width: none; padding: 16px 18px 40px; }
body.embed { background: transparent; }
body.analysis-home #listView .call-list { display: none; }
.month-step { display: inline-flex; align-items: center; gap: 10px; }
.month-step select { height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--navy); font-size: 14px; font-weight: 800; }
.month-checks { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 12px; border-bottom: 1px solid var(--line); }
.month-check { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--navy); background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer; }
.month-check:has(input:checked) { border-color: var(--lemon-deep); background: var(--lemon-100); }
body:not(.admin) .admin-only { display: none; }
/* 단어 정렬은 개발용이다. 관리자 화면에서만 보인다. */
body:not(.admin) .alignment-details { display: none; }
body:not(.login) #loginView, body.login main > :not(#loginView) { display: none; }
.login-card { max-width: 380px; margin: 60px auto; padding: 30px 30px 24px; }
.login-card h2 { margin: 0 0 20px; color: var(--navy); font-size: 20px; }
.login-card label { display: block; margin-bottom: 14px; }
.login-card label span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.login-card input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.login-card input:focus { border-color: var(--lemon-deep); outline: none; box-shadow: 0 0 0 4px #ffc62940; }
.login-card .primary-button { width: 100%; margin-top: 6px; }
.login-error { min-height: 18px; margin: 12px 0 0; color: var(--error); font-size: 12.5px; }

/* 진행 단계 */
.pipeline-progress { margin-bottom: 18px; padding: 22px; }
.pipeline-elapsed { padding: 5px 10px; border-radius: 99px; color: var(--navy); background: var(--cream-2); font: 700 13px var(--mono); }
.pipeline-track { height: 8px; margin-bottom: 18px; overflow: hidden; border-radius: 999px; background: var(--cream-2); }
.pipeline-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lemon), var(--lemon-deep)); transition: width .35s ease; }
.pipeline-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 9px; }
.pipeline-step { position: relative; min-width: 0; padding: 13px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); transition: .2s ease; }
.pipeline-step > div { min-width: 0; padding-top: 9px; }
.pipeline-step strong, .pipeline-step small { display: block; }
.pipeline-step strong { font-size: 12px; color: var(--navy); }
.pipeline-step small { min-height: 30px; margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.step-indicator { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: var(--faint); background: var(--cream-2); font-size: 11px; font-style: normal; font-weight: 800; }
.step-state { display: block; margin-top: 8px; color: var(--faint); font-size: 10px; font-weight: 800; }
.pipeline-step.running { border-color: var(--lemon); background: var(--lemon-50); box-shadow: 0 0 0 4px #ffc62926; }
.pipeline-step.running .step-indicator { color: var(--navy); background: var(--lemon); animation: stage-pulse 1.2s ease-in-out infinite; }
.pipeline-step.running .step-state { color: var(--lemon-ink); }
.pipeline-step.completed { border-color: #cdebd5; background: #f3faf4; }
.pipeline-step.completed .step-indicator { color: #fff; background: var(--success); }
.pipeline-step.completed .step-state { color: #1f7d38; }
.pipeline-step.fallback { border-color: #f3d6ae; background: #fff8ee; }
.pipeline-step.fallback .step-indicator { color: #fff; background: var(--warning); }
.pipeline-step.failed { border-color: #f4c3cd; background: #fff5f7; }
.pipeline-step.failed .step-indicator { color: #fff; background: var(--error); }
.pipeline-step.failed .step-state { color: #c23b57; }
.pipeline-step.irrelevant { display: none; }
.pipeline-step.skipped { opacity: .58; }
.pipeline-step.skipped .step-state { color: var(--faint); }
@keyframes stage-pulse { 50% { transform: scale(.88); box-shadow: 0 0 0 5px #ffc62933; } }

/* 결과 */
.results { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr); gap: 18px; }
.player-panel, .transcript-panel { padding: 22px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-heading h2 { margin: 8px 0 0; color: var(--navy); font-size: 18px; letter-spacing: -.3px; }
.muted, .timeline-scale { color: var(--muted); font: 12px var(--mono); }
audio { width: 100%; height: 42px; }
.timeline { position: relative; height: 54px; margin-top: 18px; overflow: hidden; border-radius: var(--radius); background: var(--cream-2); }
.timeline-mark { position: absolute; top: 9px; height: 36px; min-width: 3px; border: 0; border-radius: 6px; opacity: .9; transition: transform .12s ease; }
.timeline-mark:hover { opacity: 1; transform: scaleY(1.12); outline: 2px solid var(--navy); }
.timeline-scale { display: flex; justify-content: space-between; margin-top: 8px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.metrics > div { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.metrics strong { display: block; margin-bottom: 4px; color: var(--navy); font-size: 23px; letter-spacing: -.5px; }
.metrics span { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 7px; }
.actions button { padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--navy); background: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .4px; transition: .15s ease; }
.actions button:hover { border-color: var(--lemon-deep); background: var(--lemon-50); }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.filter { padding: 7px 13px; border: 0; border-radius: 999px; color: var(--navy); background: var(--cream-2); font-size: 12px; font-weight: 800; transition: .15s ease; }
.filter:hover { transform: translateY(-1px); }
.filter.active { box-shadow: inset 0 0 0 2px var(--navy); }
.segments { max-height: 560px; overflow: auto; }
.segment { display: grid; grid-template-columns: 76px 78px 1fr; gap: 10px; padding: 13px 8px; border-top: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: background .12s ease; }
.segment:hover { background: var(--cream); }
.segment.current { background: var(--lemon-50); box-shadow: inset 3px 0 0 var(--lemon); }
.segment-time { padding-top: 3px; color: var(--faint); font: 11px var(--mono); }
.speaker { align-self: start; padding: 5px 8px; border-radius: 99px; color: var(--navy); text-align: center; font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segment-text { line-height: 1.65; font-size: 14.5px; letter-spacing: .01em; overflow-wrap: anywhere; }
.empty { padding: 55px 10px; color: var(--faint); text-align: center; }

/* 단계별 결과 */
.analysis-panel { grid-column: 1 / -1; padding: 22px; }
.analysis-badge { padding: 6px 12px; border-radius: 999px; color: var(--lemon-ink); background: var(--lemon-100); font-size: 12px; font-weight: 800; }
.analysis-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.analysis-metrics > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.analysis-metrics span, .analysis-metrics small { display: block; color: var(--muted); font-size: 11px; }
.analysis-metrics strong { display: block; margin: 6px 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.analysis-metrics-compact { grid-template-columns: repeat(5, 1fr); }
.correction-note { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.raw-transcript { margin-top: 7px; padding: 7px 10px; border-left: 3px solid var(--line-strong); border-radius: 0 8px 8px 0; color: var(--muted); background: var(--cream); font-size: 12px; }
.lexical-change { display: inline-block; margin: 5px 5px 0 0; padding: 3px 8px; border-radius: 99px; color: #1f7d38; background: #e6f5ea; font-size: 11px; }
.alignment-details { margin-top: 8px; color: var(--muted); font-size: 11px; }
.alignment-details summary { cursor: pointer; }
.alignment-row { display: flex; flex-wrap: wrap; gap: 4px; max-height: 125px; margin-top: 7px; overflow-y: auto; }
.alignment-token { padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: 10px var(--mono); }
.analysis-details { margin-top: 8px; }
.analysis-details summary { cursor: pointer; color: var(--muted); font-size: 11px; }
.correction-trace { margin-top: 6px; max-height: 160px; overflow-y: auto; }
.correction-trace-row { padding: 4px 0; border-top: 1px solid var(--line); font-size: 11px; font-family: var(--mono); line-height: 1.5; overflow-wrap: anywhere; }
.correction-trace-row:first-child { border-top: none; }
.correction-trace-panel { grid-column: 1 / -1; }
.correction-trace-panel .correction-trace { max-height: 260px; }
.correction-trace-row[data-seek] { cursor: pointer; }
.correction-trace-row[data-seek]:hover { color: var(--lemon-ink); }
.stage-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.stage-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.stage-card span, .stage-card strong, .stage-card small { display: block; }
.stage-card span { color: var(--muted); font-size: 12px; }
.stage-card.failed { border-color: #f4c3cd; background: #fff5f7; }
.stage-card.skipped { opacity: .7; }
.stage-detail { max-height: 240px; overflow: auto; font-size: 11px; white-space: pre-wrap; word-break: break-all; }

/* 통화 분석. 얼굴 하나가 판정을 말하고, 나머지는 조용하게 둔다. */
.call-analysis { grid-column: 1 / -1; padding: 0; overflow: hidden; }
.call-analysis #callAnalysis { padding: 26px 28px 22px; }
.face circle:first-child { fill: #e3f4e7; stroke: var(--success); stroke-width: 1.4; }
.face g { stroke: #1f7d38; }
.face .eye { fill: #1f7d38; }
.face.bad circle:first-child { fill: #fde4e9; stroke: var(--error); }
.face.bad g { stroke: #c23b57; }
.face.bad .eye { fill: #c23b57; }
.analysis-warnings { margin: 0 0 4px; padding: 12px 14px 12px 30px; border: 1px solid #f3d6ae; border-radius: var(--radius); color: #8a5a12; background: #fff8ee; font-size: 13px; line-height: 1.6; }
.verdict + .analysis-warnings { margin-top: 16px; }
.analysis-waiting { margin: 0; color: var(--muted); font-size: 14px; }
.verdict { display: flex; align-items: center; gap: 20px; padding-bottom: 22px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.verdict .face { flex: none; }
.verdict h2 { margin: 0; color: var(--navy); font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.8px; line-height: 1.25; }
.verdict p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.call-analysis.is-red { border-color: #f4c3cd; box-shadow: 0 1px 2px #e8607a14, 0 16px 36px -16px #e8607a55; }
.call-analysis.is-red .verdict h2 { color: #b8324e; }
.analysis-row { display: grid; grid-template-columns: 124px 1fr; align-items: start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.analysis-row > span { padding-top: 3px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.flow { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-dot { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: #9fd6ae; transition: transform .12s ease; }
.flow-dot.bad { background: var(--error); }
.flow-dot:hover { transform: scale(1.25); }
.keyword-line { display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-line .keyword { padding: 5px 12px; font-size: 13px; }
.evidence-list { display: grid; gap: 6px; }
.evidence-list details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.evidence-list details[open] summary { margin-bottom: 6px; }
.evidence-list details .evidence { margin-bottom: 6px; width: 100%; }
.evidence-title { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.evidence { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--error); border-radius: 10px; background: #fff; text-align: left; font-size: 13.5px; line-height: 1.55; transition: background .15s ease; }
.evidence:hover { background: var(--lemon-50); }
.evidence b { margin-right: 8px; color: var(--muted); font-size: 11px; }
.analysis-more { border-bottom: 0; padding-bottom: 0; }
.score-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.score-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }
.score-card span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.score-card strong { display: block; margin: 4px 0 2px; color: var(--navy); font-size: 26px; letter-spacing: -.5px; }
.score-card em { display: block; margin-top: 6px; color: var(--navy); font-size: 14px; font-style: normal; font-weight: 700; overflow-wrap: anywhere; }
.score-card small { display: block; margin-top: 5px; color: var(--faint); font-size: 11px; line-height: 1.5; }
.score-card.on { border-color: #f4c3cd; background: #fff5f7; }
.score-card.on strong { color: #c23b57; }
.analysis-note { margin: 12px 0 0; color: var(--faint); font-size: 11.5px; }
.utterance-face { display: inline-flex; margin-right: 7px; vertical-align: -4px; }
.keyword { padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: #fff; font-size: 11.5px; line-height: 1.4; }
.keyword i { margin-left: 5px; color: var(--faint); font-size: 10px; font-style: normal; font-weight: 800; }
.keyword.place { border-color: #c9d6f2; color: var(--navy); background: #eef3fc; font-weight: 700; }
.keyword.proper { border-color: #dccff3; color: #5b3fa0; background: #f5f0fc; }
.keyword.action { border-color: var(--lemon-100); color: var(--lemon-ink); background: var(--lemon-50); font-weight: 700; }

@media (max-width: 760px) {   /* 레몬톡 分析 영역(약 900px)에서는 여러 칸 배치를 유지한다 */
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .report-grid, .risk-pair, .dashboard-grid, .dashboard-grid.two { grid-template-columns: 1fr; }
  .analysis-row { grid-template-columns: 1fr; gap: 8px; }
  .verdict .face { width: 48px; height: 48px; }
  .results { grid-template-columns: 1fr; }
  .analysis-metrics { grid-template-columns: repeat(3, 1fr); }
  .pipeline-steps { grid-template-columns: repeat(3, 1fr); }
  .options { grid-template-columns: 150px 1fr 150px; }
}
@media (max-width: 600px) {
  .call-row { grid-template-columns: 26px 46px 1fr 40px; }
  .call-agent, .call-words { display: none; }
  .period-row { grid-template-columns: 1fr 70px 70px 14px; }
  .period-bar { display: none; }
  .topbar { padding: 0 14px; }
  .health #healthText, .brand small { display: none; }
  .page { padding: 30px 14px 50px; }
  .options { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .analysis-metrics, .analysis-details { grid-template-columns: 1fr 1fr; }
  .pipeline-steps { grid-template-columns: 1fr; }
  .segment { grid-template-columns: 64px 70px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 상담 하나의 화면: 레몬톡 分析 영역(약 900px)에서는 타임라인과 스크립트를 위아래로 놓는다(스크립트 칸이 좁아지지 않게).
   .results의 기본 배치보다 뒤에 있어야 이긴다. */
@media (max-width: 1000px) { .results { grid-template-columns: 1fr; } }

/* 월간 조회·월간 비교: 칸과 칸 사이를 넓히고 가는 선으로 가른다(제목·범례·그림이 붙어 보이지 않게). */
.month-report > .report-block, .month-report > .report-grid, .month-report > details { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.month-report .report-grid { row-gap: 26px; }
.month-report .report-grid > .report-block { margin-top: 0; }
.month-report .report-block h4 { margin-bottom: 16px; }
.month-report .report-how { margin-bottom: 14px; }
.month-report .side-bars, .month-report .compare-lines, .month-report .day-chart { margin-top: 4px; }
/* 월간 비교의 요일별·시간대별: 범례는 두 그림 위에 한 번만 둔다(왼쪽 범례가 오른쪽 제목에 붙어 보이지 않게). */
.report-grid.pair { column-gap: 40px; }
.pair-legend { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-bottom: -10px; }

/* 월간 조회: 문의 유형의 근거 낱말, 확인할 문제 상담 */
.stat-name small { display: block; color: var(--faint); font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-group + .case-group { margin-top: 16px; }
.case-group h5 { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-size: 13.5px; }
.case-group h5 span { color: var(--muted); font-weight: 600; font-size: 12px; }
.case-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 10px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 8px; }
.case-row:hover { background: var(--hover, rgba(0,0,0,.035)); }
.case-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.case-quote { font-size: 13px; line-height: 1.6; }
.case-basis { padding: 2px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 760px) { .case-row { grid-template-columns: 1fr; gap: 4px; } }
