/* "I want" page (task #202) + the top navigation shared with the watch page */
.top-nav { display: flex; gap: 4px; margin-left: 14px; }
.top-nav a { color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.top-nav a:hover { color: var(--text); background: var(--bg-2); }
.top-nav a.on { color: var(--text); background: var(--accent-soft); }
.small { font-size: 12px; }
.good { color: var(--good); }
.bad { color: var(--crit, #ff6b6b); }

.iw-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.iw-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); min-width: 0; }
.iw-form .iw-goal { grid-column: 1 / -1; }
.iw-form .iw-wide { grid-column: span 3; }
.iw-form textarea { resize: vertical; font-size: 15px; }
.iw-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.iw-actions .muted { flex: 1; min-width: 200px; font-size: 12.5px; }
.iw-h2 { margin: 28px 0 10px; font-size: 18px; }
.iw-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.iw-card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.iw-card:hover { border-color: var(--line-2); }
.iw-card-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.iw-card-top h3 { margin: 0; font-size: 15px; }
.iw-goal-line { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.iw-tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.iw-tchip { display: inline-flex; gap: 6px; align-items: baseline; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; background: var(--bg-2); font-size: 12px; color: var(--text-2); text-transform: capitalize; }
.iw-tchip b { font-family: var(--mono); color: var(--text); }
.iw-meta { font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.iw-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.iw-pill.s-ready { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.iw-pill.s-watching { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.iw-pill.s-researching { color: var(--accent-2); }
.iw-pill.s-error { color: var(--crit, #ff6b6b); }

.iw-back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: 13px; margin-bottom: 8px; }
.iw-head h1 { margin: 4px 0; font-size: 24px; }
.iw-head p { margin: 4px 0; }
.iw-log { margin-top: 8px; font-size: 12px; font-family: var(--mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.iw-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.iw-bar .ghost-btn, .iw-watchbar .ghost-btn { margin: 0; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; padding: 7px 12px; }
.iw-bar .danger:hover { color: var(--crit, #ff6b6b); }
.iw-summary { color: var(--text-2); max-width: 900px; }
.iw-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 18px 0 12px; }
.iw-tabs button { border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-2); cursor: pointer; position: relative; }
.iw-tabs button span { text-transform: capitalize; font-weight: 600; font-size: 13px; }
.iw-tabs button b { font-family: var(--mono); font-size: 14px; color: var(--text); }
.iw-tabs button i { position: absolute; top: 6px; right: 8px; color: var(--accent); }
.iw-tabs button.on { background: var(--card-2); box-shadow: var(--shadow); color: var(--text); }
.iw-tier h2 { margin: 0 0 4px; font-size: 18px; }
.iw-tier h3, .iw-live h3, .iw-warn h3 { margin: 10px 0 4px; font-size: 15px; }
.iw-totals { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
.iw-totals > div { display: flex; flex-direction: column; font-size: 12px; }
.iw-totals b { font-family: var(--mono); font-size: 17px; color: var(--text); }
.iw-watchbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); border-radius: 10px; font-size: 13px; }
.iw-watchbar .sp { flex: 1; }
.iw-watchbar .primary-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; }
.iw-table-wrap { max-height: none; }
.iw-table td, .iw-live-table td, .iw-bom td { white-space: normal !important; font-family: inherit !important; font-size: 12.5px !important; }
.iw-table td:nth-child(2) { min-width: 90px; }
.iw-table td:nth-child(3) { min-width: 220px; }
.iw-table td:nth-child(5), .iw-table td:nth-child(6) { min-width: 120px; }
.iw-table td:nth-child(4), .iw-table td:nth-child(7) { text-align: right; }
.iw-table th:first-child, .iw-table td:first-child { width: 28px; text-align: center; }
.iw-table tr.opt td { opacity: .78; }
.iw-table .sub, .iw-live-table .sub { display: block; color: var(--text-3); font-size: 11px; line-height: 1.35; white-space: normal; }
.iw-table td:first-child { min-width: 0; }
.iw-live-table td:first-child { min-width: 160px; }
.iw-table .why { display: block; color: var(--text-2); font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
.iw-pick { color: var(--text); text-decoration: none; white-space: nowrap; }
.iw-pick:hover .pr { text-decoration: underline; }
.iw-pick .st { color: var(--text-2); font-size: 11.5px; }
.iw-pick.alt .pr { font-size: 11.5px; font-weight: 500; }
.pr { font-family: var(--mono); font-weight: 600; color: var(--text); }
.v-ok { color: var(--good); } .v-mid { color: var(--text-3); } .v-bad { color: var(--crit, #ff6b6b); }
.iw-unc { font-size: 10.5px; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); border-radius: 6px; padding: 0 4px; white-space: nowrap; }
.iw-compat { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.iw-compat li { display: flex; gap: 8px; align-items: flex-start; }
.iw-compat li i { color: var(--good); font-size: 16px; }
.iw-compat li.bad i, .iw-compat li.bad b { color: var(--crit, #ff6b6b); }
.iw-compat b { color: var(--text); font-weight: 600; }
.iw-bundles, .iw-notes, .iw-warn ul { margin: 4px 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 6px; }
.iw-bundles a { color: var(--text); }
.iw-live { margin: 14px 0; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.iw-live-table td a { color: var(--text); }
.iw-warn { margin-top: 14px; }
.iw-details { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.iw-details summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.iw-details .g-table-wrap { margin-top: 8px; }
.iw-table .ph-cat { display: none; }
.iw-unit { font-size: 11px; color: var(--good, #1f8a4c); white-space: nowrap; font-variant-numeric: tabular-nums; }
.iw-table td.iw-ux { text-align: right; white-space: nowrap !important; font-variant-numeric: tabular-nums; }
.iw-prod { display: block; color: var(--text-3); font-size: 11px; line-height: 1.3; white-space: normal; margin-bottom: 3px; }
.iw-oos { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
#deepText { width: 100%; font-family: var(--mono); font-size: 11.5px; }

@media (max-width: 640px) {
  .iw-table .iw-ux { display: none; } /* phones: the $/Wh tag next to each offer instead */
  .top-nav { margin-left: 4px; }
  .top-nav a { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
  .signin-btn { font-size: 0; padding: 8px 10px; gap: 0; }
  .signin-btn i { font-size: 18px; }
  .iw-table .pr { font-size: 12px; }
  .iw-table td:nth-child(7) { min-width: 0; }
  .iw-table .why { display: none; }
  .brand-name { display: none; }
  .iw-form { grid-template-columns: 1fr; }
  .iw-form .iw-wide { grid-column: auto; }
  .iw-projects { grid-template-columns: 1fr; }
  .iw-head h1 { font-size: 20px; }
  /* undo the generic g-table phone rule (hides columns 2 and 6): this table scrolls sideways instead */
  .iw-table td:nth-child(2), .iw-table th:nth-child(2), .iw-table td:nth-child(6), .iw-table th:nth-child(6),
  .iw-live-table td:nth-child(2), .iw-live-table th:nth-child(2), .iw-live-table td:nth-child(6), .iw-live-table th:nth-child(6),
  .iw-bom td:nth-child(2), .iw-bom th:nth-child(2) { display: table-cell; }
  .iw-table td:nth-child(2), .iw-table th:nth-child(2) { display: none; } /* category is in the part's sub line on phones */
  .iw-table td:nth-child(3) { min-width: 170px; }
  .iw-table .ph-cat { display: block; }
  .iw-table td, .iw-table th { padding-left: 5px; padding-right: 5px; }
  .iw-table td:nth-child(3) { min-width: 120px; }
  .iw-table td:nth-child(5) { min-width: 84px; }
  .iw-table td:nth-child(4), .iw-table th:nth-child(4) { display: none; } /* qty: in the part's sub line */
  .iw-pick { white-space: normal; }
  .iw-table td:nth-child(3) .sub:not(.ph-cat):not(.iw-meta2), .iw-table .sub .iw-prod, .iw-table .iw-docs { display: none; } /* specs, alternative notes, setup docs: desktop / share page; weight + power stay */
  .iw-table td:nth-child(3) .iw-meta2:not(:has(> span:not(.iw-docs))) { display: none; }
  .iw-pick .st { display: block; }
  .iw-table td:nth-child(6), .iw-table th:nth-child(6) { display: none; } /* best value: in the tier totals; tap a part for alternatives */
  .iw-totals { gap: 8px 16px; }
  .iw-watchbar .sp { display: none; }
}
/* task #214: weight / power and setup docs under a part */
.iw-meta2 { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.iw-docs { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; }
.iw-docs a { color: var(--accent, #3b82f6); text-decoration: none; white-space: nowrap; }
.iw-docs a:hover { text-decoration: underline; }
