/* 내부감사 Daily — 라이트/다크 테마 */
:root {
  color-scheme: light;
  --bg: #f0f2f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --header-bg: #003478;
  --header-text: #ffffff;
  --header-btn-bg: rgba(255, 255, 255, 0.15);
  --header-btn-text: #ffffff;
  --header-btn-hover: rgba(255, 255, 255, 0.25);
  --surface-hover: #f8fafc;
  --publisher: #334155;
  --sep: #cbd5e1;
  --link-muted: #94a3b8;
  --cal-disabled: #94a3b8;
  --cal-cell-bg: #f8fafc;
  --weekend: #dc2626;
  --dot-off: #e2e8f0;
  --dot-on: #bfdbfe;
  --dot-high: #1d4ed8;
  --dot-mid: #64748b;
  --scrollbar: #cbd5e1;
  --toast-bg: #0f172a;
  --toast-text: #f8fafc;
  --radius: 14px;
  --header-h: 64px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.04);

  --cat-company: #0369a1;
  --cat-risk: #dc2626;
  --cat-regulation: #7c3aed;
  --cat-audit: #059669;
  --cat-governance: #4338ca;
  --cat-global: #0891b2;
  --cat-all: #1d4ed8;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080e1a;
  --card: #0f172a;
  --text: #e2e8f0;
  --muted: #64748b;
  --line: #1e293b;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.1);
  --header-bg: #001f4d;
  --header-text: #e2e8f0;
  --header-btn-bg: rgba(255, 255, 255, 0.08);
  --header-btn-text: #e2e8f0;
  --header-btn-hover: rgba(255, 255, 255, 0.14);
  --surface-hover: rgba(255, 255, 255, 0.03);
  --publisher: #94a3b8;
  --sep: #1e293b;
  --link-muted: #475569;
  --cal-disabled: #334155;
  --cal-cell-bg: rgba(255, 255, 255, 0.03);
  --weekend: #f87171;
  --dot-off: #1e293b;
  --dot-on: #1e3a8a;
  --dot-high: #60a5fa;
  --dot-mid: #475569;
  --scrollbar: #1e293b;
  --toast-bg: #0f172a;
  --toast-text: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);

  --cat-company: #38bdf8;
  --cat-risk: #f87171;
  --cat-regulation: #a78bfa;
  --cat-audit: #34d399;
  --cat-governance: #818cf8;
  --cat-global: #22d3ee;
  --cat-all: #60a5fa;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

.layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Header ── */
.site-header {
  flex-shrink: 0;
  height: var(--header-h);
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

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

.header-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s;
}

.header-brand:hover {
  background: rgba(255, 255, 255, 0.08);
}

.header-brand:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.header-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.site-header h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.site-header p {
  margin: 2px 0 0;
  opacity: 0.78;
  font-size: 0.75rem;
}

/* ── Main grid ── */
.main-grid {
  flex: 1;
  min-height: 0;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 24px 20px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-content: start;
}

.calendar-panel,
.articles-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-height: 0;
}

.calendar-panel {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: start;
  width: 100%;
  height: fit-content;
}

.calendar-panel.is-expanded {
  padding-bottom: 10px;
  gap: 8px;
}

.calendar-panel.is-collapsed .day-nav-label {
  font-size: 0.82rem;
}

.calendar-panel.is-collapsed .day-nav-label .day-nav-sub {
  font-size: 0.68rem;
  margin-top: 1px;
}

.articles-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ── Calendar ── */
.day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-nav-date {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 4px;
}

.calendar-panel.is-expanded .day-nav {
  display: none;
}

.day-nav-label {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  border: none;
  background: transparent;
  border-radius: 8px;
  height: 36px;
  padding: 0 4px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.day-nav-label:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.day-nav-label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.day-nav-label .day-nav-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}

.calendar-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 4px;
}


.calendar-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  flex: 1;
  line-height: 1.3;
  color: var(--text);
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  transition: background 0.12s, color 0.12s;
}

.calendar-title:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.week-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  gap: 3px;
}

