/* TIMI Risk Score Calculator CSS - heartscorecalculator.com */
.timi-breadcrumb {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  color: #64748b;
  font: 500 13px Inter, sans-serif;
}
.timi-breadcrumb a {
  color: #1d3557;
  text-decoration: none;
}
.timi-breadcrumb a:hover {
  text-decoration: underline;
}
.timi-hero-grid {
  align-items: start;
}
.timi-lead {
  font-size: 16px;
  line-height: 1.75;
}
.timi-direct {
  margin: 20px 0;
  padding: 15px 17px;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #eff6ff;
  color: #1e3a8a;
  font: 13px/1.6 Inter, sans-serif;
}
.timi-stats {
  margin-bottom: 20px;
}

.update-badge i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e63946;
  margin-right: 6px;
  animation: timi-pulse 2s infinite;
}
@keyframes timi-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

.timi-card {
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}
.timi-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}
.timi-card-head span {
  color: #e63946;
  font: 700 10px Inter, sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.timi-card-head h2 {
  margin: 3px 0 0;
  font-size: 19px;
}
.timi-card-head > b {
  padding: 5px 9px;
  border-radius: 99px;
  background: #dcfce7;
  color: #166534;
  font: 700 9px Lexend, sans-serif;
}

/* Mode Switcher Tabs */
.timi-toggle-bar {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
  gap: 4px;
}
.timi-toggle-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  font: 700 11.5px Lexend, sans-serif;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.timi-toggle-btn.is-active {
  background: #fff;
  color: #1d3557;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.timi-mode-desc {
  font-size: 11.5px;
  color: #475569;
  background: #f8fafc;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  border-left: 3px solid #1d3557;
  line-height: 1.45;
}

/* Checklist Items for NSTEMI */
.timi-checklist {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 16px;
}
.timi-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.timi-check-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.timi-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #e63946;
  cursor: pointer;
  flex-shrink: 0;
}
.timi-check-item.is-checked {
  border-color: #1d3557;
  background: #f0f4f9;
}
.timi-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #1d3557;
  color: #fff;
  font: 800 12px Lexend, sans-serif;
  flex-shrink: 0;
}
.timi-check-text {
  flex: 1;
  min-width: 0;
}
.timi-check-text strong {
  display: block;
  font: 700 12.5px Lexend, sans-serif;
  color: #1d3557;
  line-height: 1.35;
}
.timi-check-text small {
  display: block;
  font: 400 11px Inter, sans-serif;
  color: #64748b;
  margin-top: 2px;
}
.timi-point-tag {
  padding: 3px 8px;
  border-radius: 99px;
  background: #e2e8f0;
  color: #475569;
  font: 700 10.5px Lexend, sans-serif;
  flex-shrink: 0;
}
.timi-check-item.is-checked .timi-point-tag {
  background: #fee2e2;
  color: #b91c1c;
}

/* STEMI Group & Fields */
.timi-group {
  margin: 0 0 14px;
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.timi-group legend {
  padding: 0 6px;
  color: #1d3557;
  font: 700 10.5px Lexend, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timi-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font: 700 12px Lexend, sans-serif;
  color: #1d3557;
  margin-bottom: 6px;
}
.timi-label small {
  font: 500 10.5px Inter, sans-serif;
  color: #64748b;
}

/* Segmented button row */
.timi-seg-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 11px;
}
.timi-seg-wrap.tri {
  grid-template-columns: repeat(3, 1fr);
}
.timi-seg-opt {
  display: block;
  cursor: pointer;
}
.timi-seg-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.timi-seg-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border: 1.5px solid #dbe3ed;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: 700 11px Lexend, sans-serif;
  transition: all 0.15s ease;
  text-align: center;
  padding: 0 6px;
}
.timi-seg-opt input:checked + .timi-seg-pill {
  border-color: #1d3557;
  background: #1d3557;
  color: #fff;
}

