
/* Oddspira v1.3 product polish */
.polish-toolbar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin-bottom: -8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(18,28,46,.76);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
}

.polish-toolbar-label {
  margin-right: auto;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.polish-action {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8,17,29,.68);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  cursor: pointer;
}

.polish-action:hover {
  color: var(--accent);
  border-color: rgba(84,214,140,.42);
}

.polish-action.primary {
  color: #07120c;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.result-insight {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 15px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}

.result-insight .insight-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(147,164,188,.12);
  font-weight: 950;
}

.result-insight strong {
  display: block;
  margin-bottom: 3px;
  font-size: .84rem;
}

.result-insight p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}

.result-insight.positive {
  border-color: rgba(84,214,140,.32);
  background: rgba(84,214,140,.06);
}

.result-insight.positive .insight-icon { color: var(--accent); }
.result-insight.negative {
  border-color: rgba(255,107,107,.34);
  background: rgba(255,107,107,.06);
}
.result-insight.negative .insight-icon { color: var(--danger); }
.result-insight.neutral {
  border-color: rgba(248,193,92,.3);
  background: rgba(248,193,92,.055);
}
.result-insight.neutral .insight-icon { color: var(--warning); }

.calculation-method {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(8,17,29,.42);
}

.calculation-method summary {
  padding: 13px 14px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 850;
  color: var(--text);
}

.calculation-method-body {
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: .77rem;
  line-height: 1.6;
}

.calculation-method-body code {
  display: block;
  margin: 10px 0;
  padding: 11px;
  overflow-x: auto;
  border-radius: 9px;
  background: rgba(0,0,0,.22);
  color: var(--accent);
  white-space: pre-wrap;
}

.metric {
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.metric:hover {
  transform: translateY(-2px);
  border-color: rgba(84,214,140,.28);
  background: rgba(84,214,140,.035);
}

.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(1,6,13,.72);
  backdrop-filter: blur(4px);
}

.history-drawer {
  position: fixed;
  z-index: 181;
  top: 0;
  right: 0;
  width: min(460px, 100%);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: #0c1524;
  box-shadow: -25px 0 60px rgba(0,0,0,.35);
}

.history-head,
.history-footer {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.history-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.history-close {
  margin-left: auto;
  width: 37px;
  height: 37px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.history-tabs {
  display: flex;
  gap: 7px;
  padding: 12px 16px 0;
}

.history-tab {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.history-tab.active {
  color: #07120c;
  background: var(--accent);
  border-color: transparent;
}

.history-list {
  flex: 1;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px 20px;
}

.history-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.history-item {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.history-item-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.history-item h3 {
  margin: 0 0 4px;
  font-size: .84rem;
}

.history-item p {
  margin: 0;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.45;
}

.history-star {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  cursor: pointer;
}

.history-star.active { color: var(--warning); }

.history-item-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.history-item-actions button {
  flex: 1;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(8,17,29,.65);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
}

.history-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-footer button,
.history-footer label {
  flex: 1;
  min-width: 110px;
  min-height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
}

.share-toast {
  position: fixed;
  z-index: 220;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 28px));
  padding: 11px 14px;
  border: 1px solid rgba(84,214,140,.35);
  border-radius: 11px;
  background: rgba(9,35,24,.98);
  color: #d9ffea;
  box-shadow: var(--shadow);
  font-size: .8rem;
  text-align: center;
}

.methodology-grid,
.changelog-list {
  display: grid;
  gap: 15px;
  padding-bottom: 48px;
}

.method-card,
.change-card,
.methodology-disclaimer {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(18,28,46,.82);
  box-shadow: var(--shadow);
}

.method-card h2,
.change-card h2 {
  margin: 0 0 15px;
  font-size: 1.14rem;
}

.method-row {
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.method-row:first-of-type { border-top: 0; }
.method-row strong { display: block; margin-bottom: 5px; font-size: .78rem; color: var(--text); }
.method-row p,
.change-card p,
.methodology-disclaimer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.methodology-disclaimer {
  margin-bottom: 54px;
}

@media (max-width: 680px) {
  .polish-toolbar-label {
    width: 100%;
    margin-right: 0;
  }
  .polish-action {
    flex: 1 1 calc(50% - 8px);
  }
}
