.tool-directory { max-width: 1040px; margin: 0 auto; padding: 28px 24px 48px; }
.tool-page { max-width: 1040px; margin: 0 auto; padding: 34px 24px 48px; }
.tool-header { max-width: none; width: 100%; height: 64px; padding: 0 max(22px, calc((100vw - 1040px) / 2)); background: rgba(249, 250, 246, .96); }
.tool-nav { display: flex; flex-wrap: wrap; gap: 16px; color: var(--ink-soft); font-size: 11px; }
.tool-nav a { text-decoration: none; }
.tool-nav a:hover, .tool-nav a:focus-visible { color: var(--deep); text-decoration: underline; text-underline-offset: 3px; }
.tool-breadcrumb { display: flex; gap: 8px; margin-bottom: 18px; color: #819086; font-size: 10px; }
.tool-breadcrumb a { color: #456e50; text-decoration: none; }
.tool-hero { max-width: 820px; margin-bottom: 24px; }
.tool-eyebrow { margin: 0 0 7px; color: #557761; font-size: 9px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.tool-title { margin: 0; color: #203c31; font-family: ui-sans-serif, system-ui, sans-serif; font-size: clamp(27px, 4vw, 38px); font-weight: 780; letter-spacing: -.04em; line-height: 1.12; }
.tool-summary { max-width: 760px; margin: 10px 0 0; color: #607269; font-size: 13px; line-height: 1.65; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.tool-meta span { padding: 6px 9px; border-radius: 999px; color: #496954; background: #e8f0e8; font-size: 9px; font-weight: 750; }
.tool-warning { margin: 18px 0; padding: 13px 15px; border: 1px solid #eadbc6; border-radius: 11px; color: #735b43; background: #fbf3e9; font-size: 11px; line-height: 1.6; }
.tool-content { display: grid; gap: 15px; }
.tool-card, .tool-source-card { padding: 19px; border: 1px solid #e1e7dc; border-radius: 14px; background: #fffefa; box-shadow: 0 3px 12px rgba(33, 59, 52, .035); }
.tool-card h2, .tool-source-card h2 { margin: 0; color: #203c31; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 17px; font-weight: 760; letter-spacing: -.02em; }
.tool-help { max-width: 850px; margin: 8px 0 15px; color: #64766b; font-size: 11px; line-height: 1.65; }
.tool-controls, .tool-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; margin: 13px 0; }
.tool-controls .tool-field:first-child { grid-column: span 2; }
.tool-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; color: #40574c; font-size: 10px; font-weight: 720; }
.tool-field input, .tool-field select, .tool-field textarea { min-width: 0; width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid #dfe5db; border-radius: 9px; background: #fff; color: #263e33; font-size: 11px; font-weight: 450; }
.tool-field textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus { outline: 3px solid rgba(83, 121, 97, .15); border-color: #77947d; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 1px solid #dce6da; border-radius: 9px; color: #456b4d; background: #f1f5ef; font-size: 10px; font-weight: 760; }
.tool-button:hover { background: #e8f0e8; }
.tool-button-primary { color: #fff; border-color: #254c37; background: #254c37; }
.tool-button-primary:hover { background: #326346; }
.tool-button-quiet { margin-top: 11px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-actions .tool-button { margin-top: 0; }
.tool-inline-note, .tool-inline-warning { margin: 11px 0 0; padding: 10px 12px; border-left: 3px solid #77947d; border-radius: 0 8px 8px 0; color: #596e60; background: #f0f4ee; font-size: 10px; line-height: 1.6; }
.tool-inline-warning { border-left-color: #c58754; color: #745b42; background: #fbf3e9; }
.tool-count { margin: 13px 0 9px; color: #66786c; font-size: 10px; font-weight: 700; }
.tool-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.tool-result-card { min-width: 0; padding: 14px; border: 1px solid #e5e9df; border-radius: 11px; background: #fbfcf8; }
.tool-result-card h3 { margin: 7px 0 6px; color: #284636; font-size: 12px; line-height: 1.4; }
.tool-result-card p { margin: 6px 0 0; color: #5c7064; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.tool-tag { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #537259; background: #eaf1e8; font-size: 8px; font-weight: 800; }
.tool-small-note { display: block; margin-top: 8px; color: #818e83; font-size: 8px; line-height: 1.5; }
.tool-output { display: grid; gap: 0; margin-top: 14px; border: 1px solid #e4e9df; border-radius: 10px; overflow: hidden; }
.tool-output-row { display: flex; justify-content: space-between; gap: 15px; padding: 10px 12px; border-bottom: 1px solid #e9ede6; color: #607269; font-size: 10px; line-height: 1.45; }
.tool-output-row:last-child { border-bottom: 0; }
.tool-output-row strong { color: #294b37; text-align: right; font-size: 10px; }
.tool-entry-row, .tool-node-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) repeat(3, minmax(90px, .85fr)) auto; gap: 8px; align-items: end; margin: 9px 0; padding: 11px; border: 1px solid #e6ebe2; border-radius: 10px; background: #fcfcf8; }
.tool-entry-row .tool-button, .tool-node-row .tool-button { min-height: 34px; margin: 0; }
.tool-row-list { display: grid; gap: 7px; }
.tool-subheading { margin: 17px 0 9px; color: #31523e; font-size: 13px; }
.tool-table-wrap { width: 100%; overflow-x: auto; margin-top: 12px; }
.tool-table { width: 100%; border-collapse: collapse; color: #52685b; font-size: 10px; }
.tool-table th, .tool-table td { padding: 9px 10px; border-bottom: 1px solid #e7ece3; text-align: left; vertical-align: top; }
.tool-table th { color: #385642; background: #f1f5ef; font-size: 9px; }
.tool-roster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-roster-slot { padding: 12px; border: 1px solid #e6ebe2; border-radius: 10px; background: #fbfcf8; }
.tool-roster-slot > strong { display: block; margin-bottom: 9px; color: #31533e; font-size: 11px; }
.tool-roster-slot .tool-field { margin-top: 8px; }
.tool-node-list { display: grid; gap: 7px; }
.tool-node-row { grid-template-columns: 70px repeat(4, minmax(95px, 1fr)); }
.tool-node-row > strong { align-self: center; color: #395c45; font-size: 10px; }
.tool-day-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tool-day-card { padding: 13px; border: 1px solid #e5eae1; border-radius: 10px; background: #fbfcf8; }
.tool-day-card h3 { margin: 0 0 10px; color: #31533e; font-size: 12px; }
.tool-day-card .tool-field { margin: 8px 0; }
.tool-day-card .tool-field input { min-height: 34px; }
.tool-timeline { max-width: 100%; margin-top: 13px; overflow-x: auto; }
.timeline-row { display: flex; min-width: max-content; align-items: stretch; border-bottom: 1px solid #e5eae1; }
.timeline-label { flex: 0 0 170px; display: flex; align-items: center; padding: 6px 8px; color: #4e6657; font-size: 9px; overflow-wrap: anywhere; }
.timeline-cell { flex: 1 0 33px; display: grid; min-height: 32px; place-items: center; border-left: 1px solid #e9ede6; color: transparent; font-size: 10px; }
.timeline-header .timeline-cell { color: #698071; background: #f1f5ef; font-size: 8px; font-weight: 750; }
.timeline-cell.active { color: #fff; background: #71927a; }
.timeline-cell.active.p2 { background: #c47a4a; }
.timeline-remove { flex: 0 0 33px; min-height: 30px; margin: 1px; padding: 0; }
.tool-source-card { margin-top: 16px; }
.tool-source-card p, .tool-source-card li { color: #65766b; font-size: 10px; line-height: 1.65; }
.tool-source-card a { color: #3b6a48; overflow-wrap: anywhere; }
.tool-source-card ul { display: grid; gap: 6px; padding-left: 18px; }
.tool-footer { max-width: 1040px; margin: 0 auto; padding: 16px 24px 22px; border-top: 1px solid rgba(33, 59, 52, .1); color: #839086; font-size: 9px; }
.tool-search { margin: 17px 0 13px; }
.tool-directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-directory-card { min-height: 130px; display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid #e1e7dc; border-radius: 12px; color: #294638; background: #fffefa; text-decoration: none; transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease; }
.tool-directory-card:hover { transform: translateY(-1px); border-color: #aec3ae; box-shadow: 0 7px 17px rgba(33, 59, 52, .06); }
.tool-directory-card strong { font-size: 13px; }
.tool-directory-card p { margin: 0; color: #64766a; font-size: 10px; line-height: 1.55; }
.tool-directory-card[hidden] { display: none !important; }

@media (max-width: 800px) {
  .tool-directory-grid, .tool-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-entry-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-node-row { grid-template-columns: 55px repeat(2, minmax(95px, 1fr)); }
}
@media (max-width: 560px) {
  .tool-header { height: auto; min-height: 62px; padding: 11px 15px; flex-wrap: wrap; gap: 9px; }
  .tool-nav { width: 100%; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid rgba(33, 59, 52, .08); font-size: 10px; }
  .tool-page, .tool-directory { padding: 25px 13px 34px; }
  .tool-title { font-size: 28px; }
  .tool-summary { font-size: 12px; }
  .tool-controls, .tool-form-grid { grid-template-columns: 1fr 1fr; }
  .tool-controls .tool-field:first-child { grid-column: 1 / -1; }
  .tool-result-grid, .tool-directory-grid, .tool-day-grid { grid-template-columns: 1fr; }
  .tool-card, .tool-source-card { padding: 15px; }
  .tool-roster { grid-template-columns: 1fr 1fr; }
  .tool-output-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .tool-output-row strong { text-align: left; }
  .tool-node-row { grid-template-columns: 48px 1fr 1fr; }
  .tool-node-row > strong { grid-column: 1 / -1; }
  .tool-footer { padding: 13px; }
}
@media (max-width: 380px) {
  .tool-controls, .tool-form-grid, .tool-entry-row, .tool-roster { grid-template-columns: 1fr; }
  .tool-controls .tool-field:first-child { grid-column: auto; }
  .tool-node-row { grid-template-columns: 1fr 1fr; }
  .tool-node-row > strong { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Gem Library: quality artwork is deliberately separate from effect identity. */
.gem-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 10px; }
.gem-filters .tool-field:first-child { grid-column: 1 / -1; }
.gem-filters .tool-field { font-size: 12px; }
.gem-filters input, .gem-filters select { min-height: 44px; font-size: 13px; }
.gem-filter-help { color: #5e7064; font-size: 12px; line-height: 1.6; }
.gem-count { font-size: 12px; line-height: 1.6; }
.gem-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; margin-top: 14px; }
.gem-effect-card { min-width: 0; padding: 18px; border: 1px solid #dce5d8; border-radius: 13px; background: #fbfcf8; }
.gem-card-heading { display: flex; gap: 13px; align-items: center; }
.gem-quality-icon { flex: 0 0 64px; width: 64px; height: 64px; object-fit: contain; }
.gem-title-block { min-width: 0; }
.gem-title-block h3 { margin: 7px 0 0; color: #254432; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.gem-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.gem-tags .tool-tag { font-size: 10px; }
.gem-unique-tag { color: #685021; background: #f6ecd3; }
.gem-season-tag { color: #595075; background: #ece7f5; }
.gem-quality-label { margin: 14px 0 6px; color: #46694f; font-size: 11px; font-weight: 800; }
.gem-effect { margin: 0; color: #294733; font-size: 14px; line-height: 1.7; }
.gem-data-note { margin: 11px 0 0; padding-left: 9px; border-left: 2px solid #d6b57d; color: #705f44; font-size: 11px; line-height: 1.6; }
.gem-missing { color: #7c6249; font-style: italic; }
.gem-comparison { margin-top: 15px; border-top: 1px solid #e2e8dc; }
.gem-comparison summary { padding: 12px 0; color: #355d40; font-size: 12px; font-weight: 750; cursor: pointer; }
.gem-comparison summary:focus-visible { outline: 3px solid #93ad96; outline-offset: 2px; }
.gem-quality-table { width: 100%; border-collapse: collapse; font-size: 11px; line-height: 1.6; }
.gem-quality-table th, .gem-quality-table td { padding: 10px 5px; border-bottom: 1px solid #e4eadf; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.gem-quality-table thead th { color: #385b42; }
.gem-quality-table tbody th { width: 110px; color: #3e5b47; font-weight: 650; }
.gem-table-caption { padding: 0 0 9px; color: #647567; font-size: 10px; text-align: left; }
.gem-tier-label { display: flex; align-items: center; gap: 6px; }
.gem-tier-icon { flex: 0 0 28px; width: 28px; height: 28px; object-fit: contain; }
.gem-record-source { margin: 13px 0 0; color: #718173; font-size: 10px; line-height: 1.5; }
@media (max-width: 700px) {
  .gem-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .gem-filters { grid-template-columns: 1fr; }
  .gem-filters .tool-field:first-child { grid-column: auto; }
  .gem-effect-card { padding: 15px; }
  .gem-quality-table tbody th { width: 98px; }
  .gem-tier-label { align-items: flex-start; flex-direction: column; gap: 3px; }
}
