:root {
  --fg: #1d1d1f; --muted: #6b6b70; --bg: #fff; --line: #e3e3e8; --primary: #2856f6;
  --ok: #e9f7ee; --warn: #fff6e0; --bad: #fdecec; --choice: #eef2ff;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--fg); background: var(--bg); }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--line); }
header h1 { font-size: 18px; margin: 0; }
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
#tickets { font-family: ui-monospace, Consolas, monospace; }
button, .button { font: inherit; padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px; background: #f6f6f8; color: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: none; background: none; color: var(--primary); padding: 0; }
button.small { padding: 2px 8px; font-size: 13px; margin-top: 4px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
#summary { flex: 1; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
td { overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: #b3261e; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.banner { background: var(--warn); border: 1px solid #f0d58a; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
tr.status-ready, tr.status-sent { background: var(--ok); }
tr.status-warning, tr.status-sent_with_issues { background: var(--warn); }
tr.status-blocked, tr.status-failed, tr.status-unknown { background: var(--bad); }
tr.status-needs_choice { background: var(--choice); }
fieldset.choices { border: 1px solid var(--line); border-radius: 6px; margin-top: 6px; }
fieldset.choices label { font-weight: normal; margin: 4px 0; }
pre { white-space: pre-wrap; background: #f6f6f8; padding: 12px; border-radius: 6px; }
.description-block { margin-top: 6px; }
input.description { width: 100%; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.description-preview { margin-top: 4px; }
.description-preview.error { color: #b3261e; }
label.partial-toggle { display: inline; font-weight: normal; margin: 0; white-space: nowrap; }
.message-render { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; margin-top: 8px; }
.message-render p { margin: 0 0 1em; }
.message-render p:last-child { margin-bottom: 0; }
dialog#preview-dialog { width: min(640px, 92vw); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
dialog#preview-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head button { padding: 2px 8px; }
/* Fixed layout: typing in a row's Partial fix field wraps inside its column instead of resizing the table. */
table.review-table { table-layout: fixed; }
.review-table .col-select { width: 36px; }
.review-table .col-ticket { width: 17%; }
.review-table .col-customer { width: 16%; }
.review-table .col-partial { width: 26%; }
.review-table .col-conversation { width: 10%; }
.review-table .col-action { width: 10%; }
.review-table .col-status { width: 21%; }
.review-table input.description { display: block; margin-top: 4px; }
