:root {
  --bg-top: #f6efe4;
  --bg-bottom: #ead8c3;
  --aura: rgba(191, 90, 54, 0.2);
  --aura-strong: rgba(191, 90, 54, 0.34);
  --panel: rgba(255, 251, 245, 0.8);
  --panel-strong: rgba(255, 248, 239, 0.95);
  --line: rgba(90, 54, 36, 0.12);
  --text: #2b1c16;
  --muted: #715548;
  --accent: #bf5a36;
  --accent-deep: #8f3518;
  --positive: #476b4b;
  --warning: #9f4f37;
  --shadow: 0 24px 80px rgba(93, 52, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, var(--aura), transparent 22%),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.5), transparent 28%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 90%);
}

.page-shell {
  width: min(100%, 1240px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow,
.chat-kicker,
.message-meta,
.section-title {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow,
.chat-kicker {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--accent-deep);
}

.chat-panel h1,
.chat-header h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", serif;
  line-height: 1.05;
}

.chat-panel h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.header-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.auth-panel {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.auth-status {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: right;
}

.auth-buttons {
  display: flex;
  gap: 8px;
}

.hero-card {
  padding: 20px;
  border: 1px solid rgba(191, 90, 54, 0.16);
  border-radius: 22px;
  background: rgba(255, 248, 241, 0.78);
}

.hero-card-title,
.hero-copy-small {
  margin: 0;
}

.hero-card-title {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero-copy-small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.history-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(90, 54, 36, 0.1);
  border-radius: 24px;
  background: rgba(255, 249, 243, 0.82);
}

.history-panel-bottom {
  margin: 18px 24px 24px;
}

.race-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.race-select-row {
  margin-top: 14px;
}

.selected-race-line {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.94rem;
}

.race-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(90, 54, 36, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.race-item:hover,
.race-item.is-active {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
}

.main-race-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
  padding-right: 0;
}

.race-item-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.race-item-name,
.race-item-meta,
.race-item-copy {
  margin: 0;
}

.race-item-name {
  font-weight: 700;
}

.race-item-grade {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(191, 90, 54, 0.1);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-item-meta,
.race-item-copy {
  color: var(--muted);
  line-height: 1.6;
}

.history-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.history-refresh {
  flex-shrink: 0;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.history-links {
  display: grid;
  gap: 10px;
}

.history-link-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(90, 54, 36, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 246, 239, 0.92));
}

.history-link-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.82);
}

.history-link-name,
.history-link-meta,
.history-link-summary {
  margin: 0;
}

.history-link-name {
  font-weight: 700;
}

.history-link-meta,
.history-link-summary {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.history-item {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(90, 54, 36, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.history-item:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
}

.history-item-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.history-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.8);
}

.history-copy p,
.history-dream,
.history-summary,
.history-empty,
.history-meta {
  margin: 0;
}

.history-name {
  font-weight: 700;
}

.history-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.history-dream,
.history-summary,
.history-empty {
  color: var(--muted);
  line-height: 1.6;
}

.history-dream {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.history-summary {
  color: var(--text);
  font-size: 0.9rem;
}

.history-empty {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.persona-showcase {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
}

.hero-copy-small {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.character-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(90, 54, 36, 0.12);
  border-radius: 22px;
  background: rgba(255, 251, 245, 0.78);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  appearance: none;
}

.character-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 42%);
  pointer-events: none;
}

.character-card:hover,
.character-card.is-active {
  transform: translateY(-2px);
  border-color: var(--card-accent);
  box-shadow: 0 18px 28px rgba(90, 54, 36, 0.1);
}

.character-card.is-active {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 239, 0.94));
}

.character-portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96), rgba(255, 247, 238, 0.6));
}

.character-select-pill {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(191, 90, 54, 0.1);
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 700;
}

.character-name-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.character-name {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", serif;
  font-size: 1rem;
}

.character-archetype,
.character-catch,
.character-voice {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.hero-card-title {
  margin: 0 0 10px;
  font-weight: 700;
}

.hero-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.chat-panel {
  min-height: calc(100vh - 48px);
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(246, 234, 223, 0.88));
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.race-stage,
.comparison-board,
.detail-desk {
  margin: 18px 24px 0;
  padding: 22px;
  border: 1px solid rgba(90, 54, 36, 0.1);
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.82);
}

.race-stage-header,
.detail-desk-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.selected-race-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid rgba(191, 90, 54, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 38%),
    linear-gradient(140deg, rgba(255, 247, 236, 0.96), rgba(245, 230, 214, 0.92));
}

.selected-race-meta,
.selected-race-name,
.selected-race-copy,
.selected-race-note,
.selected-race-metric-label,
.selected-race-metric-value,
.selected-race-metric-note {
  margin: 0;
}

