:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --panel: #ffffff;
  --panel-soft: #f6f6f3;
  --ink: #1d1d20;
  --muted: #6a7077;
  --line: #e6e6e1;
  --accent: #1f6f64;
  --accent-soft: #e8f2ef;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 28, .05);
  --shadow: 0 1px 3px rgba(20, 24, 28, .06), 0 10px 30px rgba(20, 24, 28, .05);
  --sidebar-width: 300px;
  --rightbar-width: 290px;
  --sans: "Inter", "Google Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --terminal-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 6px minmax(420px, 1fr) 6px var(--rightbar-width);
  overflow: hidden;
}

.right-bar {
  background: var(--panel-soft);
  border-left: 1px solid var(--line);
  min-height: 0;
  overflow: auto;
  padding: 16px 12px;
}

/* 우측 리사이즈 핸들 + 접기 토글 */
.right-resize {
  border-right: 0;
  border-left: 1px solid var(--line);
  overflow: visible;
}
.panel-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  z-index: 5;
}
.panel-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* 접힌 상태 */
.shell.right-collapsed {
  grid-template-columns: var(--sidebar-width) 6px minmax(420px, 1fr) 6px 0;
}
.shell.right-collapsed .right-bar {
  padding: 0;
  border-left: 0;
  overflow: hidden;
}

.sidebar {
  background: var(--panel-soft);
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow: auto;
}

.sidebar { padding: 16px; }

.sidebar-resize {
  cursor: col-resize;
  background: var(--panel-soft);
  border-right: 1px solid var(--line);
  position: relative;
}

.sidebar-resize::before {
  content: "";
  position: absolute;
  inset: 0 2px;
  background: transparent;
}

.sidebar-resize:hover::before,
.shell.resizing .sidebar-resize::before {
  background: #c9cdc7;
}

.shell.resizing,
.shell.resizing * {
  cursor: col-resize;
  user-select: none;
}

.brand-title {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}

.brand-title:hover {
  color: var(--accent);
}

.brand p, .eyebrow, .meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* 왼쪽 사이드바 nav를 브랜드에서 떨어뜨려 Chat을 아래로 */
.sidebar .note-tree {
  margin-top: 26px;
}

.search, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  font: inherit;
}

.search { margin: 16px 0 12px; }

button, .button {
  border: 1px solid #0f625b;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 9px 11px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button.secondary, .button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

button.small { padding: 5px 8px; font-size: 12px; }
button:disabled { opacity: .55; cursor: wait; }

.folder {
  margin-top: 14px;
}

.folder-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 5px;
  padding: 5px 4px;
  text-transform: uppercase;
  cursor: pointer;
}

.folder-title::before {
  content: "▾";
  width: 12px;
  color: #8b9299;
  font-size: 11px;
}

.folder.collapsed .folder-title::before {
  content: "▸";
}

.folder-title:hover {
  color: var(--ink);
}

.note-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 7px 8px;
  border-radius: 6px;
}

.note-item:hover, .note-item.active {
  background: #fff;
}

.note-item.index-item {
  font-weight: 650;
}

.note-item.page-item {
  margin-bottom: 2px;
  font-weight: 650;
}

.note-item.index-item,
.note-item.page-item,
.note-item.index-item:hover,
.note-item.page-item:hover,
.note-item.index-item.active,
.note-item.page-item.active {
  background: transparent;
}

.note-item.index-item.active,
.note-item.page-item.active {
  color: var(--accent);
}

.note-item.utility-item {
  color: #46515c;
  padding-left: 18px;
}

.note-item.utility-item.active {
  background: #fff;
  color: var(--accent);
}

/* Chat: 메인 메뉴처럼 눈에 띄되, 선택 상태를 표시 */
.note-item.chat-main {
  display: block;
  margin-bottom: 10px;
  padding: 11px 14px;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}
.note-item.chat-main:hover {
  background: var(--accent-soft);
}

/* 현재 표시중인 메뉴(=활성 탭) 옆에 초록 동그라미 */
.note-item.active::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}

.note-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);   /* tab-bar, header, content */
  background: var(--panel);
}

