/* 머니시트 — 엑셀 창처럼 보이는 실시간 경제뉴스 리더 */

:root {
  --green: #107c41;
  --green-dark: #0e6b38;
  --ink: #201f1e;
  --ink-soft: #4a4a48;
  --muted: #797775;
  --line: #d6d3d1;
  --line-soft: #e9e7e5;
  --grid: #d4d2d0;
  --paper: #ffffff;
  --chrome: #f3f2f1;
  --chrome-2: #faf9f8;
  --head: #f5f4f2;
  --sel: #e8f2ec;
  --sel-line: #107c41;
  --hot: #c0392b;
  /* 주목도 행 배경 — 글자가 묻히지 않게 아주 옅은 단계로만 올린다 */
  --attn-mid:  #fdf7e4;
  --attn-high: #fceccf;
  --attn-peak: #fadbd0;
  --warm: #d99100;
  --gov: #7d4fa8;
  --link: #1a5fb4;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.06);
  --row-h: 30px;
  --side-w: 336px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕",
          "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: "Consolas", "SFMono-Regular", "D2Coding", ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* display 를 지정한 클래스가 [hidden] 을 이겨버리는 사고를 막는다 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--chrome);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  -webkit-text-size-adjust: 100%;
}

button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  /* grid-template-rows 로 두면 모바일에서 .ribbon 이 사라질 때 트랙이 한 칸씩 밀려
     본문이 auto 트랙을 차지하고 하단바가 화면 밖으로 나간다. flex 는 그럴 일이 없다. */
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--chrome);
}
.app > .titlebar,
.app > .ribbon-tabs,
.app > .ribbon,
.app > .formula-bar,
.app > .bottombar { flex: none; }
.app > .sheets-grid { flex: 1 1 auto; min-height: 0; }

