/* ============ Copilot Studio Credit Estimator ============ */
:root {
  --bg: #07090f;
  --panel: #0d1120;
  --panel-2: #111631;
  --line: #1d2547;
  --text: #e8ecff;
  --muted: #8b94b8;
  --std: #38bdf8;      /* standard harness — cyan */
  --std-dim: #0e3a52;
  --ghcp: #c084fc;     /* github copilot harness — violet */
  --ghcp-dim: #3b1f5e;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Sora", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* background decorations */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(70,90,180,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70,90,180,.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow { position: fixed; z-index: -1; border-radius: 50%; filter: blur(120px); opacity: .22; pointer-events: none; }
.bg-glow-1 { width: 560px; height: 560px; top: -180px; left: -120px; background: var(--std); }
.bg-glow-2 { width: 560px; height: 560px; top: -140px; right: -160px; background: var(--ghcp); }

/* header */
.site-header { padding: 34px 0 10px; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; gap: 14px; align-items: flex-start; }
.brand-bolt { font-size: 2.4rem; filter: drop-shadow(0 0 14px rgba(251,191,36,.6)); }
.brand h1 { margin: 0; font-size: clamp(1.4rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.grad-text {
  background: linear-gradient(90deg, var(--std), var(--ghcp));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* buttons */
.btn {
  font-family: var(--sans); font-size: .85rem; font-weight: 600;
  border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { border-color: var(--std); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(56,189,248,.15); }

/* panels */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 22px 0;
  box-shadow: 0 6px 30px rgba(0,0,0,.35);
}
.panel-title { margin: 0 0 16px; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; font-size: .8rem; font-family: var(--mono);
  background: linear-gradient(135deg, var(--std-dim), var(--ghcp-dim));
  border: 1px solid var(--line);
}

/* presets */
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.preset {
  text-align: left; padding: 14px; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-family: var(--sans); transition: border-color .15s, transform .12s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.preset:hover { transform: translateY(-2px); border-color: var(--std); }
.preset.active { border-color: var(--ghcp); box-shadow: 0 0 0 1px var(--ghcp), 0 6px 24px rgba(192,132,252,.18); }
.preset-icon { font-size: 1.4rem; }
.preset strong { font-size: .95rem; }
.preset small { color: var(--muted); font-size: .78rem; line-height: 1.35; }

/* fields */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field label, .feature-row label {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: .84rem; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.field label em, .feature-row label em {
  font-style: normal; font-family: var(--mono); font-size: .72rem; color: var(--std);
  background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.25);
  padding: 1px 6px; border-radius: 6px;
}
.ghcp-em { color: var(--ghcp) !important; background: rgba(192,132,252,.1) !important; border-color: rgba(192,132,252,.3) !important; }
.range-row { display: flex; align-items: center; gap: 10px; }
input[type="range"] {
  flex: 1; appearance: none; -webkit-appearance: none; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--std), var(--ghcp)); outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--std); box-shadow: 0 0 10px rgba(56,189,248,.6); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--std); box-shadow: 0 0 10px rgba(56,189,248,.6); cursor: grab;
}
input[type="number"] {
  width: 88px; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; font-family: var(--mono); font-size: .85rem;
}
input[type="number"]:focus { outline: none; border-color: var(--std); }
.unit { color: var(--muted); font-family: var(--mono); font-size: .8rem; }
.note { color: var(--muted); font-size: .84rem; margin: 12px 0 0; }

/* tooltips */
.hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; font-size: .68rem; cursor: help;
  background: var(--line); color: var(--muted); position: relative; font-weight: 700;
}
.hint:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  width: 270px; padding: 10px 12px; border-radius: 10px; z-index: 50;
  background: #050710; border: 1px solid var(--line); color: var(--text);
  font-size: .76rem; font-weight: 400; line-height: 1.45; text-align: left;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
}

/* harness panels */
.harness-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 940px) { .harness-grid { grid-template-columns: 1fr; } }
.harness-panel { margin: 0; }
.std-panel { border-top: 3px solid var(--std); }
.ghcp-panel { border-top: 3px solid var(--ghcp); }
.harness-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.harness-head h2 { margin: 0; font-size: 1.15rem; }
.badge { font-size: .68rem; font-family: var(--mono); padding: 4px 10px; border-radius: 999px; letter-spacing: .02em; }
.badge-std { background: rgba(56,189,248,.12); color: var(--std); border: 1px solid rgba(56,189,248,.3); }
.badge-ghcp { background: rgba(192,132,252,.12); color: var(--ghcp); border: 1px solid rgba(192,132,252,.3); }
.harness-sub { color: var(--muted); font-size: .82rem; margin: 10px 0 4px; }
.sub-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; display: flex; align-items: center; gap: 6px; }
.feature-rows { display: flex; flex-direction: column; gap: 12px; }
.auto-val { font-family: var(--mono); font-weight: 700; color: var(--ghcp); font-size: 1rem; padding: 4px 0; }

.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; padding: 8px 6px; font-family: var(--mono); font-size: .74rem; cursor: pointer;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px;
  transition: all .12s;
}
.seg button.active { background: rgba(56,189,248,.14); color: var(--std); border-color: var(--std); }

.adv { margin-top: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }
.adv summary { cursor: pointer; font-size: .8rem; color: var(--muted); }
.adv .grid-3 { margin-top: 12px; }

