.tpl-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  z-index: 2900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.25s;
}
.tpl-backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tpl-panel {
  width: min(1180px, calc(100vw - 32px));
  max-height: min(90vh, 760px);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-4);
  border-radius: var(--r-xl);
  border: 1px solid var(--line2);
  display: flex;
  flex-direction: column;
  z-index: 2901;
  box-sizing: border-box;
  font-family: inherit;
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.tpl-backdrop.is-active .tpl-panel {
  transform: scale(1);
}

.tpl-panel-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  flex-shrink: 0;
}
.tpl-panel-head-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tpl-panel-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tpl-panel-sub {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.tpl-panel-close {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--fs-lg);
  line-height: 1;
  transition: all 0.15s ease;
}
.tpl-panel-close:hover {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--line2);
}

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 24px;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--bg);
  flex: 1;
  min-width: 0;
}
@media (max-width: 960px) {
  .tpl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .tpl-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
}

.tpl-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  box-shadow: var(--sh-1);
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}
.tpl-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--sh-3);
}

.tpl-card-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.tpl-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tpl-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-full);
  letter-spacing: 0.02em;
  background: var(--brand-l);
  color: var(--brand);
  border: 1px solid transparent;
}
.tpl-badge--gold {
  background: var(--mid-l);
  color: var(--mid-d);
}
.tpl-badge--blue {
  background: var(--best-l);
  color: var(--best);
}
.tpl-badge--green {
  background: var(--good-l);
  color: var(--good-d);
}
.tpl-badge--pink {
  background: var(--accent-l);
  color: var(--accent);
}
.tpl-badge--senpai {
  background: var(--good-l);
  color: var(--good-d);
}
.tpl-badge--brand {
  background: var(--brand-l);
  color: var(--brand);
}

.tpl-card-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1.35;
}
.tpl-card-num {
  font-size: var(--fs-sm);
  color: var(--brand);
  font-weight: 900;
}
.tpl-card-sub {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.4;
}

.tpl-specs {
  margin: 0 0 14px 0;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-sm);
}
.tpl-spec-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.4;
  min-width: 0;
}
.tpl-spec-step-tag {
  color: var(--brand);
  background: var(--brand-l);
  font-weight: 700;
  font-size: var(--fs-xs);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  flex-shrink: 0;
  line-height: 1.3;
}
.tpl-spec-label {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-xs);
  min-width: 48px;
  flex-shrink: 0;
}
.tpl-spec-val {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tpl-spec-val--strong {
  color: var(--brand);
  font-weight: 700;
}

.tpl-card-footer {
  margin-top: auto;
  padding-top: 4px;
}
.tpl-card-btn-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  box-sizing: border-box;
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  font-weight: 700;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tpl-card-btn-detail .btn-arrow {
  transition: transform 0.2s ease;
  font-size: var(--fs-xs);
}
.tpl-card:hover .tpl-card-btn-detail {
  background: var(--brand);
  color: #ffffff;
}
.tpl-card:hover .tpl-card-btn-detail .btn-arrow {
  transform: translateX(3px);
}

.tpl-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s;
}
.tpl-confirm-backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tpl-confirm-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(92vh, 800px);
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--line2);
  box-shadow: var(--sh-4);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}
.tpl-confirm-backdrop.is-active .tpl-confirm-dialog {
  transform: scale(1);
}

.tpl-confirm-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}
.tpl-confirm-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--text);
}
.tpl-confirm-persona {
  margin: 8px 0 0 0;
  font-size: var(--fs-md);
  color: var(--text);
  line-height: 1.5;
}
.tpl-confirm-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tpl-voice-box {
  background: var(--good-l);
  border: 1px solid var(--good);
  border-left: 4px solid var(--good-d);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpl-voice-head {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--good-d);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpl-voice-text {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--good-d);
  line-height: 1.55;
  white-space: pre-wrap;
}

