:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #eef2f6;
  --border: #d7dde5;
  --text: #17202a;
  --muted: #667085;
  --blue: #1f6feb;
  --blue-dark: #1557b0;
  --green: #147d64;
  --amber: #a15c00;
  --red: #c2413a;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

/* ACC-001: phone-first accident intake */
.first-response-page { max-width: 1180px; margin: 0 auto; }
.first-response-intro { align-items: center; }
.intake-target { display: grid; gap: 0.2rem; min-width: 220px; padding: 0.85rem 1rem; border: 1px solid var(--line-color, #d8e0e8); border-radius: 14px; background: #f4f8fb; }
.intake-target strong { color: #0b5680; font-size: 1.05rem; }
.intake-target span { color: #526575; font-size: 0.78rem; }
.first-response-form { display: grid; gap: 1rem; }
.intake-card { padding: 1.15rem; border: 1px solid #d9e2ea; border-radius: 16px; background: #fff; box-shadow: 0 4px 16px rgba(15, 52, 74, 0.05); }
.intake-card-primary { border-color: #9fc7df; box-shadow: inset 4px 0 0 #1776a4, 0 4px 16px rgba(15, 52, 74, 0.05); }
.compact-intake-grid { align-items: start; }
.required-caption, .follow-later-badge, .privacy-badge { align-self: center; border-radius: 999px; padding: 0.3rem 0.6rem; font-size: 0.75rem; font-weight: 700; }
.required-caption { background: #e9f5fb; color: #135f86; }
.follow-later-badge { background: #fff4dc; color: #815410; }
.privacy-badge { background: #eaf5ef; color: #216340; }
.segmented-radios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.segmented-radios.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented-radios label { position: relative; margin: 0; }
.segmented-radios input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented-radios span { display: flex; min-height: 44px; align-items: center; justify-content: center; padding: 0.55rem 0.75rem; border: 1px solid #b9c8d2; border-radius: 10px; background: #fff; font-weight: 700; cursor: pointer; }
.segmented-radios input:checked + span { border-color: #0f719f; background: #e7f4fa; color: #0b587f; box-shadow: inset 0 0 0 1px #0f719f; }
.segmented-radios input:focus-visible + span { outline: 3px solid rgba(17, 118, 164, 0.28); outline-offset: 2px; }
.switch-row { display: flex !important; min-height: 48px; flex-direction: row !important; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; border: 1px solid #d6e0e7; border-radius: 11px; background: #f9fbfc; }
.switch-row input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.switch-row span { display: grid; gap: 0.15rem; }
.switch-row small, .field-meta { color: #687b89; font-size: 0.75rem; }
.unknown-toggle { border-color: #e3c77d; background: #fffaf0; }
.serious-switch { border-color: #e7b9b9; background: #fff6f6; }
.partner-intake-fields { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed #cbd7df; }
.partner-intake-fields label > input + input, .partner-intake-fields label > select + input { margin-top: 0.45rem; }
.unknown-items-card summary { cursor: pointer; font-weight: 750; }
.compact-checkboxes { margin-top: 0.8rem; }
.first-response-footer { position: sticky; bottom: 0; z-index: 3; border: 1px solid #d6e1e8; border-radius: 14px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px); }
.intake-submit { min-width: 190px; min-height: 48px; font-size: 1rem; }
.validation-summary { margin: 0 auto; color: #a02a2a; font-weight: 700; }
.intake-completion { display: grid; justify-items: center; gap: 0.7rem; padding: 2rem; border: 1px solid #8fc7aa; border-radius: 18px; background: #f2fbf6; text-align: center; }
.completion-mark { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: #23784d; color: #fff; font-size: 1.7rem; }
.completion-warnings { display: grid; gap: 0.4rem; width: min(620px, 100%); }
.completion-warnings .warning-item { padding: 0.55rem 0.7rem; border-radius: 9px; background: #fff3d6; color: #744c0d; }
.first-response-detail { border-left: 4px solid #1976a3; }
.first-response-warnings { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.first-response-warnings .warning-chip { padding: 0.3rem 0.55rem; border-radius: 999px; background: #fff1cf; color: #774c06; font-size: 0.78rem; font-weight: 700; }
.protected-phone-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 0.9rem 1rem; border: 1px solid #b8d5c5; border-radius: 12px; background: #f3faf6; }
.protected-phone-panel > div { display: grid; gap: 0.12rem; }
.protected-phone-panel small { color: #5f7368; }
.inline-protected-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 0.75rem; align-items: end; margin-top: 0.75rem; padding: 0.9rem; border-radius: 12px; background: #f7f9fb; }
.confirmation-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #dde5ea; }
.confirmation-history { display: grid; gap: 0.5rem; }
.confirmation-history-row { padding: 0.65rem; border-left: 3px solid #85aabd; background: #f6f9fb; font-size: 0.84rem; }

@media (max-width: 760px) {
  .first-response-intro { align-items: stretch; }
  .intake-target { min-width: 0; }
  .segmented-radios, .segmented-radios.three { grid-template-columns: 1fr; }
  .intake-operation-type .segmented-radios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .first-response-footer { display: grid; grid-template-columns: 1fr; }
  .intake-submit { width: 100%; order: -1; }
  .protected-phone-panel { align-items: stretch; flex-direction: column; }
  .inline-protected-form, .confirmation-workspace { grid-template-columns: 1fr; }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(135deg, #f6f7f9 0%, #e8edf3 100%);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.error-banner {
  padding: 10px 12px;
  border: 1px solid #f1a6a0;
  border-radius: 6px;
  background: #fff7f7;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.permission-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 28px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
}

.permission-strip strong {
  margin-right: 4px;
  color: var(--text);
}

.app-error {
  margin: 12px 28px 0;
  padding: 10px 12px;
  border: 1px solid #f1a6a0;
  border-radius: 6px;
  background: #fff7f7;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.permission-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 800;
}

.permission-chip.is-allowed {
  background: #e5f6f1;
  color: var(--green);
}

.permission-chip.is-denied {
  background: #eef2f6;
  color: #667085;
}

.admin-panel {
  display: grid;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.ops-panel {
  display: grid;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.admin-panel h2,
.ops-panel h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.admin-section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ops-section {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.user-form,
.recipient-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
}

.recipient-form {
  grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(240px, 1.3fr) auto auto;
}

.notification-type-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.checkbox-line {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.checkbox-line input {
  width: 16px;
  min-height: 16px;
}

.user-table-wrap {
  overflow: auto;
}

.user-table {
  min-width: 760px;
}

.notification-table {
  min-width: 980px;
}

.audit-table {
  min-width: 1040px;
}

.alert-table-wrap {
  overflow: auto;
}

.alert-table {
  min-width: 920px;
}

.notification-preview-table {
  min-width: 1360px;
}

.notification-history-table {
  min-width: 1040px;
}

.user-table tbody tr,
.notification-table tbody tr,
.audit-table tbody tr {
  cursor: default;
}

.alert-table tbody tr,
.notification-preview-table tbody tr,
.notification-history-table tbody tr {
  cursor: pointer;
}

.alert-table tbody tr.is-overdue {
  background: #fff7f7;
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

a.secondary-button,
a.danger-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.topbar h1,
.detail-header h2,
.dialog-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-actions,
.detail-actions,
.filter-actions,
.dialog-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-summary {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding-right: 6px;
  color: var(--text);
  font-size: 13px;
}

.user-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  padding: 16px;
  min-height: 0;
  flex: 1;
}

.list-panel,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}

.list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-panel {
  padding: 18px;
  overflow: auto;
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

input:disabled {
  background: var(--surface-muted);
}

.table-wrap {
  overflow: auto;
  min-height: 340px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f4f8;
  color: #445064;
  font-size: 12px;
}

tr {
  height: 52px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.is-selected {
  background: #eaf2ff;
}

tbody tr.is-due-soon {
  background: #fffaf0;
}

tbody tr.is-overdue {
  background: #fff7f7;
}

tbody tr.is-due-soon td:first-child {
  box-shadow: inset 4px 0 0 #d69212;
}

tbody tr.is-overdue td:first-child {
  box-shadow: inset 4px 0 0 var(--red);
}

.list-primary {
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
}

.list-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.summary-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge,
.approval-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.status-速報 {
  background: #fff3da;
  color: var(--amber);
}

.status-調査中 {
  background: #e8f1ff;
  color: var(--blue-dark);
}

.status-原因分析中 {
  background: #f2ebff;
  color: #6b3db6;
}

.status-再発防止策作成中 {
  background: #ecfdf3;
  color: var(--green);
}

.status-承認待ち {
  background: #fff0f0;
  color: var(--red);
}

.status-承認済み {
  background: #e5f6f1;
  color: var(--green);
}

.status-完了 {
  background: #e5f6f1;
  color: var(--green);
}

.approval-未申請 {
  background: #eef2f6;
  color: #445064;
}

.approval-申請中,
.approval-action-申請 {
  background: #fff0f0;
  color: var(--red);
}

.approval-承認済み,
.approval-action-承認 {
  background: #e5f6f1;
  color: var(--green);
}

.approval-差戻し,
.approval-action-差戻し {
  background: #fff3da;
  color: var(--amber);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--blue);
  color: #fff;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.danger-button {
  background: #fff0f0;
  color: var(--red);
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 20px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.detail-header,
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
  font-size: 13px;
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-grid dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.status-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.map-preview {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.map-preview strong {
  color: var(--text);
  font-size: 14px;
}

.map-preview iframe {
  width: 100%;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.map-preview a {
  color: var(--blue);
  font-weight: 700;
}

.workflow-section,
.approval-panel {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.summary-section {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.quick-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.quick-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quick-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-summary strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #445064;
  font-size: 12px;
  font-weight: 800;
}

.state-note {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.approval-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.approval-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.approval-form textarea {
  min-height: 72px;
}

.approval-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.approval-history {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.approval-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-actions,
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.action-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.follow-up-list {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.action-row.is-overdue {
  border-color: #f1a6a0;
  background: #fff7f7;
}

.follow-up-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.follow-up-row.is-overdue {
  border-color: #f1a6a0;
  background: #fff7f7;
}

.follow-up-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.follow-up-type {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.follow-up-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.follow-up-status-未実施 {
  background: #eef2f6;
  color: #445064;
}

.follow-up-status-実施済み {
  background: #e5f6f1;
  color: var(--green);
}

.follow-up-status-期限超過 {
  background: #fff0f0;
  color: var(--red);
}

.follow-up-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.action-content strong {
  color: var(--text);
  font-size: 13px;
  word-break: break-word;
}

.due-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.due-badge.overdue {
  background: #fff0f0;
  color: var(--red);
}

.due-badge.soon {
  background: #fff3da;
  color: var(--amber);
}

.date-soft {
  color: var(--muted);
}

.delivery-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.delivery-dry_run {
  background: #eef2f6;
  color: #445064;
}

.delivery-sent,
.delivery-outbox {
  background: #e5f6f1;
  color: var(--green);
}

.delivery-failed {
  background: #fff0f0;
  color: var(--red);
}

.notification-body-cell {
  max-width: 360px;
  white-space: pre-line;
}

.attachments {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.attachments h3,
.form-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: 0;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-preview {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.attachment-preview strong {
  font-size: 13px;
}

.attachment-preview img,
.attachment-preview iframe {
  width: 100%;
  max-height: 300px;
  border: 1px solid var(--border);
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.attachment-preview iframe {
  height: 300px;
}

.attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.attachment-link {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  white-space: normal;
}

.attachment-link img,
.attachment-icon {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  color: var(--red);
  font-weight: 800;
}

dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

#accidentForm {
  padding: 18px;
  display: grid;
  gap: 18px;
}

.form-intro {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #c9ddff;
  border-radius: 6px;
  background: #f2f7ff;
  color: var(--blue-dark);
  font-size: 13px;
  line-height: 1.5;
}

.form-intro strong {
  color: var(--text);
}

.form-intro span {
  color: var(--muted);
  font-weight: 700;
}

.form-section {
  display: grid;
  gap: 10px;
}

.priority-section {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.optional-section {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.optional-section summary {
  min-height: 44px;
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.optional-section[open] {
  padding-bottom: 12px;
}

.optional-section[open] summary {
  border-bottom: 1px solid var(--border);
}

.optional-section > .form-grid,
.optional-section > .sub-section {
  margin: 12px 12px 0;
}

.sub-section {
  display: grid;
  gap: 10px;
}

label em {
  color: var(--red);
  font-size: 11px;
  font-style: normal;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.input-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.wide {
  grid-column: 1 / -1;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.checkbox-pill {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  background: #fff;
}

.checkbox-pill input {
  width: 16px;
  min-height: 16px;
}

.dialog-footer {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: 240px;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .permission-strip {
    padding: 10px 16px;
  }

  .app-error {
    margin: 10px 16px 0;
  }

  .workspace {
    padding: 10px;
  }

  .admin-panel {
    padding: 12px 16px;
  }

  .ops-panel {
    padding: 12px 16px;
  }

  .filters,
  .form-grid,
  .compact-grid,
  .user-form,
  .recipient-form,
  .input-with-action,
  .attachment-row {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .dialog-footer,
  .topbar-actions {
    width: 100%;
  }

  .filter-actions button,
  .dialog-footer button,
  .topbar-actions button {
    flex: 1;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .quick-summary {
    grid-template-columns: 1fr;
  }

  .status-editor {
    grid-template-columns: 1fr;
  }

  .approval-actions {
    grid-template-columns: 1fr;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .follow-up-grid {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button {
    flex: 1;
  }

  dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  #accidentForm {
    padding: 14px;
    gap: 14px;
  }

  .detail-header,
  .dialog-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-actions button,
  .approval-actions button {
    flex: 1;
  }
}

.master-combobox { position: relative; }
.combobox-options { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto; padding: 6px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16); }
.combobox-option { width: 100%; display: grid; gap: 2px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: #172033; text-align: left; cursor: pointer; }
.combobox-option:hover, .combobox-option:focus-visible { background: #edf7f5; }
.combobox-option span { color: #667085; font-size: 0.78rem; }
.operation-type-field { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 10px 12px; border: 1px solid #d7dee7; border-radius: 10px; }
.operation-type-field legend { padding: 0 4px; color: #526071; font-size: 0.82rem; font-weight: 700; }
.operation-type-field label { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.optional-details { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #dbe4eb; border-radius: 10px; background: #f8fafc; }
.optional-details summary { cursor: pointer; font-weight: 700; }
.video-link-inputs, .video-link-row, .recipient-preview, .attachment-upload-row, .master-admin-toolbar, .master-admin-form { display: flex; flex-wrap: wrap; gap: 10px; }
.video-link-row { width: 100%; }
.video-link-row input[data-video-title] { flex: 1 1 220px; }
.video-link-row input[data-video-url] { flex: 2 1 360px; }
.recipient-chip { padding: 6px 9px; border-radius: 999px; background: #e8f3f1; color: #155e58; font-size: 0.82rem; }
.master-admin-toolbar, .master-admin-form { margin-bottom: 16px; align-items: end; }
.master-admin-toolbar label, .master-admin-form label { display: grid; gap: 6px; min-width: 160px; }
.master-admin-form .checkbox-line { display: flex; min-width: auto; }