/* top view tabs (browser-like) */
.tab-bar {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 6px 10px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab-bar.empty { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 4px 7px 12px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  color: #5a636b;
  font-size: 13px;
  white-space: nowrap;
}
.tab:hover { background: rgba(0, 0, 0, .04); }
.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
  position: relative;
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.tab.active .tab-close { color: rgba(255, 255, 255, .8); }
.tab.active .tab-close:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.tab-label {
  border: 0; background: transparent; color: inherit; font: inherit;
  cursor: pointer; padding: 0;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tab-close {
  border: 0; background: transparent; color: #9aa3ab; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 5px;
}
.tab-close:hover { background: rgba(0, 0, 0, .1); color: #333; }

.note-top {
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.note-heading {
  min-width: 0;
}

.note-heading .eyebrow {
  display: none;
}

.note-top h2 {
  margin: 2px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.note-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #46515c;
  font-size: 24px;
  line-height: 1;
}

.note-back:hover {
  background: var(--panel-soft);
  color: var(--accent);
}

.source-link {
  display: none;
  width: fit-content;
  margin-top: 6px;
  color: #0b6f67;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid #9bc9c2;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 5px 7px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.auth-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #46515c;
  font-size: 12px;
}

.auth-logout {
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.note-content {
  grid-row: 3;   /* note-top이 숨겨져도 콘텐츠는 항상 1fr 행(전체 높이) */
  overflow: auto;
  padding: 28px;
  line-height: 1.65;
  width: 100%;
  max-width: none;
}

.note-content > :not(.table-wrap) {
  max-width: 980px;
}

.note-content h1 { font-size: 30px; margin: 0 0 20px; }
.note-content h2 { font-size: 20px; margin: 28px 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.note-content h3 { font-size: 16px; margin: 20px 0 8px; }
.note-content p { margin: 8px 0; }
.note-content ul { margin: 8px 0 12px 20px; padding: 0; }
.note-content a { color: #0b6f67; text-decoration: none; border-bottom: 1px solid #9bc9c2; }
.note-content code { background: #f1f3f5; border: 1px solid #e4e7eb; border-radius: 4px; padding: 1px 4px; }
.table-wrap { overflow-x: visible; margin: 12px auto 18px; border: 1px solid var(--line); border-radius: 8px; max-width: 1180px; }
.note-content table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.note-content th, .note-content td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; font-size: 14px; overflow-wrap: anywhere; }
.note-content th { background: #f3f5f1; color: #394047; font-weight: 650; }
.note-content tr:last-child td { border-bottom: 0; }
.table-extra-row.is-hidden { display: none; }
.table-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fafbf8;
  color: var(--muted);
  font-size: 13px;
}
.table-toggle {
  min-height: 34px;
  border: 1px solid #cbd6cf;
  border-radius: 6px;
  background: #fff;
  color: #0b6f67;
  font: inherit;
  font-weight: 650;
  padding: 0 12px;
  cursor: pointer;
}
.table-toggle:hover { border-color: #0b6f67; background: #f4fbf8; }

.workspace-panel {
  grid-row: 3;   /* note-top 숨김과 무관하게 항상 1fr 콘텐츠 행을 채움 */
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.graph-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.lab-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f7f8f6;
}

.terminal-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  background: #080b11;
}

.terminal-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: #d7dfdc;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  background:
    radial-gradient(circle at 28% 0, rgba(94, 111, 140, .13), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 160px),
    #090d14;
}

.terminal-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 16px 6px;
  border-bottom: 0;
}

.terminal-head h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
  color: #f0f2f6;
  text-shadow: 0 0 18px rgba(255,255,255,.08);
}

.terminal-head h3 span {
  color: #a5a9b3;
  font-size: .9em;
}

.terminal-head p {
  margin: 4px 0 0;
  color: #7c828e;
  font-size: 13px;
}

.terminal-head h4 {
  margin: 0;
  color: #eceff5;
  font-size: 17px;
  font-weight: 650;
  text-align: center;
  letter-spacing: 0;
}

.terminal-head .eyebrow {
  color: #8aa09b;
}

.terminal-head-right {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.measure-mode-toggle {
  display: inline-flex;
  border: 1px solid rgba(125, 136, 154, .34);
  border-radius: 7px;
  overflow: hidden;
}

.measure-mode-btn {
  min-width: 58px;
  padding: 5px 15px;
  border: 0;
  background: transparent;
  color: #8a93a1;
  font: 600 12.5px/1.2 var(--terminal-mono);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.measure-mode-btn + .measure-mode-btn {
  border-left: 1px solid rgba(125, 136, 154, .26);
}

.measure-mode-btn:hover {
  color: #d7dfdc;
}

.measure-mode-btn.active {
  background: rgba(236, 159, 35, .16);
  color: #f0a92b;
}

.measure-fy-toggle,
.measure-quarter-toggle {
  display: inline-flex;
  border: 1px solid rgba(125, 136, 154, .28);
  border-radius: 7px;
  overflow: hidden;
}

.measure-fy-btn,
.measure-quarter-btn {
  min-width: 64px;
  padding: 5px 13px;
  border: 0;
  background: transparent;
  color: #858e9d;
  font: 650 12px/1.2 var(--terminal-mono);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.measure-quarter-btn {
  min-width: 58px;
  padding-left: 11px;
  padding-right: 11px;
}

.measure-fy-btn + .measure-fy-btn,
.measure-quarter-btn + .measure-quarter-btn {
  border-left: 1px solid rgba(125, 136, 154, .22);
}

.measure-fy-btn:hover,
.measure-quarter-btn:hover {
  color: #d7dfdc;
}

.measure-fy-btn.active,
.measure-quarter-btn.active {
  background: rgba(97, 197, 183, .14);
  color: #61c5b7;
}

.terminal-status {
  justify-self: end;
  padding: 3px 9px 4px;
  border: 1px solid rgba(236, 159, 35, .86);
  border-radius: 5px;
  color: #f0a92b;
  background: rgba(236, 159, 35, .08);
  box-shadow: inset 0 0 12px rgba(236, 159, 35, .08);
  font-size: 14px;
  font-weight: 700;
}

.terminal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, .82fr);
  gap: 20px;
  padding: 0 16px 12px;
  overflow: hidden;
}

.measure-chart-panel {
  min-width: 0;
  min-height: 0;
  display: block;
}

.measure-chart {
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: block;
  border: 1px solid rgba(125, 136, 154, .16);
  background: #111722;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.38), 0 18px 48px rgba(0,0,0,.24);
}

.measure-side {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 30px;
  padding-top: 4px;
  scrollbar-color: #2f3947 transparent;
}

.measure-card {
  min-width: 0;
  padding: 2px 0 0;
}

.measure-card h4 {
  margin: 0 0 10px;
  color: #f0a22c;
  font-size: 17px;
  text-align: center;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(240, 162, 44, .14);
}

.measure-table {
  border-top: 1px solid rgba(150,158,174,.14);
}

.measure-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr .9fr;
  gap: 10px;
  align-items: center;
  min-height: 28px;
  border-bottom: 1px solid rgba(150,158,174,.07);
  color: #a4abb7;
  font-family: var(--terminal-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-size: 12px;
}

.measure-row > * {
  padding: 0 6px;
}

.measure-row.metric-row,
.measure-row.revision-row {
  grid-template-columns: minmax(56px, .7fr) minmax(92px, 1.5fr) minmax(60px, .8fr);
  justify-content: end;
}

.measure-row.broker-row {
  grid-template-columns: minmax(56px, .72fr) minmax(170px, 2.2fr);
}

.measure-row.metric-row.quarter-row {
  grid-template-columns: minmax(64px, .8fr) minmax(50px, .58fr) minmax(92px, 1.32fr) minmax(52px, .62fr);
}

.measure-row.metric-row.quarter-row > * {
  padding-left: 3px;
  padding-right: 3px;
}

.measure-row.metric-row span:first-child,
.measure-row.revision-row span:first-child,
.measure-row.broker-row span:first-child {
  justify-self: center;
  text-align: center;
  color: #7c8491;
}

.measure-row.metric-row.quarter-row span:nth-child(2) {
  justify-self: center;
  text-align: center;
  color: #9fa6b3;
}

.measure-row.metric-row.quarter-row.current-quarter {
  background: rgba(255, 105, 134, .08);
  box-shadow: inset 3px 0 0 #ff6986;
  color: #f0f2f7;
}

.measure-row.metric-row.quarter-row.current-quarter strong,
.measure-row.metric-row.quarter-row.current-quarter em {
  color: #ff6986;
  font-weight: 750;
}

.measure-row.measure-header {
  color: #78808d;
  font-weight: 650;
}

.measure-row.measure-header > * {
  justify-self: center;
  text-align: center;
}

.measure-row.current {
  color: #f0f2f7;
  font-weight: 650;
}

.measure-row strong {
  justify-self: end;
  text-align: right;
  padding-right: 16px;
  color: #dfe2ea;
  font-weight: 650;
}

.measure-row.broker-row strong {
  justify-self: stretch;
  text-align: center;
  padding-right: 8px;
  white-space: normal;
}

.measure-row.current strong {
  color: #ff6986;
  font-weight: 650;
}

.measure-row.current em {
  color: #f0a22c;
  font-weight: 750;
}

.measure-row em {
  justify-self: end;
  font-style: normal;
}

.measure-row em.up {
  color: #46c878;
}

.measure-row em.down {
  color: #e05970;
}

.measure-report-list {
  border-top: 1px solid rgba(150,158,174,.14);
  padding-top: 8px;
}

.measure-report {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0;
  color: #bbc0ca;
  font-family: var(--terminal-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-size: 12px;
  line-height: 1.45;
}

.measure-report span {
  color: #7c8491;
  text-align: right;
}

.measure-report-empty {
  padding: 14px 0 4px;
  color: #7c8491;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.measure-raw {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  background: rgba(255,255,255,.035);
  color: #9ea7b4;
  font: 11px/1.5 var(--terminal-mono);
  white-space: pre-wrap;
}

.terminal-muted {
  color: #8fa19c;
}

.terminal-prompt {
  color: #61c5b7;
  font-weight: 700;
}

.terminal-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-top: 1px solid rgba(150, 158, 174, .12);
  background: #0b1119;
  color: #9aa3b0;
  font: 12px var(--terminal-mono);
}

.terminal-feedback.hidden {
  display: none;
}

.terminal-feedback-loading {
  color: #f0a92b;
  background: rgba(236, 159, 35, .07);
}

.terminal-feedback-ok {
  color: #46c878;
  background: rgba(70, 200, 120, .07);
}

.terminal-feedback-warn {
  color: #e0b65a;
  background: rgba(224, 182, 90, .08);
}

.terminal-feedback-error {
  color: #ef7184;
  background: rgba(224, 89, 112, .1);
}

.terminal-feedback-info {
  color: #61c5b7;
  background: rgba(97, 197, 183, .07);
}

.terminal-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(240, 169, 43, .28);
  border-top-color: #f0a92b;
  border-radius: 50%;
  animation: terminal-spin .7s linear infinite;
  flex: none;
}

@keyframes terminal-spin {
  to { transform: rotate(360deg); }
}

.measure-row.measure-skeleton > span {
  height: 9px;
  margin: 0 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(150, 158, 174, .1) 25%, rgba(150, 158, 174, .22) 37%, rgba(150, 158, 174, .1) 63%);
  background-size: 360px 100%;
  animation: measure-shimmer 1.3s ease-in-out infinite;
}

@keyframes measure-shimmer {
  0% { background-position: -180px 0; }
  100% { background-position: 180px 0; }
}

.terminal-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 18px;
  border-top: 1px solid rgba(150,158,174,.12);
  background: #090d14;
}

.terminal-composer input {
  border-color: rgba(255,255,255,.12);
  background: #151b20;
  color: #eef5f3;
  font: 13px var(--terminal-mono);
}

.terminal-composer input:focus {
  border-color: #61c5b7;
  outline: 3px solid rgba(97, 197, 183, .14);
}

.terminal-composer button {
  min-width: 72px;
  border-color: #61a99f;
  background: #1f6f66;
}

.overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #ebecef;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
}

.overlay-head h2, .overlay-head h3 {
  margin: 2px 0 0;
  letter-spacing: 0;
}

.overlay-head.compact {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.graph-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  background: #fff;
  outline: none;
  touch-action: none;
}

.graph-canvas.panning {
  cursor: grabbing;
}

.chat-sheet {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #f7f8f6;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;   /* ChatGPT-style: messages + bottom composer */
  overflow: hidden;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e5df;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8f6 100%);
}