.mini-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.mini-stats > div { text-align: center; }
.mini-stats span { font-family: var(--mono); font-weight: 700; font-size: 1.25rem; display: block; }
.std-panel .mini-stats span { color: var(--std); }
.ghcp-panel .mini-stats span { color: var(--ghcp); }
.mini-stats label { font-size: .68rem; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; justify-content: center; }

/* verdict */
.results-panel { border: 1px solid var(--line); }
.verdict-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }
@media (max-width: 940px) { .verdict-grid { grid-template-columns: 1fr; } }
.verdict-card { padding: 22px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.verdict-std { border-top: 3px solid var(--std); }
.verdict-ghcp { border-top: 3px solid var(--ghcp); }
.verdict-card h3 { margin: 0 0 8px; font-size: .95rem; }
.big-money { font-family: var(--mono); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.verdict-std .big-money { color: var(--std); text-shadow: 0 0 30px rgba(56,189,248,.4); }
.verdict-ghcp .big-money { color: var(--ghcp); text-shadow: 0 0 30px rgba(192,132,252,.4); }
.verdict-sub { color: var(--muted); font-size: .8rem; font-family: var(--mono); margin-top: 2px; }
.verdict-lines { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 7px; }
.verdict-lines li { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); border-bottom: 1px dotted var(--line); padding-bottom: 6px; }
.verdict-lines b { font-family: var(--mono); color: var(--text); text-align: right; }

.verdict-center { text-align: center; }
.delta-ring { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.delta-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 12; }
.ring-fg {
  fill: none; stroke: url(#ringGrad); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 540; stroke-dashoffset: 540; transition: stroke-dashoffset .6s ease;
  stroke: var(--ghcp);
  filter: drop-shadow(0 0 8px rgba(192,132,252,.5));
}
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label span { font-family: var(--mono); font-weight: 700; font-size: 1.7rem; }
.ring-label small { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.verdict-note { color: var(--muted); font-size: .78rem; max-width: 230px; margin: 12px auto 0; }

/* charts */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
@media (max-width: 940px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.chart-card h3 { margin: 0 0 12px; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; }
.chart-card canvas { width: 100%; height: auto; display: block; }

/* pack optimizer */
.pack-opt { display: flex; flex-direction: column; gap: 14px; font-size: .84rem; }
.pack-line { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.pack-line h4 { margin: 0 0 6px; font-size: .8rem; }
.pack-line .std-c { color: var(--std); } .pack-line .ghcp-c { color: var(--ghcp); }
.pack-detail { font-family: var(--mono); font-size: .76rem; color: var(--muted); line-height: 1.7; }
.pack-detail b { color: var(--text); }
.pack-warn { color: var(--warn); font-size: .74rem; margin-top: 6px; }
.pack-save { color: var(--ok); font-weight: 700; }

/* capability table */
.cap-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cap-row { display: grid; grid-template-columns: 2fr 1fr 1fr; }
.cap-row > div { padding: 12px 16px; font-size: .82rem; border-bottom: 1px solid var(--line); }
.cap-row:last-child > div { border-bottom: none; }
.cap-head > div { background: var(--panel-2); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cap-row .yes { color: var(--ok); } .cap-row .no { color: var(--bad); } .cap-row .mid { color: var(--warn); }
@media (max-width: 700px) { .cap-row { grid-template-columns: 1.4fr 1fr 1fr; } .cap-row > div { padding: 10px 8px; font-size: .72rem; } }

/* rate card */
.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rate-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px 12px;
  text-align: center; transition: transform .12s, border-color .15s;
}
.rate-card:hover { transform: translateY(-3px); border-color: var(--std); }
.rate-card b { display: block; font-family: var(--mono); font-size: 1.5rem; color: var(--std); }
.rate-card b i { font-style: normal; font-size: .7rem; color: var(--muted); }
.rate-card span { font-size: .72rem; color: var(--muted); }
.ghcp-rate b { color: var(--ghcp); }
.ghcp-rate:hover { border-color: var(--ghcp); }

/* rate card editing (unlock / warning) */
.rate-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.rates-warn { color: var(--warn); font-size: .78rem; font-weight: 600; }
.rate-group-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 10px; }
.rate-group-title.std-group { color: var(--std); }
.rate-group-title.ghcp-group { color: var(--ghcp); }
.std-rates .rate-card { border-left: 3px solid rgba(56,189,248,.35); }
.ghcp-rates .rate-card { border-left: 3px solid rgba(192,132,252,.35); }
.rate-input {
  width: 84px; max-width: 100%; background: transparent; border: 1px dashed transparent;
  color: inherit; font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  text-align: center; padding: 0 2px; border-radius: 8px; -moz-appearance: textfield;
}
.rate-input::-webkit-outer-spin-button, .rate-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rate-input:disabled { color: inherit; -webkit-text-fill-color: currentColor; opacity: 1; cursor: default; }
.rates-unlocked .rate-input { border-color: var(--warn); background: rgba(251,191,36,.07); cursor: text; }
.rate-input:focus { outline: none; border-style: solid; border-color: var(--warn); }

/* sources / footer */
.src-list { margin: 0 0 8px; padding-left: 18px; font-size: .82rem; }
.src-list a { color: var(--std); text-decoration: none; }
.src-list a:hover { text-decoration: underline; }
.disclaimer .note { font-size: .76rem; }
.site-footer { padding: 26px 0 40px; color: var(--muted); font-size: .8rem; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.toast { color: var(--ok); font-weight: 600; opacity: 0; transition: opacity .3s; }
.toast.show { opacity: 1; }

/* number pulse animation */
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.pulse { animation: pulse .35s ease; display: inline-block; }