/* Presets & Actions */
.timi-examples {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.timi-examples > span {
  color: #64748b;
  font: 600 10px Lexend, sans-serif;
}
.timi-examples button {
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 99px;
  background: #fff;
  color: #1d3557;
  cursor: pointer;
  font: 600 10px Lexend, sans-serif;
  transition: all 0.15s ease;
}
.timi-examples button:hover {
  border-color: #1d3557;
  background: #eff6ff;
}

.timi-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.timi-actions > button:first-child {
  padding: 12px 18px;
  border: 0;
  border-radius: 9px;
  background: #e63946;
  color: #fff;
  cursor: pointer;
  font: 700 13px Lexend, sans-serif;
  transition: background 0.15s ease;
}
.timi-actions > button:first-child:hover {
  background: #c0303c;
}
.timi-actions > button:last-child, .timi-print {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font: 600 11px Lexend, sans-serif;
  transition: all 0.15s ease;
}
.timi-actions > button:last-child:hover, .timi-print:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

/* Result Reveal Card */
.timi-result {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  animation: timi-fadein 0.3s ease;
}
@keyframes timi-fadein {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.timi-result[hidden] {
  display: none !important;
}
.timi-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.timi-result-head span {
  display: block;
  color: #e63946;
  font: 700 9px Inter, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.timi-result-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
}
.timi-result-head > b {
  padding: 6px 12px;
  border-radius: 99px;
  font: 700 10.5px Lexend, sans-serif;
}
.timi-result-head > b.is-low { background: #dcfce7; color: #166534; }
.timi-result-head > b.is-mod { background: #fef3c7; color: #92400e; }
.timi-result-head > b.is-high { background: #fee2e2; color: #991b1b; }

.timi-main-value {
  padding: 16px 0 12px;
  text-align: center;
}
.timi-main-value strong {
  color: #1d3557;
  font: 800 48px Lexend, sans-serif;
  line-height: 1;
}
.timi-main-value > span {
  margin-left: 4px;
  color: #64748b;
  font: 700 20px Lexend, sans-serif;
}
.timi-main-value p {
  margin: 6px 0 0;
  color: #475569;
  font: 600 13px Inter, sans-serif;
}

.timi-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 12px 0;
}
.timi-result-grid > div {
  padding: 11px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  text-align: center;
}
.timi-result-grid span {
  display: block;
  color: #94a3b8;
  font: 8.5px Inter, sans-serif;
  text-transform: uppercase;
}
.timi-result-grid strong {
  display: block;
  margin: 4px 0 2px;
  color: #1d3557;
  font: 700 13.5px Lexend, sans-serif;
}
.timi-result-grid small {
  display: block;
  color: #64748b;
  font: 9px/1.3 Inter, sans-serif;
}

.timi-rec-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-left: 4px solid #1d3557;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font: 11.5px/1.6 Inter, sans-serif;
}
.timi-rec-box.is-high {
  border-left-color: #e63946;
  background: #fff1f2;
  color: #881337;
}
.timi-rec-box.is-mod {
  border-left-color: #d97706;
  background: #fffbeb;
  color: #92400e;
}
.timi-rec-box strong {
  display: block;
  margin-bottom: 4px;
  font: 700 12px Lexend, sans-serif;
}

.timi-factors-card {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 11px;
  color: #334155;
}
.timi-factors-card strong {
  color: #0f172a;
  display: block;
  margin-bottom: 4px;
}
.timi-factors-card ul {
  margin: 4px 0 0 18px;
  padding: 0;
}

.timi-print {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px 0;
  text-align: center;
}

/* Editorial Layout & Content */
.timi-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 30px;
  align-items: start;
}
.timi-layout .main-article {
  min-width: 0;
}
.timi-note {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font: 12.5px/1.65 Inter, sans-serif;
}
.timi-formula {
  margin: 18px 0;
  padding: 18px;
  border-radius: 11px;
  background: #1d3557;
  color: #fff;
  text-align: center;
  font: 700 15px/1.5 Lexend, sans-serif;
}
.timi-formula code {
  display: block;
  margin-top: 8px;
  font: 400 12.5px/1.6 Consolas, monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 6px;
}

/* Tables */
.timi-table-wrap {
  overflow-x: auto;
  margin: 18px 0;
}
.timi-table {
  width: 100%;
  border-collapse: collapse;
  font: 12px Inter, sans-serif;
}
.timi-table th {
  background: #1d3557;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-family: Lexend, sans-serif;
}
.timi-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
}
.timi-table tr:nth-child(even) td {
  background: #f8fafc;
}
.timi-table tr:hover td {
  background: #f1f5f9;
}

/* Internal Linking Requirement */
.text-link, .timi-content p a, .timi-content li a, .timi-content td a, .main-article p a, .main-article li a {
  color: #e63946 !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(230, 57, 70, 0.45) !important;
  text-underline-offset: 3px !important;
  text-decoration-thickness: 1.5px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}
.text-link:hover, .timi-content p a:hover, .timi-content li a:hover, .timi-content td a:hover, .main-article p a:hover, .main-article li a:hover {
  color: #c0303c !important;
  text-decoration-color: #c0303c !important;
}

/* FAQ Details Accordion */
.faq-box details {
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  margin-bottom: 10px;
  background: #fff;
  transition: all 0.2s ease;
}
.faq-box summary {
  padding: 14px 16px;
  font: 700 14px Lexend, sans-serif;
  color: #1d3557;
  cursor: pointer;
  user-select: none;
}
.faq-box summary:hover {
  color: #e63946;
}
.faq-box details[open] summary {
  border-bottom: 1px solid #e2e8f0;
  color: #e63946;
}
.faq-box details p {
  padding: 14px 16px;
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #475569;
}

/* Case Scenario Box */
.case-card {
  padding: 16px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  margin: 16px 0;
}
.case-card h3 {
  margin-top: 0;
  color: #1d3557;
  font-size: 15px;
}

/* Responsive */
@media (max-width: 900px) {
  .timi-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .timi-result-grid { grid-template-columns: 1fr; }
  .timi-card { padding: 16px; }
  .timi-seg-wrap.tri { grid-template-columns: 1fr; }
}

@media print {
  body * { visibility: hidden; }
  #timi-print-zone, #timi-print-zone * { visibility: visible; }
  #timi-print-zone { position: absolute; left: 0; top: 0; width: 100%; }
  .timi-actions, .timi-examples, .timi-print, header, footer, .sticky-sidebar { display: none !important; }
}