.chat-head h3 {
  margin: 2px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.chat-subtitle {
  margin: 6px 0 0;
  color: #64707a;
  font-size: 13px;
}

.chat-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 360px;
}

.preset {
  padding: 7px 10px;
  border-color: #d9ddd6;
  background: #fff;
  color: #394047;
  font-size: 13px;
}

.preset:hover {
  border-color: #9bc9c2;
  color: #0b6f67;
}

.chat {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* centered conversation column (ChatGPT-like) */
  padding: 28px max(20px, calc((100% - 840px) / 2)) 28px;
  background: #f7f8f6;
}

/* empty / landing state */
.chat-empty {
  margin: auto;
  max-width: 600px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
}
.chat-empty-brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent, #0b6f67);
}
.chat-empty h2 {
  margin: 6px 0 0;
  font-size: 30px;
  letter-spacing: -.5px;
}
.chat-empty p {
  margin: 0;
  color: #64707a;
  font-size: 14px;
  line-height: 1.6;
}
.chat-suggest {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}
.chat-suggest .preset {
  padding: 11px 16px;
  border: 1px solid #d9ddd6;
  border-radius: 20px;
  background: #fff;
  color: #394047;
  font-size: 14px;
  cursor: pointer;
}
.chat-suggest .preset:hover {
  border-color: #9bc9c2;
  color: #0b6f67;
  background: #fbfffe;
}