.selected-race-meta {
  color: var(--accent-deep);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.selected-race-name {
  margin-top: 10px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.selected-race-copy,
.selected-race-note {
  color: var(--muted);
  line-height: 1.65;
}

.selected-race-copy {
  margin-top: 12px;
}

.selected-race-traits,
.selected-race-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.selected-race-traits {
  margin-top: 18px;
}

.selected-race-chip,
.selected-race-metric {
  border: 1px solid rgba(90, 54, 36, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.spotlight-traits,
.spotlight-chip {
  display: none;
}

.selected-race-chip {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.88rem;
}

.selected-race-metrics {
  align-content: start;
  justify-content: end;
}

.selected-race-metric {
  min-width: 140px;
  min-height: 88px;
  border-radius: 18px;
  display: grid;
  gap: 6px;
  padding: 14px;
}

.selected-race-metric-label {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.selected-race-metric-value {
  font-size: 1.12rem;
  font-weight: 700;
}

.selected-race-metric-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.chat-log {
  flex: 1;
  padding: 20px 22px 12px;
  overflow-y: auto;
}

.message {
  margin-bottom: 16px;
}

.message.user {
  margin-left: 56px;
}

.message-meta {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--muted);
}

.message-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
}

.message.user .message-card {
  border-bottom-right-radius: 8px;
  background: linear-gradient(180deg, rgba(191, 90, 54, 0.12), rgba(255, 251, 245, 0.94));
}

.message.assistant .message-card {
  border-bottom-left-radius: 8px;
}

.loading-card {
  display: grid;
  gap: 14px;
}

.loading-copy {
  margin: 0;
  line-height: 1.8;
  color: var(--muted);
}

.loading-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 72%, white);
  animation: loading-bounce 1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.intro-card {
  font-size: 0.98rem;
  line-height: 1.8;
}

.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 16px;
  align-items: center;
}

.intro-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.intro-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(191, 90, 54, 0.08);
  color: var(--accent-deep);
  font-size: 0.78rem;
}

.intro-orbit {
  position: relative;
  width: 96px;
  height: 96px;
  justify-self: end;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96) 0 18%, transparent 19%),
    radial-gradient(circle at center, rgba(191, 90, 54, 0.18) 0 44%, transparent 45%),
    radial-gradient(circle at center, rgba(123, 95, 168, 0.16) 0 68%, transparent 69%);
}

.intro-orbit::before,
.intro-orbit::after {
  position: absolute;
  border-radius: 999px;
  content: "";
  background: rgba(191, 90, 54, 0.6);
}

.intro-orbit::before {
  top: 10px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
}

.intro-orbit::after {
  right: 10px;
  bottom: 22px;
  width: 8px;
  height: 8px;
  background: rgba(123, 95, 168, 0.72);
}

.message-question {
  margin: 0 0 10px;
  font-weight: 700;
}

.message-dream {
  margin: 0;
  line-height: 1.8;
  white-space: pre-wrap;
}

.reading-card {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.reading-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 40%);
  pointer-events: none;
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assistant-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 246, 240, 0.6));
  box-shadow: inset 0 0 0 1px rgba(90, 54, 36, 0.08);
}

.assistant-profile p {
  margin: 0;
}

.assistant-name {
  font-weight: 700;
  font-size: 1rem;
}

.assistant-tone {
  font-size: 0.84rem;
  color: var(--muted);
}

.assistant-model-note {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--accent-deep);
  line-height: 1.5;
  word-break: break-word;
}

.reading-summary {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", serif;
  font-size: 1.42rem;
  line-height: 1.55;
}

.keiba-race-line,
.horse-pick-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reading-interpretation,
.reading-caution,
.reading-action {
  margin: 0;
  line-height: 1.8;
}

.analysis-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(90, 54, 36, 0.08);
  border-radius: 20px;
  background: rgba(255, 251, 245, 0.74);
}

.analysis-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.analysis-caption {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.analysis-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(90, 54, 36, 0.08);
}

.analysis-card-wide {
  grid-column: 1 / -1;
}

.analysis-label,
.analysis-note,
.analysis-value {
  margin: 0;
}

.analysis-label {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.analysis-value {
  font-weight: 700;
  line-height: 1.5;
}

.analysis-note {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.analysis-actions-wrap {
  display: grid;
  gap: 8px;
}

.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-action-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(191, 90, 54, 0.08);
  color: var(--accent-deep);
  font-size: 0.84rem;
}

.horse-pick-panel {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 247, 236, 0.82);
  border: 1px solid rgba(191, 90, 54, 0.12);
}

.horse-pick-name,
.horse-pick-reason {
  margin: 0;
}

.horse-pick-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.horse-pick-name {
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #3a2418 !important;
  text-shadow: none;
}