/* ── 제목 표시줄 ───────────────────────────────────────── */
.titlebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  background: var(--green);
  color: #fff;
}
.quick { display: flex; align-items: center; gap: 4px; }
.app-icon {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 3px;
  background: #fff; color: var(--green);
  font-weight: 800; font-size: 13px;
}
.autosave {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px; border: 0; border-radius: 3px;
  background: rgba(255,255,255,.14); color: #fff; white-space: nowrap;
}
.autosave:hover { background: rgba(255,255,255,.24); }
.autosave-label { font-size: 11.5px; }
.switch {
  display: inline-block; position: relative;
  width: 26px; height: 13px; border-radius: 7px;
  background: #fff; transition: background .15s;
}
.switch i {
  position: absolute; top: 2px; left: 14px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); transition: left .15s;
}
.autosave.off .switch { background: rgba(255,255,255,.35); }
.autosave.off .switch i { left: 2px; background: #fff; }
.qbtn {
  display: grid; place-items: center;
  width: 24px; height: 24px; border: 0; border-radius: 3px;
  background: transparent; color: #fff;
}
.qbtn:hover { background: rgba(255,255,255,.18); }
.qbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.qbtn.spin svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.book-title { text-align: center; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-suffix { opacity: .75; margin-left: 5px; }

.window { display: flex; align-items: center; gap: 6px; }
.search {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 3px;
  background: rgba(255,255,255,.16);
}
.search:focus-within { background: #fff; }
.search svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }
.search:focus-within svg { stroke: var(--ink-soft); }
.search input {
  width: 168px; border: 0; background: transparent; color: #fff; outline: none;
}
.search input::placeholder { color: rgba(255,255,255,.75); }
.search:focus-within input { color: var(--ink); }
.search:focus-within input::placeholder { color: var(--muted); }
.avatar {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #8a4b8f; color: #fff; font-size: 10.5px; font-weight: 700;
}
.win-btn {
  width: 30px; height: 24px; border: 0; background: transparent; color: #fff;
  font-family: "Segoe MDL2 Assets", var(--font); font-size: 10px;
}
.win-btn:hover { background: rgba(255,255,255,.18); }
.win-btn.danger:hover { background: #c42b1c; }

/* ── 리본 ──────────────────────────────────────────────── */
.ribbon-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 0 8px; background: var(--green); color: #fff;
  font-size: 12.5px;
}
.ribbon-tabs > span {
  padding: 6px 10px; border-radius: 4px 4px 0 0; white-space: nowrap;
}
.ribbon-tabs > span:not(.active):hover { background: rgba(255,255,255,.14); }
.ribbon-tabs .file-tab { background: var(--green-dark); }
.ribbon-tabs .active { background: var(--chrome-2); color: var(--ink); font-weight: 600; }
.ribbon-tabs-right { margin-left: auto; display: flex; gap: 6px; padding: 3px 0; }
.btn-memo, .btn-share {
  padding: 4px 12px; border-radius: 4px; border: 1px solid rgba(255,255,255,.55);
  background: transparent; color: #fff; font-size: 12px; white-space: nowrap;
}
.btn-memo { background: #fff; color: var(--green); border-color: #fff; font-weight: 600; }
.btn-memo:hover { background: #eaf5ef; }
.btn-share:hover { background: rgba(255,255,255,.16); }

.ribbon {
  display: flex; align-items: stretch; gap: 0;
  padding: 4px 8px 0;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.ribbon.collapsed { display: none; }
.group {
  display: flex; flex-direction: column;
  padding: 0 12px; border-right: 1px solid var(--line-soft);
}
.group.grow { flex: 1; border-right: 0; }
.group-label { text-align: center; font-size: 10.5px; color: var(--muted); padding: 2px 0 4px; }
.tools { display: flex; align-items: center; gap: 8px; flex: 1; padding: 4px 0; }
.tools.filter-tools { flex-direction: column; align-items: flex-start; gap: 4px; }
.big {
  display: grid; justify-items: center; gap: 2px;
  padding: 4px 8px; border: 0; border-radius: 4px; background: transparent;
  font-size: 11px; color: var(--ink-soft);
}
.big svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.big:hover, .small:hover { background: #e6e4e2; }
.stack { display: flex; flex-direction: column; gap: 1px; }
.small {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 7px; border: 0; border-radius: 3px; background: transparent;
  font-size: 11.5px; color: var(--ink-soft); white-space: nowrap;
}
.small svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; }

.range-row { display: flex; gap: 3px; }
.rg {
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 3px;
  background: #fff; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap;
}
.rg:hover { background: #eef1ef; }
.rg.active { background: var(--sel); border-color: var(--green); color: var(--green-dark); font-weight: 600; }
.rg.toggle.active { background: #fdf3e0; border-color: var(--warm); color: #8a5c00; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; font-size: 11.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 4px; }
.lg-title { font-weight: 600; color: var(--ink-soft); }
.lg-sep { width: 1px; height: 12px; background: var(--line); }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.sw.hot { background: var(--hot); }
.sw.warm { background: var(--warm); }
.sw.gov { background: var(--gov); }
.bg { width: 14px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--grid); }
.bg.peak { background: var(--attn-peak); }
.bg.high { background: var(--attn-high); }
.bg.mid  { background: var(--attn-mid); }
.row-label { align-self: center; margin-right: 3px; font-size: 11px; color: var(--muted); }

.ribbon-collapse {
  align-self: flex-end; margin-left: auto;
  width: 22px; height: 22px; border: 0; border-radius: 3px; background: transparent;
  color: var(--muted); font-family: "Segoe MDL2 Assets", var(--font); font-size: 10px;
}
.ribbon-collapse:hover { background: #e6e4e2; }

/* ── 수식 입력줄 ───────────────────────────────────────── */
.formula-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 8px; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.name-box {
  display: flex; align-items: center; gap: 4px;
  width: 108px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 2px;
  font-size: 12px; background: #fff;
}
.caret { width: 0; height: 0; border: 3px solid transparent; border-top-color: var(--muted); margin-left: auto; margin-top: 3px; }
.fb-sep { width: 1px; height: 18px; background: var(--line); }
.fb-icons { display: flex; gap: 7px; color: var(--muted); font-family: "Segoe MDL2 Assets", var(--font); font-size: 11px; }
.fb-icons .fx { font-family: var(--font); font-style: italic; font-weight: 700; }
.fb-input {
  flex: 1; padding: 3px 8px; min-width: 0;
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 10px;
  background: var(--sel); color: var(--green-dark);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.badge.stale { background: #fdecea; color: #a4262c; }
.badge.stale::before { background: #a4262c; }

/* ── 본문 레이아웃 ─────────────────────────────────────── */
.sheets-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5px var(--side-w);
  min-height: 0;
  background: var(--paper);
}
.sheets-grid.side-hidden { grid-template-columns: minmax(0, 1fr) 0 0; }
.sheets-grid.side-hidden .splitter,
.sheets-grid.side-hidden .col-side { display: none; }

.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.col-side { border-left: 1px solid var(--line); background: var(--chrome-2); }

.splitter { background: var(--line-soft); cursor: col-resize; }
.splitter:hover, .splitter:focus-visible { background: var(--green); outline: none; }

.sheet-title {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; background: var(--head);
  border-bottom: 1px solid var(--line);
}
.sheet-title-name { font-weight: 700; font-size: 13px; }
.window-note {
  padding: 1px 8px; border-radius: 9px;
  background: #eef3f8; color: #2f6fb5; font-size: 11px; font-weight: 600;
}
.spacer { flex: 1; }
.hint { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.sheet { flex: 1; overflow: auto; background: var(--paper); scrollbar-gutter: stable; }

/* ── 뉴스 그리드 ───────────────────────────────────────── */
.news-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.news-table col.rowhead { width: 44px; }
.news-table col.c-time { width: 76px; }
.news-table col.c-src { width: 104px; }
.news-table col.c-title { width: 46%; }

.news-table thead th, .news-table thead td {
  position: sticky; z-index: 3; background: var(--head);
  border: 1px solid var(--grid); border-top: 0;
  font-weight: 600; font-size: 11.5px; color: var(--ink-soft);
  padding: 3px 8px; text-align: left;
}
.news-table thead tr.colhead th { top: 0; height: 20px; text-align: center; color: var(--muted); font-weight: 500; }
.news-table thead tr.labels th, .news-table thead tr.labels td { top: 20px; }
.news-table thead .corner, .news-table .rownum { text-align: center; color: var(--muted); }

.news-table tbody td {
  border: 1px solid var(--grid);
  padding: 5px 8px;
  height: var(--row-h);
  vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-table tbody tr { cursor: pointer; }
.news-table tbody tr:hover td { background: #f4f8f5; }
.news-table tbody tr.sel td { background: var(--sel); box-shadow: inset 0 0 0 1px var(--sel-line); }
.news-table tbody tr.read .t-title { color: var(--muted); font-weight: 400; }
.news-table tbody tr.read .t-title::after { content: " ✓"; color: var(--green); font-size: 10px; }

.t-row { text-align: center; background: var(--head); color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.t-time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.t-src { font-size: 11.5px; color: var(--ink-soft); }
.t-title { font-weight: 600; color: var(--ink); }
.t-sum { color: var(--muted); font-size: 12px; }
.t-title mark, .t-sum mark { background: #fff3a3; color: inherit; padding: 0 1px; border-radius: 2px; }

/* 배경 = 주목도, 왼쪽 띠 = 신호/정부. 두 축이 겹치지 않게 나눠 놨다. */
tr.attn-mid  td { background: var(--attn-mid); }
tr.attn-high td { background: var(--attn-high); }
tr.attn-peak td { background: var(--attn-peak); }
.news-table tbody tr.attn-mid:hover td  { background: #f7efd6; }
.news-table tbody tr.attn-high:hover td { background: #f6e2c2; }
.news-table tbody tr.attn-peak:hover td { background: #f3d0c3; }
tr.attn-peak .t-title { font-weight: 700; }

tr.sig-hot .t-title { color: var(--hot); }
tr.sig-hot .t-row { box-shadow: inset 3px 0 0 var(--hot); }
tr.sig-warm .t-row { box-shadow: inset 3px 0 0 var(--warm); }
tr.is-gov .t-row { box-shadow: inset 3px 0 0 var(--gov); }
tr.is-gov .t-src { color: var(--gov); font-weight: 600; }

.tag {
  display: inline-block; margin-right: 5px; padding: 0 5px;
  border-radius: 3px; font-size: 10px; font-weight: 700; vertical-align: 1px;
}
.tag.gov { background: #f1e9fa; color: var(--gov); }
.tag.en { background: #eef3f8; color: #2f6fb5; }
.tag.spread { background: #f6e2c2; color: #8a5312; }
.tag.clicks { background: #e4efe8; color: var(--green-dark); }

.feed-empty {
  padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7;
}

/* ── AI 시사점 ─────────────────────────────────────────── */
.brief {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7fbf9, #f2f7f4);
}
.brief-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 4px;
}
.brief-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 9px;
  background: var(--green); color: #fff; font-size: 10.5px; font-weight: 700;
}
.brief-badge::before { content: "✦"; font-size: 9px; }
.brief-meta { font-size: 11px; color: var(--muted); }
.brief-toggle {
  margin-left: auto; width: 20px; height: 20px;
  border: 1px solid var(--line); border-radius: 3px; background: #fff;
  color: var(--muted); font-size: 12px; line-height: 1;
}
.brief-toggle:hover { background: #e6e4e2; }
.brief.collapsed .brief-list { display: none; }

.brief-list {
  margin: 0; padding: 0 10px 8px 10px;
  list-style: none; display: flex; flex-direction: column; gap: 4px;
}
.brief-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink);
}
.brief-list li::before {
  content: "•"; color: var(--green); font-weight: 700; margin-right: 2px;
}
.brief-src {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 0 7px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--link); text-decoration: none;
  font-size: 10.5px; white-space: nowrap;
}
.brief-src::before { content: "↗"; font-size: 9px; opacity: .6; }
.brief-src:hover { background: var(--sel); border-color: var(--green); }
.brief-empty { padding: 2px 10px 8px; font-size: 11.5px; color: var(--muted); }

/* ── 사이드(채팅) ──────────────────────────────────────── */
.pane-close {
  width: 22px; height: 22px; flex: none;
  border: 0; border-radius: 3px; background: transparent; color: var(--muted);
  font-family: "Segoe MDL2 Assets", var(--font); font-size: 10px;
}
.pane-close:hover { background: #e6e4e2; }

.pane { flex: 1; min-height: 0; display: none; flex-direction: column; }
.pane.active { display: flex; }

.chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 10px; background: var(--head);
  border-bottom: 1px solid var(--line);
}
.chat-room { font-weight: 700; font-size: 12px; color: var(--green-dark); }
.chat-status { margin-left: auto; font-size: 11px; color: var(--muted); }
.chat-status.err { color: #a4262c; }

.chat-log {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 7px;
  background: var(--paper);
}
.msg { font-size: 12.5px; line-height: 1.45; word-break: break-word; }
.msg .who { font-weight: 700; color: var(--green-dark); margin-right: 5px; }
.msg .when { font-size: 10.5px; color: var(--muted); margin-left: 5px; font-variant-numeric: tabular-nums; }
.msg.mine .who { color: #8a4b8f; }
.chat-sys { font-size: 11.5px; color: var(--muted); text-align: center; padding: 8px 4px; line-height: 1.6; white-space: pre-line; }

.chat-form {
  display: grid; grid-template-columns: 78px minmax(0,1fr) 34px; gap: 4px;
  padding: 6px; border-top: 1px solid var(--line);
  background: var(--chrome-2);
}
.chat-nick, .chat-input {
  min-width: 0; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 3px; background: #fff; outline: none;
  font-size: 12.5px;
}
.chat-nick:focus, .chat-input:focus { border-color: var(--green); }
.chat-send {
  border: 1px solid var(--green); border-radius: 3px;
  background: var(--green); color: #fff; font-size: 14px;
}
.chat-send:hover { background: var(--green-dark); }
.chat-send:disabled { background: var(--line); border-color: var(--line); cursor: not-allowed; }
.chat-note { margin: 0; padding: 4px 10px 8px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }

/* ── 하단 ──────────────────────────────────────────────── */
.bottombar {
  display: flex; flex-direction: column;
  background: var(--chrome); border-top: 1px solid var(--line);
}
.bottombar > .sheet-tabs { order: 0; }
.bottombar > .status-bar { order: 2; }
.sheet-tabs {
  display: flex; align-items: flex-end; gap: 2px;
  padding: 3px 8px 0; overflow-x: auto; scrollbar-width: none;
}
.sheet-tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 5px 14px; border: 0; border-radius: 3px 3px 0 0;
  background: transparent; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap;
}
.tab:hover { background: #e6e4e2; }
.tab[data-tint] { background: var(--tab-tint); }
.tab[data-tint]:hover { filter: brightness(0.96); }
.tab[data-tint].active { background: #fffdf2; }
.tab.active {
  background: var(--paper); font-weight: 700; color: var(--ink);
  box-shadow: inset 0 2px 0 var(--tab-color, var(--green));
}
.tab .cnt { margin-left: 6px; font-size: 10.5px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.tab.active .cnt { color: var(--tab-color, var(--green)); }

.status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 10px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-soft);
  background: var(--chrome);
}
.sb-sep { width: 1px; height: 12px; background: var(--line); }
.sb-grow { flex: 1; }
.muted { color: var(--muted); }
.zoom { font-variant-numeric: tabular-nums; }

/* ── 퇴근 모드 ─────────────────────────────────────────── */
.boss-mask {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; background: var(--paper);
}
.boss-sheet { width: 100%; border-collapse: collapse; }
.boss-sheet td, .boss-sheet th {
  border: 1px solid var(--grid); padding: 4px 8px;
  font-size: 12px; height: 26px; white-space: nowrap;
}
.boss-sheet th { background: var(--head); font-weight: 600; }
.boss-sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── 토스트 ────────────────────────────────────────────── */
.toast-stack {
  position: fixed; right: 14px; bottom: 52px; z-index: 60;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.toast {
  padding: 8px 14px; border-radius: 4px;
  background: #323130; color: #fff; font-size: 12.5px;
  box-shadow: var(--shadow); animation: rise .18s ease-out;
}
.toast.warn { background: #a4262c; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ── 모바일 ────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --row-h: 28px; }
  .ribbon, .fb-icons, .name-box, .fb-sep, .win-btn, .autosave-label, .book-title { display: none; }
  .titlebar { grid-template-columns: auto 1fr; gap: 8px; }
  .search input { width: 100%; }
  .window { flex: 1; }
  .search { flex: 1; }
  .ribbon-tabs > span:not(.file-tab):not(.active) { display: none; }

  .sheets-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0,1fr); }
  .splitter { display: none; }
  .col-side {
    position: fixed; inset: auto 0 0 0; z-index: 40;
    height: 62dvh; border-left: 0; border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(0,0,0,.16);
    transform: translateY(100%); transition: transform .2s ease-out;
  }
  .sheets-grid.side-open .col-side { transform: translateY(0); }
  .sheets-grid.side-hidden { grid-template-columns: minmax(0,1fr); }
  .sheets-grid.side-hidden .col-side { display: flex; }

  /* 375px 폭에 5열 표를 밀어넣으면 아무것도 안 읽힌다.
     셀만 display:none 하면 colgroup 과 어긋나 열이 밀리므로 표 구조 자체를 풀어버린다. */
  .news-table, .news-table tbody, .news-table tr, .news-table td { display: block; width: auto; }
  .news-table thead, .news-table colgroup { display: none; }
  .news-table tbody tr {
    padding: 9px 12px; border-bottom: 1px solid var(--grid);
  }
  .news-table tbody td {
    border: 0; padding: 0; height: auto; white-space: normal; overflow: visible;
  }
  .news-table tbody td.t-row, .news-table tbody td.t-sum { display: none; }
  .news-table tbody td.t-time, .news-table tbody td.t-src {
    display: inline; font-size: 11px; color: var(--muted);
  }
  .news-table tbody td.t-time::after { content: " · "; }
  .news-table tbody td.t-title {
    margin-top: 3px; font-size: 13.5px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .news-table tbody tr:hover td, .news-table tbody tr.sel td { background: transparent; }
  .news-table tbody tr.sel { background: var(--sel); }
  /* 표를 풀어 놨으므로 주목도 배경도 td 가 아니라 행 전체에 깔아야 여백까지 칠해진다 */
  .news-table tbody tr.attn-mid  td,
  .news-table tbody tr.attn-high td,
  .news-table tbody tr.attn-peak td { background: transparent; }
  .news-table tbody tr.attn-mid  { background: var(--attn-mid); }
  .news-table tbody tr.attn-high { background: var(--attn-high); }
  .news-table tbody tr.attn-peak { background: var(--attn-peak); }

  /* 시사점은 모바일에서 자리를 많이 먹으니 기본으로 접어 둔다 */
  .brief-list { padding-bottom: 6px; }
  .brief-list li { font-size: 12px; }
  /* 신호 색띠는 행 번호 칸에 걸려 있었는데 그 칸이 사라지므로 행으로 옮긴다 */
  tr.sig-hot, tr.sig-warm, tr.is-gov { box-shadow: none; }
  .news-table tbody tr.sig-warm { box-shadow: inset 3px 0 0 var(--warm); }
  .news-table tbody tr.sig-hot { box-shadow: inset 3px 0 0 var(--hot); }
  .news-table tbody tr.is-gov { box-shadow: inset 3px 0 0 var(--gov); }

  /* 좁은 화면에서 상태바 항목이 줄바꿈되며 3줄이 되는 걸 막는다 */
  .status-bar { overflow-x: auto; scrollbar-width: none; }
  .status-bar > * { flex: none; white-space: nowrap; }
  .status-bar .zoom, #statusUpdated { display: none; }
  .toast-stack { right: 10px; left: 10px; bottom: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 모바일에서만 뜨는 채팅 열기 버튼. 레이아웃을 밀지 않게 띄워 둔다. */
.mobile-only { display: none; }
@media (max-width: 860px) {
  .mobile-only {
    position: fixed; right: 12px; bottom: 62px; z-index: 45;
    display: inline-flex; align-items: center;
    padding: 9px 15px; border-radius: 20px;
    background: var(--green); color: #fff; font-weight: 700; font-size: 12.5px;
    box-shadow: 0 3px 12px rgba(0,0,0,.24);
  }
  .mobile-only:hover { background: var(--green-dark); }
  .sheets-grid.side-open ~ * .mobile-only { display: none; }
}