.msg {
  position: relative;
  width: fit-content;
  max-width: min(820px, 84%);
  border: 1px solid #dde2dc;
  border-radius: 10px;
  padding: 24px 14px 12px;
  white-space: pre-wrap;
  line-height: 1.55;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 24, 31, .05);
  overflow-wrap: anywhere;
}

.msg::before {
  position: absolute;
  top: 8px;
  left: 14px;
  color: #7a838c;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
}

.msg.assistant::before {
  content: "ATH Wiki";
}

.msg.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: #c8e0d9;
}

.msg.user::before {
  content: "You";
}

.msg a {
  color: #0b6f67;
  text-decoration: none;
  border-bottom: 1px solid #9bc9c2;
}

/* rendered markdown inside assistant chat messages */
.msg.assistant { white-space: normal; }
.msg .chat-p { margin: 0 0 10px; }
.msg .chat-p:last-child { margin-bottom: 0; }
.msg .chat-h { margin: 14px 0 7px; line-height: 1.3; font-weight: 700; }
.msg .chat-h:first-child { margin-top: 0; }
.msg h3.chat-h { font-size: 17px; }
.msg h4.chat-h { font-size: 15px; }
.msg h5.chat-h, .msg h6.chat-h { font-size: 14px; color: #3a434a; }
.msg .chat-list { margin: 6px 0 10px; padding-left: 22px; }
.msg .chat-list li { margin: 3px 0; }
.msg .chat-list li::marker { color: #8a949c; }
.msg .chat-quote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid #c5d2cb;
  color: #545e65;
  background: rgba(0, 0, 0, .02);
}
.msg .chat-hr { border: 0; border-top: 1px solid #e2e5df; margin: 12px 0; }
.msg .chat-code {
  margin: 8px 0;
  padding: 12px 14px;
  background: #0d1117;
  color: #e6edf3;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
}
.msg .chat-code code { font-family: "IBM Plex Mono", monospace; background: none; padding: 0; }
.msg .chat-code-inline {
  background: rgba(0, 0, 0, .06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .92em;
  font-family: "IBM Plex Mono", monospace;
}

.chat-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 8px 0 2px;
  overflow-x: auto;
  white-space: normal;
}

.chat-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
  line-height: 1.45;
}

.chat-table th,
.chat-table td {
  padding: 9px 10px;
  border: 1px solid #e0e5df;
  text-align: left;
  vertical-align: top;
}

.chat-table th {
  background: #f0f3ef;
  color: #323a40;
  font-size: 12px;
  font-weight: 700;
}

.chat-table td:first-child {
  white-space: nowrap;
  color: #5f6a73;
}

.chat-evidence {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf0eb;
  white-space: normal;
}

.chat-evidence-title {
  margin-bottom: 8px;
  color: #68727b;
  font-size: 11px;
  font-weight: 700;
}

.chat-evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chat-evidence-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(280px, 100%);
  padding: 8px 10px;
  border-color: #d8e2dd;
  background: #fbfcfb;
  color: #20272d;
  text-align: left;
  line-height: 1.25;
}