.weekday-row span.weekend {
  color: var(--weekend);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.calendar-grid + .calendar-grid {
  margin-top: 3px;
}

.cal-cell {
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: default;
  color: var(--cal-disabled);
  padding: 2px;
  font-family: inherit;
  line-height: 1;
  position: relative;
}

.cal-cell.future {
  opacity: 0.35;
}

.cal-cell.no-news {
  opacity: 0.42;
  cursor: not-allowed;
}

.cal-cell.other-month {
  opacity: 0.28;
}

.cal-cell.has-news {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  background: var(--cal-cell-bg);
}

.cal-cell.has-news:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: scale(1.08);
  transition: transform 0.1s, background 0.1s, color 0.1s;
}

.cal-cell.selected {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.35);
}

.cal-cell.today:not(.selected) {
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent);
}

.calendar-hint {
  margin: 12px 0 0;
  padding-top: 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ── Articles panel states ── */
.panel-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-state p {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.empty-state span {
  font-size: 0.82rem;
  color: var(--muted);
}

.articles-header {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.articles-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}

.articles-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.issue-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.section-tabs {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.tab-icon {
  font-size: 0.82rem;
  line-height: 1;
  opacity: 0.9;
}

.tab-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.tab-btn.tab-company.active { color: var(--cat-company); background: #eff6ff; box-shadow: inset 0 0 0 1.5px var(--cat-company); }
.tab-btn.tab-risk.active    { color: var(--cat-risk);    background: #fef2f2; box-shadow: inset 0 0 0 1.5px var(--cat-risk); }
.tab-btn.tab-regulation.active { color: var(--cat-regulation); background: #f5f3ff; box-shadow: inset 0 0 0 1.5px var(--cat-regulation); }
.tab-btn.tab-audit.active   { color: var(--cat-audit);   background: #f0fdf4; box-shadow: inset 0 0 0 1.5px var(--cat-audit); }
.tab-btn.tab-governance.active { color: var(--cat-governance); background: #eef2ff; box-shadow: inset 0 0 0 1.5px var(--cat-governance); }
.tab-btn.tab-global.active  { color: var(--cat-global);  background: #ecfeff; box-shadow: inset 0 0 0 1.5px var(--cat-global); }

[data-theme="dark"] .tab-btn.tab-company.active { background: rgba(56,189,248,0.1); }
[data-theme="dark"] .tab-btn.tab-risk.active    { background: rgba(248,113,113,0.1); }
[data-theme="dark"] .tab-btn.tab-regulation.active { background: rgba(167,139,250,0.1); }
[data-theme="dark"] .tab-btn.tab-audit.active   { background: rgba(52,211,153,0.1); }
[data-theme="dark"] .tab-btn.tab-governance.active { background: rgba(129,140,248,0.1); }
[data-theme="dark"] .tab-btn.tab-global.active  { background: rgba(34,211,238,0.1); }


.articles-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Article list ── */
.article-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  scroll-behavior: smooth;
}

.article-list::-webkit-scrollbar {
  width: 6px;
}

.article-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 3px;
}

.article-row {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.article-row:last-child {
  border-bottom: none;
}

.article-row:hover {
  background: var(--surface-hover);
}

.article-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  min-width: 0;
}

.article-main {
  flex: 1;
  min-width: 0;
}

.article-title {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 550;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.article-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.12s;
}

.article-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  line-height: 1.4;
}

.meta-publisher {
  color: var(--publisher);
  font-weight: 500;
}

.meta-feed {
  color: var(--muted);
}

.meta-section {
  color: var(--muted);
}

.meta-section-company { color: var(--cat-company); }
.meta-section-risk { color: var(--cat-risk); }
.meta-section-regulation { color: var(--cat-regulation); }
.meta-section-audit { color: var(--cat-audit); }
.meta-section-governance { color: var(--cat-governance); }
.meta-section-global { color: var(--cat-global); }

.meta-sep {
  color: var(--sep);
  user-select: none;
}

.article-aside {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-top: 3px;
}

.article-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--link-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.12s, background 0.12s;
}

.article-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.list-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Buttons ── */
.btn {
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  height: 28px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
  white-space: nowrap;
}

.btn-primary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  background: var(--header-btn-bg);
  color: var(--header-btn-text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  flex-shrink: 0;
}

.btn-theme-icon:hover {
  background: var(--header-btn-hover);
}

.btn-theme-icon:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 10px;
  border-radius: 6px;
}

.day-nav .btn-ghost {
  height: 36px;
  padding: 0 16px;
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn-ghost:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-ghost:disabled:hover {
  background: transparent;
}

.hidden {
  display: none !important;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 380px;
}

.modal-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.modal-body {
  margin: 0 0 24px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-ghost-modal {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  height: 36px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}

.btn-ghost-modal:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-confirm {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  height: 36px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.btn-confirm:hover {
  background: var(--accent-hover);
}

/* ── Search button ── */
.btn-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  flex-shrink: 0;
  background: var(--header-btn-bg);
  color: var(--header-btn-text);
}

.btn-search-icon:hover {
  background: var(--header-btn-hover);
}

.btn-search-icon.day-nav-search {
  background: var(--card);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn-search-icon.day-nav-search:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-curate-nav {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.btn-curate-nav:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-curate-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Search modal ── */
.search-modal {
  padding: 0;
  max-width: 640px;
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.search-input-icon {
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.7;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  outline: none;
  letter-spacing: -0.01em;
}

.search-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.search-close {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  flex-shrink: 0;
  font-family: inherit;
}

.search-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.search-results {
  max-height: 62vh;
  overflow-y: auto;
  background: var(--bg);
}

.search-hint {
  margin: 0;
  padding: 40px 20px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.search-count {
  margin: 0;
  padding: 10px 20px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 12px 12px;
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  text-decoration: none;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search-result-row:hover {
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background: var(--card);
}

.search-result-date {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  white-space: nowrap;
}

.search-result-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.search-result-row:hover .search-result-title {
  color: var(--accent);
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
}

.search-result-arrow {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.search-result-row:hover .search-result-arrow {
  background: var(--accent);
  color: #fff;
}

/* ── Article detail modal ── */
.article-modal {
  max-width: 520px;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 80vh;
  overflow-y: auto;
}

.article-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--surface-hover);
  color: var(--muted);
  margin-bottom: 10px;
  width: fit-content;
}

.article-modal-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.article-modal-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.article-modal-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.article-modal-keyword {
  font-size: 0.73rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-hover);
  color: var(--muted);
  border: 1px solid var(--line);
}

.article-modal-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 0 14px;
}

.article-modal-summary {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.65;
  margin: 0 0 20px;
  white-space: pre-wrap;
}

.article-modal-summary-empty {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 20px;
}

.article-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.btn-read-original {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  height: 36px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.12s;
}

.btn-read-original:hover {
  opacity: 0.88;
}

/* ── Progress modal ── */
.progress-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 28px;
  max-width: 300px;
  text-align: center;
}

.progress-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.progress-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
}

.progress-step {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
  transition: opacity 0.3s;
}

.loading {
  color: var(--muted);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 100;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
}

@media (max-width: 860px) {
  html,
  body {
    overflow: auto;
  }

  .layout {
    height: auto;
    min-height: 100dvh;
  }

  .main-grid {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px 16px;
    min-height: 0;
  }

  .calendar-panel.is-collapsed {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .calendar-panel.is-collapsed .day-nav {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .calendar-panel.is-expanded {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 8px 10px;
  }

  .articles-panel {
    min-height: 0;
    flex: 1;
    width: 100%;
    overflow: visible;
  }

  .articles-content {
    overflow: visible;
    min-height: 0;
  }

  .article-list {
    overflow-y: visible;
    min-height: 0;
  }

  .site-header {
    padding: 0 16px;
    height: auto;
    min-height: var(--header-h);
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 0;
    gap: 8px 12px;
  }

  .header-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-actions {
    flex-shrink: 0;
  }

  .article-title {
    margin-bottom: 4px;
    line-height: 1.35;
  }

  .article-title a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
