.ai-page {
  --tool-gold: #d8b55b;
  --tool-gold-light: #fff9e9;
}
.ai-page .desktop-navigation { gap: clamp(10px, 1.1vw, 18px); }
.ai-page .desktop-navigation a { font-size: .89rem; }
.ai-main { width: min(1100px, calc(100% - 2 * var(--page-gutter))); margin: 30px auto 64px; }
.ai-page h1, .ai-page h2, .ai-page h3 { font-family: "DM Sans", system-ui, sans-serif; }
.ai-page h1 { max-width: 820px; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.25; letter-spacing: -.025em; }
.ai-page h2 { font-size: clamp(1.45rem, 2.3vw, 1.9rem); line-height: 1.3; }
.ai-page h3 { line-height: 1.4; }
.ai-page p, .ai-page li { overflow-wrap: anywhere; }
.tool-topline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.tool-back { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; color: var(--plum); text-decoration: none; font-weight: 700; }
.tool-language { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.tool-language select { width: auto; min-width: 138px; min-height: 44px; }
.tool-intro { margin-bottom: 30px; }
.tool-intro > p:not(.eyebrow) { max-width: 780px; color: var(--muted); margin: 18px 0 0; font-size: 1.05rem; }
.free-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #e4ca83; color: #674817; background: var(--tool-gold-light); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .8rem; }
.free-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tool-gold); }
.tool-hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-block: 24px 30px; }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; padding: clamp(22px, 3vw, 30px); border: 1px solid var(--line); background: rgba(255,255,255,.92); border-radius: 20px; box-shadow: 0 12px 35px rgba(69, 23, 90, .05); }
.tool-card p { margin: 0; color: var(--muted); }
.tool-card h2 { font-size: 1.55rem; }
.tool-card .primary-link { margin-top: auto; width: 100%; }
.tool-icon { width: 54px; height: 54px; display: grid; place-items: center; background: var(--lilac); color: var(--plum); border-radius: 16px; }
.tool-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.tool-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.tool-panel { min-width: 0; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.96); }
.tool-panel > p { color: var(--muted); }
.tool-panel form { margin-top: 22px; }
.tool-panel .form-grid { gap: 18px; }
.tool-panel textarea { display: block; width: 100%; min-width: 0; min-height: 128px; resize: vertical; border: 1px solid #cfb9dc; border-radius: 10px; background: #fff; color: var(--ink); padding: 12px 13px; font: inherit; font-size: 1rem; }
.tool-panel textarea:focus { outline: 3px solid rgba(125,35,174,.18); border-color: var(--violet); }
.tool-checkbox { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; color: #44354c; font-size: .91rem; line-height: 1.55; cursor: pointer; }
.tool-checkbox input { width: 20px; height: 20px; min-width: 20px; min-height: 20px; flex: 0 0 20px; margin: 3px 0 0; padding: 0; accent-color: var(--plum); }
.tool-checkbox span { min-width: 0; }
.tool-panel .primary-button { margin-top: 22px; }
.tool-status { min-height: 24px; color: var(--muted); font-size: .91rem; margin: 16px 0 0; }
.tool-status:empty { min-height: 0; margin: 0; }
.tool-status.is-error, .tool-status[data-state="error"] { color: #a12829; }
.tool-availability { padding: 14px 18px; margin-bottom: 24px; color: #674817; border: 1px solid #e6cf8d; background: var(--tool-gold-light); border-radius: 12px; font-size: .94rem; }
.birthplace-picker { position: relative; }
.birthplace-options { margin: 0; padding: 6px; list-style: none; border: 1px solid #cfb9dc; border-radius: 10px; max-height: 230px; overflow-y: auto; background: #fff; box-shadow: 0 8px 22px rgba(69,23,90,.08); }
.birthplace-options [role="option"] { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 6px; background: #fff; color: var(--ink); text-align: start; font: inherit; cursor: pointer; }
.birthplace-options [role="option"]:hover, .birthplace-options [aria-selected="true"] { background: var(--lilac); color: var(--plum); }
.tool-advanced { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fcf9fe; }
.tool-advanced summary { min-height: 30px; cursor: pointer; color: var(--plum); font-weight: 700; }
.tool-advanced p { margin: 14px 0 18px; color: var(--muted); font-size: .88rem; font-weight: 400; }
.tool-provider-consent { padding: 14px; background: var(--lilac); border-radius: 10px; }
.tool-result { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; }
.tool-result > :first-child { margin-top: 0; }
.tool-result p { color: #44354c; }
.tool-result h3 { color: var(--plum); font-size: 1.05rem; margin-top: 22px; }
.tool-result ul { padding-inline-start: 21px; }
.tool-result li + li { margin-top: 8px; }
.tool-result section + section { margin-top: 22px; }
.tool-explainer { margin-top: 0; background: linear-gradient(160deg, #f7f0fc, #fffdf8); border-color: #e5d7eb; }
.tool-explainer ul { margin: 18px 0 0; padding-inline-start: 21px; color: var(--muted); }
.tool-explainer li + li { margin-top: 12px; }
.tool-scope { margin: 20px 0 0; padding: 14px 16px; border-inline-start: 3px solid var(--tool-gold); border-radius: 0 8px 8px 0; background: var(--tool-gold-light); color: #674817; font-size: .9rem; }
.tool-privacy { color: var(--muted); font-size: .86rem; margin-top: 18px; }
.tool-privacy a { color: var(--plum); }
.tool-human-link { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; padding: 24px 28px; border: 1px solid #e3d4ed; border-radius: 18px; background: #f4edfb; }
.tool-human-link p { margin: 8px 0 0; color: var(--muted); max-width: 680px; }
.tool-human-link h2 { font-size: 1.35rem; }
.tool-human-link .secondary-link { flex-shrink: 0; }
.tool-reflection { color: var(--muted); font-size: .86rem; margin: 28px 0 0; }
.tarot-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.tarot-card { display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; min-height: 200px; text-align: center; padding: 18px 10px; border: 1px solid #d7b668; border-radius: 16px; color: #fff4d2; background: radial-gradient(circle at 50% 25%, #70418e, #321047 72%); }
.tarot-card h3 { color: #fff4d2; font-size: 1rem; }
.tarot-card p { color: #eee1f4; font-size: .86rem; }
.tarot-card .card-symbol { font-size: 2rem; margin-bottom: 18px; }
.tarot-cards[data-count="1"] { grid-template-columns: minmax(0, 220px); justify-content: center; }
.ram-tool { max-width: 850px; margin-inline: auto; }
.ram-grid { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; padding: 12px; margin-top: 24px; border: 1px solid #d8bd75; background: #fff9ed; border-radius: 14px; touch-action: manipulation; }
.ram-grid button { display: grid; place-items: center; min-width: 0; min-height: 38px; padding: 3px 0; border: 1px solid #ead9af; border-radius: 4px; color: #693d20; background: #fffdfa; font: inherit; font-size: 1.05rem; cursor: pointer; }
.ram-grid button:hover { background: #f4e9c7; border-color: #b49247; }
.ram-grid button[aria-pressed="true"], .ram-grid button.is-selected { background: var(--plum); border-color: var(--plum); color: #fff; }
.ram-grid button:focus-visible { outline: 3px solid #641a91; outline-offset: 2px; position: relative; z-index: 1; }
.ram-grid button.is-path { background: #f5e7b7; border-color: #c6a34c; }
.ram-result { padding: 22px; border: 1px solid #e6cf8d; border-radius: 14px; background: #fffbf0; }
.ram-result blockquote { margin: 14px 0; color: #60351b; font-size: 1.3rem; line-height: 1.8; }
.ram-original-verse { margin-top: 20px; padding-top: 14px; border-top: 1px solid #e6cf8d; }
.ram-original-verse summary { display: list-item; min-height: 44px; padding-block: 10px; color: var(--plum); font-size: .94rem; font-weight: 700; cursor: pointer; }
.ram-grid button { font-size: .86rem; font-variant-numeric: tabular-nums; }
.ram-explain-button { margin-top: 18px; }
.ram-explain-button:disabled { opacity: .55; cursor: default; }
.ai-page noscript { display: block; margin-top: 18px; color: #a12829; }
@media (max-width: 1120px) {
  .ai-page .desktop-navigation { display: none; }
  .ai-page .mobile-navigation { display: block; }
}
@media (max-width: 850px) {
  .tool-hub-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); }
  .tool-card > :not(.tool-icon) { grid-column: 2; }
  .tool-card .tool-icon { grid-column: 1; grid-row: 1 / 3; }
  .tool-card .primary-link { width: fit-content; min-height: 44px; }
  .tool-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .ai-main { margin-top: 20px; }
  .tool-topline { gap: 10px; }
  .tool-language { gap: 7px; font-size: .83rem; }
  .tool-language select { min-width: 110px; padding-inline: 10px; }
  .tool-panel { padding: 22px 18px; }
  .tool-human-link { padding: 22px 18px; }
  .tool-human-link .secondary-link { width: 100%; }
  .tarot-cards { gap: 8px; }
  .tarot-card { min-height: 165px; padding: 14px 7px; }
  .tarot-card h3 { font-size: .89rem; }
  .ram-grid { gap: 2px; padding: 6px; margin-inline: -10px; }
  .ram-grid button { min-height: 29px; font-size: .86rem; border-radius: 3px; }
  .ram-result { padding: 18px; }
  .ram-result blockquote { font-size: 1.12rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-page *, .ai-page *::before, .ai-page *::after { scroll-behavior: auto; transition: none; animation: none; }
}
@media (max-width: 380px) {
  .tool-topline { align-items: flex-start; }
  .tool-card { grid-template-columns: minmax(0, 1fr); }
  .tool-card > :not(.tool-icon), .tool-card .tool-icon { grid-column: 1; grid-row: auto; }
  .tool-card .primary-link { width: 100%; }
  .ram-grid button { min-height: 27px; font-size: .8rem; }
}
