:root {
  color-scheme: light;
  --ink: #18202b;
  --muted: #687385;
  --quiet: #8d97a6;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --line: #e2e7ed;
  --line-strong: #d5dce5;
  --blue: #2267e8;
  --blue-hover: #1755c5;
  --blue-soft: #edf4ff;
  --green: #23865c;
  --green-soft: #eaf7f1;
  --red: #c74444;
  --red-soft: #fff0ef;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Avenir Next", "SF Pro Text", "Segoe UI Variable Text",
    "PingFang SC", "Microsoft YaHei UI", sans-serif;
}

.shell {
  width: min(640px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.masthead,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  font-size: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  font-weight: 700;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.privacy > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.attachment-card {
  align-self: center;
  margin: 28px 0;
  padding: clamp(24px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(24, 32, 43, .04),
    0 18px 48px rgba(50, 63, 82, .08);
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.encryption-label {
  color: var(--quiet);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  letter-spacing: .04em;
}

.file-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  margin-bottom: 24px;
}

.file-glyph {
  position: relative;
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 56px;
  place-items: end center;
  padding-bottom: 8px;
  overflow: hidden;
  border: 1px solid #cdd7e4;
  border-radius: 9px;
  background: #f7faff;
  color: var(--blue);
}

.file-glyph::before {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 15px;
  height: 15px;
  border-bottom: 1px solid #cdd7e4;
  border-left: 1px solid #cdd7e4;
  border-bottom-left-radius: 5px;
  background: white;
  content: "";
}

.file-glyph span {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.title-group {
  min-width: 0;
}

.title-label {
  margin: 0 0 7px;
  color: var(--quiet);
  font-size: 12px;
}

h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 4vw, 27px);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.18;
}

.content {
  min-width: 0;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 20px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.facts div {
  min-width: 0;
}

dt {
  margin-bottom: 7px;
  color: var(--quiet);
  font-size: 11px;
}

dd {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f9fb;
}

.notice-icon {
  position: relative;
  flex: 0 0 17px;
  width: 17px;
  height: 19px;
  margin-top: 1px;
  border: 1.5px solid var(--green);
  border-radius: 9px 9px 7px 7px;
}

.notice-icon::before {
  position: absolute;
  top: -7px;
  left: 4px;
  width: 7px;
  height: 8px;
  border: 1.5px solid var(--green);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  content: "";
}

.message,
#progress-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.actions {
  display: flex;
  gap: 12px;
}

button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

button:not(:disabled):hover {
  box-shadow: 0 5px 14px rgba(32, 54, 86, .12);
}

button:focus-visible {
  outline: 3px solid rgba(34, 103, 232, .28);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.primary {
  background: var(--blue);
  color: white;
}

.primary:not(:disabled):hover {
  background: var(--blue-hover);
}

.secondary {
  border-color: var(--line-strong);
  background: white;
  color: var(--ink);
}

.progress-wrap {
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f7f9fb;
}

.progress-track {
  height: 6px;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe5ed;
}

#progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

#progress-label {
  margin-bottom: 0;
}

footer {
  min-height: 64px;
  color: var(--muted);
  font-size: 11px;
}

.is-error .eyebrow {
  background: var(--red-soft);
  color: var(--red);
}

.is-error .file-glyph {
  border-color: #edc8c5;
  background: #fff8f7;
  color: var(--red);
}

.is-error .notice-icon {
  border-color: var(--red);
  border-radius: 50%;
}

.is-error .notice-icon::before {
  top: 3px;
  left: 7px;
  width: 1.5px;
  height: 6px;
  border: 0;
  border-radius: 1px;
  background: var(--red);
}

.is-error .notice-icon::after {
  position: absolute;
  bottom: 3px;
  left: 7px;
  width: 1.5px;
  height: 1.5px;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 28px, 620px);
  }

  .masthead {
    min-height: 64px;
  }

  .attachment-card {
    margin: 22px 0;
    padding: 24px 20px;
  }

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

  .facts div {
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: baseline;
    gap: 8px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 18px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
