/* ja/calculators/primer-tm/styles.css */

.ptm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.ptm-full {
  grid-column: 1 / -1;
}

@media (min-width: 960px) {
  .ptm-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.ptm-inline {
  display: grid;
  gap: 6px;
}

.ptm-inline > span {
  font-weight: 600;
}

.ptm-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

@media (max-width: 620px) {
  .ptm-row {
    grid-template-columns: 1fr;
  }
}

.ptm-form-section {
  margin-top: 14px;
}

.ptm-muted {
  color: var(--muted, #666);
}

.ptm-inline-help {
  margin-top: 6px;
}

.ptm-methods {
  display: grid;
  gap: 8px;
  border: none;
  padding: 0;
  margin: 12px 0 0;
}

.ptm-methods legend {
  font-weight: 700;
  margin-bottom: 8px;
}

.ptm-radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}

.ptm-radio:hover {
  border-color: var(--accent, #0b57d0);
}

.ptm-radio:focus-within {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.ptm-radio input[type="radio"] {
  margin-top: 3px;
}

.ptm-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}

.ptm-check > span {
  font-weight: 600;
}

.ptm-check:hover {
  border-color: var(--accent, #0b57d0);
}

.ptm-check:focus-within {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.ptm-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
}

.ptm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.ptm-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.ptm-table th,
.ptm-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ptm-table thead th {
  font-size: 0.9rem;
  color: #334155;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.ptm-kpi {
  display: grid;
  gap: 10px;
}

.ptm-kpi-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
}

.ptm-kpi-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ptm-kpi-row--primary {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11, 87, 208, 0.18);
  background: rgba(11, 87, 208, 0.06);
}

.ptm-kpi-row--primary > div:first-child {
  font-weight: 600;
}

.ptm-kpi-row--primary .ptm-kpi-value {
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.ptm-pair {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11, 87, 208, 0.18);
  background: rgba(11, 87, 208, 0.04);
}

@supports (color: color-mix(in srgb, white, black)) {
  .ptm-pair {
    background: color-mix(in srgb, var(--accent, #0b57d0) 5%, var(--surface, #fff) 95%);
  }
}

.ptm-pair-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: baseline;
}

#ptm-ta {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent, #0b57d0);
  letter-spacing: -0.01em;
}

.ptm-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
}

.ptm-msg--error {
  border: 1px solid rgba(200, 0, 0, 0.25);
  background: rgba(200, 0, 0, 0.06);
}

.ptm-msg--warn {
  border: 1px solid rgba(255, 153, 0, 0.35);
  background: rgba(255, 153, 0, 0.08);
}

.ptm-msg-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.ptm-gcbar-wrap {
  overflow: hidden;
}

.ptm-gcbar {
  display: flex;
  gap: 2px;
  padding: 6px 0 0;
  flex-wrap: wrap;
}

.ptm-gcbar span {
  width: 8px;
  height: 10px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.6);
}

.ptm-gcbar span.gc {
  background: rgba(11, 87, 208, 0.75);
}

.ptm-gcbar span.amb {
  background: rgba(245, 158, 11, 0.75);
}

.ptm-ad-slot {
  min-height: 120px;
}

@media print {
  .breadcrumb,
  .lang-switch,
  .ad-slot,
  #load-comments,
  #giscus-container,
  .button,
  footer {
    display: none !important;
  }
  .card { box-shadow: none; }
  .ptm-grid { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
