:root {
  --briefing-green: #0f766e;
  --briefing-green-dark: #115e59;
  --briefing-mint: #ecfdf5;
  --briefing-ink: #172554;
  --briefing-muted: #64748b;
  --briefing-line: #e2e8f0;
  --briefing-warn: #9a3412;
}

.briefing-page { max-width: 920px; margin: 0 auto; padding: 28px 16px 64px; color: #1e293b; }
.briefing-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 28px; color: #fff; background: linear-gradient(135deg, #0f766e, #164e63); border-radius: 24px; box-shadow: 0 16px 40px rgba(15, 118, 110, .18); }
.briefing-hero h1 { margin: 5px 0 8px; font-size: clamp(30px, 6vw, 48px); line-height: 1.08; }
.briefing-hero p { max-width: 590px; margin: 0; color: #d9f7f2; line-height: 1.65; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.briefing-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 170px; }
.briefing-button, .admin-tools button { border: 0; border-radius: 12px; padding: 12px 15px; font-weight: 800; cursor: pointer; background: #fff; color: var(--briefing-green-dark); }
.briefing-button.secondary { background: #ccfbf1; }
.briefing-button:disabled { cursor: not-allowed; opacity: .6; }
.action-message { min-height: 20px; font-size: 12px; text-align: center; color: #d9f7f2; }

.asof-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 18px 0; overflow: hidden; background: var(--briefing-line); border: 1px solid var(--briefing-line); border-radius: 16px; }
.asof-panel > div { padding: 15px; background: #fff; }
.asof-panel span, .reference-levels span, .performance-summary span { display: block; margin-bottom: 5px; color: var(--briefing-muted); font-size: 12px; }
.asof-panel strong { font-size: 15px; }
.market-summary, .performance-section, .method-note, .empty-briefing, .admin-tools, .briefing-notice { margin: 18px 0; padding: 22px; background: #fff; border: 1px solid var(--briefing-line); border-radius: 18px; }
.market-summary h2, .performance-section h2, .method-note h2, .empty-briefing h2 { margin: 0 0 10px; color: var(--briefing-ink); }
.market-summary p, .method-note p, .empty-briefing p { margin: 0; line-height: 1.75; }
.briefing-notice.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.empty-briefing { text-align: center; padding: 42px 24px; }
.empty-icon { margin-bottom: 8px; font-size: 46px; }

.stock-list { display: grid; gap: 16px; }
.stock-card { padding: 22px; background: #fff; border: 1px solid var(--briefing-line); border-radius: 20px; box-shadow: 0 8px 22px rgba(15, 23, 42, .045); }
.stock-card-head { display: flex; align-items: center; gap: 13px; }
.rank { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: var(--briefing-green); font-size: 18px; font-weight: 900; }
.stock-card-head h2 { margin: 0; color: var(--briefing-ink); font-size: 23px; }
.stock-card-head p { margin: 3px 0 0; color: var(--briefing-muted); font-size: 13px; }
.plain-summary { margin: 17px 0; padding: 14px 16px; border-left: 4px solid #14b8a6; background: #f8fafc; border-radius: 0 12px 12px 0; line-height: 1.7; }
.factor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.factor { padding: 16px; border-radius: 15px; }
.factor.positive { background: var(--briefing-mint); }
.factor.risk { background: #fff7ed; }
.factor h3 { margin: 0 0 8px; font-size: 15px; }
.factor.positive h3 { color: #047857; }
.factor.risk h3 { color: var(--briefing-warn); }
.factor ul { margin: 0; padding-left: 19px; }
.factor li { margin: 6px 0; line-height: 1.5; }
.reference-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.reference-levels > div { padding: 13px; border: 1px solid var(--briefing-line); border-radius: 13px; }
.evidence { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--briefing-line); }
.evidence summary { color: var(--briefing-green-dark); font-weight: 800; cursor: pointer; }
.evidence p { line-height: 1.6; }
.sample-note { color: var(--briefing-muted); font-size: 13px; }
.news-links { padding-left: 18px; }
.news-links li { margin: 9px 0; }
.news-links a { color: #0369a1; font-weight: 700; }
.news-links span { display: block; color: var(--briefing-muted); font-size: 12px; }

.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.section-title h2 { margin-top: 4px; }
.section-title p { max-width: 420px; margin: 0; color: var(--briefing-muted); font-size: 13px; line-height: 1.6; }
.performance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.performance-summary > div { padding: 16px; background: #f8fafc; border-radius: 14px; }
.performance-summary strong { font-size: 20px; }
.up { color: #dc2626; }
.down { color: #2563eb; }
.recent-table-wrap { overflow-x: auto; }
.recent-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.recent-table th, .recent-table td { padding: 11px 8px; border-bottom: 1px solid var(--briefing-line); text-align: right; white-space: nowrap; }
.recent-table th:first-child, .recent-table td:first-child { text-align: left; }
.method-note { background: #f8fafc; }
.method-note h2 { font-size: 17px; }
.admin-tools summary { cursor: pointer; font-weight: 800; }
.admin-tools button { margin: 4px; color: #fff; background: #334155; }
.admin-tools pre { overflow: auto; padding: 12px; background: #0f172a; color: #e2e8f0; border-radius: 10px; white-space: pre-wrap; }

@media (max-width: 700px) {
  .briefing-page { padding: 14px 10px 48px; }
  .briefing-hero { align-items: stretch; flex-direction: column; padding: 22px 18px; border-radius: 18px; }
  .briefing-actions { min-width: 0; }
  .asof-panel, .reference-levels, .performance-summary { grid-template-columns: 1fr; }
  .factor-grid { grid-template-columns: 1fr; }
  .stock-card { padding: 18px 15px; }
  .section-title { display: block; }
}

@media (display-mode: standalone) {
  .nav .tabs > * { display: none !important; }
  .nav .tabs > a[href="/daily_briefing"] { display: flex !important; }
  .nav .tabs, .nav .nav-inner { width: 100%; justify-content: center; }
}
body.install-guide-open { overflow: hidden; }
.install-guide-backdrop { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .58); }
.install-guide-backdrop[hidden] { display: none; }
.install-guide-panel { width: min(100%, 540px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; background: #fff; border-radius: 24px; box-shadow: 0 24px 70px rgba(15, 23, 42, .32); }
.install-guide-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.install-guide-header .eyebrow { color: var(--briefing-green); }
.install-guide-header h2 { margin: 5px 0 0; color: var(--briefing-ink); font-size: 25px; }
.install-guide-close { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; background: #f1f5f9; color: #334155; font-size: 28px; line-height: 1; cursor: pointer; }
.safari-install-warning { margin: 18px 0 4px; padding: 15px; border: 1px solid #fed7aa; border-radius: 14px; background: #fff7ed; color: #9a3412; }
.safari-install-warning p { margin: 6px 0 12px; color: #7c2d12; font-size: 14px; line-height: 1.55; }
.safari-install-warning button { width: 100%; padding: 11px; border: 0; border-radius: 10px; background: #c2410c; color: #fff; font-weight: 800; }
.install-steps { display: grid; gap: 12px; margin: 20px 0; padding: 0; list-style: none; }
.install-steps li { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--briefing-line); border-radius: 15px; background: #f8fafc; }
.step-number { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--briefing-green); color: #fff; font-weight: 900; }
.install-steps strong { display: block; margin: 2px 0 5px; color: var(--briefing-ink); font-size: 16px; }
.install-steps p { margin: 0; color: var(--briefing-muted); font-size: 14px; line-height: 1.55; }
.install-after-note { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--briefing-mint); color: var(--briefing-green-dark); font-size: 14px; line-height: 1.55; }
.install-guide-done { width: 100%; padding: 14px; border: 0; border-radius: 13px; background: var(--briefing-green); color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }

@media (min-width: 701px) {
  .install-guide-backdrop { align-items: center; }
}

@media (max-width: 700px) {
  .install-guide-backdrop { padding: 0; }
  .install-guide-panel { max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
}