@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;600;800&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  --ink: #1a1410;
  --paper: #f8f5ef;
  --paper2: #f0ebe0;
  --gold: #b8943f;
  --gold-light: #d4af6a;
  --gold-bg: rgba(184, 148, 63, 0.08);
  --red: #c0392b;
  --blue: #1a3a5c;
  --muted: #6b5f4e;
  --border: #d8cdb5;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(26, 20, 16, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 20, 16, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  line-height: 1.8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== レイアウト ===== */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

.screen {
  display: none;
  animation: fadeIn 0.4s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 共通ヘッダー ===== */
.app-header {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 1.2rem 1rem;
  position: static;
  z-index: 100;
}

.app-header h1 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold-light);
}

.app-header h1 .app-home-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.app-header h1 .app-home-link:hover { opacity: 0.85; }

.app-header .date-label {
  font-size: 11px;
  color: rgba(245, 240, 232, 0.5);
  letter-spacing: 0.1em;
  margin-top: 0.2rem;
}

.header-nav {
  display: flex;
  margin-top: 0.8rem;
}

.header-nav-item {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  color: rgba(245, 240, 232, 0.4);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.1em;
  border-bottom: 2px solid transparent;
}

.header-nav-item.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

.header-nav-item:hover {
  color: var(--gold-light);
}

.header-star-name {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.15em;
  text-align: center;
  padding-top: 1.2rem;
}

.star-profile {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  padding: 1rem 0.5rem 0.5rem;
}

/* ===== 入力画面 ===== */
.input-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.input-hero {
  background: var(--ink);
  color: var(--paper);
  padding: 3rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.input-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(184,148,63,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(26,58,92,0.2) 0%, transparent 60%);
}

.input-hero-content {
  position: relative;
  z-index: 1;
}

.input-hero .app-icon {
  width: 64px;
  height: 64px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-family: 'Shippori Mincho', serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-light);
}

.input-hero h1 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.input-hero p {
  font-size: 12px;
  color: rgba(245, 240, 232, 0.5);
  letter-spacing: 0.2em;
}

.input-form-area {
  flex: 1;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.input-form-area h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.input-form-area .subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.birth-inputs {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.input-group select,
.input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}

.input-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b5f4e' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

.input-group select:focus,
.input-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 148, 63, 0.15);
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--ink);
  color: var(--gold-light);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Shippori Mincho', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  background: #2a2420;
}

.submit-btn:active {
  transform: scale(0.98);
}

.input-note {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

/* ===== 本命星結果画面 ===== */
.result-card-wrapper {
  padding: 1.5rem;
}

.result-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.result-card-header {
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.result-card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(184,148,63,0.15) 0%, transparent 70%);
}

.result-card-header .element-badge {
  display: inline-block;
  padding: 0.2rem 1.2rem;
  border: 1px solid var(--gold);
  border-radius: 20px;
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  position: relative;
}

.result-star-name {
  font-family: 'Shippori Mincho', serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  position: relative;
}

.result-personality {
  font-size: 13px;
  color: rgba(245, 240, 232, 0.7);
  line-height: 1.8;
  max-width: 300px;
  margin: 0 auto;
  position: relative;
}

.result-card-body {
  padding: 1.5rem 2rem 2rem;
}

