.tools-main { padding-top: 2.7rem; padding-bottom: 4rem; }
.tools-intro { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 2.4rem; }
.tools-intro h1 { font-size: clamp(2.5rem, 4vw, 4rem); margin: 0; }
.tools-intro h1 span { color: var(--ink); }
.tools-intro p { color: var(--muted); margin: 0; font-size: .95rem; }
.tool-layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: 2rem; align-items: start; }
.tool-nav { display: grid; gap: .7rem; }
.tool-nav a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: .25rem .7rem; padding: 1rem 1.1rem; background: var(--white); border-radius: 22px; transition: background .18s, color .18s; }
.tool-nav .icon { grid-row: 1 / 3; align-self: center; width: 24px; height: 24px; }
.tool-nav strong { font-size: .96rem; font-weight: 550; }
.tool-nav span { grid-column: 2; font-size: .72rem; line-height: 1.65; }
.tool-nav a:hover { background: rgba(221,236,246,.17); }
.tool-nav a[aria-current] { background: rgba(238,206,140,.16); color: #ffe6a7; border-color: rgba(255,226,121,.65); }
.tool-workspace { background: var(--paper); backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 30px; min-width: 0; }
.tool-panel { padding: clamp(1.4rem, 3.5vw, 3rem); border-radius: inherit; }
#activity { background: transparent; }
#truth { background: transparent; }
#talk { background: transparent; }
.panel-heading h2 { font-size: clamp(1.45rem, 2.7vw, 2.2rem); margin: 0 0 .8rem; font-weight: 550; line-height: 1.35; }
.panel-heading p { color: var(--muted); font-size: .91rem; margin-bottom: 1.8rem; line-height: 1.8; }
.mode-switch { display: inline-flex; align-items: center; flex-wrap: wrap; padding: 5px; gap: 3px; background: var(--white); border-radius: 999px; }
.mode-switch button { min-height: 44px; padding: .6rem 1.15rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-size: .85rem; }
.mode-switch button:hover { background: rgba(221,236,246,.17); }
.mode-switch button[aria-pressed='true'] { color: #172a36; background: #ffe279; }
.tools-page label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .55rem; }
.tools-page input, .tools-page select, .tools-page textarea { font-size: .94rem; background: rgba(15,31,44,.75); color: var(--ink); border: 1px solid var(--line); border-radius: 15px; padding: .85rem 1rem; min-height: 48px; max-width: 100%; }
.tools-page input, .tools-page textarea { width: 100%; }
.tools-page textarea { resize: vertical; line-height: 1.8; max-height: 360px; }
.tools-page input::placeholder, .tools-page textarea::placeholder { color: var(--muted); opacity: 1; }
.draw-result { min-height: 260px; padding: 2rem 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.draw-result h3 { font-size: clamp(1.8rem, 3.2vw, 2.85rem); line-height: 1.45; margin: .6rem 0 1rem; max-width: 20em; letter-spacing: -.025em; overflow-wrap: anywhere; font-weight: 550; }
.draw-result > p:last-child { max-width: 40em; color: var(--muted); font-size: .95rem; margin: 0; line-height: 1.85; }
.draw-result .result-caption { margin: 0; font-size: .78rem; color: var(--muted); }
.dice { width: 44px; height: 44px; background: var(--white); border-radius: 13px; position: relative; margin-bottom: .8rem; transform: rotate(-8deg); }
.dice i { position: absolute; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; }
.dice i:nth-child(1) { top: 9px; left: 9px; }.dice i:nth-child(2) { top: 18px; left: 18px; }.dice i:nth-child(3) { bottom: 9px; right: 9px; }
.question-result { min-height: 300px; }.question-result h3 { font-size: clamp(1.6rem, 2.6vw, 2.35rem); max-width: 23em; }
.draw-result.just-drawn { animation: reveal-result .28s cubic-bezier(.16,1,.3,1); }
@keyframes reveal-result { from { opacity: .45; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.tool-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.tools-page .button { min-height: 48px; font-size: .92rem; padding: .85rem 1.35rem; }
.quiet-button { min-height: 44px; border: 0; border-radius: 999px; background: var(--white); color: var(--ink); font-size: .85rem; padding: .65rem 1.05rem; }
.quiet-button:hover { background: rgba(221,236,246,.17); }
.helper { color: var(--muted); font-size: .78rem; line-height: 1.85; }
.bottom-note { margin-top: 1.3rem; }.field-error { color: #ffb9a6; font-size: .84rem; margin: .6rem 0 0; }.field-error:empty { display: none; }
.followup { padding-top: .8rem; border-top: 1px solid var(--line); }
.source-note { margin-top: 1.1rem; }
.source-note a, .source-details a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.source-details { color: var(--muted); font-size: .81rem; line-height: 1.8; margin-top: .8rem; }
.source-details summary { cursor: pointer; min-height: 44px; display: list-item; width: fit-content; padding: .65rem 0; }
.source-details p { max-width: 52em; margin-top: .5rem; }
#custom-controls { margin-top: 1.5rem; }
.wheel-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 1fr); gap: 2rem; align-items: center; margin-top: 1.5rem; }
.wheel-editor .helper { margin-top: .6rem; }
.candidate-entry { display: flex; gap: .55rem; align-items: center; }.candidate-entry input { min-width: 0; }.candidate-entry .button { white-space: nowrap; flex: 0 0 auto; padding-inline: 1rem; }
.candidate-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.candidate-list li { display: inline-flex; align-items: center; gap: .25rem; background: var(--white); border-radius: 999px; padding-left: .8rem; max-width: 100%; }
.candidate-list span { font-size: .84rem; overflow-wrap: anywhere; }.candidate-list button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink); border-radius: 50%; font-size: 1.15rem; }.candidate-list button:hover { background: rgba(221,236,246,.17); }
.wheel-stage { position: relative; width: min(100%, 350px); aspect-ratio: 1; border: 0; padding: 0; background: transparent; justify-self: center; touch-action: manipulation; }
#choice-wheel { display: block; width: 100%; height: 100%; }
.wheel-pointer { position: absolute; left: 50%; top: -1px; z-index: 1; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 27px solid var(--butter); }
.wheel-center { position: absolute; inset: 41%; display: grid; place-items: center; border-radius: 50%; background: #253c4a; color: var(--butter); font-size: 1.4rem; border: 3px solid #edc47c; }
.wheel-stage:hover .wheel-center { background: #334b59; }
.wheel-outcome { min-height: 96px; padding: 1.3rem 0; display: grid; gap: .4rem; }.wheel-outcome span { color: var(--muted); font-size: .85rem; }.wheel-outcome strong { font-size: 1.55rem; font-weight: 550; overflow-wrap: anywhere; }
mingli-lookup { display: block; }
.mingli-systems { margin-bottom: 1rem; }.lookup-modes { margin-bottom: 1.2rem; }
.book-shelf { display: flex; align-items: end; gap: clamp(.5rem, 1.6vw, 1.4rem); padding: 1rem .35rem .7rem; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #a79b82 var(--paper); }
.book-option { display: grid; justify-items: center; gap: .8rem; border: 0; background: transparent; padding: .4rem .25rem; color: var(--ink); min-width: 91px; flex: 0 0 auto; }
.book-cover { display: block; position: relative; width: 82px; height: 112px; background: #596778; border-radius: 14px 14px 14px 7px; transition: transform .2s cubic-bezier(.16,1,.3,1); }
.book-option:nth-child(2) .book-cover { background: var(--sky); }.book-option:nth-child(3) .book-cover { background: var(--pink); }.book-option:nth-child(4) .book-cover { background: rgba(238,206,140,.20); }
.book-spine { position: absolute; inset: 0 auto 0 0; width: 11px; border-right: 1px solid #17181350; border-radius: 7px 0 0 7px; }
.book-spine::after { content: ''; position: absolute; left: 0; right: 0; top: 24px; height: 33px; border-top: 1px solid #17181350; border-bottom: 1px solid #17181350; }
.book-label { position: absolute; top: 13px; right: 11px; padding: 4px 3px; writing-mode: vertical-rl; background: #e4e1d8; color: #253240; font-family: 'Songti SC', 'SimSun', serif; font-size: 14px; line-height: 1.3; letter-spacing: 1px; }
.book-title { font-size: .82rem; white-space: nowrap; }
.book-option[aria-pressed='true'] .book-cover { outline: 2px solid var(--butter); outline-offset: 4px; transform: translateY(-4px); }.book-option:hover .book-cover { transform: translateY(-4px); }
.chosen-book { margin: .7rem 0 1.4rem; color: var(--muted); font-size: .81rem; }.chosen-book span { color: var(--ink); font-weight: 550; }
.lookup-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: end; }.lookup-form .button { height: 48px; }
.example-keywords { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; color: var(--muted); font-size: .77rem; }.example-keywords button { min-height: 44px; padding: .5rem .8rem; border: 0; border-radius: 999px; background: var(--white); color: var(--ink); font-size: .78rem; }.example-keywords button:hover { background: rgba(238,206,140,.20); }
.search-status { color: var(--blue); font-size: .85rem; line-height: 1.8; margin: 1.5rem 0 1rem; }.search-status:empty { display: none; }
.lookup-empty { display: flex; gap: 1.5rem; align-items: center; padding: 2.5rem 0; }.lookup-empty > span { font-family: 'Songti SC', 'SimSun', serif; font-size: 4.5rem; line-height: 1; color: #e0c49a; }.lookup-empty p { color: var(--muted); line-height: 1.9; }
.comparison-pair { padding: 1.5rem 0 1.8rem; border-bottom: 1px solid var(--line); }.comparison-pair:last-child { border: 0; padding-bottom: 0; }
.reading-label { display: block; margin-bottom: .6rem; color: var(--butter); font-size: .8rem; font-weight: 550; }.technical p { margin: 0; font-family: 'Songti SC', 'SimSun', serif; font-size: 1.2rem; line-height: 2; color: var(--ink); overflow-wrap: anywhere; }
.plain { margin-top: 1.4rem; }.plain .reading-label { color: var(--muted); }.plain p { margin: 0; color: var(--muted); font-size: .97rem; line-height: 2; overflow-wrap: anywhere; }
.passage-source { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue); text-decoration: underline; text-underline-offset: 4px; font-size: .78rem; margin-top: .65rem; }
.lookup-pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; color: var(--muted); font-size: .85rem; }
.face-layout { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }#face-preview { max-width: min(100%, 300px); max-height: 340px; object-fit: contain; border-radius: 22px; }.face-number { margin: .5rem 0 1rem; }.face-number strong { font-size: 4rem; color: var(--ink); line-height: 1.2; font-weight: 550; }.face-number span { font-size: 1.25rem; color: var(--muted); }
.tools-page input::file-selector-button { background: var(--butter); color: #172a36; border: 0; border-radius: 999px; padding: .6rem .8rem; margin-right: .8rem; font: inherit; cursor: pointer; }
.food-photo-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem 1.1rem; align-items: center; }.food-photo-actions .button { grid-row: span 2; white-space: nowrap; }.food-photo-actions label { margin: 0; }
.food-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 1.6rem; align-items: start; }.food-layout:has(#food-preview[hidden]) { grid-template-columns: minmax(0, 1fr); }
#food-preview { margin: 0; min-width: 0; }#food-image { max-width: 100%; max-height: 340px; object-fit: contain; border-radius: 22px; margin: 0 auto; }#food-preview figcaption { color: var(--muted); margin-top: .6rem; font-size: .75rem; }.food-details { min-width: 0; }
#food-video { width: 100%; max-height: 420px; object-fit: contain; background: var(--ink); border-radius: 22px; margin: 1.5rem 0 .8rem; }.food-capture-actions { display: flex; gap: 1rem; align-items: center; }
#food-results { border-top: 1px solid var(--line); margin-top: 1.8rem; padding-top: 1.5rem; }#food-results h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); margin-bottom: 1.1rem; }
.food-breakdown { list-style: none; padding: 0; margin: 0; }.food-breakdown li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }.food-breakdown li > span:not(.food-energy) { grid-row: 2; color: var(--muted); font-size: .85rem; }.food-energy { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 1050px) { .tool-layout { grid-template-columns: 195px minmax(0, 1fr); gap: 1.25rem; }.tool-nav a { padding: 1rem .85rem; }.tool-panel { padding: 1.6rem; }.food-layout { grid-template-columns: minmax(0, 1fr); }.wheel-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
@media (max-width: 760px) {
  .tools-main { padding-top: 2rem; padding-bottom: 3rem; }.tools-intro { display: block; margin-bottom: 1.5rem; }.tools-intro p { margin-top: .7rem; font-size: .88rem; }
  .tool-layout { display: block; }.tool-nav { display: flex; overflow-x: auto; gap: .45rem; padding-bottom: .7rem; margin-bottom: .6rem; scrollbar-width: thin; }.tool-nav a { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; padding: .7rem .85rem; border-radius: 999px; min-height: 46px; }.tool-nav span { display: none; }.tool-nav .icon { width: 18px; height: 18px; }.tool-nav strong { font-size: .8rem; }
  .tool-panel { padding: 1.35rem; border-radius: 26px; }.tool-workspace { border-radius: 26px; }.panel-heading p { margin-bottom: 1.4rem; }.draw-result { min-height: 245px; padding: 1.7rem 0; }.question-result { min-height: 275px; }.tool-actions { gap: .7rem; }.tool-actions .helper { flex-basis: 100%; }
  .candidate-entry .button { min-width: 64px; }.wheel-stage { max-width: 300px; }.book-shelf { gap: .55rem; }.book-option { min-width: 84px; }.book-cover { width: 74px; height: 102px; }.book-title { font-size: .78rem; }.book-label { font-size: 13px; right: 10px; }
  .lookup-form { gap: .6rem; }.lookup-form .button { padding-inline: 1.15rem; }.technical p { font-size: 1.12rem; }.plain p { font-size: .93rem; }.lookup-empty { gap: 1rem; padding: 2rem 0; }
  .food-photo-actions { grid-template-columns: minmax(0, 1fr); }.food-photo-actions .button { grid-row: auto; justify-self: start; }.food-photo-actions label { margin-top: .5rem; }
}
.tool-nav a { border:1px solid var(--line); backdrop-filter:blur(12px); } .tool-panel { animation:panel-enter .3s cubic-bezier(.16,1,.3,1); } @keyframes panel-enter { from { opacity:.7; clip-path:inset(0 0 5% 0); } to { opacity:1; clip-path:inset(0); } } .mode-switch { border:1px solid var(--line); } .dice { background:rgba(255,226,121,.16); } .dice i { background:var(--butter); } .chosen-book span { color:var(--butter); } .book-cover { border:1px solid rgba(238,242,248,.25); } .lookup-reading { max-width:70ch; } .technical,.plain { padding-top:1.5rem; } .reading-section { padding:1.2rem 0; } .reading-section h3 { font-size:.95rem; color:#e4cc9c; margin:0 0 .7rem; letter-spacing:0; } .technical p,.plain p { white-space:pre-line; } .original-group { border-bottom:1px solid var(--line); padding-bottom:1.5rem; } .month-picker { margin:1rem 0; font-size:.82rem; color:var(--muted); } .month-picker summary { cursor:pointer; min-height:44px; padding:.6rem 0; } .month-chips { display:flex; flex-wrap:wrap; gap:.4rem; margin:.7rem 0; } .month-chips button { min-height:44px; padding:.45rem .75rem; border:1px solid var(--line); color:var(--ink); border-radius:999px; background:var(--white); font-size:.78rem; } .month-chips button[aria-pressed=true] { background:#ffe279; color:#172a36; } .month-chips button:hover { border-color:var(--butter); } .month-picker .helper { margin:.6rem 0; } .technical .reading-label { color:var(--butter); }
