/* Opinion Insight — 60대 UX: 큰 글씨, 고대비, 세로 스크롤 */
/* Design System: stone palette, Noto Serif KR headings, Noto Sans KR body */

:root {
  --bg: #f5f3ef;
  --card-bg: #fffdfb;
  --text: #1c1917;
  --text-secondary: #57534e;
  --accent: #292524;
  --border: #e7e5e4;
  --tab-height: 56px;
  --header-height: 48px;
  --font-body: 18px;
  --font-title: 22px;
  --font-small: 15px;
  --touch-min: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--font-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Header */
#app-header {
  position: sticky;
  top: 0;
  z-index: 110;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-brand {
  font-family: 'Noto Serif KR', serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
}
.header-sep {
  color: #a8a29e;
  font-size: 13px;
}
.header-title {
  font-size: 15px;
  color: var(--text-secondary);
}
.header-portal {
  font-size: 13px;
  color: #a8a29e;
  text-decoration: none;
}
.header-portal:hover {
  color: var(--text-secondary);
}

/* Views */
.view { display: none; padding: 20px 16px calc(var(--tab-height) + 20px); margin-top: 0; }
.view.active { display: block; }

/* Tab Bar */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--tab-height);
  display: flex;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  min-height: var(--touch-min);
  font-family: 'Noto Sans KR', sans-serif;
}
.tab.active { color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); }
.tab-label { font-size: var(--font-small); }

/* Briefing Cards */
.briefing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 16px;
}
.briefing-card .card-topic {
  font-size: var(--font-small);
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.briefing-card .card-title {
  font-family: 'Noto Serif KR', serif;
  font-size: var(--font-title);
  font-weight: 700;
  margin-bottom: 16px;
}
.briefing-card .ment {
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--border);
}
.briefing-card .ment-body {
  font-size: var(--font-body);
}
.briefing-card .ment-source {
  font-size: var(--font-small);
  color: var(--text-secondary);
  text-align: right;
  margin-top: 4px;
}

/* Chat */
.chat-messages {
  padding-bottom: 80px;
}
.chat-bubble {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: var(--font-body);
  line-height: 1.6;
}
.chat-bubble.user {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
}
.chat-bubble.assistant {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.chat-input-bar {
  position: fixed;
  bottom: var(--tab-height);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.chat-input-bar input {
  flex: 1;
  height: var(--touch-min);
  padding: 0 16px;
  font-size: var(--font-body);
  font-family: 'Noto Sans KR', sans-serif;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--card-bg);
}
.chat-input-bar input:focus {
  border-color: #a8a29e;
}
.chat-input-bar button {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Loading */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page Header (inside views) */
.page-header {
  font-family: 'Noto Serif KR', serif;
  font-size: var(--font-title);
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--accent);
}
