:root {
  --ink: #25312e;
  --muted: #748078;
  --cream: #f7f5ef;
  --paper: #fffefa;
  --sage: #9eb39d;
  --sage-dark: #51675a;
  --line: #e7e5dc;
  --terracotta: #bd7359;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(135deg, rgba(243, 239, 225, .78), rgba(50, 71, 61, .32)),
    url("assets/login-class.jpg") center/cover no-repeat;
}

.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(2px);
  background: rgba(33, 48, 41, .12);
}

.login-orb {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 50%;
}
.orb-one { width: 280px; height: 280px; left: -100px; bottom: -120px; }
.orb-two { width: 160px; height: 160px; right: 8%; top: 7%; }

.login-card {
  z-index: 2;
  width: min(430px, calc(100% - 32px));
  text-align: center;
  padding: 38px 42px 26px;
  background: rgba(255, 254, 250, .94);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(31, 42, 36, .22);
  backdrop-filter: blur(12px);
}

.brand-mark {
  width: 66px;
  height: 66px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border: 1px solid #b9c2b7;
  border-radius: 50%;
  transform: rotate(-4deg);
}
.brand-mark span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf0e7;
  color: var(--sage-dark);
  font-family: "DM Serif Display", serif;
  font-size: 22px;
}
.brand-mark span { width: 56px; height: 56px; font-family: "Be Vietnam Pro", sans-serif; font-size: 15px; letter-spacing: .05em; }
.eyebrow { margin: 8px 0 4px; color: var(--muted); font-size: 11px; letter-spacing: .28em; }
.login-card h1 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: 46px;
  font-weight: 400;
  line-height: 1.05;
}
.login-subtitle { margin: 8px 0 28px; color: var(--muted); font-size: 14px; }
.login-card form { text-align: left; }
.login-card label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.login-input-wrap input {
  width: 100%;
  height: 50px;
  border: 1px solid #d9ddd4;
  border-radius: 9px;
  background: #fff;
  padding: 0 14px;
  outline: none;
  transition: .2s;
}
.login-input-wrap input:focus { border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(81,103,90,.10); }
.login-error { min-height: 18px; margin: 7px 0 8px; color: #b44e43; font-size: 12px; }
.primary-button {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 9px;
  background: var(--sage-dark);
  color: white;
  font-weight: 700;
  transition: .2s;
}
.primary-button:hover { background: #405447; transform: translateY(-1px); }
.primary-button span { margin-left: 8px; }
.login-note { margin: 18px 0 0; color: #92978f; font-size: 11px; }

.app { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 84px;
  display: grid;
  grid-template-columns: 190px minmax(280px, 560px) auto;
  align-items: center;
  gap: 24px;
  padding: 12px 32px;
  background: rgba(255,254,250,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.app-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mini {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #bbc4b8;
  border-radius: 50%;
  background: #edf0e7;
  color: var(--sage-dark);
  font-family: "DM Serif Display", serif;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 10px;
  font-weight: 700;
}
.app-brand strong, .app-brand small { display: block; }
.app-brand strong { font-family: "DM Serif Display", serif; font-size: 18px; }
.app-brand small { color: var(--muted); font-size: 10px; }

.search-zone { position: relative; align-self: start; padding-top: 5px; }
.search-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.search-row input { min-width: 80px; flex: 1; height: 32px; border: 0; outline: 0; background: transparent; }
.selected-chips { display: flex; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: #edf1ea;
  color: var(--sage-dark);
  font-size: 12px;
  white-space: nowrap;
}
.chip button { border: 0; padding: 0; background: transparent; color: #87938b; }
.clear-search { border: 0; background: transparent; color: #8b918d; font-size: 18px; }
.suggestions {
  position: absolute;
  z-index: 30;
  top: 51px;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 12px 30px rgba(42,52,47,.12);
}
.suggestion-item {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  color: var(--ink);
}
.suggestion-item:hover { background: #f1f3ed; }
.suggestion-strip {
  height: 31px;
  margin-top: 5px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.suggestion-strip::-webkit-scrollbar { display: none; }
.quick-tag {
  flex: 0 0 auto;
  height: 26px;
  border: 1px solid #e3e5df;
  border-radius: 999px;
  background: white;
  color: #657067;
  font-size: 11px;
  padding: 0 10px;
}
.quick-tag.selected { background: var(--sage-dark); border-color: var(--sage-dark); color: white; }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.mode-toggle {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: 8px;
  background: #edf0e9;
}
.mode-option {
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #758076;
  font-size: 11px;
  padding: 0 9px;
  font-weight: 700;
}
.mode-option.active { background: white; color: var(--sage-dark); box-shadow: 0 2px 8px rgba(51,65,57,.08); }
.upload-button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--terracotta);
  color: white;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.upload-button span { font-size: 17px; }
.user-menu { display: flex; flex-direction: column; align-items: flex-end; max-width: 130px; }
.user-menu span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.user-menu button { border: 0; padding: 2px 0; background: transparent; color: #9a786b; font-size: 10px; }

.gallery-shell { max-width: 1500px; margin: 0 auto; padding: 28px 32px 60px; }
.gallery-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.section-kicker { margin: 0 0 3px; color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.gallery-heading h2 { margin: 0; font-family: "DM Serif Display", serif; font-size: 34px; font-weight: 400; }
.result-count { color: var(--muted); font-size: 12px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.media-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  transition: .22s;
}
.media-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(54,66,59,.10); }
.media-preview { position: relative; aspect-ratio: 4 / 3; overflow: hidden; cursor: pointer; background: #dde1d8; }
.media-preview { background: #202722; }
.media-preview img { width: 100%; height: 100%; object-fit: contain; transition: .35s; }
.media-preview video { width: 100%; height: 100%; object-fit: contain; background: #202722; }
.video-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: rgba(38,48,43,.55);
  color: white;
  backdrop-filter: blur(5px);
}
.duration { position: absolute; right: 8px; bottom: 8px; border-radius: 5px; background: rgba(30,38,34,.72); color: white; padding: 3px 6px; font-size: 9px; }
.card-footer { min-height: 62px; display: flex; align-items: center; gap: 5px; padding: 10px 11px; }
.card-tag {
  max-width: 96px;
  height: 25px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0;
  border-radius: 999px;
  background: #f0f2ec;
  color: #667267;
  padding: 0 8px;
  font-size: 10px;
  white-space: nowrap;
}
.card-tag.more { background: #faf4ef; color: #a57866; }
.empty-state { padding: 100px 20px; text-align: center; color: var(--muted); }
.empty-state span { font-size: 36px; }
.empty-state h3 { color: var(--ink); margin: 12px 0 5px; }
.empty-state p { margin: 0; font-size: 13px; }

.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(27,35,31,.66); backdrop-filter: blur(8px); }
.detail-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  height: min(720px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: 70% 30%;
  overflow: hidden;
  border-radius: 14px;
  background: white;
  box-shadow: 0 30px 90px rgba(15,22,18,.35);
}
.modal-close {
  position: absolute;
  z-index: 5;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font-size: 21px;
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
}
.detail-media { position: relative; min-width: 0; overflow: hidden; display: grid; place-items: center; background: #202722; }
.viewer-canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  transform-origin: 50% 50%;
}
.viewer-canvas.can-pan,
.viewer-canvas.can-pan video,
.viewer-canvas.can-pan img { cursor: grab; }
.viewer-canvas.panning,
.viewer-canvas.panning video,
.viewer-canvas.panning img { cursor: grabbing; }
.viewer-canvas img,
.viewer-canvas video { object-fit: contain; transition: transform .12s ease-out; }
.viewer-canvas.panning img,
.viewer-canvas.panning video { transition: none; }
.viewer-controls {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  background: rgba(20,27,23,.72);
  backdrop-filter: blur(8px);
  transition: opacity .25s;
}
.viewer-controls.hidden-controls { opacity: 0; pointer-events: none; }
.viewer-controls button {
  min-width: 38px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: rgba(255,255,255,.10);
  color: white;
  font-size: 13px;
}
#zoomResetButton { min-width: 58px; }
.detail-media:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #111713;
}
.detail-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  grid-template-columns: 1fr;
  border-radius: 0;
  background: #111713;
}
.detail-panel:fullscreen .detail-sidebar,
.detail-panel:fullscreen .modal-close,
.detail-panel:fullscreen .modal-nav { display: none; }
.detail-panel:fullscreen .detail-media {
  width: 100vw;
  height: 100vh;
  background: #111713;
}
.detail-sidebar { position: relative; overflow-y: auto; padding: 32px 24px 20px; }
.detail-label { margin: 0 0 18px; color: #a1a69f; font-size: 10px; letter-spacing: .17em; }
.detail-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.uploader { margin: 12px 0 24px; color: var(--muted); font-size: 12px; }
.uploader strong { color: var(--ink); }
.detail-section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.detail-section-title button { border: 0; background: transparent; color: var(--terracotta); font-size: 11px; }
.detail-tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  border-radius: 999px;
  background: #eef1ea;
  color: #637066;
  padding: 0 9px;
  font-size: 11px;
}
.detail-tag button { border: 0; padding: 0; background: transparent; color: #99a098; }
.tag-editor { display: flex; gap: 6px; margin-top: 8px; }
.tag-editor input { min-width: 0; flex: 1; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; font-size: 11px; }
.tag-editor button { border: 0; border-radius: 7px; background: var(--sage-dark); color: white; font-size: 11px; }
.detail-actions { display: grid; grid-template-columns: 1fr 70px; gap: 8px; margin: 22px 0; }
.detail-actions a, .delete-button { height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); text-decoration: none; font-size: 11px; }
.delete-button { border-color: #efcbc4; color: #b65748; }
.audit { border-top: 1px solid var(--line); padding-top: 14px; }
.audit summary { cursor: pointer; font-size: 12px; font-weight: 700; }
.audit-item { display: grid; grid-template-columns: 6px 1fr; gap: 8px; margin-top: 12px; }
.audit-dot { width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: var(--sage); }
.audit-item strong { display: block; font-size: 10px; }
.audit-item span { color: var(--muted); font-size: 9px; }
.modal-nav { position: absolute; right: 20px; bottom: 16px; display: flex; gap: 5px; }
.modal-nav button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: white; }

.upload-panel {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 30px;
  border-radius: 14px;
  background: var(--paper);
}
.upload-panel h2 { margin: 0 0 20px; font-family: "DM Serif Display", serif; font-size: 30px; font-weight: 400; }
.dropzone {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #bcc5ba;
  border-radius: 10px;
  background: #f7f8f4;
  cursor: pointer;
}
.dropzone input { display: none; }
.dropzone.drag-active {
  border-color: var(--sage-dark);
  background: #edf1e8;
  box-shadow: inset 0 0 0 2px rgba(81,103,90,.12);
}
.dropzone-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; background: #e8ede4; color: var(--sage-dark); font-size: 22px; }
.dropzone strong { font-size: 13px; }
.dropzone small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.upload-preview { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
.upload-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 7px; }
.upload-preview video { width: 96px; height: 72px; object-fit: cover; border-radius: 7px; background: #202722; }
.common-tags { margin-top: 16px; font-size: 12px; }
.upload-tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.upload-tag-search { display: flex; gap: 7px; margin-top: 12px; }
.upload-tag-search input { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 12px; }
.upload-tag-search button { border: 0; border-radius: 7px; background: #edf1ea; color: var(--sage-dark); font-size: 11px; }

.nav-button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.nav-count {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--terracotta);
  color: white;
  font-size: 9px;
}
.filter-panel { margin: -4px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.filter-row { display: flex; align-items: end; gap: 14px; padding: 10px 12px; }
.filter-row.secondary { align-items: center; border-top: 1px solid #f0efe8; padding-block: 7px; }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-label { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.segmented { height: 34px; display: flex; padding: 3px; border-radius: 8px; background: #f0f2ec; }
.segmented button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 10px; font-size: 11px; }
.segmented button.active { background: white; color: var(--sage-dark); box-shadow: 0 2px 8px rgba(50,62,55,.08); }
.date-inputs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.date-inputs input { height: 34px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); padding: 0 8px; font-size: 11px; }
.quick-dates { display: flex; gap: 5px; margin-left: auto; align-self: end; }
.quick-dates button { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #667267; padding: 0 9px; font-size: 10px; }
.check-filter { display: flex; align-items: center; gap: 6px; color: #667267; font-size: 11px; }
.check-filter input { accent-color: var(--sage-dark); }
.reset-button, .undo-button { margin-left: 6px; border: 0; background: transparent; color: #9a786b; font-size: 11px; }
.undo-button { margin-left: auto; color: var(--sage-dark); }
.active-filters { min-height: 0; display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 12px; }
.filter-chip { height: 26px; border: 0; border-radius: 999px; background: #edf1ea; color: #667267; padding: 0 9px; font-size: 10px; }
.filter-chip button { border: 0; background: transparent; color: #8e988f; margin-left: 4px; }
.exact-note { margin: -3px 0 12px; border-radius: 7px; background: #f5f2e8; color: #7b7768; padding: 8px 10px; font-size: 11px; }
.tag-editor, .upload-tag-search { position: relative; }
.editor-suggestions {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 24px rgba(45,55,49,.12);
  padding: 5px;
}
.tag-editor .editor-suggestions { top: 42px; }
.upload-tag-search .editor-suggestions { bottom: 44px; }
.editor-suggestion { width: 100%; height: 34px; border: 0; border-radius: 6px; background: transparent; text-align: left; padding: 0 8px; font-size: 11px; }
.editor-suggestion:hover { background: #f1f3ed; }
.management-panel {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 14px;
  background: var(--paper);
  padding: 30px;
}
.management-heading { display: flex; align-items: center; justify-content: space-between; }
.management-heading h2, .trash-panel h2 { margin: 0; font-family: "DM Serif Display", serif; font-size: 30px; font-weight: 400; }
.small-primary { height: 36px; border: 0; border-radius: 7px; background: var(--sage-dark); color: white; padding: 0 10px; font-size: 11px; }
.tag-create-row { display: flex; gap: 6px; margin: 14px 0 8px; }
.tag-create-row input { flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; }
.tag-create-row button { border: 0; border-radius: 7px; background: var(--terracotta); color: white; padding: 0 12px; }
.tag-manager-search { width: 100%; height: 40px; margin: 12px 0 8px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; }
.tag-manager-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.tag-manager-item { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px 6px 10px; }
.tag-manager-item strong { font-size: 11px; }
.tag-manager-actions { display: flex; gap: 3px; }
.tag-manager-actions button { height: 28px; border: 0; border-radius: 6px; background: #f0f2ec; color: #667267; padding: 0 7px; font-size: 9px; }
.tag-manager-actions button.danger { color: #b65748; }
.trash-note { color: var(--muted); font-size: 11px; }
.trash-list { display: grid; gap: 8px; margin-top: 18px; }
.trash-item { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 7px; }
.trash-item img { width: 82px; height: 58px; object-fit: cover; border-radius: 6px; }
.trash-item video { width: 82px; height: 58px; object-fit: cover; border-radius: 6px; background: #202722; }
.trash-item strong { display: block; font-size: 11px; }
.trash-item span { color: var(--muted); font-size: 10px; }
.trash-actions { display: flex; flex-direction: column; gap: 5px; }
.trash-actions button { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 9px; }
.trash-actions button:last-child { color: #b65748; }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 170px 1fr auto; gap: 12px; padding-inline: 18px; }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .upload-button { width: 42px; padding: 0; font-size: 0; }
  .upload-button span { font-size: 18px; }
  .user-menu { display: none; }
}

@media (max-width: 760px) {
  .login-card { padding-inline: 24px; }
  .topbar {
    min-height: 124px;
    grid-template-columns: 1fr auto;
    grid-template-rows: 48px 58px;
    gap: 4px 8px;
    padding: 8px 12px;
  }
  .app-brand strong { font-size: 16px; }
  .brand-mini { width: 38px; height: 38px; }
  .search-zone { grid-row: 2; grid-column: 1 / -1; width: 100%; padding-top: 3px; }
  .suggestion-strip { display: none; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .mode-toggle { height: 36px; }
  .mode-option { height: 30px; padding-inline: 7px; }
  .upload-button { width: 38px; height: 38px; }
  .gallery-shell { padding: 18px 12px 40px; }
  .gallery-heading h2 { font-size: 28px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .media-card { border-radius: 9px; }
  .card-footer { min-height: 54px; padding: 7px; }
  .card-tag { max-width: 74px; }
  .detail-panel {
    width: 100%;
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: 55% 45%;
    border-radius: 0;
  }
  .detail-sidebar { padding: 20px 16px 70px; }
  .detail-label { margin-bottom: 12px; }
  .uploader { margin-bottom: 14px; }
  .modal-nav { bottom: 12px; }
  .detail-actions { margin: 14px 0; }
  .upload-panel { width: calc(100% - 20px); padding: 24px 16px; }
  .viewer-controls { bottom: 10px; gap: 3px; }
  .viewer-controls button { min-width: 44px; height: 44px; font-size: 16px; }
  #zoomResetButton { min-width: 64px; }
  .filter-row { flex-wrap: wrap; align-items: end; }
  .date-group { width: 100%; }
  .date-inputs { width: 100%; }
  .date-inputs input { min-width: 0; flex: 1; }
  .quick-dates { width: 100%; overflow-x: auto; margin: 0; }
  .filter-row.secondary { flex-wrap: wrap; }
  .tag-manager-list { grid-template-columns: 1fr; }
  .management-panel { width: calc(100% - 20px); padding: 24px 16px; }
  .trash-item { grid-template-columns: 68px 1fr; }
  .trash-actions { grid-column: 1 / -1; flex-direction: row; }
  .trash-actions button { flex: 1; }
}
