@charset "UTF-8";
:root {
  color-scheme: light;
  --bg: #edf4f8;
  --surface: #fff;
  --interactive: #f5f9fb;
  --text: #173a53;
  --secondary: #49677b;
  --muted: #6f899a;
  --accent: #1f6696;
  --soft: #7eacc7;
  --border: #c9dae4;
  --hover: #e5eff5;
  --selected: #dfedf5;
  --danger: #9b3543;
  --shadow: 0 8px 32px #173a5308;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #132f40;
    --surface: #203f53;
    --interactive: #23465d;
    --text: #e0e9ef;
    --secondary: #aec1ce;
    --muted: #87a5b7;
    --accent: #a7d9f6;
    --soft: #87a5b7;
    --border: #35586c;
    --hover: #23465d;
    --selected: #2c536c;
    --danger: #ffb1b9;
    --shadow: 0 8px 32px #0e24300c;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
svg.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
dialog:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 12px;
  padding: 12px 20px;
  background: var(--surface);
  z-index: 200;
}
.skip-link:focus {
  top: 12px;
}
.startup {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--secondary);
}
.noscript {
  padding: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  width: 43px;
  height: 43px;
}
.brand strong {
  font-size: 22px;
  letter-spacing: -0.8px;
  font-weight: 720;
}
.brand span {
  color: var(--accent);
}
.shell {
  min-height: 100dvh;
}
.sidebar {
  position: fixed;
  width: 228px;
  top: 0;
  bottom: 0;
  left: 0;
  padding: 34px 22px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 15;
}
.sidebar .brand {
  margin: 0 3px 56px;
}
.nav-label,
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--muted);
}
.nav-label {
  padding: 0 15px;
  margin-bottom: 12px;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 5px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 550;
  color: var(--secondary);
}
.nav-item:hover {
  background: var(--hover);
}
.nav-item.active {
  background: var(--selected);
  color: var(--accent);
}
.nav-item .icon {
  width: 19px;
  height: 19px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 32px;
}
.privacy-note {
  display: flex;
  gap: 10px;
  padding: 17px 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.privacy-note .icon {
  width: 17px;
  margin-top: 2px;
}
.content {
  margin-left: 228px;
}
.topbar {
  height: 88px;
  padding: 0 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar .brand {
  display: none;
}
.breadcrumb {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--secondary);
  min-width: 0;
}
.breadcrumb .icon {
  width: 15px;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb .current {
  color: var(--text);
  font-weight: 600;
}
.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.private-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.private-tag .icon {
  width: 14px;
  height: 14px;
}
.btn {
  min-height: 43px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn:hover {
  background: var(--hover);
}
.btn .icon {
  width: 17px;
  height: 17px;
}
.btn.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
.btn.primary:hover {
  filter: brightness(0.95);
}
.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--secondary);
}
.btn.quiet:hover {
  background: var(--hover);
}
.btn.danger {
  color: var(--danger);
}
.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.icon-button:hover {
  background: var(--hover);
}
.main {
  padding: 44px 48px 48px;
  max-width: 1800px;
  margin: auto;
}
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.hero .eyebrow {
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero .eyebrow:before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--soft);
  border-radius: 50%;
}
h1 {
  font-size: 38px;
  letter-spacing: -1.4px;
  line-height: 1.2;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.hero .subtitle {
  margin-top: 12px;
  font-size: 14px;
  color: var(--secondary);
}
.hero-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 7px;
  align-items: center;
  padding-bottom: 3px;
  white-space: nowrap;
}
.hero-meta .icon {
  width: 15px;
  height: 15px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}
