.view-card + .view-card { margin-top: 12px; }
.case-form { padding: 18px; }
.form-section-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; }
.section-index { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border: 1px solid #dce7e8; border-radius: 6px; background: #f8fbfb; color: #56817c; font-size: 8px; font-weight: 750; }
.form-section-heading h2 { margin: 0 0 4px; color: #354f59; font-size: 11px; }
.form-section-heading p { margin: 0; color: #87949a; font-size: 8px; line-height: 1.5; }
.section-spaced { margin-top: 20px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.field { display: grid; min-width: 0; gap: 6px; color: #526972; font-size: 8px; font-weight: 650; }
.field-span-2 { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; min-height: 35px; padding: 8px 10px; border: 1px solid #dfe7e9; border-radius: 6px; background: #fff; color: #415a64; font-size: 9px; font-weight: 450; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.field textarea { min-height: 68px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #a4afb3; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8dbdb6; box-shadow: 0 0 0 3px rgba(19,136,126,.08); }
.field small { color: #909da2; font-size: 7px; font-weight: 450; line-height: 1.45; }
.field-label { color: #526972; font-size: 8px; font-weight: 650; }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.choice-card { position: relative; display: grid; min-height: 105px; grid-template-columns: 16px 29px 1fr; grid-template-rows: 29px auto auto; align-content: center; align-items: center; gap: 5px 8px; padding: 10px; border: 1px solid #e4eaec; border-radius: 7px; background: #fff; cursor: pointer; transition: .15s ease; }
.choice-card:hover { border-color: #bfcecf; }
.choice-card:has(input:checked) { border-color: #8bc4ba; background: #f8fcfb; box-shadow: 0 0 0 2px rgba(19,136,126,.055); }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-check { grid-column: 1; grid-row: 1; width: 13px; height: 13px; border: 1px solid #c6d2d5; border-radius: 50%; }
.choice-card input:checked + .choice-check { border: 4px solid var(--teal); }
.choice-icon { display: grid; width: 29px; height: 29px; grid-column: 2; grid-row: 1; place-items: center; border-radius: 7px; }
.choice-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.icon-blue { background: var(--blue-light); color: var(--blue); }
.icon-teal { background: var(--teal-light); color: var(--teal); }
.icon-violet { background: var(--purple-light); color: var(--purple); }
.icon-amber { background: var(--gold-light); color: var(--gold); }
.icon-rose { background: var(--rose-light); color: var(--rose); }
.choice-card strong { grid-column: 1 / -1; grid-row: 2; align-self: end; color: #405963; font-size: 8px; font-weight: 650; }
.choice-card small { grid-column: 1 / -1; grid-row: 3; align-self: start; color: #8a979c; font-size: 7px; line-height: 1.4; }
.saved-case { margin-top: 12px; padding: 10px; border: 1px solid #dcebe4; border-radius: 6px; background: #f5faf7; color: #4f7866; font-size: 8px; }
.form-actions { margin-top: 17px; padding-top: 13px; border-top: 1px solid #edf0f1; }

.source-tabs { display: flex; gap: 5px; width: fit-content; margin: 0 0 12px; padding: 4px; border: 1px solid #e8edef; border-radius: 8px; background: #f6f8f9; }
.source-tab { display: inline-flex; min-height: 32px; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: #78888f; font-size: 9px; font-weight: 600; cursor: pointer; }
.source-tab svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.source-tab.is-selected { background: #fff; color: #286e69; box-shadow: 0 1px 4px rgba(20,53,64,.1); }
.source-view { display: none; }
.source-view.is-visible { display: block; }
.source-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(210px, .8fr); gap: 12px; }
.upload-card { padding: 14px; }
.dropzone { position: relative; display: flex; min-height: 195px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #a9c9c5; border-radius: 9px; background: linear-gradient(135deg, #f8fcfb, #f5faf9); color: #77878e; cursor: pointer; transition: .18s ease; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--teal); background: #f0f8f6; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-symbol { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 11px; border: 1px solid #d6eae6; border-radius: 12px; background: #fff; color: var(--teal); box-shadow: 0 4px 12px rgba(36,126,116,.08); }
.upload-symbol svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.dropzone strong { margin-bottom: 5px; color: #304d57; font-size: 11px; font-weight: 650; }
.dropzone > span:not(.upload-symbol) { font-size: 8px; }
.dropzone small { margin-top: 11px; color: #a0acb0; font-size: 8px; }
.file-summary { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid #e0e9ea; border-radius: 7px; background: #fbfcfc; }
.file-icon { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 7px; background: var(--teal-light); color: var(--teal); font-size: 7px; font-weight: 750; }
.file-info { display: grid; min-width: 0; gap: 3px; }
.file-info strong { overflow: hidden; color: #405963; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { color: #8d9ba1; font-size: 7px; }
.file-remove { margin-left: auto; border: 0; background: none; color: #9b7373; font-size: 7px; cursor: pointer; }
.source-actions { justify-content: flex-start; margin-top: 12px; }
.source-actions .form-footnote { max-width: 260px; }
.source-error { margin-top: 10px; padding: 9px; border: 1px solid #ecdada; border-radius: 6px; background: #fcf5f5; color: #8e5f60; font-size: 8px; }
.source-aside { padding: 15px; }
.aside-kicker { color: #82939a; font-size: 7px; font-weight: 750; letter-spacing: .12em; }
.source-aside h2 { margin-top: 10px; }
.source-aside p, .source-aside li { color: #819097; font-size: 8px; line-height: 1.55; }
.source-aside p { margin-bottom: 12px; }
.source-aside ul, .database-aside ul { display: grid; gap: 7px; margin: 8px 0 0; padding-left: 14px; }
.source-aside li::marker, .database-aside li::marker { color: var(--teal); }
.aside-divider { height: 1px; margin: 12px 0; background: #e8edef; }
.source-aside > strong { color: #516871; font-size: 8px; }
.database-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .7fr); overflow: hidden; padding: 0; }
.database-main, .database-aside { padding: 17px; }
.database-aside { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #f8fafb; }
.section-title-row { display: flex; align-items: center; gap: 10px; }
.section-title-row > div { min-width: 0; }
.section-title-row h2 { margin-bottom: 4px; }
.section-title-row p { margin: 0; color: #87949a; font-size: 8px; }
.db-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 8px; background: var(--blue-light); color: var(--blue); }
.db-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.section-title-row .status-label { margin-left: auto; }
.database-fields { margin: 17px 0 12px; }
.database-fields :disabled { opacity: 1; -webkit-text-fill-color: #8d999e; }
.security-note { margin-bottom: 12px; padding: 9px 10px; border-left: 2px solid #d6b36f; background: #fbf8f1; color: #8a754e; font-size: 8px; line-height: 1.55; }
.security-note strong { color: #765f36; }
.db-feedback { margin-top: 9px; padding: 9px 10px; border: 1px solid #dcebe4; border-radius: 6px; background: #f5faf7; color: #557765; font-size: 8px; line-height: 1.5; }
.database-aside h3 { margin-top: 10px; }
.database-aside li { color: #829096; font-size: 8px; }
.database-aside .status-label { margin-top: auto; align-self: flex-start; }

@media (max-width: 900px) {
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-layout, .database-layout { grid-template-columns: 1fr; }
  .database-aside { border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 620px) {
  .case-form { padding: 13px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .choice-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .choice-card { min-height: 100px; grid-template-columns: 14px 25px 1fr; gap: 5px 6px; padding: 8px; }
  .choice-icon { width: 25px; height: 25px; }
  .choice-icon svg { width: 14px; height: 14px; }
  .choice-card strong { font-size: 7px; }
  .choice-card small { font-size: 6px; }
  .form-actions, .source-actions { align-items: flex-start; flex-direction: column; }
  .form-actions .button { align-self: flex-end; }
  .source-actions .button { align-self: flex-start; }
  .source-layout { gap: 9px; }
  .dropzone { min-height: 170px; }
  .database-layout { grid-template-columns: 1fr; }
  .database-aside { min-height: 170px; }
  .section-title-row { flex-wrap: wrap; }
  .section-title-row .status-label { margin-left: 44px; }
}