.chat-evidence-chip:hover {
  border-color: #8fbfb7;
  color: #0b6f67;
}

.chat-evidence-chip span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.chat-evidence-chip em {
  margin-top: 3px;
  color: #71808a;
  font-size: 11px;
  font-style: normal;
}

.msg-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: 2px;
}

.msg-actions button {
  padding: 8px 11px;
  border-color: #cbd8d4;
  background: #fff;
  color: #0b6f67;
  font-size: 13px;
}

.composer {
  padding: 14px max(20px, calc((100% - 840px) / 2)) 22px;
  border-top: 1px solid #e6e8e3;
  background: linear-gradient(180deg, rgba(247,248,246,0), #f7f8f6 40%);
}
.composer-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d9ddd6;
  border-radius: 26px;
  padding: 6px 6px 6px 20px;
  box-shadow: 0 6px 28px rgba(20, 24, 31, .07);
  transition: border-color .15s, box-shadow .15s;
}
.composer-inner:focus-within {
  border-color: #80bdb5;
  box-shadow: 0 8px 30px rgba(23, 115, 107, .12);
}
.composer-inner input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 11px 0;
  font-size: 15px;
  font-family: inherit;
}
.composer-inner #sendBtn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent, #0b6f67);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.composer-inner #sendBtn:hover { background: #0e8076; }
.composer-inner #sendBtn:disabled { opacity: .45; cursor: default; }