.result-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.result-info-item {
  background: rgba(245, 240, 232, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.result-info-item .label {
  font-size: 10px;
  color: var(--gold-light);
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
}

.result-info-item .value {
  font-size: 13px;
  color: var(--paper);
  line-height: 1.6;
}

.result-actions {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.08em;
}

.btn-primary:hover { background: var(--gold-light); }
.btn-primary:active { transform: scale(0.98); }

.btn-outline {
  width: 100%;
  padding: 0.8rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ===== 今日の運気画面 ===== */
.daily-content {
  padding: 0 1rem 2rem;
}

/* 日付ヘッダー */
.daily-date-bar {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.daily-date-bar .date-main {
  font-family: 'Shippori Mincho', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.daily-date-bar .star-info {
  font-size: 12px;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* スコアカード */
.score-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 0.8rem 0 1rem;
  position: relative;
  overflow: hidden;
}

.score-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(184,148,63,0.1) 0%, transparent 60%);
}

.score-card > * { position: relative; }

.score-palace {
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: 0.2em;
  margin-bottom: 0.8rem;
}

.score-number {
  font-family: 'Shippori Mincho', serif;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.score-sub {
  font-size: 12px;
  color: rgba(245, 240, 232, 0.5);
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.score-max {
  font-size: 13px;
  color: rgba(245, 240, 232, 0.4);
  margin-bottom: 0.8rem;
}

.score-meaning {
  font-size: 12px;
  color: rgba(245, 240, 232, 0.6);
  margin-top: 0.5rem;
}

.score-rank {
  display: inline-block;
  padding: 0.3rem 1.5rem;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.score-stars {
  margin-top: 0.8rem;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
}

.score-detail {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 11px;
  color: rgba(245, 240, 232, 0.5);
}

.score-detail span { display: flex; align-items: center; gap: 0.3rem; }

.penalty-badge {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0.6rem auto 0;
  padding: 0.2rem 0.8rem;
  background: rgba(192, 57, 43, 0.3);
  border: 1px solid rgba(192, 57, 43, 0.5);
  border-radius: 4px;
  font-size: 11px;
  color: #e74c3c;
}

/* ===== 同会先・五行関係バッジ（表示専用） ===== */
.gogyo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(245, 240, 232, 0.08);
  border: 1px solid rgba(245, 240, 232, 0.2);
  color: rgba(245, 240, 232, 0.85);
  letter-spacing: 0.04em;
}
.gogyo-badge-dohkai { font-weight: 600; }
.gogyo-badge-rel { padding: 0 0.4rem; font-weight: 700; }
.gogyo-badge-short { opacity: 0.75; }

.gogyo-tone-daikichi { background: rgba(216, 168, 73, 0.18); border-color: rgba(216, 168, 73, 0.5); color: #f5cf7a; }
.gogyo-tone-chukichi { background: rgba(126, 168, 117, 0.16); border-color: rgba(126, 168, 117, 0.45); color: #b6d6a8; }
.gogyo-tone-shokichi { background: rgba(195, 178, 130, 0.14); border-color: rgba(195, 178, 130, 0.4);  color: #ddd0a6; }
.gogyo-tone-kyo      { background: rgba(192, 57, 43, 0.15);  border-color: rgba(192, 57, 43, 0.45);   color: #e8806f; }
.gogyo-tone-neutral  { background: rgba(245, 240, 232, 0.08); border-color: rgba(245, 240, 232, 0.2); color: rgba(245, 240, 232, 0.7); }

/* ===== 同会先・五行コメンタリーカード（advice 末尾、白背景向け） ===== */
.gogyo-card {
  margin-top: 1.0rem;
  background: #fff;
  border: 1px solid rgba(74, 68, 58, 0.12);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 18px -14px rgba(40, 30, 15, 0.18);
  position: relative;
}
.gogyo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gc-accent, #cccccc);
}

.gogyo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.1rem 0.35rem;
}
.gogyo-card-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(74, 68, 58, 0.62);
  font-weight: 600;
}
.gogyo-card-tone-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 0.22rem 0.75rem;
  border-radius: 999px;
  background: var(--gc-pill-bg, #f0f0f0);
  color: var(--gc-pill-color, #555);
  letter-spacing: 0.06em;
}

.gogyo-card-headline {
  padding: 0.25rem 1.1rem 0.55rem;
  font-family: "Shippori Mincho B1", serif;
  font-weight: 700;
  font-size: 1.06rem;
  color: #2c281f;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
  line-height: 1.45;
}
.gogyo-card-dohkai { color: #2c281f; }
.gogyo-card-sep    { color: rgba(0, 0, 0, 0.22); font-weight: 400; font-size: 0.92em; }
.gogyo-card-rel    { color: var(--gc-accent, #555); }
.gogyo-card-short  { color: rgba(74, 68, 58, 0.7); font-weight: 500; font-size: 0.88em; }

.gogyo-card-body {
  padding: 0.45rem 1.1rem 1.0rem;
  font-size: 13.5px;
  line-height: 1.9;
  color: #3a3328;
  margin: 0;
}

/* トーン別色定義（白背景向け・コントラスト確保） */
.gogyo-card.gogyo-tone-daikichi {
  --gc-accent: #b8943f;
  --gc-pill-bg: #fff3d3;
  --gc-pill-color: #7a5d1e;
  background: linear-gradient(180deg, #fdfaf2 0%, #fff 40%);
}
.gogyo-card.gogyo-tone-chukichi {
  --gc-accent: #5b8a51;
  --gc-pill-bg: #e6f1de;
  --gc-pill-color: #2d5826;
  background: linear-gradient(180deg, #f4f9f1 0%, #fff 40%);
}
.gogyo-card.gogyo-tone-shokichi {
  --gc-accent: #a8946a;
  --gc-pill-bg: #f6ecd5;
  --gc-pill-color: #5e4e2a;
  background: linear-gradient(180deg, #fcf8ef 0%, #fff 40%);
}
.gogyo-card.gogyo-tone-kyo {
  --gc-accent: #b23121;
  --gc-pill-bg: #fbe1da;
  --gc-pill-color: #82211a;
  background: linear-gradient(180deg, #fcf1ee 0%, #fff 40%);
}
.gogyo-card.gogyo-tone-neutral {
  --gc-accent: #8a8478;
  --gc-pill-bg: #ececec;
  --gc-pill-color: #555;
}

/* ===== 年・月・日の運勢カード ===== */
.fortune-layers {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fortune-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--gold);
}

.fortune-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}

.fortune-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.fortune-layer-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.fortune-sub {
  margin-left: 0.5em;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.fortune-palace-name {
  font-family: 'Shippori Mincho', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.fortune-score-area {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.fortune-score {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.fortune-rank-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.fortune-keyword {
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.fortune-body {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.9;
  margin-bottom: 0.5rem;
}

.fortune-warning {
  font-size: 11px;
  color: var(--ink);
  line-height: 1.6;
  padding: 0.4rem 0.6rem;
  background: rgba(184, 148, 63, 0.07);
  border-radius: 4px;
}

/* アドバイスタブ */
.advice-section {
  margin: 1rem 0;
}

.advice-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.advice-tabs::-webkit-scrollbar { display: none; }

.advice-tab {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.3rem;
  border: none;
  background: none;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
}

.advice-tab.active {
  color: var(--gold);
  font-weight: 500;
}

.advice-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

.advice-panel {
  display: none;
  padding: 1.2rem 0;
  animation: fadeIn 0.3s ease;
}
.advice-panel.active { display: block; }

.advice-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.advice-item:last-child {
  border-bottom: none;
}

.advice-item-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.advice-text {
  font-size: 14px;
  line-height: 2;
  color: var(--ink);
}

.advice-modifier {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--gold-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.advice-modifier::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--gold);
  border-radius: 2px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* ラッキー情報 */
.lucky-section {
  margin: 1rem 0;
}

.section-label {
  font-family: 'Shippori Mincho', serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
}

.lucky-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.lucky-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
}

.lucky-item .lucky-label {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.15em;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.lucky-item .lucky-value {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

.lucky-item.full-width {
  grid-column: 1 / -1;
}

.color-chips {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.3rem;
}

.color-chip {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.color-chip-label {
  font-size: 12px;
  color: var(--muted);
}

/* バイオリズムグラフ */
.chart-section {
  margin: 1.5rem 0;
}

.chart-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 200px !important;
}

/* 9年サイクル */
.cycle-section {
  margin: 1.5rem 0;
}

.cycle-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
  margin-bottom: 1rem;
}

.cycle-bar {
  display: flex;
  gap: 2px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cycle-item {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.2rem;
  font-size: 10px;
  transition: all 0.2s;
}

.cycle-item .cycle-palace {
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.cycle-item .cycle-year {
  font-size: 9px;
  opacity: 0.7;
}

.cycle-item.current {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  font-weight: 700;
}

/* ===== 各宮の意味テーブル ===== */
.palace-table-section {
  margin: 1.5rem 0;
}

.palace-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.6;
}

.palace-table th {
  background: var(--ink);
  color: var(--gold-light);
  padding: 0.5rem 0.7rem;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-align: left;
}

.palace-table th:first-child {
  border-radius: 4px 0 0 0;
}

.palace-table th:last-child {
  border-radius: 0 4px 0 0;
}

.palace-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

.palace-name {
  font-family: 'Shippori Mincho', serif;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== スコア内訳テーブル ===== */
.breakdown-section {
  margin: 1.5rem 0;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.6;
}

.breakdown-table th {
  background: var(--ink);
  color: var(--gold-light);
  padding: 0.5rem 0.7rem;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-align: left;
}

.breakdown-table th:first-child {
  border-radius: 4px 0 0 0;
}

.breakdown-table th:last-child {
  border-radius: 0 4px 0 0;
}

.breakdown-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.breakdown-table tfoot td {
  background: var(--paper2);
  font-weight: 500;
  color: var(--ink);
}

.breakdown-penalty {
  margin-top: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: rgba(192, 57, 43, 0.05);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: 4px;
  font-size: 12px;
  color: var(--red);
}

.caution-self-hit {
  margin-top: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(192, 57, 43, 0.08);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  font-size: 12px;
  color: var(--red);
  line-height: 1.55;
}

.palace-row-high { background: rgba(184, 148, 63, 0.08); }
.palace-row-mid { background: var(--white); }
.palace-row-low { background: rgba(26, 58, 92, 0.05); }

.palace-table tr.palace-current {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  font-weight: 700;
}

/* シェアボタン */
.share-section {
  margin: 1.5rem 0 0;
  text-align: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.share-btn svg {
  width: 16px;
  height: 16px;
}

/* フッター */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.reset-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Noto Sans JP', sans-serif;
}

.reset-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

.app-footer .credit {
  font-size: 10px;
  color: var(--border);
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
}

/* ===== ランク色 ===== */
.rank-daikichi { background: linear-gradient(135deg, #b8943f, #d4af6a); color: #fff; }
.rank-kichi { background: #c0392b; color: #fff; }
.rank-chukichi { background: #e67e22; color: #fff; }
.rank-shokichi { background: #95a5a6; color: #fff; }
.rank-hei { background: #6b5f4e; color: #fff; }
.rank-kyo { background: #1a3a5c; color: #fff; }
.rank-daikyo { background: #4a0080; color: #fff; }

/* ===== 9年サイクルの色 ===== */
.cycle-high { background: rgba(184, 148, 63, 0.15); color: var(--ink); }
.cycle-mid { background: var(--paper2); color: var(--ink); }
.cycle-low { background: rgba(26, 58, 92, 0.08); color: var(--ink); }

/* ===== レスポンシブ ===== */
@media (min-width: 481px) {
  body { background: #e8e3d8; }
  .app-container {
    max-width: 760px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    background: var(--paper);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: calc(100vh - 4rem);
  }

  .daily-content,
  .compat-content {
    padding: 0 2.5rem 2.5rem;
  }

  .input-form-area {
    padding: 2.5rem 3rem;
  }

  .input-hero {
    padding: 4rem 2rem 5rem;
  }

  .input-hero h1 {
    font-size: 2.2rem;
  }

  .app-header {
    position: sticky;
    top: 0;
  }

  .header-nav-item {
    font-size: 13px;
    padding: 0.7rem 1.5rem;
  }

  .header-star-name {
    font-size: 1.7rem;
  }

  .score-card {
    padding: 2.5rem 2rem;
  }

  .score-number {
    font-size: 4rem;
  }

  .chart-wrapper canvas {
    height: 280px !important;
  }

  .lucky-grid {
    gap: 0.8rem;
  }

  .calendar-grid {
    gap: 4px;
  }

  .cal-cell {
    font-size: 13px;
    border-radius: 6px;
  }

  .cal-rank {
    font-size: 9px;
  }

  .cycle-bar {
    gap: 3px;
  }

  .cycle-item {
    padding: 0.8rem 0.3rem;
    font-size: 11px;
  }

  .compat-stars-pair {
    gap: 2rem;
  }

  .compat-star-box {
    max-width: 200px;
    padding: 1.5rem 1.2rem;
  }

  .birth-inputs {
    max-width: 420px;
  }

  .star-grid {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }

  .fortune-card {
    padding: 1.2rem 1.5rem;
  }

  .advice-text {
    font-size: 14px;
  }

  .compat-form {
    padding: 1.5rem;
  }

  .compat-birthday-inputs {
    max-width: 420px;
  }

  .main-tab {
    font-size: 14px;
  }
}

/* ===== ローディング ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.4s;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(184, 148, 63, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-family: 'Shippori Mincho', serif;
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: 0.2em;
  margin-top: 1rem;
}


/* ===== 月間カレンダー ===== */
.calendar-section {
  margin: 1.5rem 0;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cal-nav-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.calendar-month-label {
  font-family: 'Shippori Mincho', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 120px;
  text-align: center;
}

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

.cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  padding: 0.3rem 0;
  letter-spacing: 0.1em;
}

.cal-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  position: relative;
  cursor: default;
  transition: transform 0.15s;
}

.cal-cell:not(.cal-empty) {
  cursor: default;
}

.cal-empty {
  background: transparent;
}

.cal-day {
  font-weight: 500;
  line-height: 1;
  margin-bottom: 1px;
}

.cal-rank {
  font-size: 8px;
  line-height: 1;
  opacity: 0.8;
  letter-spacing: 0.05em;
}

.cal-today {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
}

/* ===== 入力モードタブ ===== */
.input-mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-mode-tab {
  flex: 1;
  padding: 0.7rem;
  border: none;
  background: var(--paper2);
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.input-mode-tab.active {
  background: var(--ink);
  color: var(--gold-light);
}

/* ===== 本命星選択グリッド ===== */
.star-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.star-grid-btn {
  padding: 1.1rem 0.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Shippori Mincho', serif;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.star-grid-btn:hover {
  border-color: var(--gold);
  background: var(--gold-bg);
}

.star-grid-btn:active {
  transform: scale(0.96);
}

.star-grid-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* ===== サイト説明 ===== */
.site-desc {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

/* カレンダーセルのランク色 */
.cal-cell.rank-daikichi { background: rgba(184, 148, 63, 0.25); color: var(--ink); }
.cal-cell.rank-kichi    { background: rgba(192, 57, 43, 0.18); color: var(--ink); }
.cal-cell.rank-chukichi { background: rgba(230, 126, 34, 0.15); color: var(--ink); }
.cal-cell.rank-shokichi { background: rgba(149, 165, 166, 0.2); color: var(--ink); }
.cal-cell.rank-hei      { background: rgba(107, 95, 78, 0.12); color: var(--ink); }
.cal-cell.rank-kyo      { background: rgba(26, 58, 92, 0.15); color: var(--ink); }
.cal-cell.rank-daikyo   { background: rgba(74, 0, 128, 0.15); color: var(--ink); }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
  justify-content: center;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 9px;
  color: var(--muted);
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ===== 相性診断画面 ===== */
.compat-content {
  padding: 0 1rem 2rem;
}

.compat-header {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.compat-header h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.compat-header p {
  font-size: 12px;
  color: var(--muted);
}

.compat-user-card {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.compat-user-card .compat-label {
  font-size: 10px;
  color: var(--gold-light);
  letter-spacing: 0.15em;
}

.compat-user-card .compat-name {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.compat-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.compat-mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.compat-mode-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: var(--paper);
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.compat-mode-tab.active {
  background: var(--ink);
  color: var(--gold-light);
}

.compat-select-row {
  margin-bottom: 1rem;
}

.compat-select-row label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.compat-select-row select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b5f4e' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

.compat-birthday-inputs {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.compat-birthday-inputs select {
  width: 100%;
  padding: 0.7rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
}

.btn-compat {
  width: 100%;
  padding: 0.9rem;
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}

.btn-compat:hover { background: var(--gold-light); }
.btn-compat:active { transform: scale(0.98); }

/* 相性結果 */
.compat-result {
  display: none;
  animation: fadeIn 0.4s ease;
}

.compat-stars-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.compat-star-box {
  flex: 1;
  max-width: 140px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  padding: 1.2rem 0.8rem;
  text-align: center;
}

.compat-star-box .cs-element {
  font-size: 10px;
  color: var(--gold-light);
  letter-spacing: 0.15em;
  margin-bottom: 0.3rem;
}

.compat-star-box .cs-name {
  font-family: 'Shippori Mincho', serif;
  font-size: 1rem;
  font-weight: 600;
}

.compat-rel-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gold);
  flex-shrink: 0;
}

/* スコアゲージ */
.compat-gauge {
  margin: 1.2rem 0;
}

.compat-gauge-bar {
  width: 100%;
  height: 8px;
  background: var(--paper2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.compat-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--red));
  border-radius: 4px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.compat-gauge-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.compat-score-num {
  font-family: 'Shippori Mincho', serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.compat-type-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* スコアの理由 */
.compat-reason {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-top: 1rem;
}

.compat-reason .section-label {
  margin-bottom: 0.8rem;
}

.cr-pair {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.cr-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.cr-role {
  font-size: 11px;
  color: var(--muted);
}

.cr-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.cr-el {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.cr-detail {
  text-align: center;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.cr-gogyo-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.cr-gogyo-desc {
  font-size: 12px;
  color: var(--muted);
}

/* 五行相関図 */
.gogyo-diagram-wrapper {
  margin: 1rem 0;
  text-align: center;
}

.gogyo-diagram {
  display: block;
  max-width: 300px;
  margin: 0 auto;
}

.gogyo-diagram svg {
  width: 100%;
  height: auto;
}

/* 相性アドバイス */
.compat-advice-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-top: 1rem;
}

.compat-advice-card .section-label {
  margin-bottom: 0.6rem;
}

.compat-summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.8rem;
  line-height: 1.8;
}

.compat-advice-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}

/* ===== メインタブ（日・月・年） ===== */
.main-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin: 1rem 0 0;
}

.main-tab {
  flex: 1;
  padding: 0.8rem 0.3rem;
  border: none;
  background: none;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  letter-spacing: 0.08em;
}

.main-tab.active {
  color: var(--gold);
  font-weight: 600;
}

.main-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

.main-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.main-panel.active {
  display: block;
}


/* ===== 運気のタイミング（いつ改善／いつ行動） ===== */
.timing-section {
  margin-top: 1.2rem;
}

.timing-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.8rem;
}

.timing-card-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.timing-when {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.timing-when-rank {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
}

.timing-reason {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}

.timing-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.timing-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 0.5rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
}

.timing-day-current {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  position: relative;
}
.timing-day-current::after {
  content: '今月';
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 9px;
  font-weight: 700;
  background: var(--gold);
  color: #fff;
  padding: 1px 5px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.timing-day-date {
  font-family: 'Shippori Mincho', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.timing-day-rank {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.1rem;
}

.timing-caution {
  font-size: 11px;
  color: var(--red);
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  line-height: 1.7;
}

/* ===== 相性：二人のバイオリズム比較 ===== */
.compat-bio-section {
  margin-top: 1.2rem;
}

.bio-legend {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 0.5rem;
  font-size: 11px;
  color: var(--muted);
}

.bio-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.bio-leg::before {
  content: '';
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.bio-leg-self::before { background: var(--gold); }
.bio-leg-partner::before {
  background: var(--blue);
  background-image: linear-gradient(90deg, var(--blue) 0 60%, transparent 60% 100%);
}

.bio-today {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
  margin-top: 0.9rem;
}

.bio-today-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
}

.bio-state-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.bio-role {
  font-size: 12px;
  color: var(--muted);
  width: 3.2em;
  flex-shrink: 0;
}

.bio-state-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
}

.bio-state-txt {
  font-size: 12px;
  color: var(--ink);
}

.bio-empathy {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.85;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.bio-empathy-detail {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 0.5rem;
}

/* ===== 相手の登録・保存 ===== */
.saved-partners { margin-bottom: 1.2rem; }
.saved-partners .section-label { margin-bottom: 0.6rem; }

.partner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.partner-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem 0.45rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s;
}
.partner-chip:active { transform: scale(0.97); }

.partner-chip-body {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.partner-chip-name { font-size: 13px; font-weight: 600; }
.partner-chip-star {
  font-size: 10px;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}
.partner-chip-del {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.15);
  color: var(--paper);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.partner-chip-del:hover { background: rgba(245, 240, 232, 0.3); }

.partner-save { margin-bottom: 1rem; }
.partner-save-row { display: flex; gap: 0.5rem; }
.partner-name-input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
}
.partner-name-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 148, 63, 0.15);
}
.partner-save-btn {
  padding: 0.7rem 1.1rem;
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}
.partner-save-btn:active { transform: scale(0.97); }
.partner-save-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.6;
}
.partner-saved-done {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  padding: 0.4rem 0;
}

/* ===== 根拠（なぜこの結果？） ===== */
.evidence-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  overflow: hidden;
}
.evidence-summary {
  padding: 0.9rem 2.4rem 0.9rem 1.1rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  position: relative;
  user-select: none;
}
.evidence-summary::-webkit-details-marker { display: none; }
.evidence-summary::after {
  content: '＋';
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-weight: 400;
}
.evidence-block[open] .evidence-summary::after { content: '−'; }
.evidence-block-static .evidence-summary { cursor: text; padding-right: 1.1rem; user-select: text; }
.evidence-block-static .evidence-summary::after { content: none; }
.evidence-body { padding: 0 1.1rem 0.8rem; }
.evidence-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}
.evidence-key {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.evidence-val {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.85;
}

/* ===== 盤ペア（evidence 内の同会対比） ===== */
.kk-boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 0.9rem;
  padding: 0.9rem 1.0rem 0.4rem;
  background: rgba(245, 240, 232, 0.5);
  border-top: 1px dashed var(--border);
}
@media (max-width: 480px) {
  .kk-boards { grid-template-columns: 1fr; gap: 18px; padding: 0.7rem 0.6rem 0.3rem; }
}
.kk-board-wrap { display: flex; flex-direction: column; align-items: center; }
.kk-board-cap { text-align: center; margin-bottom: 4px; }
.kk-board-cap b {
  font-family: 'Shippori Mincho', serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: block;
}
.kk-board-cap span {
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.kk-dir-label {
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--red);
  font-family: 'Zen Old Mincho', serif;
  text-align: center;
  margin: 2px 0;
}
.kk-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1.5px solid var(--ink);
  background: #fbf6ea;
  width: 100%;
  max-width: 220px;
  box-shadow: 0 8px 22px -16px rgba(40, 30, 15, 0.25);
}
.kk-cell {
  aspect-ratio: 1;
  border: 0.5px solid rgba(35, 32, 26, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  padding: 2px;
}
.kk-cell .kk-kanji {
  font-family: 'Shippori Mincho', serif;
  font-weight: 700;
  font-size: clamp(0.9rem, 3vw, 1.15rem);
  line-height: 1;
  color: var(--ink);
}
.kk-cell .kk-gua {
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-family: 'Zen Old Mincho', serif;
}
.kk-cell .kk-dir {
  font-size: 0.5rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.kk-cell .kk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
  opacity: 0.85;
}
.kk-cell.kk-cell-center { background: #f6ecd2; }
.kk-cell.kk-cell-highlight {
  background: #fff4d9;
  box-shadow: inset 0 0 0 2px var(--gold);
  z-index: 2;
}
.kk-cell.kk-cell-honmei {
  box-shadow: inset 0 0 0 2.5px var(--red);
  z-index: 3;
}
.kk-cell.kk-cell-honmei.kk-cell-highlight {
  background: #fff4d9;
  box-shadow: inset 0 0 0 2.5px var(--red);
}
.kk-cell.kk-cell-honmei::after {
  content: 'あなた';
  position: absolute;
  bottom: 2px;
  font-size: 0.48rem;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* 五行カラードット */
.kk-water  { background: #3a4a63; }
.kk-earth  { background: #7a5a35; }
.kk-wood   { background: #3f7a52; }
.kk-metal  { background: #b8aa7a; }
.kk-fire   { background: #9c3a6a; }
.kk-yellow { background: #c79a2e; }

.kk-board-note {
  padding: 0.6rem 1.0rem 0.9rem;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  background: rgba(245, 240, 232, 0.5);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.kk-board-note b { color: var(--ink); font-weight: 700; }

/* ===== 九星気学とは（イントロ） ===== */
.intro-section {
  background: rgba(184, 148, 63, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1.3rem;
}
.intro-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}
.intro-text {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.95;
  margin: 0;
}

/* ===== LP（ランディング） ===== */
.lp-content { padding: 1.5rem 1.5rem 2.5rem; }
.lp-section { margin-bottom: 3.8rem; }
.lp-section-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin: 0 0 1.1rem;
  padding-bottom: 0.6rem;
  position: relative;
}
.lp-section-title::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 40px; height: 2px;
  background: var(--gold);
}
.lp-section-lead { font-size: 12.5px; color: var(--muted); line-height: 1.9; margin: 0 0 1rem; }
.lp-text { font-size: 13px; color: var(--muted); line-height: 2; margin: 0 0 0.9rem; }

/* 使い方 */
.lp-steps { display: flex; flex-direction: column; gap: 0.7rem; }
.lp-step {
  display: flex; align-items: flex-start; gap: 0.8rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem;
}
.lp-step-num {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--white); border-radius: 50%;
  font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: 14px;
}
.lp-step-body { display: flex; flex-direction: column; gap: 0.2rem; }
.lp-step-head { font-size: 14px; font-weight: 600; color: var(--ink); }
.lp-step-desc { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* 機能 */
.lp-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.lp-features li {
  background: var(--white); border: 1px solid var(--border);
  border-left: 3px solid var(--gold); border-radius: var(--radius-sm);
  padding: 0.8rem 1rem; font-size: 12px; color: var(--muted); line-height: 1.7;
}
.lp-feature-head { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 0.2rem; }

/* 九つの星 */
.lp-stars { list-style: none; padding: 0; margin: 0; }
.lp-stars li {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 0.6rem;
  padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted); line-height: 1.6;
}
.lp-star-name { font-family: 'Shippori Mincho', serif; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.lp-star-el {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(184,148,63,0.12); color: var(--gold);
  font-size: 11px; font-weight: 700;
}

/* FAQ */
.faq-item {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 0.6rem; overflow: hidden;
}
.faq-q {
  padding: 0.9rem 2.4rem 0.9rem 1.1rem; font-size: 13px; font-weight: 600;
  color: var(--ink); cursor: pointer; list-style: none; position: relative; user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '＋'; position: absolute; right: 1.1rem; top: 50%;
  transform: translateY(-50%); color: var(--gold); font-weight: 400;
}
.faq-item[open] .faq-q::after { content: '−'; }
.faq-a { padding: 0 1.1rem 1rem; font-size: 12px; color: var(--muted); line-height: 1.95; }

/* CTA */
.lp-cta { text-align: center; background: var(--ink); border-radius: var(--radius); padding: 1.8rem 1.3rem; }
.lp-cta-text { font-size: 13px; color: var(--paper); line-height: 1.8; margin: 0 0 1rem; }
.lp-cta-btn {
  background: var(--gold); color: var(--white); border: none; border-radius: var(--radius-sm);
  padding: 0.9rem 2rem; font-family: 'Shippori Mincho', serif; font-size: 15px; font-weight: 600; cursor: pointer;
}
.lp-cta-btn:active { transform: scale(0.98); }

/* ===== アプリセクション見出し ===== */
.app-section-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin: 2.4rem 0 0.7rem;
  padding-bottom: 0.6rem;
  position: relative;
}
.app-section-title::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 40px; height: 2px;
  background: var(--gold);
}

/* ===== アドバイスの根拠（一行） ===== */
.advice-basis {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
}
.advice-basis-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.advice-basis-text {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

/* ===== 五行関係の凡例（結果ページ・スコア内訳下、表示専用） ===== */
.gogyo-legend {
  margin-top: 0.8rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.gogyo-legend-summary {
  padding: 0.7rem 1.1rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  position: relative;
  user-select: none;
}
.gogyo-legend-summary::-webkit-details-marker { display: none; }
.gogyo-legend-summary::after {
  content: '＋';
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
}
.gogyo-legend[open] .gogyo-legend-summary::after { content: '−'; }
.gogyo-legend-static .gogyo-legend-summary { cursor: text; padding-right: 1.1rem; user-select: text; }
.gogyo-legend-static .gogyo-legend-summary::after { content: none; }

/* ===== スコア内訳テーブル拡張 ===== */
.breakdown-table .weight-tag {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}
.breakdown-table tr.penalty-row td {
  background: rgba(220, 70, 60, 0.06);
  color: #b23121;
  font-size: 11px;
}
.breakdown-table tr.final-row td {
  background: var(--paper2);
  border-top: 2px solid var(--gold);
}
.breakdown-table .breakdown-subscore {
  font-family: var(--font-num, "Shippori Mincho B1", serif);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  color: var(--ink);
}
.breakdown-table .breakdown-final {
  text-align: right;
  white-space: nowrap;
  font-size: 1.05em;
}
.gogyo-legend-body {
  padding: 0 1.1rem 0.9rem;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.gogyo-legend-body p { margin: 0 0 0.5rem; }
.gogyo-legend-body ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.gogyo-legend-body li { padding: 0.15rem 0; }
.gogyo-legend-body b { color: var(--ink); font-weight: 700; }
.gogyo-legend-note {
  margin-top: 0.6rem !important;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  font-size: 11px;
}
.gogyo-legend-note a { color: var(--gold); text-decoration: underline; }

/* ===== LP「本ツールの算出ロジック」 ===== */
.lp-logic-title {
  font-family: var(--font-serif, serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 1.4rem 0 0.5rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--gold);
  letter-spacing: 0.04em;
}
.lp-logic-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 0.4rem;
  font-size: 12px;
  background: var(--white);
}
.lp-logic-table th,
.lp-logic-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.lp-logic-table thead th {
  background: var(--ink);
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 0.05em;
}
.lp-logic-table tbody td:first-child { white-space: nowrap; }
.lp-logic-table tbody td:last-child {
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  text-align: right;
}

/* ===== 広告枠（記事内・レスポンシブ） ===== */
/* 本文と視覚的に分離し、誤クリックを防ぐ。最小高さで CLS（レイアウトシフト）を抑える。 */
.result-ad,
.lp-ad {
  display: block;
  margin: 28px auto;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  min-height: 100px;
  overflow: hidden;
}
.result-ad .adsbygoogle,
.lp-ad .adsbygoogle {
  display: block;
}