.horse-pick-reason {
  line-height: 1.8;
}

.deep-points-panel,
.reading-split-panel {
  display: grid;
  gap: 12px;
}

.deep-points-panel {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.78);
  border: 1px solid rgba(90, 54, 36, 0.08);
}

.supporting-points-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
  line-height: 1.8;
}

.reading-split-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reading-split-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.78);
  border: 1px solid rgba(90, 54, 36, 0.08);
}

.fan-view,
.light-view {
  margin: 0;
  line-height: 1.8;
}

.reading-action {
  color: var(--accent-deep);
  font-weight: 700;
}

.follow-up-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 244, 231, 0.78);
  border: 1px solid rgba(191, 90, 54, 0.12);
}

.follow-up-question {
  margin: 0;
  line-height: 1.8;
  color: var(--text);
}

.picker-board-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pick-grid.pick-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.pick-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 14%, #1f2230) 0%, rgba(18, 20, 28, 0.92) 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.pick-grid.pick-grid-single .pick-card {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 22px 24px;
}

.pick-card:hover,
.pick-card.is-focused {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--card-accent) 48%, rgba(255, 255, 255, 0.18));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.24);
}

.pick-card-loading {
  pointer-events: none;
}

.pick-loading-lines {
  display: grid;
  gap: 10px;
}

.pick-loading-line {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.1));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.pick-loading-line.line-lg {
  width: 78%;
}

.pick-loading-line.line-md {
  width: 62%;
}

.pick-loading-line.line-sm {
  width: 46%;
}

.pick-card-comment-loading {
  color: rgba(248, 248, 253, 0.78);
}

.pick-card-header {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
}

.pick-divination {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.pick-divination-visual {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}

.pick-divination-visual-loading {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.1));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.pick-divination-title,
.pick-divination-label {
  margin: 0;
}

.pick-divination-title {
  color: rgba(242, 244, 255, 0.62);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pick-divination-label {
  margin-top: 4px;
  color: rgba(255, 250, 243, 0.96);
  font-size: 0.94rem;
  font-weight: 600;
}

.pick-card-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.pick-card-name,
.pick-card-theme,
.pick-card-horse,
.pick-card-bloodline,
.pick-card-meta,
.pick-card-score,
.pick-card-comment,
.pick-card-buy,
.pick-card-tone {
  margin: 0;
}

.pick-card-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.pick-card-tone {
  color: rgba(242, 244, 255, 0.72);
  font-size: 0.88rem;
  line-height: 1.55;
}

.pick-card-theme {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: color-mix(in srgb, var(--card-accent) 60%, #fff);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.pick-card-horse,
.pick-card .pick-card-horse,
.pick-grid .pick-card .pick-card-horse {
  font-size: 1.48rem;
  font-weight: 700;
  color: #fffaf3 !important;
  -webkit-text-fill-color: #fffaf3;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
}

.pick-card-bloodline {
  margin-top: -6px;
  color: color-mix(in srgb, var(--card-accent) 38%, rgba(255, 248, 235, 0.92));
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.pick-card-meta,
.pick-card-score,
.pick-card-buy {
  color: rgba(242, 244, 255, 0.78);
  font-size: 0.92rem;
}

.pick-card-comment {
  color: rgba(248, 248, 253, 0.92);
  line-height: 1.7;
}

.pick-detail-button {
  width: 100%;
  justify-content: center;
}

.deepen-insight-block {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 249, 242, 0.72);
  border: 1px solid rgba(90, 54, 36, 0.08);
}

.deepen-partner-grid,
.deepen-ticket-grid {
  display: grid;
  gap: 10px;
}

.deepen-partner-card,
.deepen-ticket-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(90, 54, 36, 0.08);
}

.deepen-partner-name,
.deepen-partner-meta,
.deepen-partner-reason,
.deepen-ticket-structure,
.deepen-ticket-note {
  margin: 0;
}

.deepen-partner-name,
.deepen-ticket-structure {
  font-weight: 700;
  line-height: 1.6;
}

.deepen-partner-meta,
.deepen-ticket-note {
  color: var(--muted);
  line-height: 1.7;
}

.deepen-partner-reason {
  line-height: 1.75;
}

.deepen-flag-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
  line-height: 1.8;
}

.deepen-actions {
  display: flex;
  justify-content: flex-end;
}

.deepen-slot {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.deepen-button.is-loading {
  opacity: 0.88;
  cursor: wait;
}

.pick-detail-button.is-loading {
  opacity: 0.88;
  cursor: wait;
}

.pick-detail-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.deepen-paywall-card,
.deepen-result-card,
.deepen-loading-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(90, 54, 36, 0.12);
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.86);
}

.deepen-loading-card {
  min-height: 148px;
  align-content: center;
}

.deepen-loading-dots {
  justify-self: start;
}

