.xcl-app {
  --xcl-accent: #6d28d9;
  --xcl-dark: #17142a;
  --xcl-muted: #6b7280;
  --xcl-border: #e5e7eb;
  max-width: 1180px;
  margin: 28px auto;
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid var(--xcl-border);
  border-radius: 24px;
  background: linear-gradient(145deg, #fff 0%, #faf8ff 100%);
  box-shadow: 0 22px 60px rgba(27, 20, 60, .10);
  color: var(--xcl-dark);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
}
.xcl-app *, .xcl-app *::before, .xcl-app *::after { box-sizing: border-box; }
.xcl-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.xcl-kicker { color: var(--xcl-accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.xcl-header h2 { margin: 6px 0 5px; color: var(--xcl-dark); font-size: clamp(25px, 3.2vw, 38px); line-height: 1.12; }
.xcl-header p { margin: 0; color: var(--xcl-muted); font-size: 16px; }
.xcl-live { flex: none; margin-top: 8px; padding: 8px 12px; border: 1px solid #d1fae5; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 700; }
.xcl-live span { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.13); }
.xcl-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 20px; }
.xcl-editor-card, .xcl-controls-card, .xcl-duration-card, .xcl-fit-card, .xcl-comparison { border: 1px solid var(--xcl-border); border-radius: 16px; background: #fff; }
.xcl-editor-card { overflow: hidden; }
.xcl-editor-top { display: flex; justify-content: space-between; gap: 15px; padding: 15px 17px; border-bottom: 1px solid var(--xcl-border); }
.xcl-editor-top label, .xcl-field > label { color: var(--xcl-dark); font-size: 13px; font-weight: 800; }
.xcl-save-note { color: var(--xcl-muted); font-size: 11px; }
.xcl-text { display: block; width: 100%; min-height: 310px; padding: 19px; resize: vertical; border: 0 !important; outline: none; background: #fff; color: #242033; font: 16px/1.75 Georgia, serif; box-shadow: none !important; }
.xcl-text::placeholder { color: #9ca3af; }
.xcl-counts { display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 17px; border-top: 1px solid var(--xcl-border); background: #fafafa; color: var(--xcl-muted); font-size: 12px; }
.xcl-counts strong { color: var(--xcl-dark); }
.xcl-controls-card { padding: 18px; }
.xcl-field + .xcl-field { margin-top: 20px; }
.xcl-field > label { display: block; margin-bottom: 9px; }
.xcl-targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.xcl-targets button { min-height: 39px; padding: 7px 5px; border: 1px solid var(--xcl-border); border-radius: 9px; background: #fff; color: #4b5563; font-size: 12px; font-weight: 750; cursor: pointer; }
.xcl-targets button:hover { border-color: var(--xcl-accent); color: var(--xcl-accent); }
.xcl-targets button.is-active { border-color: var(--xcl-accent); background: var(--xcl-accent); color: #fff; box-shadow: 0 5px 15px color-mix(in srgb, var(--xcl-accent) 28%, transparent); }
.xcl-pace, .xcl-custom-target, .xcl-custom-pace { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--xcl-border); border-radius: 9px; background: #fff; color: var(--xcl-dark); font: inherit; font-size: 13px; }
.xcl-custom-target-wrap, .xcl-custom-pace-wrap { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--xcl-muted); font-size: 12px; }
.xcl-custom-target-wrap[hidden], .xcl-custom-pace-wrap[hidden] { display: none; }
.xcl-custom-target, .xcl-custom-pace { width: 100px; }
.xcl-checkbox { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; color: #4b5563; font-size: 12px; line-height: 1.45; cursor: pointer; }
.xcl-checkbox input { flex: none; width: 17px; height: 17px; margin-top: 1px; accent-color: var(--xcl-accent); }
.xcl-checkbox code { padding: 1px 4px; border-radius: 4px; background: #f3f4f6; font-size: 10px; }
.xcl-results { display: grid; grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr); gap: 20px; margin-top: 20px; }
.xcl-duration-card { display: flex; flex-direction: column; justify-content: center; min-height: 150px; padding: 22px; text-align: center; }
.xcl-duration-card > span { color: var(--xcl-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.xcl-duration-card strong { margin: 4px 0; color: var(--xcl-accent); font-size: clamp(36px, 5vw, 54px); line-height: 1; }
.xcl-duration-card small { color: var(--xcl-muted); }
.xcl-fit-card { --status: #9ca3af; padding: 24px; border-left: 5px solid var(--status); }
.xcl-fit-card.is-short { --status: #3b82f6; }
.xcl-fit-card.is-good { --status: #10b981; }
.xcl-fit-card.is-warning { --status: #f59e0b; }
.xcl-fit-card.is-over { --status: #ef4444; }
.xcl-fit-heading { display: flex; justify-content: space-between; gap: 15px; color: var(--status); font-weight: 800; }
.xcl-progress { height: 10px; margin: 17px 0; overflow: hidden; border-radius: 99px; background: #edf0f3; }
.xcl-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--status); transition: width .25s ease; }
.xcl-fit-card p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.55; }
.xcl-comparison { margin-top: 20px; padding: 20px; }
.xcl-comparison h3 { margin: 0 0 14px; color: var(--xcl-dark); font-size: 14px; }
.xcl-comparison-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.xcl-comparison-grid > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 13px; border-radius: 10px; background: #f8f7fb; }
.xcl-comparison-grid span { color: #4b5563; font-size: 12px; font-weight: 700; }
.xcl-comparison-grid strong { grid-row: span 2; color: var(--xcl-dark); font-size: 20px; }
.xcl-comparison-grid small { color: var(--xcl-muted); font-size: 10px; }
.xcl-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 19px; }
.xcl-button { min-height: 42px; padding: 10px 16px; border: 1px solid var(--xcl-border); border-radius: 9px; background: #fff; color: var(--xcl-dark); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
.xcl-button:hover { border-color: var(--xcl-accent); color: var(--xcl-accent); transform: translateY(-1px); }
.xcl-copy { border-color: var(--xcl-accent); background: var(--xcl-accent); color: #fff; }
.xcl-copy:hover { background: var(--xcl-dark); color: #fff; }
.xcl-clear { color: #b91c1c; }
.xcl-feedback { color: #047857; font-size: 12px; font-weight: 700; }
.xcl-disclaimer { margin: 18px 0 0; color: var(--xcl-muted); font-size: 11px; line-height: 1.5; }

@media (max-width: 760px) {
  .xcl-app { margin: 16px auto; padding: 18px; border-radius: 16px; }
  .xcl-header { display: block; }
  .xcl-live { display: inline-block; margin-top: 14px; }
  .xcl-grid, .xcl-results { grid-template-columns: 1fr; }
  .xcl-editor-top { display: block; }
  .xcl-save-note { display: block; margin-top: 4px; }
  .xcl-text { min-height: 260px; }
  .xcl-comparison-grid { grid-template-columns: 1fr; }
}

@media print {
  body.xcl-print-mode * { visibility: hidden !important; }
  body.xcl-print-mode .xcl-print-target, body.xcl-print-mode .xcl-print-target * { visibility: visible !important; }
  body.xcl-print-mode .xcl-print-target { position: absolute; inset: 0 auto auto 0; width: 100%; max-width: none; margin: 0; padding: 20px; border: 0; box-shadow: none; }
  body.xcl-print-mode .xcl-controls-card, body.xcl-print-mode .xcl-actions, body.xcl-print-mode .xcl-live, body.xcl-print-mode .xcl-disclaimer { display: none !important; }
  body.xcl-print-mode .xcl-grid { grid-template-columns: 1fr; }
  body.xcl-print-mode .xcl-text { min-height: 280px; }
}

