:root {
  --ink: #24211d;
  --muted: #746f65;
  --paper: #f7f1e7;
  --paper-strong: #fffaf1;
  --line: rgba(61, 51, 39, 0.14);
  --charcoal: #1f2926;
  --sage: #7f927d;
  --moss: #52644e;
  --clay: #bd7459;
  --clay-dark: #8f4d39;
  --butter: #f2d58a;
  --shadow: 0 24px 70px rgba(49, 39, 28, 0.16);
  --radius: 28px;
  --sans: "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --serif: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 8% 12%, rgba(242, 213, 138, 0.28), transparent 26rem),
    radial-gradient(circle at 88% 2%, rgba(127, 146, 125, 0.22), transparent 24rem),
    linear-gradient(135deg, #fbf6ed 0%, #efe4d2 48%, #e9ddd0 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 33, 29, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  z-index: 0;
}

.login-canvas,
.app-shell,
.public-album,
.public-missing {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.brand-mark small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.brand-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(36, 33, 29, 0.14);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--charcoal), var(--moss));
  font-family: var(--serif);
}

.brand-mark.compact .brand-symbol {
  width: 40px;
  height: 40px;
  border-radius: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--clay-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  min-height: 48px;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--charcoal), #314b41);
  box-shadow: 0 16px 34px rgba(31, 41, 38, 0.2);
  font-weight: 800;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.74);
  font-weight: 800;
}

.text-button {
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.text-button.danger {
  color: var(--clay-dark);
}

.primary-button:disabled,
.secondary-button:disabled,
.text-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.wide {
  width: 100%;
}

.login-canvas {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1.12fr 0.88fr;
}

.login-story {
  display: grid;
  align-items: end;
  padding: clamp(28px, 6vw, 78px);
}

.story-card {
  max-width: 680px;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 42px;
  background:
    linear-gradient(145deg, rgba(255, 250, 241, 0.82), rgba(245, 230, 203, 0.58)),
    radial-gradient(circle at 90% 0%, rgba(189, 116, 89, 0.16), transparent 18rem);
  box-shadow: var(--shadow);
}

.story-card h1 {
  max-width: 620px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.story-card p {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.9;
}

.story-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.story-grid span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.68);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-panel {
  display: grid;
  align-items: center;
  padding: clamp(24px, 5vw, 64px);
}

.login-box {
  width: min(420px, 100%);
  margin-inline: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 250, 241, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  outline: none;
}

input,
select {
  height: 48px;
  padding: 0 14px;
}

textarea {
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(82, 100, 78, 0.52);
  box-shadow: 0 0 0 4px rgba(127, 146, 125, 0.16);
}

.micro-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.58);
  backdrop-filter: blur(18px);
}

.main-nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  display: grid;
  gap: 3px;
  padding: 15px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: var(--muted);
}

.nav-item span {
  color: var(--ink);
  font-weight: 900;
}

.nav-item small {
  font-size: 0.76rem;
}

.nav-item.is-active {
  border-color: var(--line);
  background: rgba(255, 250, 241, 0.78);
  box-shadow: 0 12px 28px rgba(49, 39, 28, 0.08);
}

.rail-note {
  margin-top: auto;
  padding: 18px;
  border-radius: 20px;
  color: #f8f2e7;
  background: linear-gradient(145deg, var(--charcoal), #34423b);
  font-family: var(--serif);
  line-height: 1.7;
}

.main-stage {
  width: min(1240px, 100%);
  margin-inline: auto;
  padding: 30px clamp(20px, 4vw, 54px) 64px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.top-bar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.72);
}

.inline-form {
  margin: 0;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
}

.flash {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: 0 12px 30px rgba(49, 39, 28, 0.08);
  font-weight: 800;
}

.flash-success {
  border-color: rgba(82, 100, 78, 0.25);
  color: var(--moss);
}

.flash-error,
.flash-warning {
  border-color: rgba(189, 116, 89, 0.35);
  color: var(--clay-dark);
}

.hero-board,
.content-card,
.empty-state,
.album-detail-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.78);
  box-shadow: 0 18px 50px rgba(49, 39, 28, 0.1);
}

.hero-board {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 42px);
  background:
    radial-gradient(circle at 88% 18%, rgba(242, 213, 138, 0.34), transparent 18rem),
    rgba(255, 250, 241, 0.8);
}

