input,
select,
textarea {
  width: 100%;
  border: 1px solid #bdc8c2;
  border-radius: 9px;
  padding: 12px;
  font: inherit;
  background: #fff;
}
select:focus,
textarea:focus { outline: 3px solid rgba(30, 89, 72, .15); border-color: var(--brand); }
input[type="checkbox"] { width: auto; }
.action-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 20px 0; }
.action-bar form { margin: 0; }
.button { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 9px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button-secondary { background: #e3ece8; color: var(--brand-dark); }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.template-variable-guide { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.template-variable-guide h3 { margin: 0 0 5px; }
.template-variable-guide > p { margin: 5px 0 14px; }
.template-variable-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; }
.template-variable { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: grab; }
.template-variable:hover, .template-variable:focus-visible { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.template-variable:active { cursor: grabbing; }
.template-variable code { color: var(--brand); font-weight: 700; }
.template-variable span { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 22px; }
.field-wide { grid-column: 1 / -1; }
.field ul { list-style: none; margin: 7px 0; padding: 0; }
.field ul label { display: inline; font-weight: 500; margin-left: 6px; }
.errorlist { color: #9c302b; margin: 8px 0; padding-left: 20px; }
.data-list { display: flex; flex-direction: column; gap: 10px; }
.data-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.data-row:hover { border-color: #afc4ba; }
.data-row span { display: block; }
.data-row small,
.summary-line small { display: block; color: var(--muted); }
.summary-line { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 22px; }
.text-action { color: var(--brand); font-weight: 700; }
  .inline-form { display: inline; margin: 0; }
.question-list { padding-left: 22px; }
.question-list li { padding: 7px 0; }
.question-list small { color: var(--brand); }
.messages { margin-bottom: 18px; }
.notice { border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; background: #e9f2ee; color: var(--brand-dark); }
.notice-error { background: #fff0ef; color: #9c302b; }
.notice-warning { background: #fff7dc; color: #765d0b; }
.scale-help { display: flex; gap: 12px; flex-wrap: wrap; background: var(--soft); border-radius: 12px; padding: 14px; margin-bottom: 18px; }
.evaluation-question { border-top: 1px solid var(--line); padding: 12px 0 18px; }
.evaluation-question select { max-width: 360px; }
.signature-card { background: #fff; border: 2px solid var(--brand); border-radius: 16px; padding: 24px; margin-top: 24px; }
.signature-card h2 { margin-top: 0; }
.signature-card .button { margin-top: 18px; }
.check-label { font-weight: 500; }
.check-label input { margin-right: 8px; }
.master-factor { background: #edf3f0; border: 1px solid #cbdad3; border-radius: 17px; padding: 20px; margin-bottom: 20px; }
.master-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.master-header h2 { margin: 3px 0; }
.master-header p { margin: 0; color: var(--muted); }
.row-actions { margin-left: auto; display: flex; gap: 14px; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 20px; user-select: none; }
.dragging { opacity: .45; }
.empty-inline { padding: 18px; color: var(--muted); text-align: center; }
.factors-list .process-card { background: #fff; }
.question-edit { float: right; }
.evaluation-progress { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.progress-track { height: 10px; background: #dfe8e3; border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--brand); transition: width .2s ease; }
.master-step-heading { background: linear-gradient(120deg, var(--brand-dark), var(--brand)); color: #fff; border-radius: 16px; padding: 22px 25px; margin-bottom: 18px; }
.master-step-heading .eyebrow { color: #dcebe5; }
.master-step-heading h2 { margin: 4px 0; }
.master-step-heading p { margin: 0; color: #dcebe5; }
.master-step-heading small { display: block; margin-top: 10px; }
.step-navigation { display: flex; justify-content: space-between; margin: 18px 0; }
.filter-bar { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 20px; }
.filter-bar label { margin-top: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-grid article { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.metric-grid strong { display: block; color: var(--brand); font-size: 26px; }
.metric-grid span { color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.dashboard-panel h2 { margin-top: 0; }
.stat-line { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stat-line:last-child { border-bottom: 0; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr 48px; gap: 10px; align-items: center; margin: 10px 0; }
.bar-row div { background: #e4ece8; height: 9px; border-radius: 8px; overflow: hidden; }
.bar-row i { display: block; height: 100%; background: var(--brand); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.celery-filter { grid-template-columns: minmax(220px, 1fr) minmax(180px, .7fr) auto auto; }
.celery-privacy-note { margin: 0 0 18px; }
.celery-history-table { margin-bottom: 18px; }
.celery-task-id { color: var(--muted); overflow-wrap: anywhere; }
.celery-state { display: inline-flex; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.celery-state-queued, .celery-state-retry { background: #fff4d7; color: #765300; }
.celery-state-started { background: #e4f2ff; color: #174b77; }
.celery-state-success { background: #e5f5ea; color: #17643a; }
.celery-state-failure, .celery-state-revoked { background: #fde8e7; color: #8d2420; }
.celery-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
@media (max-width: 800px) {
  .form-grid,
  .summary-line { grid-template-columns: 1fr; }
  .data-row { align-items: flex-start; flex-direction: column; }
  .filter-bar,
  .dashboard-grid,
  .metric-grid { grid-template-columns: 1fr; }
  .celery-filter, .celery-metrics { grid-template-columns: 1fr; }
}
