/*!
 * Ookubo Horoscope All-in-One Calculator — stylesheet
 * Part of the senjutsu.jp / Ookubo Uranai Laboratory project.
 *
 * No third-party CSS is bundled. All rules below are original.
 */

.ookubo-horoscope-aio {
    max-width: 1024px;
    margin: 24px auto;
    padding: 20px;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    background: #fafbfc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Meiryo", sans-serif;
    line-height: 1.6;
    color: #24292f;
}
.ookubo-horoscope-aio h3 {
    margin: 0 0 8px 0;
    font-size: 1.18em;
    border-bottom: 2px solid #4a6fa5;
    padding-bottom: 4px;
    color: #1e3a5f;
}
.ookubo-horoscope-aio h4 {
    margin: 18px 0 8px 0;
    font-size: 1.04em;
    color: #1e3a5f;
    border-left: 4px solid #4a6fa5;
    padding-left: 8px;
}
.ookubo-horoscope-aio .haio-note {
    font-size: 0.92em;
    color: #444;
    margin: 0 0 16px 0;
}

/* Form */
.ookubo-horoscope-aio .haio-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 14px;
    align-items: end;
}
.ookubo-horoscope-aio .haio-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ookubo-horoscope-aio .haio-field label {
    font-size: 0.82em;
    font-weight: 600;
    color: #24292f;
}
.ookubo-horoscope-aio .haio-field select,
.ookubo-horoscope-aio .haio-field input[type="number"] {
    padding: 5px 8px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95em;
    min-height: 32px;
    color: #24292f;
}
.ookubo-horoscope-aio .haio-field.haio-check {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}
.ookubo-horoscope-aio .haio-field.haio-check label {
    font-size: 0.88em;
    font-weight: 500;
}
.ookubo-horoscope-aio button.haio-calc {
    padding: 8px 22px;
    background: #4a6fa5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.0em;
    cursor: pointer;
    font-weight: 600;
}
.ookubo-horoscope-aio button.haio-calc:hover { background: #3d5d8a; }

/* Result panels */
.ookubo-horoscope-aio .haio-result {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.ookubo-horoscope-aio .haio-panel {
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 14px 16px;
}
.ookubo-horoscope-aio .haio-panel.haio-panel-western { border-color: #4a6fa5; }
.ookubo-horoscope-aio .haio-panel.haio-panel-vedic   { border-color: #a05a6e; background: #fff8f9; }
.ookubo-horoscope-aio .haio-panel.haio-panel-sizhu   { border-color: #5a8a5a; background: #f8fbf8; }
.ookubo-horoscope-aio .haio-panel-western h4 { color: #1e3a5f; border-left-color: #4a6fa5; }
.ookubo-horoscope-aio .haio-panel-vedic h4   { color: #6a2a3f; border-left-color: #a05a6e; }
.ookubo-horoscope-aio .haio-panel-sizhu h4   { color: #2a5a2a; border-left-color: #5a8a5a; }

.ookubo-horoscope-aio .haio-summary {
    font-size: 0.92em;
    color: #444;
    margin-bottom: 8px;
}
.ookubo-horoscope-aio .haio-summary strong {
    color: #24292f;
}

/* Tables */
.ookubo-horoscope-aio table.haio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
    margin: 6px 0;
    table-layout: auto;
}
.ookubo-horoscope-aio table.haio-table th,
.ookubo-horoscope-aio table.haio-table td {
    border: 1px solid #d0d7de;
    padding: 5px 8px;
    text-align: center;
    vertical-align: middle;
}
.ookubo-horoscope-aio table.haio-table th {
    background: #eef3f8;
    font-weight: 600;
    font-size: 0.88em;
}
.ookubo-horoscope-aio .haio-scroll { overflow-x: auto; }

/* Status messages */
.ookubo-horoscope-aio .haio-stub {
    padding: 12px 14px;
    background: #fff8e1;
    border-radius: 6px;
    border: 1px solid #e0c878;
    font-size: 0.92em;
    color: #7a5a00;
}
.ookubo-horoscope-aio .haio-error {
    padding: 12px 14px;
    background: #ffe5e5;
    border-radius: 6px;
    border: 1px solid #d09090;
    font-size: 0.92em;
    color: #7a2a2a;
}

/* Privacy / credits */
.ookubo-horoscope-aio .haio-privacy {
    font-size: 0.82em;
    color: #6a7080;
    margin-top: 14px;
    padding: 6px 10px;
    background: #f3f5f7;
    border-radius: 4px;
    border-left: 3px solid #8a9aae;
}
.ookubo-horoscope-aio .haio-credits {
    margin-top: 18px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    font-size: 0.86em;
    color: #444;
}
.ookubo-horoscope-aio .haio-credits h4 {
    margin-top: 0;
    border-left-color: #8a9aae;
    color: #444;
}
.ookubo-horoscope-aio .haio-credits ul {
    margin: 6px 0 6px 1.2em;
    padding: 0;
}
.ookubo-horoscope-aio .haio-credits li {
    margin-bottom: 6px;
    line-height: 1.55;
}
.ookubo-horoscope-aio .haio-credits code {
    background: #eef3f8;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.92em;
}
.ookubo-horoscope-aio .haio-caution {
    font-size: 0.85em;
    margin-top: 8px;
    color: #6a4a1a;
}

/* Phase 5: SVG charts */
.ookubo-horoscope-aio .haio-svg-wrap {
    text-align: center;
    margin: 12px 0;
    overflow: visible;     /* SVG の viewBox 外余白（AC/MC ラベル等）が親で切れないよう保護 */
}
.ookubo-horoscope-aio .haio-svg-western,
.ookubo-horoscope-aio .haio-svg-southindian {
    max-width: 100%;
    height: auto;
    display: inline-block;
    background: #fff;
    overflow: visible;
}
.ookubo-horoscope-aio .haio-vedic-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: flex-start;
    margin: 12px 0;
}
.ookubo-horoscope-aio .haio-vedic-charts .haio-svg-wrap {
    flex: 0 1 auto;
    margin: 0;
}
/* Phase 7c: 品位欄の小字（Mrityubhag/Gandanta）と四柱推命の天干/地支太字 */
.ookubo-horoscope-aio .haio-dignity-small {
    font-size: 0.78em;
    color: #a05a3a;
    font-weight: 600;
    margin-left: 2px;
}
.ookubo-horoscope-aio table.haio-table td.haio-sizhu-stem,
.ookubo-horoscope-aio table.haio-table td.haio-sizhu-branch {
    font-weight: 700;
    font-size: 1.18em;
}

/* Phase 7: ヨーガ表 — ツールチップが切れないよう overflow visible に保つ。
   3 列構成（ヨーガ名/関連天体/性質）で縦書きを許容しつつ、テーブルそのものは
   折り返して縦長になっても OK。テーブル幅が画面幅に収まらない場合は table
   セル内で折り返して対応する（haio-scroll の clip 効果を避けるため）。 */
.ookubo-horoscope-aio .haio-yoga-table-wrap {
    overflow: visible;
    margin: 8px 0;
}
.ookubo-horoscope-aio .haio-yoga-table-wrap table.haio-table {
    table-layout: auto;
}
.ookubo-horoscope-aio .haio-yoga-table-wrap table.haio-table td:first-child,
.ookubo-horoscope-aio .haio-yoga-table-wrap table.haio-table th:first-child {
    word-break: keep-all;
    overflow-wrap: normal;
    white-space: normal;
}

/* Phase 7: ヨーガツールチップ */
.ookubo-horoscope-aio .haio-yoga-trigger {
    position: relative;
    cursor: pointer;
    color: #6a2a3f;
    border-bottom: 1px dotted #a05a6e;
    padding: 1px 2px;
    user-select: none;
    -webkit-tap-highlight-color: rgba(160, 90, 110, 0.15);
}
.ookubo-horoscope-aio .haio-yoga-trigger:hover,
.ookubo-horoscope-aio .haio-yoga-trigger:focus,
.ookubo-horoscope-aio .haio-yoga-trigger.haio-active {
    background: #fff8f9;
    outline: none;
}
.ookubo-horoscope-aio .haio-yoga-icon {
    color: #a05a6e;
    font-size: 0.85em;
    margin-left: 2px;
    opacity: 0.8;
}
.ookubo-horoscope-aio .haio-yoga-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #a05a6e;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    width: 320px;
    max-width: 90vw;
    font-size: 0.92em;
    line-height: 1.65;
    color: #333;
    font-weight: 400;
    white-space: normal;
    margin-top: 4px;
    text-align: left;
    cursor: auto;
}
.ookubo-horoscope-aio .haio-yoga-trigger:hover .haio-yoga-tooltip,
.ookubo-horoscope-aio .haio-yoga-trigger:focus .haio-yoga-tooltip,
.ookubo-horoscope-aio .haio-yoga-trigger.haio-active .haio-yoga-tooltip {
    display: block;
}
.ookubo-horoscope-aio .haio-yoga-good {
    color: #2a6a3f;
    font-weight: 600;
}
.ookubo-horoscope-aio .haio-yoga-bad {
    color: #a05a3a;
    font-weight: 600;
}
@media (max-width: 480px) {
    .ookubo-horoscope-aio .haio-yoga-tooltip {
        width: 84vw;
        font-size: 0.88em;
    }
}

/* Phase 14a: 特殊配置のアスペクト (Aspect Patterns)
   既存の haio-yoga-* と同じ体裁で実装。クラス名は haio-pattern-* で独立し、
   将来的にスタイル分岐できるようにする (色のみ西洋占星術用に調整)。 */
.ookubo-horoscope-aio .haio-pattern-table-wrap {
    overflow: visible;
    margin: 8px 0;
}
.ookubo-horoscope-aio .haio-pattern-table-wrap table.haio-table {
    table-layout: auto;
}
.ookubo-horoscope-aio .haio-pattern-table-wrap table.haio-table td:first-child,
.ookubo-horoscope-aio .haio-pattern-table-wrap table.haio-table th:first-child {
    word-break: keep-all;
    overflow-wrap: normal;
    white-space: normal;
}
.ookubo-horoscope-aio .haio-pattern-trigger {
    position: relative;
    cursor: pointer;
    color: #4a3a8a;
    border-bottom: 1px dotted #6a5aa0;
    padding: 1px 2px;
    user-select: none;
    -webkit-tap-highlight-color: rgba(106, 90, 160, 0.15);
}
.ookubo-horoscope-aio .haio-pattern-trigger:hover,
.ookubo-horoscope-aio .haio-pattern-trigger:focus,
.ookubo-horoscope-aio .haio-pattern-trigger.haio-active {
    background: #f8f6fc;
    outline: none;
}
.ookubo-horoscope-aio .haio-pattern-icon {
    color: #6a5aa0;
    font-size: 0.85em;
    margin-left: 2px;
    opacity: 0.8;
}
.ookubo-horoscope-aio .haio-pattern-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #6a5aa0;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    width: 320px;
    max-width: 90vw;
    font-size: 0.92em;
    line-height: 1.65;
    color: #333;
    font-weight: 400;
    white-space: normal;
    margin-top: 4px;
    text-align: left;
    cursor: auto;
}
.ookubo-horoscope-aio .haio-pattern-trigger:hover .haio-pattern-tooltip,
.ookubo-horoscope-aio .haio-pattern-trigger:focus .haio-pattern-tooltip,
.ookubo-horoscope-aio .haio-pattern-trigger.haio-active .haio-pattern-tooltip {
    display: block;
}
/* 性質ラベルの色分け 4 種 (調和・緊張・運命・集中) */
.ookubo-horoscope-aio .haio-pattern-harmony {
    color: #2a6a3f;
    font-weight: 600;
}
.ookubo-horoscope-aio .haio-pattern-tension {
    color: #a05a3a;
    font-weight: 600;
}
.ookubo-horoscope-aio .haio-pattern-fate {
    color: #6a3a8a;
    font-weight: 600;
}
.ookubo-horoscope-aio .haio-pattern-concentration {
    color: #2a5a8a;
    font-weight: 600;
}
@media (max-width: 480px) {
    .ookubo-horoscope-aio .haio-pattern-tooltip {
        width: 84vw;
        font-size: 0.88em;
    }
}

.ookubo-horoscope-aio button.haio-aspect-toggle {
    padding: 6px 14px;
    background: #4a6fa5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.88em;
    cursor: pointer;
    margin: 4px 0 12px 0;
    font-weight: 500;
}
.ookubo-horoscope-aio button.haio-aspect-toggle:hover { background: #3d5d8a; }

/* Phase 11: 緯度経度入力（世界対応） */
.ookubo-horoscope-aio .haio-place-mode-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 4px;
}
.ookubo-horoscope-aio .haio-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92em;
    cursor: pointer;
    font-weight: 500;
}
.ookubo-horoscope-aio .haio-radio input[type="radio"] {
    margin: 0;
}
.ookubo-horoscope-aio .haio-place-pref-fields,
.ookubo-horoscope-aio .haio-place-latlng-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    flex-basis: 100%;
    align-items: end;
}
.ookubo-horoscope-aio .haio-field-hint {
    font-weight: 400;
    color: #6a7080;
    font-size: 0.84em;
    margin-left: 4px;
}
.ookubo-horoscope-aio .haio-in-place-name {
    padding: 5px 8px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95em;
    min-height: 32px;
    color: #24292f;
    width: 100%;
    box-sizing: border-box;
}
.ookubo-horoscope-aio .haio-latlng-note {
    font-size: 0.85em;
    color: #6a4a1a;
    margin: 4px 0 0 0;
    padding: 6px 10px;
    background: #fff8e1;
    border-left: 3px solid #e0c878;
    border-radius: 4px;
}
.ookubo-horoscope-aio .haio-overseas-banner {
    background: #fff5e7;
    border: 1px solid #d8a878;
    border-left: 4px solid #c87830;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0 0 12px 0;
    font-size: 0.92em;
    color: #6a4010;
    line-height: 1.55;
}
.ookubo-horoscope-aio .haio-overseas-banner strong {
    color: #6a3010;
    font-size: 0.96em;
    display: block;
    margin-bottom: 4px;
}
.ookubo-horoscope-aio .haio-overseas-banner p {
    margin: 0;
}

/* Phase 10: 結果 JSON ダウンロードセクション */
.ookubo-horoscope-aio .haio-download-section {
    margin-top: 18px;
    padding: 14px 16px;
    background: #f3f7fb;
    border: 1px solid #c8d4e3;
    border-radius: 8px;
}
.ookubo-horoscope-aio .haio-download-section h4 {
    margin: 0 0 10px 0;
    font-size: 1.02em;
    color: #1e3a5f;
    border-left: 4px solid #4a6fa5;
    padding-left: 8px;
}
.ookubo-horoscope-aio button.haio-download-btn {
    padding: 10px 22px;
    background: #4a6fa5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.96em;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    margin: 4px 0 12px 0;
}
.ookubo-horoscope-aio button.haio-download-btn:hover { background: #3d5d8a; }
.ookubo-horoscope-aio button.haio-download-btn:focus {
    outline: 2px solid #4a6fa5;
    outline-offset: 2px;
}
.ookubo-horoscope-aio .haio-download-notice {
    font-size: 0.84em;
    color: #4a5060;
    line-height: 1.6;
}
.ookubo-horoscope-aio .haio-download-points {
    margin: 0;
    padding-left: 1.2em;
}
.ookubo-horoscope-aio .haio-download-points li {
    margin-bottom: 4px;
}

/* Phase 13: /horoscope/star-meanings/ ガイドへの誘導 CTA (結果末尾) */
.ookubo-horoscope-aio .haio-star-meanings-cta {
    margin-top: 18px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f3f0fa 0%, #e8eaf3 100%);
    border: 1px solid #c8cce3;
    border-left: 4px solid #6a4a8a;
    border-radius: 8px;
}
.ookubo-horoscope-aio .haio-star-meanings-cta h4 {
    margin: 0 0 8px 0;
    color: #4a2a6a;
    font-size: 1.02em;
    border-left: none;
    padding-left: 0;
}
.ookubo-horoscope-aio .haio-star-meanings-cta-text {
    margin: 0 0 10px 0;
    font-size: 0.92em;
    color: #4a4060;
    line-height: 1.65;
}
.ookubo-horoscope-aio .haio-star-meanings-cta-link {
    display: inline-block;
    padding: 8px 18px;
    background: #6a4a8a;
    color: #fff !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
}
.ookubo-horoscope-aio .haio-star-meanings-cta-link:hover {
    background: #5a3a7a;
    color: #fff !important;
}

/* Phase 12: iOS Safari 向け注記 (ダウンロード非対応の案内) */
.ookubo-horoscope-aio .haio-download-safari-note {
    font-size: 0.86em;
    color: #6a4010;
    line-height: 1.55;
    margin: 6px 0 10px 0;
    padding: 8px 12px;
    background: #fff5e7;
    border-left: 4px solid #c87830;
    border-radius: 4px;
}
.ookubo-horoscope-aio .haio-download-safari-note strong {
    color: #6a3010;
    display: inline-block;
    margin-right: 2px;
}

@media (max-width: 480px) {
    .ookubo-horoscope-aio { padding: 14px; }
    .ookubo-horoscope-aio table.haio-table { font-size: 0.85em; }
    .ookubo-horoscope-aio table.haio-table th,
    .ookubo-horoscope-aio table.haio-table td { padding: 4px 5px; }
    /* SVG 図表: 親 (.haio-panel) のコンテンツ幅にフィットさせる。
       v0.12.4 で 95vw を使ったところ、ビューポート全幅基準のためパネル左右
       パディング分を考慮できず右にはみ出した。100% 基準に変更し、
       max-width で上限を設けるだけにする。height:auto と viewBox に任せて
       アスペクト比は SVG 側で維持される。 */
    .ookubo-horoscope-aio .haio-svg-southindian {
        width: 100%;
        max-width: 380px;
        height: auto;
    }
    .ookubo-horoscope-aio .haio-svg-western {
        width: 100%;
        max-width: 420px;
        height: auto;
    }
}

/* ============ クイックアクセス (作成ボタン直下: JSON DL + プロンプト集リンク) ============ */
/* 重い装飾を避け、シンプルなテキストリンクで控えめに配置 */
.haio-quick-access {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45em 1.3em;
    align-items: center;
    margin: 0.5em 0 1.2em;
    padding: 0.7em 1em;
    background: #f7f3fb;
    border: 1px solid #e3d6f0;
    border-radius: 8px;
}
.haio-quick-link {
    color: #7a6997;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 600;
    border-bottom: 1px solid rgba(122, 105, 151, 0.4);
    transition: color 0.12s ease, border-color 0.12s ease;
}
.haio-quick-link:hover {
    color: #5d4f76;
    border-bottom-color: #5d4f76;
}
/* 下部ダウンロードボタン直下: プロンプト集リンク (DLボタンと同じボタン形状に統一) */
.haio-download-prompt-link-wrap {
    margin: 0 0 12px 0;
    text-align: left;
}
.ookubo-horoscope-aio a.haio-download-prompt-link {
    padding: 10px 22px;
    background: #4a6fa5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.96em;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: background 0.12s ease;
}
.ookubo-horoscope-aio a.haio-download-prompt-link:hover {
    background: #3d5d8a;
    color: #fff;
}
.ookubo-horoscope-aio a.haio-download-prompt-link:focus {
    outline: 2px solid #4a6fa5;
    outline-offset: 2px;
}

/* 緯度経度モード: 座標検索サイトへの誘導リンク */
.ookubo-horoscope-aio .haio-coord-lookup {
    margin: 0 0 6px 0;
    font-size: 0.9em;
}
.ookubo-horoscope-aio .haio-coord-lookup a {
    color: #4a6fa5;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(74, 111, 165, 0.4);
}
.ookubo-horoscope-aio .haio-coord-lookup a:hover {
    color: #3d5d8a;
    border-bottom-color: #3d5d8a;
}
