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

.cal-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.cal-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-field.cal-span { grid-column: 1 / -1; }
.cal-field > label, .cal-field > .cal-label { font-weight: 600; font-size: .86em; color: #374151; }
.cal-input, .cal-select { width: 100%; box-sizing: border-box; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-size: .95em; background: #fff; color: #23272f; }
.cal-input:focus, .cal-select:focus, .cal-btn:focus-visible, .cal-check input:focus-visible { outline: 3px solid rgba(20,184,166,.45); outline-offset: 2px; }
.cal-input:disabled, .cal-select:disabled { background: #f3f4f6; color: #9ca3af; }
.cal-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cal-hint { font-size: .8em; color: #6b7280; line-height: 1.4; }
.cal-disabled { opacity: .55; }
.cal-check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9em; color: #374151; }
.cal-check input { width: 18px; height: 18px; accent-color: var(--site-dark, #0f766e); }
.cal-subhead { grid-column: 1 / -1; font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; border-top: 1px solid #eee; padding-top: 14px; margin-top: 4px; }

.cal-actions { display: flex; justify-content: center; margin-top: 20px; }
.cal-btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 30px; padding: 11px 28px; font-weight: 600; font-size: .95em; cursor: pointer; background: var(--site-dark, #0f766e); color: #fff; transition: background .2s ease; }
.cal-btn:hover { background: var(--site-dark-2, #115e59); }

.cal-error { margin-top: 18px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 8px; padding: 12px 14px; font-size: .9em; }
.cal-error[hidden] { display: none; }

.cal-results { margin-top: 24px; border-top: 1px solid #eee; padding-top: 22px; }
.cal-results[hidden], .cal-macro-wrap[hidden], .cal-floor[hidden], .cal-field[hidden] { display: none; }
.cal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cal-stat { background: #f7f8fa; border: 1px solid #eee; border-radius: 10px; padding: 16px 12px; text-align: center; }
.cal-stat.cal-stat-main { background: #f0fdfa; border-color: var(--site-light, #14b8a6); }
.cal-stat-label { font-size: .78em; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.cal-stat-value { font-size: 1.35em; font-weight: 700; color: #23272f; margin-top: 6px; font-variant-numeric: tabular-nums; }
.cal-note { margin-top: 14px; font-size: .92em; color: #374151; text-align: center; }
.cal-floor { margin-top: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 10px 12px; font-size: .88em; line-height: 1.45; }

.cal-steps-wrap { margin-top: 18px; background: #f7f8fa; border: 1px solid #eee; border-radius: 10px; padding: 14px 18px; }
.cal-steps-wrap h3 { font-size: .95em; margin: 0 0 8px; color: #23272f; }
.cal-steps { margin: 0; padding-left: 20px; font-size: .9em; line-height: 1.6; color: #374151; font-family: "Courier New", monospace; }
.cal-steps li { margin-bottom: 6px; word-break: break-word; }

.cal-macro-wrap { margin-top: 18px; }
.cal-macro-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.cal-macro-table th, .cal-macro-table td { border-bottom: 1px solid #eee; padding: 10px 8px; text-align: left; }
.cal-macro-table th { color: #374151; font-size: .85em; text-transform: uppercase; letter-spacing: .04em; }
.cal-macro-table td { font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
    .cal-card { padding: 20px 16px; }
    .cal-title-bar { margin: -20px -16px 20px; }
    .cal-form { grid-template-columns: 1fr; }
    .cal-stats { grid-template-columns: 1fr; }
    .cal-pair { grid-template-columns: 1fr 1fr; }
    .cal-btn { width: 100%; justify-content: center; }
}