.tpl-section-title {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpl-lines-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tpl-line-group {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tpl-line-head {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpl-line-count {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: normal;
}
.tpl-station-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tpl-station-pill {
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line2);
  padding: 3px 9px;
  border-radius: var(--r-xs);
  box-shadow: var(--sh-1);
  line-height: 1.3;
}

.tpl-confirm-suumo-section {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tpl-confirm-suumo-label {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpl-confirm-suumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
}
.tpl-btn-suumo {
  width: 100%;
  box-sizing: border-box;
  background: var(--accent);
  color: #ffffff !important;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--sh-1);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tpl-btn-suumo:hover {
  background: var(--accent-d);
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
}
.tpl-btn-suumo .tpl-suumo-icon {
  font-size: var(--fs-md);
  line-height: 1;
}
.tpl-rare-badge {
  font-size: 10px;
  font-weight: 800;
  background: #ffffff;
  color: var(--accent);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  white-space: nowrap;
  line-height: 1.2;
}
.tpl-suumo-notes {
  margin-top: 6px;
}
.tpl-suumo-note {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.5;
}

.tpl-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-alt);
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.tpl-detail-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-md);
  line-height: 1.45;
}
.tpl-detail-step-tag {
  color: var(--brand);
  background: var(--brand-l);
  font-weight: 700;
  font-size: var(--fs-xs);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  flex-shrink: 0;
  line-height: 1.3;
}
.tpl-detail-label {
  font-weight: 700;
  color: var(--muted);
  min-width: 80px;
  flex-shrink: 0;
}
.tpl-detail-val {
  color: var(--text);
  font-weight: 600;
}

.tpl-confirm-footer {
  padding: 14px 20px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.tpl-btn-cancel {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tpl-btn-cancel:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.tpl-btn-apply {
  padding: 8px 18px;
  background: var(--surface);
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  transition: all 0.15s ease;
}
.tpl-btn-apply:hover {
  background: var(--brand-l);
  color: var(--brand);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.tpl-toast {
  position: fixed;
  bottom: 64px;
  right: 24px;
  background: var(--text);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  font-size: var(--fs-md);
  font-weight: 600;
  z-index: 3100;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: tplToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes tplToastIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.tpl-selective-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  z-index: 3050;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}
.tpl-selective-backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.tpl-selective-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: min(90vh, 740px);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--r-xl);
  border: 1px solid var(--line2);
  box-shadow: var(--sh-4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  font-family: inherit;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tpl-selective-backdrop.is-active .tpl-selective-dialog {
  transform: scale(1);
}
.tpl-selective-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--surface);
  flex-shrink: 0;
}
.tpl-selective-title-area {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tpl-selective-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--brand);
}
.tpl-selective-desc {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.4;
}
.tpl-selective-close {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.tpl-selective-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.tpl-selective-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tpl-selective-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mid-l);
  border: 1px solid var(--mid);
  border-radius: var(--r-md);
  padding: 10px 14px;
}
.tpl-selective-alert-icon {
  font-size: var(--fs-md);
  line-height: 1;
  flex-shrink: 0;
}
.tpl-selective-alert-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tpl-selective-alert-text strong {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--mid-d);
}
.tpl-selective-alert-text span {
  font-size: var(--fs-xs);
  color: var(--text);
  line-height: 1.4;
}

.tpl-selective-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .tpl-selective-mode-grid {
    grid-template-columns: 1fr;
  }
}
.tpl-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--line2);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  box-sizing: border-box;
  width: 100%;
}
.tpl-mode-card:hover {
  border-color: var(--brand);
  background: var(--surface-alt);
}
.tpl-mode-card.is-selected {
  border-color: var(--brand);
  background: var(--brand-l);
  box-shadow: var(--sh-1);
}
.tpl-mode-card-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.tpl-mode-card.is-selected .tpl-mode-card-radio {
  border-color: var(--brand);
  background: var(--brand);
}
.tpl-mode-card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s ease;
}
.tpl-mode-card.is-selected .tpl-mode-card-dot {
  background: #ffffff;
}
.tpl-mode-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.tpl-mode-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
}
.tpl-mode-card.is-selected .tpl-mode-card-title {
  color: var(--brand);
}
.tpl-keep-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--good-l);
  color: var(--good-d);
  border: 1px solid var(--good);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  font-weight: 800;
  align-self: flex-start;
  line-height: 1.3;
}
.tpl-keep-check {
  font-weight: 900;
  font-size: var(--fs-sm);
  line-height: 1;
}
.tpl-mode-card-desc {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.45;
}