.hero-board h2,
.content-card h2,
.section-head h2,
.album-detail-hero h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.hero-board p,
.content-card p,
.album-detail-hero p,
.empty-state p {
  color: var(--muted);
  line-height: 1.8;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.stat-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.72);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin: 8px 0;
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
}

.stat-card.accent {
  background: rgba(242, 213, 138, 0.34);
}

.stat-card.dark {
  color: #fff;
  background: linear-gradient(145deg, var(--charcoal), var(--moss));
}

.stat-card.dark span,
.stat-card.dark small {
  color: rgba(255, 255, 255, 0.72);
}

.two-column {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}

.content-card {
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.section-head.standalone {
  margin: 30px 0 16px;
}

.section-head a {
  color: var(--moss);
  font-weight: 900;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 34px;
}

.empty-state.compact {
  margin-top: 18px;
  padding: 22px;
  box-shadow: none;
}

.album-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.album-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.album-row strong,
.album-row small {
  display: block;
}

.album-row small,
.material-card small,
.album-card small {
  color: var(--muted);
}

.status-live,
.status-draft {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
}

.status-live {
  color: #fff;
  background: var(--moss);
}

.status-draft {
  color: var(--clay-dark);
  background: rgba(189, 116, 89, 0.14);
}

.thumb-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.thumb-strip img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  object-fit: cover;
}

.upload-card {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 430px);
  gap: 24px;
  align-items: center;
}

.upload-form {
  display: grid;
  gap: 14px;
}

.upload-form.is-busy {
  opacity: 0.96;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 20px;
  border: 1px dashed rgba(82, 100, 78, 0.44);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.44);
  text-align: center;
  cursor: pointer;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-zone span {
  margin: 0;
  color: var(--ink);
  font-size: 1.06rem;
}

.drop-zone small {
  color: var(--muted);
}

.upload-progress-panel {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(82, 100, 78, 0.22);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.upload-progress-head,
.upload-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-progress-head strong {
  font-size: 0.96rem;
}

.upload-progress-head span,
.upload-progress-meta span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.progress-meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(82, 100, 78, 0.12);
}

.progress-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f6a59, #88a07d);
  transition: width 0.28s ease;
}

.material-grid,
.selectable-grid,
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.material-card,
.select-card,
.album-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.74);
  box-shadow: 0 16px 38px rgba(49, 39, 28, 0.08);
}

.material-card img,
.select-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.material-card div,
.select-card div,
.album-card {
  padding: 16px;
}

.material-card strong,
.select-card strong {
  display: block;
  margin-bottom: 6px;
}

.material-card {
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.material-card.is-selected {
  border-color: rgba(82, 100, 78, 0.58);
  box-shadow: 0 18px 48px rgba(82, 100, 78, 0.18);
  transform: translateY(-2px);
}

.bulk-material-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.material-select-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  cursor: pointer;
}

.material-select-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.material-select-toggle span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(36, 33, 29, 0.08);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.92);
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(49, 39, 28, 0.14);
}

.material-card.is-selected .material-select-toggle span {
  color: #fff;
  background: var(--moss);
}

.material-preview-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.material-preview-trigger img {
  transition: transform 0.2s ease;
}

.material-preview-trigger:hover img {
  transform: scale(1.02);
}

.material-card-body {
  display: grid;
  gap: 8px;
  height: 100%;
}

.material-card-actions {
  margin-top: auto;
}

.material-usage-note {
  line-height: 1.6;
}

.danger-text {
  color: var(--clay-dark);
}

body.has-modal {
  overflow: hidden;
}

.material-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.material-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(24, 19, 14, 0.72);
  cursor: zoom-out;
}

.material-preview-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(96vw, 1180px);
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  background: rgba(28, 30, 28, 0.95);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.material-preview-close {
  justify-self: end;
}

.material-preview-sheet img {
  width: 100%;
  max-height: min(78vh, 980px);
  border-radius: 22px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}

.material-preview-sheet figcaption {
  display: grid;
  gap: 4px;
  padding: 0;
}

.material-preview-sheet figcaption strong {
  color: #fff;
  font-size: 1rem;
}

.material-preview-sheet figcaption small {
  color: rgba(255, 255, 255, 0.72);
}

.form-card {
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.wide-field {
  grid-column: 1 / -1;
}

.selection-pill {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  font-weight: 900;
}

.select-card {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.select-card label {
  position: relative;
  display: block;
  cursor: pointer;
}

.select-card input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.86);
  font-size: 0.74rem;
  font-weight: 900;
}

