/* calc-tools.css — styles for the study tools on the calculator front page
   (tab bar, tool cards, graphing, guides). Matches the calculator's dark look. */

#ctApp { display: flex; flex-direction: column; height: 100%; background: #0d0d16; color: #e7e5ff; }

/* ---- tab bar ---- */
#ctTabs {
  flex: none; display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; scrollbar-width: thin;
  background: #121124; border-bottom: 1px solid #26244a;
}
.ct-tab {
  flex: none; padding: 8px 14px; border: 1px solid #2c2a52; border-radius: 999px; background: #1a1930;
  color: #c9c5f5; font: 600 13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; cursor: pointer; white-space: nowrap;
}
.ct-tab:hover { background: #232142; }
.ct-tab.on { background: #7c6ff0; border-color: #7c6ff0; color: #fff; }

/* ---- panel area ---- */
#ctPanel { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 60px; display: none; }
.ct-section { max-width: 1100px; margin: 0 auto; }
.ct-section h2 { margin: 0 0 6px; font-size: 22px; color: #fff; }
.ct-intro { margin: 0 0 16px; color: #9f9bc9; font-size: 14px; line-height: 1.5; max-width: 820px; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ct-card { background: #17162a; border: 1px solid #26244a; border-radius: 14px; padding: 16px; }
.ct-card h3 { margin: 0 0 4px; font-size: 16px; color: #fff; }
.ct-desc { margin: 0 0 10px; color: #9f9bc9; font-size: 13px; line-height: 1.4; }
.ct-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ct-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #b4b0e0; }
.ct-field.wide { grid-column: 1 / -1; }
.ct-in, .ct-expr {
  width: 100%; padding: 9px 10px; border-radius: 9px; border: 1px solid #2f2d55; background: #0d0d16; color: #fff;
  font-size: 15px; font-family: inherit; outline: none;
}
.ct-in:focus, .ct-expr:focus { border-color: #7c6ff0; }
.ct-btn {
  padding: 9px 16px; border: none; border-radius: 9px; background: #7c6ff0; color: #fff; font-weight: 600;
  font-size: 14px; cursor: pointer;
}
.ct-btn:hover { filter: brightness(1.1); }
.ct-btn.sm { padding: 6px 12px; font-size: 14px; }
.ct-out {
  margin-top: 10px; font-size: 14px; line-height: 1.6; color: #e7e5ff; font-variant-numeric: tabular-nums; word-break: break-word;
}
.ct-out:empty { display: none; }
.ct-out:not(:empty) { background: #0d0d16; border-radius: 9px; padding: 10px 12px; border: 1px solid #222044; }
.ct-out.err { color: #ff9b9b; border-color: #5a2a3a; }

/* ---- scientific ---- */
.ct-sci { max-width: 520px; background: #17162a; border: 1px solid #26244a; border-radius: 16px; padding: 16px; }
.ct-sci-top { display: flex; gap: 8px; }
.ct-sci-top .ct-expr { font-size: 18px; }
.ct-sci-result { text-align: right; font-size: 26px; min-height: 36px; margin: 10px 4px; color: #fff; word-break: break-all; }
.ct-sci-result.err { font-size: 14px; color: #ff9b9b; }
.ct-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.ct-key {
  height: 44px; border: none; border-radius: 10px; background: #2a2942; color: #fff; font-size: 16px; cursor: pointer;
  touch-action: manipulation;
}
.ct-key.fn { background: #23223a; color: #c9c5f5; font-size: 14px; }
.ct-key.eq { background: #7c6ff0; }
.ct-key:active { filter: brightness(1.3); }
.ct-sci h4 { margin: 14px 0 6px; font-size: 13px; color: #9f9bc9; }
.ct-hist { max-height: 160px; overflow-y: auto; font-size: 13px; color: #b4b0e0; }
.ct-hist-row { padding: 4px 0; border-bottom: 1px solid #222044; }

/* ---- graphing ---- */
.ct-graph { background: #17162a; border: 1px solid #26244a; border-radius: 16px; padding: 14px; }
.ct-graph-fns { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 10px; }
.ct-fn-row { display: flex; align-items: center; gap: 6px; }
.ct-fn-row.bad .ct-in { border-color: #c9475e; }
.ct-swatch { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.ct-fn-lab { flex: none; font-size: 13px; color: #b4b0e0; }
.ct-canvas { display: block; width: 100%; height: min(60vh, 520px); border-radius: 10px; touch-action: none; cursor: grab; }
.ct-graph-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ct-graph-info { font-size: 13px; color: #b4b0e0; }

/* ---- guides ---- */
.ct-guide-subjects { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ct-chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid #2c2a52; background: #1a1930; color: #c9c5f5;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.ct-chip.on { background: #3a3470; border-color: #7c6ff0; color: #fff; }
.ct-guide-body { max-width: 860px; }
.ct-guide-body h2 { font-size: 24px; margin: 0 0 6px; color: #fff; }
.ct-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 18px; padding: 12px 14px; background: #17162a; border: 1px solid #26244a; border-radius: 12px; }
.ct-toc a { color: #a99ff8; font-size: 13px; text-decoration: none; }
.ct-toc a:hover { text-decoration: underline; }
.ct-sheet, .ct-topic { background: #17162a; border: 1px solid #26244a; border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; scroll-margin-top: 12px; }
.ct-sheet h3, .ct-topic h3 { margin: 0 0 8px; font-size: 18px; color: #fff; }
.ct-sheet h4, .ct-topic h4 { margin: 12px 0 4px; font-size: 13px; color: #a99ff8; text-transform: uppercase; letter-spacing: 0.04em; }
.ct-sheet ul { margin: 0; padding-left: 18px; }
.ct-sheet li, .ct-topic li { margin: 4px 0; line-height: 1.5; font-size: 14px; color: #dcd9f7; }
.ct-topic p { margin: 0 0 8px; line-height: 1.55; font-size: 14px; color: #dcd9f7; }
.ct-topic ol { margin: 0; padding-left: 20px; }
.ct-formulas { margin: 8px 0; padding: 10px 12px; background: #0d0d16; border-left: 3px solid #7c6ff0; border-radius: 6px; font-size: 14px; line-height: 1.7; color: #fff; }
.ct-example { margin-top: 10px; padding: 10px 12px; background: #142a24; border-radius: 8px; font-size: 14px; line-height: 1.55; color: #d4f5e9; }
.ct-tips { margin-top: 8px; padding: 10px 12px; background: #2a2414; border-radius: 8px; font-size: 13px; line-height: 1.55; color: #f5e9c8; }
.ct-top-link { display: inline-block; margin-top: 10px; font-size: 12px; color: #8f89c9; text-decoration: none; }

@media (max-width: 520px) {
  #ctPanel { padding: 14px 12px 60px; }
  .ct-grid { grid-template-columns: 1fr; }
  .ct-key { height: 42px; font-size: 15px; }
  .ct-section h2, .ct-guide-body h2 { font-size: 20px; }
}
