:root {
  --navy: #0c1f35;
  --blue: #1d4f91;
  --sky: #e9f1ff;
  --gold: #e8b54a;
  --mint: #e9fff4;
  --ink: #1b2838;
  --muted: #61728a;
  --line: #d9e2ef;
  --white: #ffffff;
  --danger: #bf3a30;
  --header-h: 76px;
  --tabs-h: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, #dff2ff 0, transparent 25%),
    radial-gradient(circle at 95% 20%, #fff8dc 0, transparent 25%),
    #f4f8fc;
  padding-bottom: calc(12px + var(--safe-bottom));
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) calc(14px + var(--safe-right)) 12px calc(14px + var(--safe-left));
  background: linear-gradient(135deg, var(--navy), #123e78);
  color: var(--white);
  box-shadow: 0 12px 24px rgba(12, 31, 53, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-content: center;
  background: linear-gradient(135deg, var(--gold), #d2942b);
  font-size: 24px;
}

h1 {
  margin: 0;
  font-size: 1.1rem;
}

.brand p {
  margin: 3px 0 0;
  font-size: 0.82rem;
  opacity: 0.85;
}

.tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  background: rgba(244, 248, 252, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

body:not(.is-admin) .tabs {
  grid-template-columns: repeat(2, 1fr);
}

.tab {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  padding: 12px 8px;
  min-height: 44px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.15s ease;
}

.tab:active {
  transform: scale(0.98);
}

.tab.active {
  color: var(--white);
  border-color: var(--navy);
  background: linear-gradient(135deg, var(--navy), var(--blue));
}

.app-main {
  max-width: 1100px;
  margin: 16px auto 30px;
  padding: 0 calc(14px + var(--safe-left)) 0 calc(14px + var(--safe-right));
  width: 100%;
}

.screen {
  display: none;
  animation: fade 0.25s ease;
}

.screen.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  background: linear-gradient(135deg, #0f7445, #1b9a5c);
  border-radius: 20px;
  color: var(--white);
  padding: 24px;
  box-shadow: 0 10px 24px rgba(15, 116, 69, 0.2);
}

.hero h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.hero p {
  margin: 0;
  opacity: 0.92;
}

.cards {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.cards.three {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(12, 31, 53, 0.06);
}

.card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  color: var(--navy);
}

.label {
  color: var(--muted);
  font-size: 0.8rem;
}

.panel {
  margin-top: 16px;
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: 0 10px 20px rgba(12, 31, 53, 0.05);
}

.panel h3 {
  margin: 0 0 10px;
  color: var(--navy);
}

.checklist {
  margin: 0;
  padding-right: 20px;
  color: #224a35;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-text {
  font-size: 0.85rem;
  color: var(--muted);
}

.status-text.ok {
  color: #19743b;
}

.status-text.error {
  color: var(--danger);
}

.status-text.loading {
  color: #9a6700;
  font-weight: 700;
}

body.is-busy {
  touch-action: none;
}

.app-busy {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  background: rgba(12, 31, 53, 0.38);
  padding: 20px;
}

.app-busy-card {
  min-width: min(320px, 92vw);
  background: var(--white);
  border-radius: 18px;
  padding: 22px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(12, 31, 53, 0.25);
}

.app-busy-spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 3px solid #dbe7f7;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.app-busy-card p {
  margin: 0;
  color: var(--navy);
  font-weight: 700;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 210;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  box-shadow: 0 14px 30px rgba(12, 31, 53, 0.22);
  background: var(--navy);
  color: var(--white);
}

.app-toast.ok {
  background: #19743b;
}

.app-toast.error {
  background: var(--danger);
}

.app-toast.info {
  background: var(--navy);
}

.btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.file-upload-label {
  grid-column: 1 / -1;
  display: block;
  padding: 12px 14px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #f8fbff;
  color: var(--navy);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

#attachmentsInput {
  grid-column: 1 / -1;
  font-size: 0.9rem;
}

.attachments-box {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.attachments-box ul {
  margin: 6px 0 0;
  padding-right: 18px;
}

.attachments-box li span {
  color: var(--muted);
  font-size: 0.78rem;
}

.existing-attach-list li {
  margin: 4px 0;
}

.attach-video-frame {
  width: 100%;
  min-height: 220px;
  border: none;
  border-radius: 10px;
  background: #000;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 16px;
  background: #fbfdff;
  touch-action: manipulation;
}

@media (min-width: 768px) {
  input,
  textarea {
    font-size: 0.95rem;
    padding: 10px;
  }
}

textarea {
  grid-column: 1 / -1;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 44px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: var(--white);
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.btn.secondary {
  background: #dfe8f7;
  color: #1d3e73;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.hidden {
  display: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: right;
  padding: 10px;
  white-space: nowrap;
}

th {
  background: #f2f7ff;
  color: var(--navy);
}

tr.total td {
  font-weight: 800;
  background: #f4f9ff;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-btn {
  border: 1px solid var(--line);
  background: #f7faff;
  color: var(--navy);
  border-radius: 8px;
  padding: 6px 9px;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.mini-btn.danger {
  background: #fff2f1;
  border-color: #f3cbc7;
  color: #9f2e25;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-link {
  font-size: 0.78rem;
  color: #1d4f91;
  text-decoration: none;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-link:hover {
  text-decoration: underline;
}

.initiative-cover {
  background: linear-gradient(130deg, #152e52, #1e4d8c);
  color: var(--white);
}

.initiative-cover h3 {
  color: var(--white);
}

.video {
  width: 100%;
  border-radius: 12px;
  background: #000;
}

@media (max-width: 760px) {
  :root {
    --header-h: 118px;
  }

  .tabs {
    top: var(--header-h);
    grid-template-columns: repeat(2, 1fr);
  }

  body.is-admin .tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab {
    font-size: 0.84rem;
    padding: 11px 6px;
  }

  .app-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .brand {
    flex: 1;
    min-width: 0;
  }

  .brand p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }

  .header-actions .btn.ghost {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }

  .logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }

  h1 {
    font-size: 0.98rem;
    line-height: 1.3;
  }

  .hero {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .hero h2 {
    font-size: 1.15rem;
  }

  .hero p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card strong {
    font-size: 1.2rem;
  }

  .panel {
    padding: 14px;
    border-radius: 14px;
  }

  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head .btn {
    width: 100%;
  }

  .case-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .case-card-thumb,
  .case-card-placeholder {
    height: 180px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  #attachmentsInput {
    font-size: 14px;
  }

  .admin-dialog {
    margin: auto;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
}

@media (min-width: 761px) and (max-width: 1024px) {
  .case-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .app-main {
    padding: 0 20px;
  }

  .case-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero h2 {
    font-size: 1.55rem;
  }
}

@media (max-width: 380px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .role-badge {
    font-size: 0.7rem;
    padding: 5px 8px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.role-badge.viewer {
  background: rgba(255, 255, 255, 0.12);
}

.role-badge.admin {
  background: rgba(232, 181, 74, 0.25);
  border-color: var(--gold);
}

.donor-hero {
  background: linear-gradient(135deg, var(--navy), #1a5088);
}

.last-sync {
  margin-top: 10px !important;
  font-size: 0.82rem;
  opacity: 0.85;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h3 {
  margin: 0;
}

.cases-filter {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
}

.cases-filter-compact {
  padding: 12px;
}

.cases-filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.cases-filter-row input[type="search"],
.cases-filter-row select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--white);
  color: var(--ink);
}

.cases-filter-row input[type="search"]:focus,
.cases-filter-row select:focus {
  outline: 2px solid rgba(29, 79, 145, 0.18);
  border-color: var(--blue);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 38px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-chip:hover {
  border-color: #b8cae4;
  color: var(--blue);
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border-color: transparent;
  color: var(--white);
}

.filter-summary {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

@media (min-width: 720px) {
  .cases-filter-row {
    grid-template-columns: 1.4fr 1fr 1fr auto;
    align-items: center;
  }

  .cases-filter-compact .cases-filter-row {
    grid-template-columns: 1.5fr 1fr;
  }

  .cases-filter-row .case-filter-clear {
    white-space: nowrap;
  }
}

.case-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.case-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 18px rgba(12, 31, 53, 0.06);
  touch-action: manipulation;
}

.case-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(12, 31, 53, 0.12);
}

.case-card:active {
  transform: scale(0.99);
}

.case-card-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #e8eef7;
}

.case-card-placeholder {
  height: 150px;
  display: grid;
  place-content: center;
  font-size: 2.4rem;
  background: linear-gradient(135deg, #edf4ff, #fff8e8);
}

.case-card-body {
  padding: 12px 14px 14px;
}

.case-card-num {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.case-card-body h4 {
  margin: 6px 0 4px;
  color: var(--navy);
  font-size: 1rem;
}

.case-card-project {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.case-card-cost {
  display: inline-block;
  margin-top: 8px;
  color: #0f7445;
  font-size: 1.05rem;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

body:not(.is-admin) .admin-only {
  display: none !important;
}

body.is-admin .donor-only {
  display: none !important;
}

.case-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.case-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-new { background: #e8f1ff; color: #1d4f91; }
.status-reviewing { background: #fff4dd; color: #9a6700; }
.status-approved { background: #e7f8ef; color: #0f7445; }
.status-funded { background: #dff5ea; color: #0b6b3f; }
.status-progress { background: #e9ecff; color: #4338ca; }
.status-completed { background: #edf7ed; color: #2e7d32; }
.status-hold { background: #f3f4f6; color: #5b6778; }

.case-details-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.case-details-hero img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 16px rgba(12, 31, 53, 0.08);
}

.status-current {
  margin-bottom: 12px;
}

.status-select-wrap {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.status-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  background: #f8fbff;
}

.admin-dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  max-width: 380px;
  width: calc(100% - 24px);
  box-shadow: 0 20px 50px rgba(12, 31, 53, 0.25);
}

.admin-dialog form {
  padding: 20px;
}

.admin-dialog h3 {
  margin: 0 0 8px;
  color: var(--navy);
}

.admin-dialog::backdrop {
  background: rgba(12, 31, 53, 0.45);
}

.case-row {
  cursor: pointer;
}

.case-details-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(circle at 5% 0%, #dff2ff 0, transparent 25%),
    radial-gradient(circle at 95% 20%, #fff8dc 0, transparent 25%),
    #f4f8fc;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding:
    calc(12px + var(--safe-top))
    calc(14px + var(--safe-right))
    calc(16px + var(--safe-bottom))
    calc(14px + var(--safe-left));
}

body.case-details-open {
  overflow: hidden;
}

body.case-details-open .app-footer {
  display: none;
}

.app-footer {
  margin-top: 8px;
  padding:
    20px calc(14px + var(--safe-right))
    calc(20px + var(--safe-bottom))
    calc(14px + var(--safe-left));
  background: linear-gradient(180deg, transparent 0%, rgba(12, 31, 53, 0.04) 100%);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.footer-divider {
  height: 3px;
  width: 56px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #d2942b);
  opacity: 0.85;
}

.footer-credits-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--navy);
  line-height: 1.5;
}

.footer-credit-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.footer-sep {
  color: #b8c4d4;
  font-weight: 700;
  user-select: none;
}

.footer-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
}

.footer-name {
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  color: var(--navy);
}

.footer-name-secondary {
  color: #0f7445;
}

.footer-tagline {
  margin: 0;
  font-size: 0.75rem;
  color: #8a9bb0;
}

.case-details-header {
  background: linear-gradient(135deg, var(--navy), #123e78);
  color: var(--white);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 16px 24px rgba(12, 31, 53, 0.2);
}

.case-details-back {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 44px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  width: 100%;
  margin-bottom: 14px;
}

.case-details-tag {
  margin: 0;
  font-size: 0.8rem;
  color: #cadbf6;
}

.case-details-head-text h2 {
  margin: 8px 0 6px;
  font-size: 1.35rem;
  color: var(--white);
}

.case-details-head-text p {
  margin: 0;
  color: #dce9ff;
  font-size: 0.92rem;
}

.case-details-body {
  max-width: 1000px;
  margin: 0 auto;
}

.case-details-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 10px 18px rgba(13, 33, 60, 0.06);
}

.case-details-card h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 1.05rem;
}

.case-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.case-details-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
}

.case-details-item .label {
  font-size: 0.78rem;
  color: var(--muted);
}

.case-details-item .value {
  margin-top: 4px;
  font-weight: 700;
}

.case-details-notes {
  margin: 0;
  line-height: 1.8;
}

.case-details-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.case-details-attachment {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf2;
  padding: 10px;
}

.case-details-attachment a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.case-details-attachment.media {
  background: var(--white);
  overflow: hidden;
}

.case-details-attachment.media img,
.case-details-attachment.media video {
  width: 100%;
  max-height: min(420px, 55vh);
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin-bottom: 8px;
  background: #000;
}

@media (max-width: 760px) {
  .case-details-grid,
  .case-details-attachments {
    grid-template-columns: 1fr;
  }

  .case-details-head-text h2 {
    font-size: 1.15rem;
  }
}