.select-card.is-selected {
  border-color: rgba(82, 100, 78, 0.58);
  box-shadow: 0 18px 48px rgba(82, 100, 78, 0.18);
  transform: translateY(-2px);
}

.select-card.is-selected .check-mark {
  color: #fff;
  background: var(--moss);
}

.album-card {
  display: grid;
  gap: 14px;
}

.album-card-top,
.album-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.album-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
}

.album-card p {
  margin: 0;
  color: var(--muted);
}

.album-meta span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.album-detail-hero {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 390px);
  gap: 24px;
  align-items: start;
  padding: clamp(24px, 4vw, 42px);
}

.album-detail-hero.theme-gallery {
  background: linear-gradient(145deg, rgba(31, 41, 38, 0.94), rgba(82, 100, 78, 0.86));
  color: #fff;
}

.album-detail-hero.theme-gallery p,
.album-detail-hero.theme-gallery .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.album-detail-hero.theme-letter {
  background:
    linear-gradient(90deg, rgba(189, 116, 89, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(189, 116, 89, 0.12) 1px, transparent 1px),
    rgba(255, 250, 241, 0.86);
  background-size: 28px 28px;
}

.client-name {
  color: var(--clay-dark);
  font-weight: 900;
}

.share-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.8);
  color: var(--ink);
}

.album-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.album-preview-grid figure,
.public-gallery figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 241, 0.78);
  box-shadow: 0 18px 48px rgba(49, 39, 28, 0.1);
}

.album-preview-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

figcaption {
  padding: 16px 18px 18px;
  color: var(--muted);
  line-height: 1.7;
}

.public-page {
  background:
    radial-gradient(circle at 78% 0%, rgba(242, 213, 138, 0.28), transparent 26rem),
    linear-gradient(135deg, #fbf7ef 0%, #efe4d8 100%);
}

.public-page.theme-gallery {
  background:
    radial-gradient(circle at 70% 0%, rgba(127, 146, 125, 0.24), transparent 24rem),
    linear-gradient(145deg, #e6dfd4 0%, #f8f1e7 100%);
}

.public-page.theme-letter {
  background:
    linear-gradient(90deg, rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    #f8f0e3;
  background-size: 34px 34px;
}

.public-album {
  width: min(1120px, calc(100% - 34px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 60px) 0;
}

.public-hero {
  display: grid;
  justify-items: center;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 42px;
  background: rgba(255, 250, 241, 0.76);
  box-shadow: var(--shadow);
  text-align: center;
}

.public-hero h1 {
  max-width: 820px;
  margin: 26px 0 12px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.public-client {
  color: var(--clay-dark);
  font-weight: 900;
}

.public-message {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.95;
}

.public-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.public-meta span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-weight: 800;
}

.public-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.public-gallery figure.featured {
  grid-column: 1 / -1;
}

.public-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.public-gallery figure.featured img {
  aspect-ratio: 16 / 9;
}

.public-footer,
.public-missing {
  margin-top: 28px;
  color: var(--muted);
  text-align: center;
}

.public-missing {
  width: min(620px, calc(100% - 32px));
  margin: 16vh auto 0;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 250, 241, 0.82);
  box-shadow: var(--shadow);
}

.public-missing .brand-mark {
  justify-content: center;
}

@media (max-width: 980px) {
  .login-canvas,
  .app-shell,
  .upload-card,
  .album-detail-hero,
  .two-column {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid,
  .material-grid,
  .selectable-grid,
  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .login-story,
  .login-panel {
    padding: 18px;
  }

  .story-card,
  .login-box,
  .public-hero {
    border-radius: 28px;
  }

  .top-bar,
  .hero-board,
  .section-head,
  .user-chip {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav,
  .stat-grid,
  .material-grid,
  .selectable-grid,
  .album-grid,
  .album-preview-grid,
  .public-gallery,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .public-gallery figure.featured img {
    aspect-ratio: 4 / 3;
  }

  .main-stage {
    padding-inline: 16px;
  }

  .section-actions,
  .bulk-material-form {
    width: 100%;
    justify-content: flex-start;
  }

  .material-preview-modal {
    padding: 14px;
  }

  .material-preview-sheet {
    width: 100%;
    max-height: calc(100vh - 28px);
    padding: 14px;
  }
}