.search {
  position: relative;
  max-width: 280px;
  width: 100%;
}
.search .icon {
  position: absolute;
  left: 13px;
  top: 13px;
  color: var(--muted);
  width: 17px;
  height: 17px;
}
.search input {
  width: 100%;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px 10px 39px;
  font-size: 13px;
  color: var(--text);
}
input::placeholder {
  color: var(--muted);
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.count-label {
  font-size: 12px;
  color: var(--muted);
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.album-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  min-width: 0;
  transition:
    border-color 0.18s,
    transform 0.18s;
  position: relative;
}
.album-card:hover {
  border-color: var(--soft);
  transform: translateY(-3px);
}
.cover {
  aspect-ratio: 1.45;
  background: var(--hover);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--soft);
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.album-card:hover .cover img {
  transform: scale(1.035);
}
.cover > .icon {
  width: 50px;
  height: 50px;
  stroke-width: 1.2;
}
.cover .folder-badge {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: #173a53cc;
  color: #edf4f8;
  border: 1px solid #edf4f840;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
}
.folder-badge .icon {
  width: 12px;
  height: 12px;
}
.album-details {
  padding: 18px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.album-details h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}
.album-details p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.album-details > .icon {
  width: 16px;
  color: var(--muted);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 34px 0 19px;
  gap: 12px;
}
.section-heading h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.4px;
}
.section-heading p {
  font-size: 12px;
  color: var(--muted);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.media-tile {
  position: relative;
  aspect-ratio: 1;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.media-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}
.media-tile:hover img {
  transform: scale(1.045);
}
.media-tile > .icon {
  width: 42px;
  height: 42px;
  color: var(--soft);
  stroke-width: 1.2;
}
.media-tile.selected {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.select-mark {
  position: absolute;
  top: 11px;
  right: 11px;
  background: #edf4f8de;
  border: 1px solid #49677b8c;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  color: #173a53;
  display: flex;
  align-items: center;
  justify-content: center;
}
.select-mark .icon {
  width: 17px;
  height: 17px;
}
.selected .select-mark {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
.video-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: #173a53d9;
  color: #edf4f8;
  display: flex;
  gap: 5px;
  align-items: center;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 10px;
}
.video-badge .icon {
  width: 13px;
  height: 13px;
}
.media-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 22px 10px 9px;
  background: linear-gradient(transparent, #173a53bb);
  color: #fff;
  font-size: 11px;
  text-align: left;
  opacity: 0;
}
.media-tile:hover .media-name,
.media-tile:focus-visible .media-name {
  opacity: 1;
}
.selection-bar {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: calc(50% + 114px);
  transform: translateX(-50%);
  z-index: 25;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
  white-space: nowrap;
}
.selection-bar strong {
  font-size: 13px;
}
.footer {
  margin-top: 48px;
  padding-top: 21px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}
.footer span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer .icon {
  width: 12px;
  height: 12px;
}
.load-more {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}
.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: center;
  padding: 70px 24px;
  color: var(--secondary);
}
.empty img {
  width: 90px;
  height: 90px;
  margin-bottom: 20px;
  opacity: 0.85;
}
.empty > .icon {
  width: 48px;
  height: 48px;
  color: var(--soft);
  margin-bottom: 18px;
}
.empty h2 {
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 9px;
}
.empty p {
  max-width: 440px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.8;
}
.empty .btn {
  margin-top: 20px;
}
.skeleton {
  background: var(--border);
  animation: pulse 1.8s ease-in-out infinite;
}
.skeleton-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.skeleton-card .cover {
  background: var(--border);
}
.skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: var(--border);
  margin: 20px;
  width: 58%;
}
.skeleton-line.small {
  width: 35%;
  margin-top: -7px;
  margin-bottom: 22px;
  height: 9px;
}
@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}
.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
.auth-story {
  background: var(--bg);
  padding: 52px 64px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.auth-story .story-body {
  margin: auto 0;
  max-width: 490px;
  padding: 42px 0;
}
.auth-illustration {
  width: 180px;
  height: 180px;
  margin-bottom: 30px;
}
.auth-story h1 {
  font-size: 48px;
  line-height: 1.18;
  letter-spacing: -1.8px;
}
.auth-story .story-body p {
  margin-top: 20px;
  color: var(--secondary);
  font-size: 16px;
  max-width: 350px;
  line-height: 1.8;
}
.auth-story footer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.auth-story footer .icon {
  width: 15px;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 40px;
}
.auth-form {
  width: 100%;
  max-width: 350px;
}
.auth-form > .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 24px;
  color: var(--accent);
}
.auth-form h2 {
  font-size: 29px;
  letter-spacing: -0.9px;
  font-weight: 650;
  margin-bottom: 9px;
}
.auth-form > p {
  color: var(--secondary);
  font-size: 14px;
  margin-bottom: 32px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
}
.field input,
.field select {
  width: 100%;
  height: 47px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--interactive);
  padding: 10px 13px;
  color: var(--text);
}
.field small {
  color: var(--muted);
  font-size: 12px;
}
.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--secondary);
  min-height: 44px;
}
.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.auth-form .btn.primary {
  width: 100%;
  margin-top: 20px;
  min-height: 48px;
  font-size: 14px;
}
.auth-form .auth-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.auth-note .icon {
  width: 13px;
  height: 13px;
}
.error-message {
  color: var(--danger);
  background: var(--bg);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}
