/* Reply template surfaces share the prototype's cream, white and bronze palette. */
.macro-manager-toolbar .macro-help{max-width:580px;margin:0}
.macro-manager-toolbar>.button{flex-shrink:0}
.macro-manager-row{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px;border-bottom:1px solid var(--line,#e4e2d9)}
.macro-manager-copy{min-width:0;flex:1}
.macro-row-title{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:11px}
.macro-row-title h2{font-size:16px;line-height:1.5}
.macro-template-text{font-size:13px;color:var(--muted,#6e746a);line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.macro-row-actions{display:flex;flex-shrink:0;gap:6px}
.macro-icon-button.icon-button{width:44px;height:44px;min-width:44px;min-height:44px;flex-shrink:0;border:1px solid var(--line,#e4e2d9);border-radius:9px;background:white;color:var(--bronze,#806034)}
.macro-icon-button.icon-button:hover{background:#f6f0e6;border-color:#bba47e}
.macro-catalog-note{padding:16px 22px;background:#fdfcf9;color:var(--muted,#6e746a);font-size:11px;border-radius:0 0 12px 12px}
.macro-help{font-size:12px;line-height:1.7;color:var(--muted,#6e746a)}
.macro-dialog{position:fixed;inset:0;margin:auto;padding:26px;width:900px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--line,#e4e2d9);border-radius:15px;background:white;color:var(--ink,#262b28);box-shadow:0 20px 80px #10221430}
.macro-dialog::backdrop{background:#252c2870}
.macro-dialog-editor{width:660px}
.macro-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.macro-dialog-head h2{font-size:22px;line-height:1.4}
.macro-dialog .field{margin:18px 0}
.macro-dialog .field>span{line-height:1.6}
.macro-dialog .field .macro-required{display:inline;font-size:11px;font-weight:400;color:var(--muted,#6e746a)}
.macro-search-field{max-width:420px}
.macro-picker-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:22px;align-items:start}
.macro-picker-list{border:1px solid var(--line,#e4e2d9);border-radius:10px;overflow:hidden}
.macro-picker-row{display:flex;align-items:flex-start;gap:12px;padding:16px;border-bottom:1px solid var(--line,#e4e2d9)}
.macro-picker-row:last-child{border-bottom:0}
.macro-picker-row>div{min-width:0;flex:1}
.macro-picker-row h3,.macro-detail-title{font-family:Arial,sans-serif;font-size:14px;line-height:1.6;letter-spacing:0;margin-bottom:6px}
.macro-picker-row p{font-size:12px;color:var(--muted,#6e746a);line-height:1.7;overflow-wrap:anywhere;white-space:pre-wrap}
.macro-picker-row.macro-selected{background:#faf6ee}
.macro-selected-label{display:inline-block;margin-top:8px;font-size:11px;color:#806034;font-weight:600}
.macro-picker-placeholder{padding:28px 22px;border:1px dashed #d8d0c2;border-radius:10px;background:#fdfbf7}
.macro-picker-placeholder h3{font-size:16px;margin-bottom:10px}
.macro-picker-placeholder p{font-size:12px;line-height:1.7;color:var(--muted,#6e746a)}
.macro-preview-box{border:1px solid #e6dfd2;background:#faf7f2;border-radius:9px;padding:16px;margin-top:18px}
.macro-preview-box h4{font:600 11px/1.5 Arial,sans-serif;color:#806034;margin-bottom:9px}
.macro-preview{font-size:13px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;min-height:44px}
.macro-validation{font-size:12px;line-height:1.6;color:var(--red,#9d3c3c);margin-top:10px;min-height:20px;overflow-wrap:anywhere}
.macro-insert-mode{border:1px solid var(--line,#e4e2d9);border-radius:9px;padding:9px 13px 12px;margin:12px 0}
.macro-insert-mode legend,.macro-tokens legend{padding:0 5px;font-size:12px;font-weight:600;line-height:1.7}
.macro-insert-mode label{display:flex;align-items:center;gap:9px;min-height:44px;font-size:12px;cursor:pointer}
.macro-insert-mode input{accent-color:#806034;width:17px;height:17px;flex-shrink:0}
.macro-dialog-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:20px}
.macro-dialog-actions .button{min-height:44px}
.macro-footnote{font-size:11px;line-height:1.7;color:var(--muted,#6e746a);margin-top:12px}
.macro-textarea{width:100%;resize:vertical;min-height:136px;border:1px solid #dcded5;border-radius:8px;padding:12px 14px;line-height:1.8;color:var(--ink,#262b28);background:white;font:13px/1.8 Arial,sans-serif}
.macro-tokens{display:flex;flex-wrap:wrap;gap:7px;padding:12px;border:1px solid var(--line,#e4e2d9);border-radius:9px}
.macro-token{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;min-height:44px;max-width:100%;padding:8px 10px;border:1px solid #e5dccd;border-radius:7px;background:#faf7f2;color:#5f492c;font-size:11px;text-align:left;cursor:pointer}
.macro-token code{font-size:10px;overflow-wrap:anywhere}
.macro-token:hover{background:#f1e8d9}
.macro-empty{padding:24px;font-size:13px;line-height:1.8;color:var(--muted,#6e746a)}
.macro-dialog :is(button,input,textarea):focus-visible,.macro-manager-toolbar button:focus-visible,.macro-manager-row button:focus-visible{outline:2px solid #806034;outline-offset:3px}
@media(max-width:650px){
  .macro-manager-toolbar{align-items:stretch}
  .macro-manager-toolbar>.button{width:100%}
  .macro-manager-row{gap:14px;padding:18px 16px;flex-wrap:wrap}
  .macro-manager-copy{flex-basis:100%}
  .macro-row-actions{margin-left:auto}
  .macro-row-title h2{font-size:15px}
  .macro-catalog-note{padding:16px}
  .macro-dialog{padding:18px 16px;max-width:calc(100vw - 20px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px)}
  .macro-dialog-head h2{font-size:18px}
  .macro-picker-layout{grid-template-columns:minmax(0,1fr);gap:20px}
  .macro-picker-row{padding:13px;gap:9px}
  .macro-picker-list{max-height:260px;overflow:auto;overscroll-behavior:contain}
  .macro-dialog-actions{flex-wrap:wrap}
  .macro-dialog-actions .button{flex:1;white-space:normal;min-width:100px;font-size:12px;padding:10px}
  .macro-dialog .field input{font-size:16px}
  .macro-token{flex:1 1 120px}
}
