.route-data { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.uuid { overflow-wrap: anywhere; font-size: .85em; direction: ltr; unicode-bidi: isolate; display: inline-block; max-width: 100%; }
.answer-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-entry { border-inline-start: 2px solid var(--border); margin-block: 14px; padding-inline-start: 14px; }
.form-field ul, .form-field div { max-width: 100%; }
.form-field input[type=checkbox] { margin-left: 8px; }
.access-form { max-width: 850px; }
.access-form select[multiple] { min-height: 150px; }
/* Opt-in columns for long forms; rich controls keep the full row. */
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px 24px; margin-bottom: 20px; }
.form-columns > * { min-width: 0; margin-bottom: 0; }
.form-columns > :only-child,
.form-columns > .errorlist,
.form-columns > .form-column-wide,
.form-columns > :has(textarea, select[multiple], [data-working-week], select[name=basis], input[type=checkbox][name=service_ids], input[type=checkbox][name=channels]) { grid-column: 1 / -1; }
.form-columns > div > label, .form-columns > div > fieldset > legend { display: block; margin-bottom: 6px; font-size: inherit; }
.form-columns fieldset { min-width: 0; }
.form-columns > div > fieldset > legend { float: none; width: auto; }
.form-columns .helptext { display: block; margin-top: 6px; color: var(--muted); font-size: .85em; }
.form-columns .errorlist { color: var(--bad); }
@media (max-width: 1000px) {
  .form-columns { grid-template-columns: minmax(0, 1fr); }
}
.phase-note { border-top: 1px solid #e6ecef; margin-top: 36px; padding-top: 20px; font-size: .85rem; }
.phase-note span { color: var(--muted); font-size: .75rem; }
.eyebrow { font-size: .85rem; color: #00727c; margin-bottom: 6px; }
h1, .h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; }
h2, .h2 { font-size: 1.2rem; }
h3, .h3 { font-size: 1.1rem; }
h4, .h4, h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: .875rem; }
p { margin-bottom: 10px; }
.narrow { max-width: 560px; }
.compact .table td, .compact .table th { padding-top: 5px; padding-bottom: 5px; }
footer { text-align: center; padding: 10px; font-size: .8rem; color: var(--muted); }
@media(max-width: 760px) {
  .phase-note { display: none; }
}
.technical-id { overflow-wrap: anywhere; font-size: .85em; direction: ltr; unicode-bidi: isolate; display: inline-block; max-width: 100%; }
.ui-icon { flex-shrink: 0; vertical-align: middle; }
.jalali-date { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .875rem; }
.eyebrow { color: var(--brand); }
.errorlist, .access-form .errorlist { color: var(--bad); }
.service-picker { margin-top: 16px; }
.tracking-code { display: inline-block; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
#definition-editor { scroll-margin-top: 96px; }
/* Keep MDB's dark controls aligned with the shared surface and text palette. */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
[data-theme="dark"] textarea,
[data-theme="dark"] select { background-color: var(--surface); color: var(--ink); border-color: var(--border-strong); }
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled { background-color: var(--surface-2); color: var(--muted); }
/* ویرایشگر قدیمی مرحله و مسیر (edit.html). نقشه، طراح و فهرست گردش‌ها در workflow-designer.css و اجزای مشترک‌اند. */
.flow-preview { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; padding: 24px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin: 20px 0; max-width: 850px; }
.flow-preview-node { padding: 12px 18px; background: var(--surface); border: 1px solid var(--brand); border-radius: 10px; font-size: .875rem; overflow-wrap: anywhere; }
.flow-preview-action { display: flex; flex-direction: column; align-items: center; color: var(--brand); font-size: .8rem; }
.flow-preview[data-action="reject"] .flow-preview-action { color: var(--bad); }
.flow-preview-warning [data-preview-target] { border-style: dashed; color: var(--bad); }
.flow-editor-context { color: var(--muted); }
.flow-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.flow-editor-grid .flow-field-code, .flow-editor-grid .flow-field-title, .flow-editor-grid .flow-field-order, .flow-editor-grid .flow-field-calendar_id { grid-column: 1 / -1; }
.workflow-hint { color: var(--muted); font-size: .875rem; margin: 10px 0 22px; }
@media (max-width: 760px) {
  .flow-editor-grid { grid-template-columns: 1fr; }
  .flow-preview { gap: 10px; padding: 16px; }
}
.history-technical { margin-bottom:12px; }
.history-technical article { border:0; margin:0 !important; box-shadow:none; background:transparent; }
.tracking-code { direction:ltr; unicode-bidi:isolate; display:inline-block; }
/* UI polish — layout fixes, grouped navigation and calmer lists. */
/* Reboot makes legends float; that squeezed the next flex row (service picker) to zero width. */
legend { float: none; width: 100%; }
fieldset { min-width: 0; }
.card > .btn:not(.w-100) { align-self: flex-start; }

/* Readable schema controls and inquiry filters on narrow screens. */
@media(max-width:600px){
 [data-schema-editor] .table{min-width:0;width:100%;table-layout:auto}
 [data-schema-editor] thead{display:none}
 [data-schema-editor] tbody,[data-schema-editor] tr,[data-schema-editor] td{display:block;width:100%;box-sizing:border-box}
 [data-schema-editor] tr{padding:12px;border-bottom:1px solid var(--border)}
 [data-schema-editor] td{border:0;padding:8px 0;white-space:normal}
 [data-schema-editor] .sr-only{position:static;width:auto;height:auto;clip:auto;clip-path:none;display:block;margin-bottom:6px}
 [data-schema-editor] input.form-control,[data-schema-editor] select{width:100%;min-width:0}
 .inquiry-filters{flex-direction:column;align-items:stretch;min-width:0}
 .inquiry-filters .search{width:100%;min-width:0;max-width:100%}
 .inquiry-filters .seg{flex-wrap:wrap;max-width:100%}
 .inquiry-filters input{min-width:0}
}
