/*
  Fender Amp Decoder — page styles (fd- prefix).
  Tokens alias the site-wide --tbc-* set from styles.css /
  dimastro-shell.css, so the shell's dark overrides drive this page
  and the two can't drift apart.
*/
:root {
  --fd-bg: var(--tbc-bg);
  --fd-panel: var(--tbc-panel);
  --fd-raised: var(--tbc-panel-raised);
  --fd-ink: var(--tbc-ink);
  --fd-ink2: var(--tbc-ink-muted);
  --fd-ink3: var(--tbc-ink-faint);
  --fd-line: var(--tbc-border-soft);
  --fd-line2: var(--tbc-border);
  --fd-line3: var(--tbc-border);
  --fd-accent: #ff9142; /* matches the site's --live accent */
  --fd-font-body: var(--tbc-font-body);
  --fd-font-display: var(--tbc-font-display);
  --fd-font-mono: var(--tbc-font-mono);
}
.fd-main { font-size: 15px; line-height: 1.6; color: var(--fd-ink); }
.fd-main p, .fd-main li { text-align: left; } /* override global justify for tool UI */
@media print { .fd-panel, .fd-chips { display: none !important; } }
.fd-main [hidden] { display: none !important; }
.fd-main code { font-family: var(--fd-font-mono); font-size: 0.92em; }
.fd-eyebrow { margin: 0 0 14px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #d9d9d9; }
.fd-main { max-width: 1180px; margin: 0 auto; padding: 56px 24px 24px; }
.fd-section { margin: 0 0 64px; }
.fd-section-title { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--fd-line2); font-family: var(--fd-font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #dddddd; }
.fd-lead { max-width: 74ch; margin: 0 0 24px; color: var(--fd-ink2); font-size: 15px; }
@media (max-width: 640px) {
  .fd-main { padding: 36px 16px 16px; }
}
.fd-panel { background: var(--fd-panel); border: 1px solid var(--fd-line); padding: 22px; margin: 0 0 24px; }
.fd-field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; }
.fd-label { font-family: var(--fd-font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fd-ink2); }
.fd-hint { font-size: 12.5px; color: var(--fd-ink3); margin: 0; }
.fd-input, .fd-select, .fd-search { width: 100%; background: #000; color: var(--fd-ink); border: 1px solid #3a3a3a; border-radius: 0; padding: 12px 14px; font: inherit; font-size: 16px; }
.fd-input { font-family: var(--fd-font-mono); font-size: 16px; min-height: 112px; resize: vertical; line-height: 1.5; }
.fd-input::placeholder, .fd-search::placeholder { color: #6a6a6a; }
.fd-input:focus, .fd-select:focus, .fd-search:focus { border-color: var(--fd-accent); outline: none; box-shadow: 0 0 0 1px var(--fd-accent); }
.fd-select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #bbb 50%), linear-gradient(135deg, #bbb 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.fd-select option { background: #000; color: var(--fd-ink); }
.fd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .fd-grid2 { grid-template-columns: 1fr; gap: 0; }
}
.fd-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 4px; }
.fd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px; border: 1px solid var(--fd-ink); border-radius: 0; background: var(--fd-ink); color: #000; font-family: var(--fd-font-display); font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color 150ms ease, transform 150ms ease; }
.fd-btn:hover { background: #d9d9d9; transform: translateY(-2px); }
.fd-btn-ghost { background: transparent; color: var(--fd-ink); border-color: #5d5d5d; }
.fd-btn-ghost:hover { background: #181818; border-color: #8d8d8d; }
.fd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.fd-chip { min-height: 36px; padding: 0 12px; background: #000; color: #e6e6e6; border: 1px solid #3a3a3a; border-radius: 0; font-family: var(--fd-font-mono); font-size: 12.5px; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.fd-chip:hover { border-color: var(--fd-accent); background: #181818; }
.fd-empty { color: var(--fd-ink3); font-style: italic; margin: 8px 0; }
.fd-group { margin: 0 0 28px; }
.fd-group-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font-family: var(--fd-font-display); font-size: 15px; font-weight: 600; color: var(--fd-ink); }
.fd-group-label { font-family: var(--fd-font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fd-ink3); border: 1px solid var(--fd-line2); padding: 2px 8px; }
.fd-result { background: #000; border: 1px solid var(--fd-line); padding: 20px 22px; margin: 0 0 14px; }
.fd-multi .fd-result { margin-bottom: 14px; }
.fd-result-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 14px; }
.fd-result-head h3 { margin: 0; font-family: var(--fd-font-display); font-size: 17px; font-weight: 600; color: var(--fd-ink); overflow-wrap: anywhere; }
.fd-tag { font-family: var(--fd-font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px; border: 1px solid var(--fd-line2); color: #cfcfcf; white-space: nowrap; }
.fd-tag-hot { border-color: var(--fd-accent); color: var(--fd-accent); }
.fd-rows { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 8px 18px; margin: 0; }
.fd-rows dt { font-family: var(--fd-font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fd-ink3); padding-top: 3px; }
.fd-rows dd { margin: 0; color: #f0f0f0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .fd-rows { grid-template-columns: 1fr; gap: 0; }
  .fd-rows dt { padding-top: 10px; }
}
.fd-notes { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--fd-line); }
.fd-notes li { position: relative; padding-left: 16px; margin: 0 0 6px; font-size: 13px; line-height: 1.55; color: var(--fd-ink2); }
.fd-notes li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; background: var(--fd-accent); }
.fd-estimate-card { border-color: #7a4a22; background: #0d0905; }
.fd-table-wrap { overflow-x: auto; border: 1px solid var(--fd-line); margin: 0; -webkit-overflow-scrolling: touch; }
.fd-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #000; }
.fd-table th, .fd-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--fd-line); }
.fd-table th { font-family: var(--fd-font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fd-ink2); background: #0d0d0d; white-space: nowrap; }
.fd-table td { color: #cfcfcf; }
.fd-table td:first-child { color: var(--fd-ink); font-weight: 600; white-space: nowrap; }
.fd-table tr:last-child td { border-bottom: 0; }
.fd-table tbody tr:nth-child(even) td { background: #080808; }
.fd-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--fd-ink3); white-space: normal; }
.fd-table-flow td:first-child { white-space: normal; min-width: 150px; }
.fd-table-flow td:nth-child(2) { white-space: nowrap; }
.fd-table-flow td:nth-child(3) { white-space: nowrap; font-weight: 600; color: var(--fd-ink); }
#fd-results, .fd-group { scroll-margin-top: 84px; }
.fd-xf-list { border: 1px solid var(--fd-line); }
.fd-xf-item { display: grid; grid-template-columns: 170px 110px 1fr; gap: 6px 18px; padding: 11px 14px; border-bottom: 1px solid var(--fd-line); font-size: 13px; }
.fd-xf-item:last-child { border-bottom: 0; }
.fd-xf-item:nth-child(even) { background: #080808; }
.fd-xf-pn { font-weight: 600; color: var(--fd-ink); overflow-wrap: anywhere; }
.fd-xf-type { font-family: var(--fd-font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fd-ink2); padding-top: 2px; }
.fd-xf-use { color: #cfcfcf; }
#ref-tank .fd-rows { border: 1px solid var(--fd-line); padding: 12px 14px; }
#ref-tank .fd-rows dd { color: #cfcfcf; font-size: 13px; }
@media (max-width: 640px) {
  .fd-xf-item { grid-template-columns: 1fr auto; padding: 12px; }
  .fd-xf-use { grid-column: 1 / -1; }
  .fd-result { padding: 16px; }
  .fd-table th, .fd-table td { padding: 9px 8px; }
  .fd-table-flow td:first-child { min-width: 0; }
  .fd-table-wide td:nth-child(n+2), .fd-table-wide td:last-child { min-width: 0; }
}
.fd-table-wide td:nth-child(n+2) { min-width: 140px; }
.fd-table-wide td:last-child { min-width: 260px; }
.fd-result .fd-table-wrap { margin-bottom: 0; }
.fd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fd-card { display: flex; flex-direction: column; gap: 12px; background: #000; border: 1px solid var(--fd-line); padding: 22px; transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.fd-card:hover { transform: translateY(-3px); border-color: var(--fd-line3); background: var(--fd-raised); }
.fd-card-icon { width: 36px; height: 36px; color: var(--fd-accent); }
.fd-card h3 { margin: 0; font-family: var(--fd-font-display); font-size: 16px; font-weight: 600; color: var(--fd-ink); }
.fd-card p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--fd-ink2); }
.fd-card .fd-tag { align-self: flex-start; margin-top: auto; }
.fd-callout { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,145,66,0.08); border: 1px solid rgba(255,145,66,0.45); padding: 14px 16px; margin: 0 0 28px; font-size: 13.5px; line-height: 1.6; color: #e2e2e2; }
.fd-callout svg { flex: none; margin-top: 2px; color: var(--fd-accent); }
.fd-callout strong { color: var(--fd-accent); }
.fd-details { border: 1px solid var(--fd-line); background: #000; margin: 0 0 10px; }
.fd-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 16px 20px; min-height: 52px; font-family: var(--fd-font-display); font-size: 15px; font-weight: 600; color: var(--fd-ink); }
.fd-details > summary::-webkit-details-marker { display: none; }
.fd-details > summary::before { content: ''; flex: none; width: 7px; height: 7px; border-right: 1.5px solid #bbb; border-bottom: 1.5px solid #bbb; transform: rotate(-45deg); transition: transform 150ms ease; }
.fd-details[open] > summary::before { transform: rotate(45deg); }
.fd-details > summary:hover { background: var(--fd-raised); }
.fd-details-body { padding: 4px 20px 22px; }
.fd-details-body p { margin: 0 0 14px; color: var(--fd-ink2); font-size: 13.5px; max-width: 80ch; }
.fd-details-body h4 { margin: 22px 0 10px; font-family: var(--fd-font-display); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: #ddd; }
.fd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) {
  .fd-two { grid-template-columns: 1fr; }
}
.fd-search { margin: 0 0 14px; max-width: 420px; }
.fd-sources { list-style: none; margin: 0; padding: 0; }
.fd-sources li { margin: 0 0 8px; padding: 10px 14px; border: 1px solid var(--fd-line); font-size: 13px; color: var(--fd-ink2); }
.fd-sources a { color: var(--fd-ink); text-underline-offset: 2px; }
.fd-sources a:hover { color: var(--fd-accent); }
@media (prefers-reduced-motion: reduce) {
  .fd-card, .fd-btn { transition: none; }
}
