:root {
  --bg: #e6ecf3;
  --bg-2: #ffffff;
  --line: #d5dee8;
  --cyan: #0ea5e9;
  --cyan-dim: #e5f3fa;
  --brand: #1a429f;
  --brand-hover: #15357f;
  --amber: #1fc16d;
  --amber-dim: #e8f9ef;
  --text: #0f172a;
  --muted: #565656;
  --danger: #d64545;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --font: Inter, system-ui, sans-serif;
  --font-display: Poppins, Inter, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

code {
  font-family: inherit;
  color: var(--brand);
  background: var(--cyan-dim);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.lock {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.lock-frame {
  width: min(440px, 100%);
  padding: 36px 32px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.lock h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.lock-copy { color: var(--muted); line-height: 1.6; }

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.app { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 14px max(32px, env(safe-area-inset-right)) 14px max(32px, env(safe-area-inset-left));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.logo {
  margin: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo img {
  display: block;
  height: 28px;
  width: auto;
}

.lock-logo {
  justify-content: center;
  margin: 0 0 24px;
}

.lock-logo img {
  height: 36px;
}

.lock-form {
  display: grid;
  gap: 16px;
}

.pin-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pin-wrap {
  position: relative;
  min-height: 56px;
}

.pin-wrap input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  font-size: 16px;
}

.pin-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.pin-box {
  width: 46px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.pin-box.is-on {
  border-color: var(--brand);
  background: #fff;
}

.pin-wrap:focus-within .pin-box {
  box-shadow: 0 0 0 3px rgba(26, 66, 159, 0.12);
}

.lock-form .btn {
  width: 100%;
  min-width: 0;
}

.lock-form + .status-line {
  margin-top: 16px;
}

.topbar-actions,
.gallery-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-tools:not([hidden]) {
  margin-left: auto;
}

.gallery-tools:not([hidden]) + .topbar-actions {
  margin-left: 0;
}

.topbar-actions {
  margin-left: auto;
}

.page {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.page-head { margin: 0 0 28px; }

.page-head h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 650;
  overflow-wrap: break-word;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.text-btn {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.page-head-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 16px;
}

.page-head-top h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.page-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.page-head-foot {
  margin-top: 10px;
}

.page-head-foot .lede {
  margin-top: 4px;
}

.ghost-btn.danger {
  color: var(--danger);
  background: #fdecec;
  box-shadow: inset 0 0 0 1px #f4c7c7;
}

.ghost-btn.danger:hover {
  background: #f8d4d4;
  box-shadow: inset 0 0 0 1px #e8a0a0;
}

.project-cover {
  position: relative;
  cursor: pointer;
}

.btn,
.ghost-btn,
.seg-btn,
.lb-close,
.lb-play,
.lb-nav,
.text-btn,
.tag-chip {
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  height: 32px;
  min-height: 32px;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  appearance: none;
}

.btn {
  color: #fff;
  background: var(--brand);
}

.upload-btn {
  position: relative;
  overflow: hidden;
}

.upload-btn input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

.btn:hover { background: var(--brand-hover); }

.btn:disabled,
.ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:disabled:hover { background: var(--brand); }

.ghost-btn:disabled:hover {
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover { background: #b42323; }

.ghost-btn {
  color: var(--text);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.ghost-btn:hover {
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.seg {
  display: flex;
  align-items: center;
  height: 32px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 999px;
  padding: 2px;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
}

.seg-btn.is-on {
  background: var(--cyan-dim);
  color: var(--brand);
  font-weight: 600;
}

.seg-btn:hover { color: var(--brand); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.45);
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(480px, 100%);
  padding: 28px 24px 22px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.field-hint {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 22px;
}

.modal-card textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  margin-bottom: 18px;
  resize: vertical;
  min-height: 76px;
}

.modal-card textarea:focus { border-color: var(--brand); }

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 24px;
}

.tag-chip {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tag-chip.is-on {
  background: var(--cyan-dim);
  color: var(--brand);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--cyan-dim);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

#confirm-copy { margin: 0 0 22px; }

.modal-card label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.modal-card input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  margin-bottom: 18px;
}

.modal-card input:focus { border-color: var(--brand); }

.ares-wrap {
  position: relative;
  margin: 0 0 8px;
}

.ares-wrap input { margin-bottom: 0; }

.ares-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.ares-hit {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.ares-hit:last-child { border-bottom: 0; }

.ares-hit:hover { background: var(--cyan-dim); }

.ares-hit strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.ares-hit span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.ares-status {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.firm-card {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #f4f7fb;
  border-radius: 12px;
}

.firm-card p { margin: 0; }

.firm-name {
  font-weight: 650;
  color: var(--text);
}

.firm-addr {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.firm-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.firm-note-label {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.firm-note p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
}

.firm-card .text-btn {
  margin: 8px 0 0;
  font-size: 13px;
}

.page-head .firm-card {
  margin: 0 0 8px;
  max-width: none;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 0;
  padding: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(26, 66, 159, 0.12);
}

.project-cover,
.project-cover img,
.project-cover-empty {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #dbe7f3;
}

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
}

.project-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.3;
}

.project-foot {
  margin-top: auto;
  padding-top: 10px;
}

.project-firm {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.project-meta {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.project-foot .tag-list {
  margin-top: 8px;
}

.star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #b0b8c4;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.star-btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

.star-btn.is-on svg { fill: currentColor; }

.star-btn:hover,
.star-btn.is-on { color: var(--amber); }

.star-btn.is-on { background: var(--amber-dim); }

.card-frame .star-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

.del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--danger);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.del-btn svg {
  display: block;
  width: 18px;
  height: 18px;
}

.del-btn:hover {
  background: #fdecec;
}

.card-frame .del-btn,
.project-cover .del-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
}

.grid {
  columns: 4 240px;
  column-gap: 18px;
}

.card {
  break-inside: avoid;
  margin: 0 0 18px;
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(26, 66, 159, 0.12);
}

.card.is-ref { outline: 2px solid var(--amber); }

.card-frame {
  position: relative;
  overflow: hidden;
  background: #eef3f8;
}

.card-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.card-num {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
}

.card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.card-dim {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 48px auto 0;
  padding: 36px 28px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.empty h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
}

.empty p { color: var(--muted); line-height: 1.6; }

.empty .btn {
  margin-top: 18px;
  width: auto;
}

.toast {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
}

.upload-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 45;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.upload-bar-copy {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.upload-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ecf3;
}

.upload-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.2s linear;
}

.upload-bar-fill.is-wait {
  background: linear-gradient(90deg, var(--brand) 0%, #6b8fd4 45%, var(--brand) 100%);
  background-size: 200% 100%;
  animation: upload-wait 1.1s linear infinite;
}

@keyframes upload-wait {
  to {
    background-position: -200% 0;
  }
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(26, 66, 159, 0.42);
}

.drop-frame {
  padding: 40px 48px;
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: 56px 1fr 56px;
  background: rgba(15, 23, 42, 0.92);
}

.lightbox[hidden],
.drop-overlay[hidden],
.empty[hidden],
.toast[hidden],
.upload-bar[hidden],
.gallery-tools[hidden],
.topbar-actions[hidden],
.lb-play[hidden],
.btn[hidden] { display: none !important; }

.lb-stage {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 18px 8px 8px;
}

.lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 168px);
  object-fit: contain;
  border-radius: 8px;
}

.lb-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  margin-top: 12px;
  color: #e6ecf3;
  font-size: 13px;
  max-width: 100%;
}

.lb-meta #lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(42vw, 280px);
}

.lb-index {
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.lb-play,
.lb-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.lb-play {
  right: calc(max(16px, env(safe-area-inset-right)) + 48px);
}

.lb-play.is-on {
  color: #fff;
  background: var(--brand);
}

.lb-play svg,
.lb-close svg {
  display: block;
  width: 18px;
  height: 18px;
}

.lb-close {
  right: max(16px, env(safe-area-inset-right));
}

.lb-nav {
  grid-row: 1;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.lb-nav svg {
  display: block;
  width: 28px;
  height: 28px;
}

.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }

.filmstrip {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.filmstrip img {
  height: 64px;
  width: auto;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.7;
}

.filmstrip img.is-on {
  opacity: 1;
  outline: 2px solid var(--amber);
}

@media (hover: none) {
  .project-card:hover,
  .card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
}

@media (max-width: 1100px) {
  .grid { columns: 3 200px; }
}

@media (max-width: 800px) {
  .lock {
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .lock-frame {
    padding: 28px 20px;
  }

  .lock-logo img {
    height: 30px;
  }

  .pin-box {
    width: 42px;
    height: 50px;
    font-size: 24px;
  }

  .topbar {
    padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  }

  .logo img {
    height: 22px;
  }

  .btn,
  .ghost-btn {
    min-width: 0;
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
  }

  .gallery-tools:not([hidden]) {
    flex: 1 1 100%;
    order: 3;
    margin-left: 0;
    justify-content: space-between;
  }

  .page {
    width: calc(100% - 32px);
    padding: 24px 0 48px;
  }

  .page-head {
    margin: 0 0 20px;
  }

  .page-head h1 { font-size: 26px; }

  .lede { font-size: 15px; }

  .page-head-top {
    flex-wrap: wrap;
  }

  .page-head-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .page-head-actions .ghost-btn {
    flex: 0 0 auto;
    width: auto;
  }

  .modal-card {
    width: 100%;
    max-height: min(92dvh, 100%);
    overflow-y: auto;
    padding: 22px 18px 18px;
  }

  .modal-card input,
  .modal-card textarea {
    font-size: 16px;
  }

  .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-actions .btn,
  .modal-actions .ghost-btn {
    width: 100%;
    min-width: 0;
    height: 32px;
    min-height: 32px;
  }

  .empty {
    margin-top: 28px;
    padding: 28px 20px;
  }

  .drop-frame {
    margin: 16px;
    padding: 28px 24px;
  }

  .toast {
    left: 16px;
    right: 16px;
    max-width: none;
  }

  .upload-bar {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .grid { columns: 2 140px; }

  .lightbox {
    grid-template-columns: 1fr;
  }

  .lb-stage {
    grid-column: 1;
    padding: 56px 12px 8px;
  }

  .lb-stage img {
    max-height: calc(100dvh - 200px);
  }

  .lb-nav {
    position: absolute;
    top: 45%;
    z-index: 2;
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.42);
    border-radius: 50%;
  }

  .lb-prev { grid-column: 1; left: 8px; }
  .lb-next { grid-column: 1; right: 8px; }

  .lb-meta #lb-name {
    flex: 1 1 100%;
    max-width: 100%;
    text-align: center;
  }

  .filmstrip img {
    height: 52px;
  }
}

@media (max-width: 520px) {
  .grid { columns: 1; }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .seg {
    flex: 1;
  }

  .seg-btn {
    flex: 1;
    text-align: center;
  }
}
