.utm-card { padding: 28px; }
.utm-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.utm-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }

.utm-hide { display: none !important; }

.utm-topline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.utm-mode-switch { display: flex; border: 1px solid #e5e7eb; border-radius: 30px; padding: 4px; background: #f7f8fa; }
.utm-mode-btn { border: none; background: none; padding: 9px 20px; border-radius: 26px; font-weight: 700; font-size: .9em; color: #6b7280; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .2s ease, color .2s ease; font-family: inherit; }
.utm-mode-btn.active { background: var(--site-dark); color: #fff; }
.utm-mode-btn:hover:not(.active) { color: var(--site-dark); }
.utm-sample { font: inherit; font-size: .85em; font-weight: 700; color: var(--site-dark); background: #fff; border: 1px dashed var(--site-dark); border-radius: 8px; padding: 8px 14px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.utm-sample:hover { background: var(--site-dark); color: #fff; border-style: solid; }

.utm-group { margin-bottom: 20px; }
.utm-group-title { font-size: .78em; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #6b7280; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.utm-group-title i { color: var(--site-accent); }
.utm-group-title em { font-style: normal; font-weight: 600; text-transform: none; letter-spacing: 0; color: #9ca3af; }
.utm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.utm-field label, .utm-field .utm-label { display: block; font-weight: 600; margin-bottom: 7px; font-size: .9em; color: #23272f; }
.utm-field label code { font-family: "Courier New", monospace; background: #f7f8fa; border: 1px solid #eee; border-radius: 4px; padding: 1px 6px; font-size: .95em; color: var(--site-dark); }
.utm-input-row { display: flex; align-items: center; gap: 8px; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; background: #fff; }
.utm-input-row:focus-within { border-color: var(--site-dark); }
.utm-input-row > i { color: #9ca3af; flex: none; }
.utm-input-row input { border: none; outline: none; width: 100%; min-width: 0; font-size: 1em; background: none; color: #23272f; font-family: inherit; }
.utm-field.utm-bad .utm-input-row, .utm-field.utm-bad textarea { border-color: #b91c1c; background: #fef2f2; }
.utm-field.utm-bad small { color: #b91c1c; }
.utm-field small { display: block; color: #6b7280; font-size: .8em; margin-top: 6px; }
.utm-field textarea { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-family: "Courier New", monospace; font-size: .9em; line-height: 1.5; resize: vertical; box-sizing: border-box; outline: none; color: #23272f; background: #fff; }
.utm-field textarea:focus { border-color: var(--site-dark); }

.utm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.utm-chip { font: inherit; font-size: .82em; font-weight: 600; color: #23272f; background: #f7f8fa; border: 1px solid #e5e7eb; border-radius: 20px; padding: 6px 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.utm-chip i { color: var(--site-accent); }
.utm-chip:hover { border-color: var(--site-dark); color: var(--site-dark); }
.utm-chip.active { background: var(--site-dark); border-color: var(--site-dark); color: #fff; }
.utm-chip.active i { color: #fff; }

.utm-custom-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.utm-custom-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 2fr) auto; align-items: center; gap: 8px; }
.utm-custom-row input { border: 1px solid #ddd; border-radius: 8px; padding: 9px 12px; font-size: .95em; font-family: inherit; color: #23272f; outline: none; min-width: 0; width: 100%; box-sizing: border-box; background: #fff; }
.utm-custom-row input:focus { border-color: var(--site-dark); }
.utm-custom-eq { color: #9ca3af; font-weight: 700; }
.utm-x-btn { border: 1px solid #e5e7eb; background: #fff; color: #6b7280; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.utm-x-btn:hover { border-color: #b91c1c; color: #b91c1c; }
.utm-add-btn { font: inherit; font-size: .85em; font-weight: 700; color: var(--site-dark); background: none; border: 1px solid var(--site-light); border-radius: 20px; padding: 6px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.utm-add-btn:hover { background: #f0fdfa; }

.utm-options { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-bottom: 20px; padding: 14px 16px; background: #f7f8fa; border: 1px solid #eee; border-radius: 8px; }
.utm-option-group { display: flex; align-items: center; gap: 8px; font-size: .88em; font-weight: 600; color: #374151; }
.utm-option-group select { border: 1px solid #ddd; border-radius: 6px; padding: 6px 10px; font-size: .95em; font-family: inherit; background: #fff; color: #23272f; }
.utm-checkbox { display: flex; align-items: center; gap: 6px; font-size: .88em; font-weight: 600; color: #374151; cursor: pointer; user-select: none; }
.utm-checkbox input { accent-color: var(--site-dark); width: 15px; height: 15px; cursor: pointer; }

.utm-output-block { margin-bottom: 14px; }
.utm-output-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.utm-output-head label { font-weight: 600; font-size: .92em; color: #23272f; }
.utm-output-head label i { color: var(--site-light); margin-right: 6px; }
.utm-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.utm-output-block textarea { width: 100%; border: 1px solid var(--site-light); border-radius: 8px; padding: 12px 14px; font-family: "Courier New", monospace; font-size: .9em; line-height: 1.55; resize: vertical; box-sizing: border-box; outline: none; background: #f0fdfa; color: #23272f; word-break: break-all; }
.utm-length { font-size: .8em; color: #6b7280; margin-top: 6px; }

.utm-copy-btn, .utm-ghost-btn { font: inherit; background: none; border: 1px solid var(--site-light); border-radius: 20px; padding: 5px 14px; font-size: .8em; font-weight: 600; color: var(--site-dark); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.utm-copy-btn:hover, .utm-ghost-btn:hover { background: #f0fdfa; }
.utm-ghost-btn { border-color: #d1d5db; color: #374151; }
.utm-ghost-btn:disabled { opacity: .45; cursor: default; }
.utm-ghost-btn:disabled:hover { background: none; }
.utm-copy-btn.utm-copied { background: var(--site-success-bg); border-color: #86efac; color: var(--site-success); }

.utm-warnings { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.utm-warn { display: flex; align-items: flex-start; gap: 9px; font-size: .86em; line-height: 1.45; padding: 9px 12px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.utm-warn i { margin-top: 2px; flex: none; }
.utm-warn-bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.utm-warn-ok { background: var(--site-success-bg); border-color: #86efac; color: var(--site-success); }

.utm-breakdown-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.utm-breakdown { width: 100%; border-collapse: collapse; font-size: .88em; }
.utm-breakdown th, .utm-breakdown td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
.utm-breakdown th { font-size: .78em; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; background: #f7f8fa; }
.utm-breakdown tr.utm-is-utm td { background: #f0fdfa; }
.utm-mono { font-family: "Courier New", monospace; word-break: break-all; }
.utm-empty-cell { color: #6b7280; font-style: italic; text-align: center; }
.utm-badge { display: inline-block; font-size: .72em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; background: #eef2f7; color: #4b5563; white-space: nowrap; }
.utm-badge-utm { background: var(--site-dark); color: #fff; }
.utm-badge-custom { background: #ede9fe; color: #5b21b6; }
.utm-cell-input { width: 100%; min-width: 120px; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; font-size: .95em; background: transparent; color: #23272f; outline: none; box-sizing: border-box; }
.utm-cell-input:hover { border-color: #ddd; background: #fff; }
.utm-cell-input:focus { border-color: var(--site-dark); background: #fff; }
.utm-parse-table td:first-child { display: flex; align-items: center; gap: 8px; }
.utm-row-x { width: 44px; text-align: center; }
.utm-parse-add { margin: 10px 0 18px; }
.utm-parse-stats { font-size: .82em; color: #6b7280; margin-top: 6px; }

.utm-recent { margin-top: 26px; border-top: 1px solid #eee; padding-top: 18px; }
.utm-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.utm-recent-head h3 { margin: 0; font-size: 1em; color: #23272f; display: flex; align-items: center; gap: 8px; }
.utm-recent-head h3 i { color: var(--site-accent); }
.utm-recent-empty { font-size: .85em; color: #6b7280; margin: 0; }
.utm-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.utm-recent-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #eee; border-radius: 8px; background: #fafbfc; }
.utm-recent-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.utm-recent-url { font-family: "Courier New", monospace; font-size: .84em; color: #23272f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.utm-recent-time { font-size: .74em; color: #9ca3af; }
.utm-recent-actions { display: flex; gap: 6px; flex: none; }

@media (max-width: 900px) {
    .utm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .utm-card { padding: 18px; }
    .utm-title-bar { margin: -18px -18px 18px; }
    .utm-grid { grid-template-columns: minmax(0, 1fr); }
    .utm-mode-switch { width: 100%; }
    .utm-mode-btn { flex: 1; justify-content: center; padding: 9px 10px; }
    .utm-sample { width: 100%; }
    .utm-custom-row { grid-template-columns: minmax(0, 1fr) auto; }
    .utm-custom-eq { display: none; }
    .utm-custom-row .utm-custom-value { grid-column: 1 / 2; }
    .utm-custom-row .utm-x-btn { grid-row: 1 / 3; grid-column: 2 / 3; height: 100%; }
    .utm-recent-item { flex-direction: column; align-items: stretch; }
    .utm-recent-actions { justify-content: flex-end; }
    .utm-breakdown th, .utm-breakdown td { padding: 8px 6px; }
}
