@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/ibm-plex-sans-arabic-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/ibm-plex-sans-arabic-semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  line-height: 1.6;
  --ink: #0b0e0c;
  --muted: #4d5a51;
  --forest: #173524;
  --paper: #f5f6f2;
  --border: #d9e0d6;
  --error: #8c2e24;
}
*, *::before, *::after { box-sizing: border-box; }
body { min-inline-size: 0; min-block-size: 100vh; min-block-size: 100svh; margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, p, dl, dd { margin: 0; }
button, input { font: inherit; }
img { display: block; max-inline-size: 100%; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
.skip-link {
  position: fixed;
  z-index: 3;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--forest);
  color: white;
  clip-path: inset(50%);
}
.skip-link:focus { clip-path: none; }
.share-shell {
  inline-size: min(100% - 2.5rem, 72rem);
  min-block-size: 100vh;
  min-block-size: 100svh;
  margin-inline: auto;
  padding-block: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
}
.share-brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  color: var(--forest);
  font-size: 1.125rem;
  font-weight: 600;
}
.share-brand img { inline-size: 1.75rem; block-size: 1.75rem; }
#share-content { flex: 1; }
.share-state {
  min-block-size: min(65svh, 38rem);
  max-inline-size: 34rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.75rem;
}
.share-state h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.3; }
.share-state p { color: var(--muted); }
.share-state .button { inline-size: auto; margin-block-start: 0.5rem; }
.eyebrow { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.share-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-block-start: auto;
  padding-block-start: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.share-footer a { color: var(--forest); text-underline-offset: 0.2em; }
.share-footer p { margin: 0; }
.file-view { display: grid; gap: 1.25rem; padding-block: clamp(2.25rem, 6vw, 4rem) 2rem; }
.file-heading { min-inline-size: 0; }
.file-name { margin-block: 0.25rem; font-size: clamp(1.5rem, 3.5vw, 2.25rem); line-height: 1.3; overflow-wrap: anywhere; }
.file-type { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.media-surface {
  display: grid;
  place-items: center;
  min-inline-size: 0;
  min-block-size: clamp(16rem, 48vw, 35rem);
  overflow: hidden;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #edf0eb;
}
.media-surface img { max-inline-size: 100%; max-block-size: min(72svh, 48rem); object-fit: contain; }
.media-surface iframe { inline-size: 100%; block-size: min(75svh, 48rem); border: 0; background: white; }
.media-surface audio { inline-size: min(100%, 36rem); }
.media-surface video { inline-size: 100%; max-block-size: min(75svh, 48rem); }
.preview-unavailable { max-inline-size: 32ch; padding: 1rem; color: var(--muted); text-align: center; }
.file-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-inline-size: 42rem; }
.file-details > div { min-inline-size: 0; }
.file-details dt { color: var(--muted); font-size: 0.875rem; }
.file-details dd { font-weight: 600; overflow-wrap: anywhere; }
.download-form { display: grid; gap: 1rem; max-inline-size: 42rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; }
.field-hint { color: var(--muted); font-size: 0.9375rem; }
.password-input {
  display: block;
  inline-size: 100%;
  min-block-size: 3.25rem;
  padding: 0.65rem 0.875rem;
  border: 1px solid #808e81;
  border-radius: 0.625rem;
  background: white;
  color: var(--ink);
}
.password-input[aria-invalid="true"] { border: 2px solid var(--error); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 3.25rem;
  inline-size: 100%;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--forest);
  border-radius: 0.625rem;
  background: var(--forest);
  color: white;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #244a32; }
.button:disabled { border-color: #808e81; background: #e6ebe3; color: #354439; cursor: default; }
.file-view > .button { max-inline-size: 42rem; background: transparent; color: var(--forest); }
.file-view > .button:hover { background: #e9eee7; }
.message { padding: 0.65rem 0.875rem; border: 1px solid #cfb0aa; border-radius: 0.625rem; background: #fff4f2; color: var(--error); overflow-wrap: anywhere; }
.media-surface .message { margin: 1rem; }
.auth-dialog {
  inline-size: min(100% - 2rem, 27rem);
  max-block-size: min(90svh, 45rem);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  color: var(--ink);
  box-shadow: 0 1.5rem 4rem rgb(11 14 12 / 16%);
}
.auth-dialog::backdrop { background: rgb(11 14 12 / 48%); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block-end: 1rem; }
.dialog-top h2 { font-size: 1.375rem; }
.dialog-close {
  flex: none;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: white;
  color: var(--forest);
  font-size: 1.5rem;
  cursor: pointer;
}
.dialog-close:hover { background: var(--paper); }
@media (max-width: 40rem) {
  .share-shell { inline-size: calc(100% - 2rem); }
  .file-view { padding-block-start: 2rem; }
  .media-surface { min-block-size: 15rem; padding: 0.5rem; }
  .file-details { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
}
@media (forced-colors: active) {
  .media-surface, .auth-dialog, .dialog-close, .button { border-color: ButtonText; }
  :focus-visible { outline-color: Highlight; }
}