.tpl-selective-details {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  overflow: hidden;
  margin-top: 4px;
}
.tpl-selective-summary {
  padding: 12px 16px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  background: var(--surface-alt);
  transition:
    background 0.15s ease,
    color 0.15s ease;
  list-style: none;
}
.tpl-selective-summary::-webkit-details-marker {
  display: none;
}
.tpl-selective-summary:hover {
  background: var(--gray-l);
  color: var(--brand);
}
.tpl-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tpl-summary-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
  display: inline-block;
}
.tpl-selective-details[open] .tpl-summary-arrow {
  transform: rotate(90deg);
}
.tpl-summary-hint {
  font-size: var(--fs-xs);
  font-weight: normal;
  color: var(--muted);
}
.tpl-selective-table-wrap {
  padding: 12px 16px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}
.tpl-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.tpl-diff-thead-row {
  border-bottom: 2px solid var(--line2);
}
.tpl-diff-th {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 6px 8px 8px;
  white-space: nowrap;
}
.tpl-diff-th.tpl-diff-col-action {
  text-align: right;
}
.tpl-diff-row {
  border-bottom: 1px solid var(--line);
  transition: opacity 0.15s ease;
}
.tpl-diff-row:last-child {
  border-bottom: none;
}
.tpl-diff-row.is-same {
  opacity: 0.65;
}
.tpl-diff-row.is-keep {
  opacity: 0.7;
  background: var(--surface-alt);
}
.tpl-diff-row.is-keep .tpl-diff-col-arrow {
  opacity: 0.25;
}
.tpl-diff-cell {
  padding: 10px 8px;
  vertical-align: middle;
}
.tpl-diff-col-name {
  width: 14%;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.tpl-diff-col-name .tpl-detail-step-tag {
  margin-right: 0;
}
.tpl-diff-col-cur {
  width: 27%;
  color: var(--muted);
  word-break: break-all;
}
.tpl-diff-col-arrow {
  width: 4%;
  text-align: center;
  color: var(--hint);
  font-size: var(--fs-xs);
  transition: opacity 0.15s ease;
}
.tpl-diff-col-new {
  width: 30%;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.tpl-diff-col-action {
  width: 25%;
  text-align: right;
  white-space: nowrap;
}
.tpl-diff-same-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--hint);
  font-weight: 600;
  padding: 3px 8px;
  background: var(--gray-l);
  border-radius: var(--r-sm);
}
.tpl-diff-keep-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--gray-l);
  border: 1px dashed var(--line-strong);
  padding: 2px 8px;
  min-height: 24px;
  border-radius: var(--r-sm);
  letter-spacing: 0.02em;
}
.tpl-diff-keep-dash {
  color: var(--hint);
  font-weight: 800;
}
.tpl-diff-seg {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 2px;
}
.tpl-diff-seg .ui-seg-item {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 3px 9px;
  min-height: 26px;
  border-radius: var(--r-sm);
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}
.tpl-diff-seg .ui-seg-item:hover {
  color: var(--text);
  background: var(--gray-l);
}
.tpl-diff-seg .ui-seg-item.is-on::before {
  content: "✓";
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
}
.tpl-diff-seg .ui-seg-item.is-on[data-val="add"] {
  background: var(--good-l);
  color: var(--good-d);
  border-color: var(--good);
  font-weight: 700;
  box-shadow: var(--sh-1);
}
.tpl-diff-seg .ui-seg-item.is-on[data-val="overwrite"] {
  background: var(--brand-l);
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 700;
  box-shadow: var(--sh-1);
}
.tpl-diff-seg .ui-seg-item.is-on[data-val="keep"] {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
  font-weight: 700;
  box-shadow: var(--sh-1);
}
.tpl-selective-footer {
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

#tplFooterBtn {
  cursor: pointer;
  transition: all 0.15s ease;
}
#tplFooterBtn:hover {
  filter: brightness(0.95);
  border-color: var(--good-d);
  box-shadow: var(--sh-1);
}
#tplFooterBtn:active {
  filter: brightness(0.90);
}



