/* Tailor-to-job panel + preview banner (public/tailor.mjs). Builds on app.css (.btn, .field, inputs). */
.tl-primary {
  background: #0b57d0; border-color: #0b57d0; color: #fff; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.tl-primary:active { background: #0842a0; }
.tl-open { background: #0b57d0; border-color: #0b57d0; color: #fff; font-weight: 600; }
.tl-open:active { background: #0842a0; }

/* Phones: topbar button hidden, full-width card at the top of the Edit tab instead. */
.tl-open-top { display: none; }
.tl-mobile-card {
  display: flex; align-items: center; gap: 10px; margin: 12px 12px 0; padding: 12px;
  background: #e8f0fe; border: 1px solid #b6cdf7; border-radius: 10px;
}
.tl-mobile-card > div { flex: 1; min-width: 0; font-size: 14px; color: #1f2328; }
.tl-mobile-card strong { display: block; font-size: 15px; }
.tl-mobile-card .btn { flex-shrink: 0; }
body[data-tab="preview"] .tl-mobile-card, body.tailor-previewing .tl-mobile-card { display: none; }
@media (min-width: 900px) {
  .tl-open-top { display: inline-flex; align-items: center; }
  .tl-mobile-card { display: none; }
}

/* Panel: bottom sheet on phones, centered dialog on desktop */
.tl-dialog {
  border: 0; padding: 0; width: 100%; max-width: 100%; max-height: 92vh;
  margin: auto 0 0; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
}
.tl-dialog::backdrop { background: rgba(15, 20, 30, 0.45); }
@media (min-width: 640px) {
  .tl-dialog { max-width: 560px; margin: auto; border-radius: 12px; }
}
.tl-form { padding: 14px 16px 16px; }
.tl-head { display: flex; align-items: center; justify-content: space-between; }
.tl-head h2 { margin: 0; font-size: 19px; }
.tl-head .btn-icon { border: 0; }
.tl-sub { margin: 2px 0 12px; font-size: 14px; color: #57606a; }
textarea.tl-jd { min-height: 30vh; field-sizing: fixed; }
.tl-err { display: block; color: #b42318; font-size: 13px; margin-top: 3px; }
.tl-err[hidden], .tl-progress[hidden], .tl-error[hidden], .tl-banner[hidden] { display: none; }
.tl-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
.tl-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .tl-actions .btn { flex: 0 0 auto; } }

.tl-progress { display: flex; align-items: center; gap: 10px; color: #57606a; font-size: 15px; padding: 8px 0 0; }
.tl-spinner {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #c4cbd3; border-top-color: #0b57d0; animation: tl-spin 0.8s linear infinite;
}
@keyframes tl-spin { to { transform: rotate(360deg); } }
.tl-error {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: #ffebe9; border: 1px solid #ffcecb; color: #b42318; font-size: 14px;
}

/* Preview banner */
.tl-banner {
  max-width: 8.5in; margin: 0 auto 12px; padding: 12px;
  background: #fff; border: 1px solid #b6cdf7; border-left: 4px solid #0b57d0; border-radius: 10px;
}
.tl-banner-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-banner-head strong { flex: 1 1 auto; }
.tl-banner a { color: #0b57d0; font-weight: 600; }
.tl-banner a.tl-primary { color: #fff; }
.tl-pages {
  font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: #dafbe1; color: #116329; white-space: nowrap;
}
.tl-pages.over { background: #ffebe9; color: #b42318; }
.tl-notes { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.tl-notes li { margin-bottom: 3px; }
.tl-hint { margin: 8px 0 0; font-size: 13px; color: #57606a; }
.tailor-previewing .pane-edit { opacity: 0.5; }

@media print { .tl-banner, .tl-mobile-card, .tl-dialog { display: none !important; } }