.setup-code {
  display: block;
  background: var(--bg);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  overflow: auto;
  margin-top: 20px;
}
.toast {
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow);
  z-index: 150;
  max-width: calc(100% - 32px);
  text-align: center;
}
.modal {
  width: min(480px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  max-height: 90dvh;
}
.modal::backdrop {
  background: #132f4066;
  backdrop-filter: blur(4px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 6px;
}
.modal-header h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
}
.modal-header .icon-button {
  border: 0;
  background: transparent;
}
.modal > p {
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 25px;
}
.modal .btn.primary {
  width: 100%;
  margin-top: 18px;
  min-height: 46px;
}
.share-url {
  width: 100%;
  background: var(--interactive);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  margin: 10px 0;
}
.share-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.share-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 21px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.share-card h3 {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.share-card p {
  color: var(--secondary);
  font-size: 12px;
  margin-top: 6px;
}
.share-card .share-label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}
.share-label .icon {
  width: 13px;
  height: 13px;
}
.viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  color: #e0e9ef;
  background: #132f40;
  overflow: hidden;
}
.viewer::backdrop {
  background: #132f40;
}
.viewer-header {
  height: 80px;
  padding: env(safe-area-inset-top) 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: #132f40f0;
}
.viewer-title {
  min-width: 0;
  padding: 12px 0;
}
.viewer-title strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-title span {
  font-size: 11px;
  color: #87a5b7;
}
.viewer-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}
.viewer .icon-button {
  border-color: transparent;
  background: transparent;
  color: #e0e9ef;
}
.viewer .icon-button:hover {
  background: #23465d;
}
.viewer-stage {
  position: absolute;
  inset: 80px 72px 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  touch-action: pan-y pinch-zoom;
}
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  border-radius: 3px;
}
.viewer-stage.zoomed {
  display: block;
  cursor: zoom-out;
  overscroll-behavior: contain;
}
.viewer-stage.zoomed img {
  max-width: none;
  max-height: none;
  width: 200%;
  display: block;
}
.viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  outline: none;
}
.viewer-error {
  max-width: 420px;
  text-align: center;
  color: #aec1ce;
  padding: 25px;
}
.viewer-error .icon {
  width: 36px;
  height: 36px;
  margin-bottom: 15px;
}
.viewer-error p {
  margin: 12px 0 20px;
  font-size: 14px;
}
.viewer-error a {
  color: #a7d9f6;
  text-decoration: underline;
}
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.viewer-nav.prev {
  left: 15px;
}
.viewer-nav.next {
  right: 15px;
}
.viewer-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 54px;
  padding: 8px 24px max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #aec1ce;
  gap: 15px;
}
.viewer-footer .key-hint {
  font-size: 11px;
  color: #87a5b7;
}
.loading-photo {
  position: absolute;
  width: 27px;
  height: 27px;
  border: 2px solid #35586c;
  border-top-color: #a7d9f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.mobile-nav {
  display: none;
}
.offline-notice {
  padding: 12px 20px;
  font-size: 13px;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--secondary);
}
.content.without-sidebar {
  margin-left: 0;
}
.without-sidebar .main {
  max-width: 1320px;
}
.viewing {
  overflow: hidden;
}
/* The palette's muted blue is reserved for decoration; small text uses slate
   for readable contrast in both appearances. Interactive targets are >=44px. */
