@font-face {
  font-family: Apercu;
  src: url("/assets/fonts/ApercuPro-Regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Ivy;
  src: url("/assets/fonts/IvyPrestoHeadline-Regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Mono;
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-display: swap;
}
:root {
  --ink: #252723;
  --paper: #f3f1e9;
  --white: #fdfcf8;
  --gold: #8b7446;
  --line: #dcdcd1;
  --muted: #6e7468;
  --green: #52654f;
  --red: #a04432;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    15px/1.5 Apercu,
    Arial,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  top: -80px;
  left: 20px;
  background: var(--white);
  padding: 15px;
  z-index: 20;
}
.skip:focus {
  top: 10px;
}
.rail {
  width: 232px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--ink);
  color: var(--paper);
  padding: 37px 25px;
  display: flex;
  flex-direction: column;
  z-index: 8;
}
.logo img {
  width: 182px;
  height: auto;
}
.rail-label,
.eyebrow {
  font:
    10px/1.6 Mono,
    monospace;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.rail-label {
  color: #aaa999;
  margin: 61px 0 18px;
}
.rail nav {
  display: grid;
  gap: 6px;
}
.rail nav a,
.rail nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 11px;
  text-decoration: none;
  color: #bebfb4;
  border: 0;
  background: none;
  text-align: left;
  font-size: 14px;
  border-radius: 5px;
}
.rail nav .active {
  background: #ffffff10;
  color: #eee7d4;
  border: 1px solid #9e8a514d;
}
.rail-bottom {
  margin-top: auto;
  font-size: 11px;
  color: #bbbdae;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #adba95;
  border-radius: 50%;
  margin-right: 6px;
}
.rail-bottom p {
  font:
    21px/1.2 Ivy,
    Georgia,
    serif;
  color: #e0ddcf;
  margin: 30px 0;
}
.rail-bottom a {
  color: inherit;
  text-decoration: none;
}
.shell {
  margin-left: 232px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  padding: 27px 4vw 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.eyebrow {
  color: var(--gold);
  margin: 0 0 9px;
}
h1 {
  font:
    31px/1.1 Ivy,
    Georgia,
    serif;
  font-weight: 400;
  margin: 0;
}
h2 {
  font:
    44px/1.1 Ivy,
    Georgia,
    serif;
  font-weight: 400;
  margin: 0 0 16px;
}
h3 {
  font:
    27px/1.2 Ivy,
    Georgia,
    serif;
  font-weight: 400;
  margin: 0 0 13px;
}
h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 400;
}
p {
  margin: 0 0 16px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
#save-status {
  font-size: 12px;
  color: var(--green);
}
#save-status.unsaved {
  color: var(--red);
}
main {
  padding: 35px 4vw 65px;
  flex: 1;
  min-width: 0;
}
.shell-footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 4vw;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.login-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 8%;
  max-width: 1050px;
  margin: 8vh auto;
}
.login-intro h2 {
  font-size: clamp(48px, 5vw, 76px);
  margin: 22px 0;
}
.login-intro em {
  color: var(--gold);
  font-style: normal;
}
.login-intro > p {
  max-width: 380px;
  color: var(--muted);
  font-size: 17px;
}
.intro-steps {
  padding: 0;
  list-style: none;
  margin: 40px 0 0;
}
.intro-steps li {
  border-top: 1px solid var(--line);
  padding: 14px 0;
  font-size: 13px;
}
.intro-steps b {
  font:
    11px Mono,
    monospace;
  color: var(--gold);
  margin-right: 20px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 25px;
}
.login-card {
  align-self: center;
  padding: 34px;
  box-shadow: 0 12px 35px #25272305;
}
.login-card h3 {
  font-size: 36px;
  margin: 15px 0 25px;
}
.login-card .primary {
  width: 100%;
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
}
label {
  display: block;
  color: #53594e;
  font-size: 12px;
  margin-bottom: 17px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #c9cbbf;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  border-radius: 4px;
  margin-top: 7px;
  min-height: 44px;
  max-width: 100%;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
input[type="checkbox"] {
  display: inline-block;
  width: 17px;
  min-height: 17px;
  height: 17px;
  vertical-align: middle;
  margin: 0 8px 0 0;
  accent-color: var(--green);
}
.check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.primary,
.secondary,
.quiet,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 43px;
  padding: 10px 18px;
  border-radius: 5px;
  border: 1px solid transparent;
  text-decoration: none;
}
.primary {
  background: var(--ink);
  color: #fff;
}
.secondary {
  border-color: #c2c6b7;
  color: var(--ink);
  background: transparent;
}
.quiet {
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
}
.danger {
  color: var(--red);
  background: transparent;
  border-color: #dbc9bf;
}
.primary:hover {
  background: #41483b;
}
.secondary:hover,
.quiet:hover {
  background: #e8e9df;
}
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.error {
  color: var(--red);
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading h2 {
  margin-bottom: 8px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: #ecece2;
  border-radius: 8px;
  margin: 25px 0 32px;
}
.stats > div {
  padding: 20px 25px;
  border-right: 1px solid var(--line);
}
.stats > div:last-child {
  border: 0;
}
.stats small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.stats strong {
  font:
    32px Ivy,
    Georgia,
    serif;
  display: block;
  margin-top: 5px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.toolbar input {
  max-width: 360px;
  margin: 0;
}
.jobs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.job {
  display: block;
  text-align: left;
  width: 100%;
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.job:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.job-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}
.tag {
  display: inline-block;
  padding: 4px 8px;
  background: #eceee5;
  color: var(--green);
  font-size: 10px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}
.tag.draft {
  background: #eee5d3;
  color: #826b3e;
}
.job h3 {
  font-size: 29px;
}
.job p {
  font-size: 13px;
  color: var(--muted);
}
.job-bottom {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.empty {
  padding: 55px 25px;
  text-align: center;
  border: 1px dashed #bfc4b5;
  border-radius: 8px;
}
.empty h3 {
  font-size: 31px;
}
.empty p {
  max-width: 400px;
  margin: 0 auto 24px;
  color: var(--muted);
}
.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 25px;
}
.back {
  padding-left: 0;
  margin-bottom: 12px;
  font-size: 12px;
}
.job-head h2 {
  font-size: 38px;
  overflow-wrap: anywhere;
}
.tabs {
  display: flex;
  gap: 27px;
  border-bottom: 1px solid var(--line);
  margin: 25px 0 28px;
  overflow-x: auto;
}
.tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: none;
  padding: 12px 0 15px;
  white-space: nowrap;
  font-size: 13px;
}
.tabs button.active {
  border-color: var(--gold);
  color: var(--ink);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.section-label {
  margin: 0 0 21px;
  font:
    11px Mono,
    monospace;
  letter-spacing: 1px;
  color: var(--gold);
}
.card + .card {
  margin-top: 20px;
}
.grid-2 > .card + .card {
  margin: 0;
}
.field-note {
  padding: 12px 15px;
  border-left: 2px solid var(--gold);
  background: #f2eee2;
  color: #6c6045;
  font-size: 12px;
  margin-bottom: 18px;
}
.scope-layout {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  gap: 25px;
}
.units {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.unit-button {
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 12px 14px;
  text-align: left;
  color: var(--muted);
}
.unit-button.active {
  background: #e5e8dc;
  border-color: #cbd2bf;
  color: var(--ink);
}
.unit-button small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
}
.unit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.unit-heading h3 {
  margin: 0;
  font-size: 33px;
}
.trade {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 13px;
  overflow: hidden;
}
.trade > summary {
  list-style: none;
  padding: 19px 22px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
}
.trade > summary::-webkit-details-marker {
  display: none;
}
.trade > summary small {
  font:
    10px Mono,
    monospace;
  color: var(--muted);
}
.trade[open] > summary {
  border-bottom: 1px solid var(--line);
}
.trade-body {
  padding: 20px;
}
.scope-item {
  padding-bottom: 22px;
  margin-bottom: 23px;
  border-bottom: 1px solid var(--line);
}
.scope-item:last-of-type {
  margin-bottom: 12px;
}
.item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
}
.item-ref {
  font:
    10px Mono,
    monospace;
  color: var(--gold);
}
.scope-item textarea {
  min-height: 70px;
}
.quantity-result {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 15px;
  background: #eaf0e4;
  color: #435b3b;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 15px;
}
.quantity-result.unknown {
  background: #f3ebdc;
  color: #8a6b39;
}
.quantity-result strong {
  font-weight: 400;
  font-size: 15px;
}
.inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.original-note {
  font-size: 13px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  white-space: pre-wrap;
}
.original-note time {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 8px;
}
.capture {
  border: 1px dashed #aeb89d;
  background: #f2f5ed;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
}
.capture textarea {
  margin: 10px 0;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.media-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 7px;
  min-width: 0;
}
.media-card img {
  width: 100%;
  height: 155px;
  object-fit: cover;
  border-radius: 3px;
  background: #e9e8de;
}
.file-icon {
  height: 155px;
  background: #e9e8de;
  display: grid;
  place-items: center;
  color: var(--gold);
  font:
    27px Ivy,
    serif;
}
.media-card p {
  overflow-wrap: anywhere;
  font-size: 12px;
  margin: 12px 0;
}
.media-card .actions button {
  font-size: 11px;
  padding: 7px 10px;
  min-height: 35px;
}
.upload-panel {
  border: 1px dashed #9fab8b;
  padding: 23px;
  border-radius: 7px;
  background: #eaf0e3;
  margin-bottom: 20px;
}
.upload-panel input[type="file"] {
  background: transparent;
  border: 0;
  padding: 0;
  max-width: 100%;
}
.upload-row {
  font-size: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
progress {
  width: 100%;
  height: 6px;
  accent-color: var(--green);
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist li {
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  display: flex;
  gap: 12px;
}
.checklist li:before {
  content: "!";
  color: var(--gold);
  font:
    18px Ivy,
    serif;
}
.checklist .notice:before {
  content: "i";
  color: var(--green);
}
.checklist .required:before {
  color: var(--red);
}
.review-banner {
  padding: 23px;
  background: #e7eddf;
  border: 1px solid #cbd5bf;
  border-radius: 7px;
  margin-bottom: 20px;
}
.version-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.version-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.packet-unit {
  padding: 9px 0;
}
.email-text {
  min-height: 390px;
  font-size: 13px;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-top: 25px;
}
.help-grid p {
  font-size: 12px;
  color: var(--muted);
}
#notice:not(:empty) {
  border: 1px solid #d7bd94;
  border-radius: 5px;
  padding: 15px;
  background: #f9f0dd;
  margin-bottom: 22px;
  font-size: 13px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 640px;
  width: calc(100% - 30px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 27px;
  background: var(--white);
  color: var(--ink);
}
dialog::backdrop {
  background: #171e16bb;
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}
.icon-button {
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 25px;
  min-width: 40px;
  min-height: 40px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: calc(50% + 116px);
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--ink);
  color: white;
  border-radius: 7px;
  box-shadow: 0 5px 30px #0002;
  z-index: 30;
  max-width: 80vw;
  font-size: 13px;
}
#toast:empty {
  display: none;
}
.media-view {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}
.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 25px 0;
}
.account-list {
  font-size: 13px;
}
.file-warning {
  font-size: 11px;
  color: var(--gold);
}
@media (min-width: 1600px) {
  main {
    max-width: 1500px;
    width: 100%;
    margin-inline: auto;
  }
}
@media (max-width: 1150px) {
  .rail {
    width: 200px;
    padding-inline: 20px;
  }
  .logo img {
    width: 160px;
  }
  .shell {
    margin-left: 200px;
  }
  main {
    padding-inline: 28px;
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scope-layout {
    grid-template-columns: 140px minmax(0, 1fr);
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .login-layout {
    gap: 35px;
  }
  .login-card {
    padding: 25px;
  }
}
@media (max-width: 800px) {
  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 19px 22px;
  }
  .logo img {
    width: 140px;
  }
  .rail-label,
  .rail-bottom,
  .rail nav a {
    display: none;
  }
  .rail nav button {
    font-size: 12px;
    padding: 8px;
  }
  .shell {
    margin: 0;
  }
  .topbar {
    padding: 22px;
  }
  .topbar .eyebrow {
    font-size: 9px;
  }
  h1 {
    font-size: 28px;
  }
  .top-actions {
    gap: 3px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  #save-status {
    font-size: 10px;
    max-width: 140px;
  }
  .top-actions button {
    font-size: 12px;
  }
  main {
    padding: 25px 20px 50px;
  }
  .login-layout {
    grid-template-columns: 1fr;
    margin: 15px 0;
    gap: 25px;
  }
  .login-intro h2 {
    font-size: 52px;
  }
  .intro-steps {
    display: none;
  }
  .login-intro > p {
    font-size: 15px;
  }
  .login-card {
    max-width: 500px;
    width: 100%;
    margin: auto;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .page-heading h2 {
    font-size: 36px;
  }
  .stats {
    margin: 24px 0;
  }
  .stats > div {
    padding: 15px;
  }
  .stats small {
    font-size: 10px;
  }
  .stats strong {
    font-size: 27px;
  }
  .jobs {
    grid-template-columns: 1fr;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar label {
    white-space: nowrap;
    font-size: 11px;
  }
  .toolbar input {
    min-width: 0;
  }
  .job-head {
    display: block;
  }
  .job-head h2 {
    font-size: 32px;
  }
  .job-head .actions {
    margin-top: 15px;
  }
  .tabs {
    gap: 24px;
    margin-top: 20px;
  }
  .grid-2,
  .help-grid {
    grid-template-columns: 1fr;
  }
  .scope-layout {
    display: block;
  }
  .units {
    flex-direction: row;
    overflow: auto;
    margin-bottom: 23px;
    padding-bottom: 5px;
  }
  .unit-button {
    white-space: nowrap;
    min-width: 105px;
  }
  .units > .secondary {
    white-space: nowrap;
  }
  .unit-heading h3 {
    font-size: 28px;
  }
  .card {
    padding: 20px;
  }
  .trade > summary {
    padding: 17px;
  }
  .trade-body {
    padding: 16px;
  }
  .grid-3 {
    gap: 12px;
  }
  .inline-pair {
    gap: 12px;
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .media-card {
    padding: 11px;
  }
  .media-card img,
  .file-icon {
    height: 120px;
  }
  .version-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .shell-footer {
    padding: 15px 20px;
    font-size: 10px;
  }
  #toast {
    left: 50%;
  }
  .unit-heading .actions {
    gap: 2px;
  }
  .unit-heading button {
    font-size: 11px;
    padding: 8px;
  }
  .topbar {
    position: sticky;
    top: 0;
    background: #f3f1e9ed;
    backdrop-filter: blur(14px);
    z-index: 6;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .primary,
  .secondary,
  .quiet {
    min-height: 44px;
  }
  .upload-panel {
    padding: 17px;
  }
  .grid-2 > .card + .card {
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  body {
    display: none;
  }
}
.media-library .toolbar h3 { margin: 4px 0; }
.media-filters { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 14px; margin: 18px 0; }
.media-thumbnail { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 5px; overflow: hidden; background: #e9e8de; text-align: left; }
.media-thumbnail img { display: block; height: 200px; transition: transform .2s ease; }
.media-thumbnail:hover img { transform: scale(1.025); }
.media-open-hint { position: absolute; right: 9px; bottom: 9px; background: #252723d9; color: #fff; padding: 6px 9px; border-radius: 5px; font-size: 11px; }
.media-card .file-icon { height: 200px; gap: 12px; align-content: center; font: 14px Apercu, sans-serif; }
.media-card .video-cover { color: #f2e4c2; background: radial-gradient(ellipse at 15% 20%,#58624d,#252723 75%); }
.media-card .pdf-cover { background: linear-gradient(140deg,#eeeadf,#d8d1bf); color: #6c5937; }
.media-symbol { font: 34px Ivy, serif; text-align: center; }
.media-card h4 { font: 17px/1.3 Apercu, sans-serif; margin: 8px 0; overflow-wrap: anywhere; }
.media-card .media-card-unit { font: 10px/1.5 Mono, monospace; color: var(--gold); margin: 14px 0 6px; }
.media-card .actions { margin-top: 12px; }
.media-empty { border: 1px dashed var(--line); }
#media-viewer { width: calc(100% - 36px); max-width: 1200px; padding: 22px; max-height: 94dvh; }
.media-view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 16px; }
.media-view-head h3 { margin: 4px 0; font-size: 27px; overflow-wrap: anywhere; }
.media-view-head .eyebrow { font-size: 9px; }
.media-stage { background: #20231f; border-radius: 6px; display: grid; place-items: center; overflow: auto; min-height: 280px; max-height: 67dvh; color: #fff; }
.media-stage > img { max-width: 100%; max-height: 67dvh; object-fit: contain; display: block; }
.media-stage.is-zoomed { display: block; }
.media-stage.is-zoomed > img { max-width: none; max-height: none; width: auto; }
.media-stage video { display: block; width: 100%; max-height: 67dvh; }
.media-loading { padding: 50px 25px; text-align: center; font-size: 14px; }
.media-loading progress { min-width: 200px; margin-top: 10px; }
.media-caption { white-space: pre-wrap; font-size: 12px; color: var(--muted); margin: 14px 0; }
.media-error { color: var(--red); font-size: 13px; }
.media-view-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.media-view-foot .actions { gap: 8px; align-items: center; }
.media-view-foot button { font-size: 12px; min-height: 40px; }
.media-stage.pdf-stage { display: block; background: #e4e1d8; color: var(--ink); max-height: none; overflow: visible; }
.pdf-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px; }
.pdf-controls > div { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.pdf-controls button { min-width: 42px; min-height: 40px; padding: 6px; }
.pdf-canvas-wrap { max-height: 58dvh; overflow: auto; padding: 0 16px 16px; }
.pdf-canvas-wrap canvas { display: block; margin: auto; box-shadow: 0 2px 16px #25272319; }
.pdf-text { padding: 12px 16px; font-size: 12px; background: #f4f2ec; }
.pdf-text p { white-space: pre-wrap; max-height: 180px; overflow: auto; }
.pdf-links { padding: 0 16px; font-size: 11px; overflow-wrap: anywhere; }
.pdf-links a { display: block; margin-bottom: 8px; }
@media (max-width: 680px) {
  .media-filters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .media-filters label:last-child { grid-column: 1 / -1; }
  .media-thumbnail img, .media-card .file-icon { height: 150px; }
  .media-card h4 { font-size: 13px; }
  .media-card .media-card-unit { font-size: 9px; }
  #media-viewer { width: calc(100% - 12px); padding: 15px; max-height: 96dvh; }
  .media-view-head h3 { font-size: 22px; }
  .media-stage { min-height: 200px; }
  .media-view-foot { display: block; }
  .media-view-foot > .actions + .actions { margin-top: 12px; }
  .media-view-foot button { padding: 9px; }
}
