*{box-sizing:border-box}body{margin:0;background:#f4f5f7;color:#222;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.container{max-width:1440px;margin:28px auto;padding:0 16px}.card{background:#fff;border:1px solid #e2e5ea;border-radius:14px;padding:20px;margin-bottom:18px;box-shadow:0 6px 18px rgba(0,0,0,.04)}h1{margin:0 0 8px;font-size:26px}h2{margin:0;font-size:20px}h3{margin:16px 0 10px;font-size:16px}.lead,.note{color:#555;line-height:1.7}.lead{margin:0 0 18px}.note{margin:10px 0 0;font-size:13px}code{background:#f0f2f5;padding:2px 5px;border-radius:5px}.form-grid{display:grid;grid-template-columns:180px 150px 150px 150px;gap:14px;align-items:end}.form-grid .wide{grid-column:span 2}label{display:block;margin-bottom:6px;font-weight:700}input,textarea{width:100%;padding:11px 12px;border:1px solid #cfd4dc;border-radius:10px;font-size:15px;background:#fff}.option-row{display:flex;gap:14px;flex-wrap:wrap;margin-top:14px}.check-label{display:inline-flex;align-items:center;gap:8px;font-weight:600}.check-label input{width:auto}.button-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.compact-row{margin:10px 0 14px}button{padding:10px 16px;border:1px solid #b8c0cc;border-radius:10px;background:#fff;cursor:pointer;font-size:15px}button:hover:not(:disabled){background:#f0f3f7}button:disabled{opacity:.55;cursor:not-allowed}#fetchTechnicalBtn,#fetchFundamentalBtn,#fetchDisclosureBtn,#fetchBoardBtn,#fetchAllBtn{font-weight:700;background:#16213e;color:#fff;border-color:#16213e}.status-row{margin-top:14px;padding:10px 12px;background:#f7f8fa;border-radius:10px}.status-label{font-weight:700}.hidden{display:none!important}.result-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.tab-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.tab-buttons button.active{background:#16213e;color:#fff;border-color:#16213e}.metric-grid,.analysis-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px 0}.metric-card,.analysis-item,.signal-box{border:1px solid #e5e7eb;border-radius:12px;padding:12px;background:#fbfbfc}.metric-label,.analysis-title{color:#666;font-size:12px;font-weight:700;margin-bottom:6px}.metric-value{font-size:20px;font-weight:800;word-break:break-word}.metric-sub,.analysis-text{color:#555;font-size:13px;line-height:1.6}.chart-panel{border:1px solid #e2e5ea;border-radius:12px;padding:12px;background:#fff;height:460px;margin:12px 0 14px}.chart-panel canvas{width:100%;height:100%;display:block}.table-wrap{overflow:auto;border:1px solid #e2e5ea;border-radius:10px;margin:12px 0 18px;max-height:560px}table{width:100%;border-collapse:collapse;font-size:13px}th,td{border-bottom:1px solid #e8ebef;padding:8px 9px;white-space:nowrap;text-align:right;vertical-align:top}th:first-child,td:first-child{text-align:left;position:sticky;left:0;background:#fff}th{background:#f7f8fa;font-weight:700}th:first-child{background:#f7f8fa}td.text-cell{text-align:left;white-space:pre-wrap;word-break:break-word;min-width:420px}.raw-json,.answer-box{white-space:pre-wrap;word-break:break-word;max-height:680px;overflow:auto;background:#f7f8fa;border:1px solid #e2e5ea;border-radius:10px;padding:12px;font-size:13px;line-height:1.55}.prompt-area{min-height:440px;font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;font-size:13px;line-height:1.55}.extracted-list{display:grid;gap:12px}.extract-card{border:1px solid #e2e5ea;border-radius:12px;padding:12px;background:#fafbfc}.extract-meta{color:#555;font-size:12px;margin-bottom:8px}.extract-text{white-space:pre-wrap;word-break:break-word;max-height:260px;overflow:auto;border:1px solid #e2e5ea;border-radius:10px;background:#fff;padding:10px;font-size:13px;line-height:1.55}.small-btn{padding:6px 9px;border-radius:8px;font-size:12px}@media(max-width:1100px){.form-grid,.metric-grid,.analysis-grid{grid-template-columns:repeat(2,1fr)}.form-grid .wide{grid-column:span 2}}@media(max-width:700px){.form-grid,.metric-grid,.analysis-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:span 1}.button-row{flex-direction:column}button{width:100%}.chart-panel{height:380px}}

/* Finance table display aligned with standalone Kabutan Finance Analyst */
.signal-main{font-size:24px;font-weight:800;margin-bottom:4px}.signal-sub{color:#555}.finance-table-wrap{max-height:560px}.finance-table-wrap table{width:100%;border-collapse:collapse;font-size:13px}.finance-table-wrap th,.finance-table-wrap td{border-bottom:1px solid #e8ebef;padding:8px 9px;white-space:nowrap;text-align:right;vertical-align:top}.finance-table-wrap th:first-child,.finance-table-wrap td:first-child{text-align:left;position:sticky;left:0;background:#fff}.finance-table-wrap th{background:#f7f8fa;font-weight:700}.finance-table-wrap th:first-child{background:#f7f8fa}

.rule-method-note{margin-top:8px;color:#777;font-size:11px;line-height:1.55}


/* Gemini Markdown rendering */
.markdown-body{white-space:normal;line-height:1.75;font-size:14px;color:#222}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4{margin:18px 0 10px;line-height:1.35}.markdown-body h1{font-size:22px;border-bottom:1px solid #dfe3ea;padding-bottom:6px}.markdown-body h2{font-size:19px;border-bottom:1px solid #e7eaf0;padding-bottom:5px}.markdown-body h3{font-size:16px}.markdown-body p{margin:8px 0 12px}.markdown-body ul,.markdown-body ol{margin:8px 0 14px;padding-left:24px}.markdown-body li{margin:4px 0}.markdown-body strong{font-weight:800}.markdown-body em{color:#444}.markdown-body code{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;background:#eef1f5;border-radius:5px;padding:2px 5px}.markdown-body .md-code{white-space:pre;overflow:auto;background:#111827;color:#f9fafb;border-radius:10px;padding:12px;margin:12px 0;font-size:13px;line-height:1.55}.markdown-body .md-code code{background:transparent;color:inherit;padding:0}.md-code-lang{color:#93c5fd;font-weight:700}.markdown-body blockquote{border-left:4px solid #cbd5e1;margin:10px 0;padding:8px 12px;background:#f8fafc;color:#475569}.markdown-body hr{border:0;border-top:1px solid #e5e7eb;margin:16px 0}.md-table-wrap{overflow:auto;border:1px solid #e2e5ea;border-radius:10px;margin:12px 0}.markdown-body .md-table-wrap table{width:100%;border-collapse:collapse;font-size:13px}.markdown-body .md-table-wrap th,.markdown-body .md-table-wrap td{border-bottom:1px solid #e8ebef;padding:8px 9px;text-align:left;white-space:normal;vertical-align:top}.markdown-body .md-table-wrap th{background:#f7f8fa;font-weight:800}.markdown-body .md-table-wrap tr:last-child td{border-bottom:0}


/* Two-row analysis/Gemini tab layout */
.grouped-tabs{
  display:grid;
  grid-template-columns:minmax(120px,.7fr) repeat(4,minmax(150px,1fr));
  gap:10px;
  align-items:stretch;
}
.grouped-tabs .tab-group{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.grouped-tabs .tab-group button{
  width:100%;
  min-height:42px;
}
.grouped-tabs .tab-pair button{
  font-size:15px;
  font-weight:400;
}
.grouped-tabs .overview-tab-group{
  justify-content:center;
}
.grouped-tabs .overview-tab-button{
  min-height:92px;
  font-weight:800;
  font-size:16px;
}
.grouped-tabs .tab-pair button:first-child,
.grouped-tabs .tab-pair button:nth-child(2){
  font-size:15px;
  font-weight:400;
  padding-top:10px;
  padding-bottom:10px;
}
@media(max-width:980px){
  .grouped-tabs{grid-template-columns:repeat(2,minmax(0,1fr));}
  .grouped-tabs .overview-tab-group{grid-column:1 / -1;}
  .grouped-tabs .overview-tab-button{min-height:48px;}
}
@media(max-width:560px){
  .grouped-tabs{grid-template-columns:1fr;}
}

/* Overview: 3-line summaries from each Gemini answer */
.overview-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.overview-summary-card{border:1px solid #e2e5ea;border-radius:12px;background:#fff;padding:12px}
.overview-summary-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.overview-summary-head span{font-weight:800}
.overview-summary-head small{color:#666;font-size:12px;background:#f4f5f7;border-radius:999px;padding:3px 8px;white-space:nowrap}
.overview-summary-card ol{margin:0;padding-left:22px;color:#333;line-height:1.65;font-size:13px}
.overview-summary-card li{margin:3px 0}
.summary-empty{margin:0;color:#777;font-size:13px;line-height:1.6}
@media(max-width:900px){.overview-summary-grid{grid-template-columns:1fr}}

/* Overview tab: match the height of each two-row analysis/Gemini tab pair */
.grouped-tabs .overview-tab-group{
  height:100%;
}
.grouped-tabs .overview-tab-button{
  height:100%;
  min-height:96px;
  display:flex;
  align-items:center;
  justify-content:center;
}
@media(max-width:980px){
  .grouped-tabs .overview-tab-button{min-height:96px;}
}

/* Status badge colors in overview summaries */
.overview-summary-card.status-done{border-color:#bbf7d0;background:#f0fdf4}
.overview-summary-card.status-ready{border-color:#bfdbfe;background:#eff6ff}
.overview-summary-card.status-running{border-color:#fde68a;background:#fffbeb}
.overview-summary-card.status-error{border-color:#fecaca;background:#fef2f2}
.overview-summary-card.status-empty{border-color:#e2e5ea;background:#fff}
.overview-summary-head small.summary-status{font-weight:800;border-radius:999px;padding:4px 9px;white-space:nowrap}
.overview-summary-head small.summary-status.status-done{color:#166534;background:#dcfce7;border:1px solid #86efac}
.overview-summary-head small.summary-status.status-ready{color:#1d4ed8;background:#dbeafe;border:1px solid #93c5fd}
.overview-summary-head small.summary-status.status-running{color:#92400e;background:#fef3c7;border:1px solid #fcd34d}
.overview-summary-head small.summary-status.status-error{color:#991b1b;background:#fee2e2;border:1px solid #fca5a5}
.overview-summary-head small.summary-status.status-empty{color:#666;background:#f4f5f7;border:1px solid #e5e7eb}

.answer-box.answer-empty{color:#9ca3af;background:#fafbfc}
.answer-placeholder{margin:0;color:#9ca3af;font-size:14px;font-style:italic}

/* Disclosure PDF news table: header center, body left */
.disclosure-news-table th { text-align: center; }
.disclosure-news-table td { text-align: left; }
.disclosure-news-table td:first-child,
.disclosure-news-table td:nth-child(2),
.disclosure-news-table td:last-child { text-align: center; }
.disclosure-news-table .text-cell { text-align: left; min-width: 420px; white-space: normal; word-break: break-word; }

/* AI分析中のスケルトンスクリーン */
.answer-box.answer-loading {
  background: #fffdf5;
  border-color: #fde68a;
}
.skeleton-answer { padding: 4px 0; }
.loading-label {
  margin: 0 0 12px;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}
.skeleton-line {
  height: 13px;
  border-radius: 999px;
  margin: 10px 0;
  background: linear-gradient(90deg, #e5e7eb 0%, #f9fafb 45%, #e5e7eb 90%);
  background-size: 220% 100%;
  animation: skeleton-loading 1.2s ease-in-out infinite;
}
.skeleton-line.long { width: 92%; }
.skeleton-line.short { width: 46%; }
.summary-skeleton { padding: 4px 0; }
@keyframes skeleton-loading {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* unified pale acquired-state styling */
.overview-summary-card.status-done,
.overview-summary-card.status-ready {
  border-color: #d8e0ea;
  background: #f6f8fb;
}
.overview-summary-head small.summary-status.status-done,
.overview-summary-head small.summary-status.status-ready {
  color: #44546a;
  background: #eef2f7;
  border: 1px solid #d8e0ea;
}
.overview-summary-card.status-running {
  border-color: #d8e0ea;
  background: #f6f8fb;
}
.overview-summary-head small.summary-status.status-running {
  color: #44546a;
  background: #eef2f7;
  border: 1px solid #d8e0ea;
}

/* Acquired-state cue: use one subtle pale tone, not colorful */
#summaryText{display:none;}
.grouped-tabs button.tab-acquired:not(.active),
.grouped-tabs button.tab-done:not(.active),
.grouped-tabs button.tab-loading:not(.active){
  background:#f6f8fb;
  border-color:#d8e0ea;
  color:#222;
}
.grouped-tabs button.tab-loading:not(.active){
  background:linear-gradient(90deg,#f6f8fb 0%,#eef2f7 50%,#f6f8fb 100%);
  background-size:220% 100%;
  animation:skeleton-loading 1.2s ease-in-out infinite;
}

.legal-footer {
  margin: 18px 0 8px;
  padding: 12px 14px;
  border: 1px solid #e2e5ea;
  border-radius: 12px;
  background: #f8f9fb;
  color: #666;
  font-size: 12px;
  line-height: 1.7;
}


.extension-note { margin: 10px 0 0; color: #666; font-size: 13px; line-height: 1.6; }
.extension-note .note-label { font-weight: 700; color: #555; }


/* Status colors: data acquired / AI running / AI done */
.overview-summary-card.status-ready{
  border-color:#bfdbfe !important;
  background:#eff6ff !important;
}
.overview-summary-card.status-running{
  border-color:#fde68a !important;
  background:#fffbeb !important;
}
.overview-summary-card.status-done{
  border-color:#bbf7d0 !important;
  background:#f0fdf4 !important;
}
.overview-summary-head small.summary-status.status-ready{
  color:#1d4ed8 !important;
  background:#dbeafe !important;
  border-color:#93c5fd !important;
}
.overview-summary-head small.summary-status.status-running{
  color:#92400e !important;
  background:#fef3c7 !important;
  border-color:#fcd34d !important;
}
.overview-summary-head small.summary-status.status-done{
  color:#166534 !important;
  background:#dcfce7 !important;
  border-color:#86efac !important;
}
.grouped-tabs button.tab-acquired:not(.active){
  background:#eff6ff !important;
  border-color:#bfdbfe !important;
  color:#1e3a8a !important;
}
.grouped-tabs button.tab-loading:not(.active){
  background:linear-gradient(90deg,#fffbeb 0%,#fef3c7 50%,#fffbeb 100%) !important;
  border-color:#fde68a !important;
  color:#78350f !important;
  background-size:220% 100% !important;
  animation:skeleton-loading 1.2s ease-in-out infinite !important;
}
.grouped-tabs button.tab-done:not(.active){
  background:#f0fdf4 !important;
  border-color:#bbf7d0 !important;
  color:#14532d !important;
}

.extension-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  color: #555;
  font-size: 13px;
  line-height: 1.6;
}
.extension-note .note-label {
  font-weight: 700;
  color: #444;
  margin-right: 2px;
}
.extension-note a {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #d7dce5;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  text-decoration: none;
}
.extension-note a:hover {
  background: #eef2f7;
}


.extension-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #d7dce5;
  background: #f8fafc;
  color: #475569;
}
.extension-status-enabled {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.extension-status-disabled {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}
.extension-status-checking {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}


/* Data tab state rule: data tabs stay pale yellow after data acquisition; AI tabs stay white until done. */
.grouped-tabs button.tab-acquired:not(.active),
.grouped-tabs button.tab-loading:not(.active){
  background:#fffbeb !important;
  border-color:#fde68a !important;
  color:#78350f !important;
  animation:none !important;
}
.grouped-tabs button.tab-done:not(.active){
  background:#f0fdf4 !important;
  border-color:#bbf7d0 !important;
  color:#14532d !important;
}


/* AIテクニカル分析: Geminiの回答を加工せず、そのまま表示 */
.answer-box.answer-plain{
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

/* AI回答欄は途中で切れないように全文表示する */
.answer-box,
.markdown-body.answer-box,
.answer-box.answer-plain {
  max-height: none !important;
  overflow: visible !important;
}

/* 長い表・コードだけは横スクロールを許可 */
.markdown-body .md-table-wrap,
.markdown-body .md-code {
  overflow: auto;
}

/* AI回答欄: フロントエンド側で途中で切れないように全文表示 */
.answer-box,
.markdown-body.answer-box,
.answer-box.answer-plain {
  max-height: none !important;
  overflow: visible !important;
}




/* Technical indicator help popup */
.indicator-label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
.indicator-help-btn{width:18px;height:18px;min-width:18px;padding:0;border-radius:999px;border:1px solid #cbd5e1;background:#f8fafc;color:#475569;font-size:11px;font-weight:800;line-height:16px;text-align:center;cursor:pointer;}
.indicator-help-btn:hover{background:#eef2f7;}
.indicator-help-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.35);z-index:9999;}
.indicator-help-modal{position:relative;width:min(620px,100%);max-height:min(82vh,760px);display:flex;flex-direction:column;background:#fff;border:1px solid #e2e8f0;border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.18);padding:20px 22px;}
.indicator-help-modal h3{margin:0 34px 10px 0;font-size:17px;}
.indicator-help-modal p{margin:0;color:#334155;line-height:1.75;font-size:14px;white-space:pre-wrap;overflow:auto;max-height:calc(82vh - 96px);padding-right:8px;}
.indicator-help-close{position:absolute;top:10px;right:10px;width:30px;height:30px;padding:0;border-radius:999px;font-size:20px;line-height:26px;}

/* Dow theory swing evidence */
.dow-evidence-title{margin:14px 0 6px;font-size:14px;}
.dow-evidence-note{margin:0 0 8px;color:#555;font-size:12px;line-height:1.6;}

/* Final integrated decision panel */
.final-decision-panel{
  margin-top:16px;
  border:1px solid #dbeafe;
  border-radius:14px;
  background:#f8fbff;
  padding:14px;
}
.final-decision-panel .answer-box{
  background:#fff;
  border-color:#bfdbfe;
  margin-top:10px;
}
.final-decision-panel .prompt-area{
  min-height:260px;
  background:#fff;
}
#finalPromptStatus{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 10px;
  font-size:12px;
  font-weight:800;
  color:#1d4ed8;
  background:#dbeafe;
  border:1px solid #93c5fd;
  white-space:nowrap;
}
#sendFinalGeminiBtn{
  font-weight:800;
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}
#sendFinalGeminiBtn:disabled{
  background:#fff;
  color:#555;
  border-color:#b8c0cc;
}

/* Yahoo掲示板: 投稿一覧は内容を読みやすくするため左寄せ */
#boardPostsTable th,
#boardPostsTable td {
  text-align: left !important;
}
#boardPostsTable td.text-cell {
  text-align: left !important;
  white-space: pre-wrap;
  word-break: break-word;
}