.deepen-paywall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.deepen-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.deepen-plan-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(90, 54, 36, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.deepen-plan-card-featured {
  border-color: rgba(183, 92, 56, 0.28);
  background: linear-gradient(180deg, rgba(255, 244, 236, 0.96), rgba(255, 250, 245, 0.92));
}

.deepen-plan-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(183, 92, 56, 0.14);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
}

.deepen-plan-kicker {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.deepen-plan-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.deepen-plan-price {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--accent-deep);
}

.deepen-plan-note {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
  font-size: 0.92rem;
}

.follow-up-button {
  justify-self: start;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--accent-deep);
  background: rgba(191, 90, 54, 0.12);
  transition: transform 180ms ease, background 180ms ease;
}

@media (max-width: 720px) {
  .deepen-plan-grid {
    grid-template-columns: 1fr;
  }
}

.follow-up-button:hover {
  transform: translateY(-1px);
  background: rgba(191, 90, 54, 0.18);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  border: 1px solid rgba(90, 54, 36, 0.1);
  background: rgba(255, 248, 241, 0.92);
}

.chip.warning {
  color: var(--warning);
}

.chip.positive {
  color: var(--positive);
}

.advice-block {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 240, 221, 0.72);
}

.section-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--accent-deep);
}

.advice-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.composer {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 251, 247, 0.92);
}

.composer-form {
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.active-character {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid rgba(90, 54, 36, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.history-page-shell {
  min-height: 100vh;
  padding: 16px;
}

.history-page-panel {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 251, 245, 0.9);
  box-shadow: var(--shadow);
}

.history-page-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.history-back-link {
  text-decoration: none;
}

.history-page-character {
  padding: 20px 24px 0;
}

.history-page-character-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 247, 236, 0.92);
  border: 1px solid rgba(90, 54, 36, 0.08);
}

.history-page-character-image {
  width: 110px;
  height: 110px;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.84);
}

.history-page-character-name,
.history-page-character-note,
.history-page-race,
.history-page-meta,
.history-page-horse,
.history-page-summary {
  margin: 0;
}

.history-page-character-name {
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", serif;
  font-size: 1.5rem;
}

.history-page-character-note,
.history-page-meta,
.history-page-summary {
  color: var(--muted);
  line-height: 1.6;
}

.history-page-list {
  display: grid;
  gap: 12px;
  padding: 20px 24px 24px;
}

.history-page-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(90, 54, 36, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.history-page-item-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.history-page-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
}

.history-page-race,
.history-page-horse {
  font-weight: 700;
}

.active-character img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
}

.active-character-name {
  margin: 0;
  font-weight: 700;
}

.active-character-copy {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.field span {
  font-size: 0.88rem;
  font-weight: 700;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  border: 1px solid rgba(90, 54, 36, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(191, 90, 54, 0.52);
  box-shadow: 0 0 0 4px rgba(191, 90, 54, 0.12);
}

textarea {
  min-height: 148px;
  resize: vertical;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

.submit-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.submit-button {
  padding: 14px 20px;
  border-radius: 999px;
  color: #fff9f1;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 12px 24px rgba(159, 79, 55, 0.24);
}

.submit-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.submit-button:disabled {
  opacity: 0.64;
  cursor: wait;
}

.ghost-button {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(191, 90, 54, 0.08);
}

.loading-dots::after {
  display: inline-block;
  width: 1.4em;
  content: "...";
  overflow: hidden;
  vertical-align: bottom;
  animation: dots 1s steps(4, end) infinite;
}

@keyframes dots {
  from {
    width: 0;
  }
  to {
    width: 1.4em;
  }
}

@keyframes loading-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 1024px) {
  .chat-panel {
    min-height: 70vh;
  }

  .character-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pick-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  .page-shell {
    padding: 12px;
    gap: 12px;
  }

  .chat-panel {
    border-radius: 22px;
  }

  .chat-header,
  .chat-log,
  .race-stage,
  .comparison-board,
  .detail-desk,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chat-header {
    align-items: start;
    flex-direction: column;
  }

  .field-row,
  .field-row.compact,
  .composer-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .character-grid {
    grid-template-columns: 1fr;
  }

  .picker-board-header,
  .race-stage-header,
  .detail-desk-header {
    align-items: start;
    flex-direction: column;
  }

  .intro-layout {
    grid-template-columns: 1fr;
  }

  .intro-orbit {
    justify-self: start;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .reading-split-panel {
    grid-template-columns: 1fr;
  }

  .message.user {
    margin-left: 20px;
  }

  .history-page-header {
    flex-direction: column;
    align-items: start;
  }

  .history-page-character-card {
    grid-template-columns: 1fr;
  }

  .history-page-character-image {
    width: 88px;
    height: 88px;
  }
}