.lab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e5df;
  background: #fff;
}

.lab-head h3 {
  margin: 2px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.lab-body {
  min-height: 0;
  overflow: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lab-section {
  border: 1px solid #dfe4dd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

/* API 카드 섹션: 드래그로 높이 조절(아래 모서리) + 내부 스크롤 */
.lab-section:not(.lab-chat-section) {
  flex: 0 0 auto;
  height: 520px;
  min-height: 140px;
  max-height: 82vh;
  resize: vertical;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lab-chat-section {
  flex: 0 0 auto;
}

.lab-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid #edf0eb;
}

.lab-section-head h4 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.lab-count,
.lab-meta {
  color: #77818b;
  font-size: 12px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: #edf0eb;
  /* 카드 표출부 단일 스크롤 — 남는 공간을 채우고 끝까지 스크롤 */
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
}
.lab-section-head { flex: 0 0 auto; }

.api-card {
  padding: 13px;
  background: #fff;
}

.api-card.configured {
  background: #fbfefd;
}

.api-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.api-card-top p {
  margin: 0 0 3px;
  color: #68747d;
  font-size: 12px;
}

.api-card-top h5 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.api-card-top strong {
  padding: 3px 7px;
  border: 1px solid #d8ded7;
  border-radius: 999px;
  color: #69727c;
  font-size: 11px;
  letter-spacing: 0;
}

.api-card.configured .api-card-top strong {
  color: #0b6f67;
  border-color: #9bc9c2;
  background: #edf8f5;
}

.api-role {
  margin: 9px 0;
  color: #404950;
  font-size: 12.5px;
  line-height: 1.4;
}

.api-env {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.api-env span {
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11px;
  background: #f1f3f0;
  color: #6d7680;
}

.api-env span.ok {
  background: #e5f4ee;
  color: #0b6f67;
}

.api-env span.missing {
  background: #f8ece9;
  color: #9c4034;
}

.api-test-btn {
  margin-top: 12px;
}

.api-result {
  margin: 0;
  padding: 14px 16px;
  min-height: 120px;
  overflow: auto;
  border-top: 1px solid #edf0eb;
  background: #fbfcfb;
  color: #33404a;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.api-empty {
  padding: 16px;
  background: #fff;
  color: #68747d;
}

.lab-chat-section {
  display: grid;
  grid-template-rows: auto minmax(160px, 26vh) auto;
}

.lab-chat {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #f7f8f6;
}

.lab-msg {
  width: fit-content;
  max-width: min(860px, 88%);
  border: 1px solid #dde2dc;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lab-msg.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: #c8e0d9;
}

.lab-msg-detail {
  margin: 10px 0 0;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #edf0eb;
  border-radius: 6px;
  background: #fbfcfb;
  color: #33404a;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.lab-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px 15px;
  border-top: 1px solid #edf0eb;
  background: #fff;
}

.lab-composer input {
  border-radius: 8px;
  padding: 12px 13px;
}

.lab-composer button {
  min-width: 76px;
  border-radius: 8px;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: min(var(--sidebar-width), 38vw) 6px minmax(0, 1fr) 6px min(var(--rightbar-width), 30vw); }
  .shell.right-collapsed { grid-template-columns: min(var(--sidebar-width), 38vw) 6px minmax(0, 1fr) 6px 0; }
  .terminal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .measure-chart {
    min-height: 380px;
  }
  .measure-side {
    overflow: visible;
  }
  .terminal-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px 14px;
  }
  .terminal-head h4 {
    flex-basis: 100%;
    order: 3;
    text-align: left;
    font-size: 14px;
  }
  .terminal-head-right {
    order: 2;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
}

@media (max-width: 760px) {
  .shell, .shell.right-collapsed { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; }
  .sidebar-resize, .right-resize { display: none; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .right-bar { border-left: 0; border-top: 1px solid var(--line); max-height: 38vh; }
  .note-top { padding: 14px 16px; align-items: flex-start; flex-direction: column; }
  .top-actions { flex-wrap: wrap; }
  .note-content { padding: 18px; }
  .chat-head { flex-direction: column; padding: 16px; }
  .chat-presets { justify-content: flex-start; max-width: none; }
  .chat { padding: 16px; }
  .msg { max-width: 94%; }
  .composer { padding: 12px; }
  .lab-body { padding: 16px; }
  .lab-head { padding: 16px; }
  .terminal-head {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
    padding: 14px 16px 10px;
  }
  .terminal-head h4 {
    text-align: left;
  }
  .terminal-status {
    justify-self: start;
  }
  .terminal-body {
    padding: 0 14px 14px;
  }
  .measure-chart {
    min-height: 360px;
  }
  .terminal-composer {
    grid-template-columns: 1fr;
  }
}

/* ===================== NotebookLM-style theme refinements ===================== */
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* sidebar: clean white panel */
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; }
.brand-title { font-size: 20px; letter-spacing: -.3px; }
.search { border-radius: 12px; padding: 10px 14px; background: var(--panel-soft); border-color: var(--line); font-size: 13.5px; }
.search:focus { background: #fff; border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.note-item, .folder-title { border-radius: 10px; }
.note-item { padding: 8px 10px; font-size: 13px; transition: background .12s; }
.note-item:hover, .note-item.active { background: var(--accent-soft); }

/* buttons: Material rounded */
button, .button { border-radius: 999px; border: 1px solid transparent; font-weight: 600; padding: 9px 16px; box-shadow: var(--shadow-sm); transition: filter .12s, background .12s; }
button.secondary, .button.secondary { background: #fff; border-color: var(--line); box-shadow: none; }
button.secondary:hover, .button.secondary:hover { background: var(--panel-soft); }

/* tabs */
.tab-bar { padding: 8px 14px 0; background: var(--panel); }
.tab { border-radius: 11px 11px 0 0; font-size: 12.5px; }

/* header + readable note column (document feel) */
.note-top { padding: 16px 28px; border-bottom: 1px solid var(--line); }
.note-top h2 { font-weight: 700; letter-spacing: -.3px; }
.note-content { padding: 36px 28px 60px; }
.note-content > :not(.table-wrap) { max-width: 760px; margin-left: auto; margin-right: auto; }

/* panels */
.workspace-panel { background: var(--panel); }

/* chat: clean & flat (assistant plain text, user soft bubble) */
.chat, .chat-sheet, .composer { background: var(--panel); }
.composer { border-top: 1px solid var(--line); }
.msg.assistant { border: 0; background: transparent; box-shadow: none; padding: 6px 0; max-width: 100%; white-space: normal; }
.msg.assistant::before { display: none; }
.msg.user { background: var(--accent-soft); border: 0; border-radius: 18px; padding: 11px 16px; box-shadow: none; max-width: min(560px, 85%); }
.msg.user::before { display: none; }
.chat-empty h2 { letter-spacing: -.5px; }
.chat-suggest .preset { border-radius: 999px; box-shadow: var(--shadow-sm); }
.composer-inner { border-radius: 28px; box-shadow: var(--shadow); }

/* thinking indicator (대기 중 체감속도용) */
.thinking { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; padding: 2px 0; }
.thinking-dots { display: inline-flex; gap: 4px; }
.thinking-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; animation: thinking-bounce 1.2s ease-in-out infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .18s; }
.thinking-dots i:nth-child(3) { animation-delay: .36s; }
.thinking-text { font-weight: 500; }
.thinking-time { color: #a4a9a2; font-variant-numeric: tabular-nums; font-size: 13px; }
@keyframes thinking-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }

/* refined scrollbars */
* { scrollbar-width: thin; scrollbar-color: #d3d5cf transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #d7d9d2; border-radius: 8px; border: 3px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background: #bcbfb7; }

/* Small-screen responsive overrides: keep desktop behavior unchanged. */
@media (max-width: 1100px) {
  .terminal-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .measure-chart {
    height: auto;
    min-height: 380px;
    aspect-ratio: 16 / 10;
  }

  .measure-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    overflow: visible;
  }

  .measure-side .measure-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .shell,
  .shell.right-collapsed {
    height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .sidebar-resize,
  .right-resize {
    display: none;
  }

  .sidebar {
    max-height: 32dvh;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

  .right-bar {
    max-height: 30dvh;
    overflow: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px;
  }

  .note-pane {
    min-height: 0;
  }

  .note-top {
    padding: 12px 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .note-top h2 {
    font-size: 21px;
    line-height: 1.25;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .top-actions > * {
    max-width: 100%;
  }

  .note-content {
    padding: 18px 14px 36px;
  }

  .note-content h1 {
    font-size: 26px;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .note-content table {
    min-width: 640px;
    table-layout: auto;
  }

  .chat {
    padding: 16px 12px 18px;
  }

  .chat-empty {
    padding: 24px 4px;
  }

  .chat-empty h2 {
    font-size: 26px;
  }

  .msg,
  .msg.assistant {
    max-width: 100%;
  }

  .msg.user {
    max-width: 92%;
  }

  .chat-table {
    min-width: 560px;
  }

  .composer {
    padding: 10px 12px 14px;
  }

  .composer-inner {
    border-radius: 22px;
    padding-left: 14px;
  }

  .terminal-shell {
    min-height: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .terminal-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 12px;
    gap: 10px;
  }

  .terminal-head h3 {
    font-size: 20px;
    line-height: 1.25;
  }

  .terminal-head p {
    font-size: 12px;
  }

  .terminal-head h4 {
    order: initial;
    flex-basis: auto;
    text-align: left;
    font-size: 13px;
  }

  .terminal-head-right {
    justify-self: start;
    order: initial;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .terminal-status {
    justify-self: start;
    font-size: 12px;
  }

  .terminal-body {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 10px 12px;
    overflow: auto;
  }

  .measure-chart {
    min-height: 300px;
    aspect-ratio: 4 / 3;
  }

  .measure-side {
    grid-template-columns: 1fr;
    gap: 20px;
    overflow: visible;
  }

  .measure-side .measure-card:last-child {
    grid-column: auto;
  }

  .measure-card h4 {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .measure-row {
    gap: 6px;
    font-size: 11px;
  }

  .measure-row.metric-row.quarter-row {
    grid-template-columns: minmax(58px, .75fr) minmax(44px, .55fr) minmax(82px, 1.2fr) minmax(40px, .5fr);
  }

  .measure-row.broker-row {
    grid-template-columns: minmax(48px, .6fr) minmax(150px, 2fr);
  }

  .terminal-composer {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .terminal-prompt {
    display: none;
  }

  .overlay-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .graph-canvas {
    min-height: 360px;
  }

  .lab-head,
  .lab-body {
    padding: 14px;
  }

  .lab-section:not(.lab-chat-section) {
    height: 420px;
    max-height: 72dvh;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 18px;
  }

  .sidebar .note-tree {
    margin-top: 14px;
  }

  .note-item {
    padding: 7px 8px;
  }

  .right-bar {
    max-height: 26dvh;
  }

  .sidebar {
    max-height: 30dvh;
  }

  .note-top h2 {
    font-size: 19px;
  }

  .note-content {
    font-size: 14px;
  }

  .note-content h1 {
    font-size: 24px;
  }

  .note-content h2 {
    font-size: 18px;
  }

  .chat-suggest .preset {
    width: 100%;
    justify-content: center;
  }

  .measure-chart {
    min-height: 260px;
  }

  .measure-row {
    min-height: 26px;
    font-size: 10.5px;
  }

  .measure-row > * {
    padding: 0 3px;
  }

  .measure-row.metric-row,
  .measure-row.revision-row {
    grid-template-columns: minmax(48px, .75fr) minmax(82px, 1.35fr) minmax(50px, .75fr);
  }

  .measure-row.metric-row.quarter-row {
    grid-template-columns: minmax(54px, .76fr) minmax(40px, .56fr) minmax(72px, 1.15fr) minmax(36px, .48fr);
  }

  .measure-row.broker-row {
    grid-template-columns: minmax(44px, .6fr) minmax(126px, 2fr);
  }

  .terminal-status {
    font-size: 12px;
  }

  .measure-mode-btn {
    min-width: 48px;
    padding: 5px 11px;
  }

  .measure-fy-btn {
    min-width: 56px;
    padding: 5px 10px;
  }

  .measure-quarter-btn {
    min-width: 44px;
    padding: 5px 8px;
  }

}