.nav-label,
.eyebrow,
.privacy-note,
.private-tag,
.hero-meta,
.count-label,
.album-details p,
.section-heading p,
.footer,
.field small,
.share-note,
.share-label,
.auth-form .auth-note,
.auth-story footer {
  color: var(--secondary);
}
.btn {
  min-height: 44px;
}
.viewer-actions .icon-button {
  min-width: 44px;
  min-height: 44px;
}
@media (min-width: 1600px) {
  .album-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .media-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 208px;
    padding: 32px 16px;
  }
  .content {
    margin-left: 208px;
  }
  .topbar {
    padding: 0 30px;
  }
  .main {
    padding: 36px 30px;
  }
  .album-grid {
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .selection-bar {
    left: calc(50% + 104px);
  }
}
@media (max-width: 800px) {
  .sidebar {
    display: none;
  }
  .content {
    margin-left: 0;
  }
  .topbar {
    height: 78px;
    padding: env(safe-area-inset-top) 24px 0;
  }
  .topbar .brand {
    display: flex;
  }
  .topbar .brand strong {
    font-size: 20px;
  }
  .topbar .brand img {
    width: 37px;
    height: 37px;
  }
  .topbar .breadcrumb {
    display: none;
  }
  .private-tag {
    display: none;
  }
  .main {
    padding: 30px 24px 104px;
  }
  .hero {
    margin-bottom: 26px;
  }
  .hero-meta {
    display: none;
  }
  h1 {
    font-size: 32px;
    letter-spacing: -1px;
  }
  .hero .eyebrow {
    font-size: 9px;
  }
  .hero .subtitle {
    font-size: 13px;
    line-height: 1.7;
  }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    padding: 8px 24px max(9px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    gap: 10px;
  }
  .mobile-nav button {
    flex: 1;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    color: var(--muted);
    border-radius: 8px;
    font-size: 10px;
    min-height: 48px;
  }
  .mobile-nav button.active {
    color: var(--accent);
    background: var(--selected);
  }
  .mobile-nav .icon {
    width: 21px;
    height: 21px;
  }
  .selection-bar {
    left: 50%;
    bottom: calc(80px + env(safe-area-inset-bottom));
    gap: 12px;
  }
  .auth-story {
    padding: 40px;
  }
  .auth-story h1 {
    font-size: 38px;
  }
  .auth-story .auth-illustration {
    width: 130px;
    height: 130px;
  }
  .auth-panel {
    padding: 40px 28px;
  }
  .auth-story .story-body p {
    font-size: 14px;
  }
  .footer {
    flex-wrap: wrap;
  }
  .toolbar .count-label {
    display: none;
  }
}
@media (max-width: 560px) {
  .main {
    padding: 28px 18px 110px;
  }
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
  .top-actions .btn {
    padding: 10px 12px;
    min-height: 44px;
    font-size: 12px;
  }
  .album-grid {
    gap: 14px;
  }
  .cover {
    aspect-ratio: 1.18;
  }
  .album-details {
    padding: 13px 12px 15px;
  }
  .album-details h3 {
    font-size: 13px;
    letter-spacing: -0.2px;
  }
  .album-details p {
    font-size: 10px;
    line-height: 1.7;
  }
  .album-details > .icon {
    display: none;
  }
  .folder-badge {
    display: none !important;
  }
  .toolbar {
    gap: 10px;
    flex-wrap: wrap;
  }
  .search {
    max-width: none;
    flex: 1;
    min-width: 155px;
  }
  .toolbar-actions {
    gap: 5px;
  }
  .toolbar-actions .btn {
    padding: 10px 11px;
    font-size: 12px;
  }
  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .media-tile {
    border-radius: 8px;
  }
  .video-badge {
    left: 6px;
    bottom: 6px;
    font-size: 9px;
    padding: 3px 5px;
  }
  .select-mark {
    top: 7px;
    right: 7px;
    width: 23px;
    height: 23px;
  }
  .selection-bar {
    padding: 9px 11px;
    gap: 9px;
    width: calc(100% - 36px);
    justify-content: space-between;
  }
  .selection-bar .btn {
    padding: 10px 12px;
    font-size: 12px;
  }
  .selection-bar strong {
    font-size: 12px;
  }
  .selection-bar .icon-button {
    width: 35px;
  }
  .hero {
    gap: 12px;
    align-items: flex-start;
  }
  .hero .subtitle {
    max-width: 300px;
  }
  .hero .hero-buttons {
    display: flex;
    gap: 6px;
    flex-direction: column;
  }
  .hero-buttons .btn {
    padding: 9px 11px;
    min-height: 44px;
  }
  .hero-buttons .btn span {
    display: none;
  }
  .empty {
    padding: 50px 20px;
  }
  .empty h2 {
    font-size: 20px;
  }
  .empty p {
    font-size: 13px;
  }
  .auth-page {
    display: flex;
    flex-direction: column;
    background: var(--bg);
  }
  .auth-story {
    padding: 28px 26px 0;
    border: 0;
  }
  .auth-story .brand img {
    width: 37px;
    height: 37px;
  }
  .auth-story .brand strong {
    font-size: 20px;
  }
  .auth-story .story-body {
    padding: 30px 0 25px;
  }
  .auth-story .auth-illustration {
    display: none;
  }
  .auth-story h1 {
    font-size: 36px;
    max-width: 300px;
  }
  .auth-story .story-body p {
    margin-top: 12px;
    max-width: 290px;
    font-size: 13px;
  }
  .auth-story footer {
    display: none;
  }
  .auth-panel {
    padding: 8px 26px 50px;
    background: var(--bg);
  }
  .auth-form {
    background: var(--surface);
    padding: 27px 23px;
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 440px;
  }
  .auth-form > .icon {
    display: none;
  }
  .auth-form h2 {
    font-size: 24px;
  }
  .auth-form > p {
    font-size: 13px;
    margin-bottom: 25px;
  }
  .auth-form .auth-note {
    font-size: 10px;
  }
  .viewer-header {
    height: 82px;
    padding-left: 12px;
    padding-right: 8px;
    gap: 6px;
  }
  .viewer-actions {
    gap: 0;
  }
  .viewer-actions .icon-button {
    width: 39px;
  }
  .viewer-actions .fullscreen-control {
    display: none;
  }
  .viewer-stage {
    inset: 85px 0 76px;
  }
  .viewer-nav {
    top: auto;
    bottom: 17px;
    transform: none;
  }
  .viewer-nav.prev {
    left: 15px;
  }
  .viewer-nav.next {
    right: 15px;
  }
  .viewer-footer {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    pointer-events: none;
  }
  .viewer-footer .key-hint {
    display: none;
  }
  .share-card {
    padding: 17px;
    gap: 12px;
  }
  .share-card .btn {
    padding: 10px 11px;
  }
  .modal {
    padding: 23px;
  }
  .section-heading {
    margin-top: 28px;
  }
  .topbar .brand {
    gap: 7px;
  }
}
.admin-shell { max-width: 1000px; margin: auto; padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; margin-bottom: 24px; }
.admin-card h2 { margin: 0 0 12px; font-size: 23px; }
.admin-card p { color: var(--secondary); line-height: 1.65; }
.admin-card fieldset { border: 0; padding: 16px 0 0; margin: 12px 0 0; border-top: 1px solid var(--border); }
.admin-card legend { font-weight: 600; padding: 12px 0 0; }
.admin-card fieldset:disabled { opacity: .65; }
.expiration-options { display: flex; gap: 12px 28px; flex-wrap: wrap; }
.admin-card .checkbox { min-height: 44px; margin: 8px 0; }
.admin-card .settings-note { font-size: 14px; }
.settings-save { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.settings-save p { flex: 1; min-width: 180px; color: var(--secondary); }
.admin-gate { max-width: 560px; margin: auto; padding: max(32px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom)); }
.admin-gate-brand { margin: 18px 0 38px; }
.admin-gate .auth-form { max-width: none; }
.admin-gate h1 { font-size: 30px; margin: 12px 0; }
@media (max-width: 560px) {
  .admin-shell { padding: 20px max(16px, env(safe-area-inset-left)); }
  .admin-header .brand strong { font-size: 22px; }
  .admin-header .toolbar-actions { gap: 8px; }
  .admin-card { padding: 22px; }
  .admin-shell .hero { padding-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 400px) {
  .selection-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
    gap: 7px;
  }
  .selection-bar strong {
    grid-column: 1 / 3;
  }
  .selection-bar > .icon-button {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
  }
  .selection-bar > .btn {
    grid-row: 2;
  }
  .selection-bar > .btn.primary {
    grid-column: 2 / 4;
  }
  .toolbar-actions .btn {
    min-height: 44px;
  }
}
