:root {
  --paper: #f2ede3;
  --paper-deep: #e8e0d3;
  --paper-light: #fbf8f1;
  --ink: #201e1b;
  --ink-soft: #625e56;
  --line: rgba(32, 30, 27, 0.17);
  --line-strong: rgba(32, 30, 27, 0.34);
  --accent: #cf4c2f;
  --accent-dark: #a73521;
  --sage: #687869;
  --sage-light: #dce3d8;
  --white: #fffdf8;
  --danger: #9e2f2f;
  --shadow: 0 24px 70px rgba(48, 39, 28, 0.17);
  --serif: "Iowan Old Style", "Baskerville", "Palatino Linotype", "Songti SC",
    "STSong", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(46, 39, 30, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 39, 30, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legal-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.legal-links a {
  text-underline-offset: 3px;
}

.legal-page {
  padding: 32px 18px 64px;
}

.legal-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 54px);
  background: var(--paper-light);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 42px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}

.legal-brand .brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--paper-light);
  background: var(--accent);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.legal-kicker {
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-shell h1 {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 500;
  line-height: 0.98;
}

.legal-lead {
  max-width: 58ch;
  margin: 0 0 34px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.75;
}

.legal-shell h2 {
  margin: 32px 0 10px;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.legal-shell p,
.legal-shell li {
  line-height: 1.75;
}

.legal-shell ul {
  padding-left: 1.25rem;
}

.legal-meta {
  margin-top: 42px;
  padding-top: 20px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-transform: uppercase;
}

.button,
.text-button,
.icon-button,
.avatar-button,
.sidebar-link,
.round-action,
.view-toggle {
  border: 0;
  background: none;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button svg {
  width: 18px;
  height: 18px;
}

.button-primary {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-ink {
  min-height: 42px;
  color: var(--paper-light);
  background: var(--ink);
  border-color: var(--ink);
}

.button-ink:hover {
  background: #000;
}

.text-button {
  padding: 10px 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.icon-button:hover {
  background: rgba(32, 30, 27, 0.07);
  border-color: var(--line);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.15fr) minmax(410px, 0.85fr);
  overflow: hidden;
}

.login-collage {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 6vw, 96px);
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.25) 0 9%, transparent 9.4%),
    linear-gradient(143deg, #7f8b75 0%, #aeb89d 54%, #d7d2bd 100%);
  isolation: isolate;
}

.login-collage::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 57%, rgba(28, 31, 24, 0.16) 57.2% 57.6%, transparent 57.8%),
    repeating-linear-gradient(0deg, transparent 0 89px, rgba(255, 255, 255, 0.07) 90px);
  content: "";
  mix-blend-mode: overlay;
}

.login-collage::after {
  position: absolute;
  z-index: -1;
  right: -18%;
  bottom: -38%;
  width: 90%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  content: "";
}

.collage-copy {
  position: absolute;
  top: 38px;
  right: 42px;
  left: 42px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.74);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.collage-card {
  position: relative;
  margin: 0;
  box-shadow: 0 30px 70px rgba(37, 38, 29, 0.23);
}

.collage-card-main {
  width: min(72%, 590px);
  aspect-ratio: 4 / 5;
  padding: 16px 16px 56px;
  background: #fcf9f1;
  transform: rotate(-4.5deg) translateX(4%);
}

.collage-card-main::after {
  position: absolute;
  inset: 16px 16px 56px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 50%);
  content: "";
}

.puppy-illustration {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-sun {
  position: absolute;
  top: 16%;
  right: 13%;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f0ad66;
  box-shadow: 0 0 0 20px rgba(240, 173, 102, 0.12);
}

.collage-hill {
  position: absolute;
  right: 16px;
  bottom: 56px;
  left: 16px;
  height: 66%;
  overflow: hidden;
  background: linear-gradient(180deg, #c6c2a0 0 21%, #5e705f 21.3% 58%, #34463a 58.2%);
  clip-path: polygon(0 35%, 28% 17%, 55% 38%, 76% 10%, 100% 29%, 100% 100%, 0 100%);
}

.collage-hill::before,
.collage-hill::after {
  position: absolute;
  bottom: 17%;
  width: 5%;
  height: 30%;
  background: #24342c;
  content: "";
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.collage-hill::before {
  left: 31%;
}

.collage-hill::after {
  right: 24%;
  height: 38%;
}

.collage-card figcaption {
  position: absolute;
  bottom: 18px;
  left: 16px;
  font-family: var(--serif);
  font-size: 0.98rem;
  font-style: italic;
}

.collage-card-small {
  position: absolute;
  right: 7%;
  bottom: 13%;
  display: grid;
  width: min(26%, 190px);
  aspect-ratio: 3 / 4;
  place-items: center;
  padding: 16px;
  color: #f8ede4;
  background:
    radial-gradient(circle at 60% 34%, #e2a877 0 16%, transparent 16.4%),
    linear-gradient(152deg, #934b36, #632f28);
  transform: rotate(7deg);
}

.collage-card-small span {
  align-self: end;
  justify-self: start;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.5;
}

.collage-note {
  position: absolute;
  bottom: 8%;
  left: 8%;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--serif);
  font-size: clamp(0.9rem, 1.2vw, 1.08rem);
  line-height: 1.8;
}

.login-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(46px, 7vw, 110px);
  background:
    linear-gradient(90deg, rgba(43, 36, 27, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 100%;
}

.login-brand,
.app-brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
}

.login-brand {
  position: absolute;
  top: 44px;
  left: clamp(46px, 7vw, 110px);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--accent);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  transform: rotate(-7deg);
}

.brand-word {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-sub {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.login-copy {
  max-width: 570px;
}

.login-copy h1 {
  margin: 18px 0 20px;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 4vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.login-copy > p:last-child {
  max-width: 420px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.8;
}

.login-form {
  width: min(100%, 520px);
  margin-top: 38px;
}

.login-form > label,
.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.password-row {
  display: flex;
  gap: 10px;
}

.password-row input {
  min-width: 0;
  flex: 1;
}

input,
select {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: 0;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

input:focus,
select:focus {
  background: var(--white);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(207, 76, 47, 0.13);
}

.form-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
}

.login-footnote {
  position: absolute;
  right: clamp(46px, 7vw, 110px);
  bottom: 34px;
  left: clamp(46px, 7vw, 110px);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.login-footnote svg {
  width: 17px;
  height: 17px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  min-height: 82px;
  grid-template-columns: minmax(220px, 286px) 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  background: rgba(242, 237, 227, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.app-brand {
  align-items: center;
}

.app-brand .brand-mark {
  width: 38px;
  height: 38px;
}

.app-brand span:last-child {
  display: grid;
  gap: 1px;
}

.app-brand strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.app-brand small {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.topbar-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bb8a2f;
  box-shadow: 0 0 0 4px rgba(187, 138, 47, 0.12);
}

.status-dot.is-connected {
  background: #4f7457;
  box-shadow: 0 0 0 4px rgba(79, 116, 87, 0.12);
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  width: min(20vw, 260px);
  height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  background: rgba(255, 253, 248, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search-box svg {
  width: 17px;
  height: 17px;
  color: var(--ink-soft);
}

.search-box input {
  height: auto;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.8rem;
}

.search-box input:focus {
  background: none;
  box-shadow: none;
}

.avatar-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  font-weight: 700;
}

.account-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.account-menu button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.82rem;
}

.account-menu button:hover {
  background: var(--paper-deep);
}

.mobile-menu-button {
  display: none;
}

.app-layout {
  display: grid;
  min-height: calc(100vh - 82px);
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 82px;
  display: flex;
  height: calc(100vh - 82px);
  flex-direction: column;
  padding: 34px 24px 24px;
  background: rgba(232, 224, 211, 0.38);
  border-right: 1px solid var(--line);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 18px;
}

.sidebar-heading h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 550;
}

.album-list {
  display: grid;
  gap: 5px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.album-button {
  display: grid;
  width: 100%;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.album-button:hover {
  background: rgba(255, 253, 248, 0.55);
  border-color: var(--line);
}

.album-button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-light);
}

.album-button-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0.75;
}

.album-button-name {
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-button-count {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.64rem;
}

.album-button.is-active .album-button-count {
  color: rgba(255, 253, 248, 0.62);
}

.sidebar-bottom {
  display: grid;
  gap: 13px;
  margin-top: auto;
}

.storage-card {
  padding: 16px;
  background: rgba(255, 253, 248, 0.45);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.storage-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.76rem;
}

.storage-heading strong {
  font-family: var(--mono);
  font-size: 0.65rem;
}

.storage-card progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--paper-deep);
}

.storage-card progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--paper-deep);
}

.storage-card progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--sage);
}

.storage-card progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--sage);
}

.storage-card p {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.sidebar-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 4px;
  color: var(--ink-soft);
  font-size: 0.73rem;
  text-align: left;
}

.sidebar-link:hover {
  color: var(--ink);
}

.sidebar-link svg {
  width: 17px;
  height: 17px;
}

.sidebar-link-arrow {
  margin-left: auto;
}

.sidebar-scrim {
  display: none;
}

.main-content {
  min-width: 0;
  padding: clamp(34px, 5vw, 72px);
}

.content-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.content-heading h1 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.content-heading > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.content-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-toggle {
  display: grid;
  width: 39px;
  height: 39px;
  grid-template-columns: repeat(2, 5px);
  grid-template-rows: repeat(2, 5px);
  place-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.view-toggle span {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 1px;
}

.round-action {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.round-action:hover {
  color: var(--paper-light);
  background: var(--ink);
}

.connection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 30px;
  padding: 25px 28px;
  background:
    linear-gradient(120deg, rgba(104, 120, 105, 0.18), transparent 52%),
    var(--paper-light);
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
}

.connection-banner h2 {
  margin: 7px 0 5px;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 550;
}

.connection-banner p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.media-section {
  padding-top: 30px;
}

.media-grid {
  columns: 4 220px;
  column-gap: 18px;
}

.media-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid rgba(32, 30, 27, 0.08);
  border-radius: 5px;
  break-inside: avoid;
  cursor: zoom-in;
  box-shadow: 0 3px 0 rgba(32, 30, 27, 0.04);
  transition:
    transform 220ms cubic-bezier(0.2, 0.75, 0.25, 1),
    box-shadow 220ms ease;
}

.media-card:hover {
  z-index: 2;
  transform: translateY(-4px) rotate(-0.35deg);
  box-shadow: 0 18px 34px rgba(38, 31, 24, 0.14);
}

.media-card figure {
  margin: 0;
}

.media-card-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--sage-light);
}

.media-card.orientation-portrait .media-card-visual {
  aspect-ratio: 3 / 4;
}

.media-card.orientation-landscape .media-card-visual {
  aspect-ratio: 4 / 3;
}

.media-card.orientation-square .media-card-visual {
  aspect-ratio: 1;
}

.media-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.media-card:hover .media-card-visual img {
  transform: scale(1.025);
}

.media-card-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  gap: 10px;
  color: var(--sage);
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 255, 255, 0.72), transparent 28%),
    var(--sage-light);
}

.media-card-placeholder svg {
  width: 34px;
  height: 34px;
  margin: auto;
}

.media-card-placeholder span {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.media-card-video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: var(--paper-light);
  background: rgba(24, 22, 18, 0.75);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.6rem;
  backdrop-filter: blur(8px);
}

.media-card-video-badge svg {
  width: 13px;
  height: 13px;
}

.media-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 12px;
  background: var(--paper-light);
}

.media-card-name {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-date {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.55rem;
}

.empty-state {
  min-height: 53vh;
  padding: 70px 24px;
  text-align: center;
}

.empty-visual {
  position: relative;
  width: 122px;
  height: 102px;
  margin: 0 auto 28px;
}

.empty-visual span {
  position: absolute;
  width: 72px;
  height: 88px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  box-shadow: 0 12px 22px rgba(38, 31, 24, 0.1);
}

.empty-visual span:nth-child(1) {
  left: 0;
  transform: rotate(-11deg);
}

.empty-visual span:nth-child(2) {
  top: -6px;
  left: 26px;
  background: var(--sage-light);
  transform: rotate(3deg);
}

.empty-visual span:nth-child(3) {
  right: 0;
  background: #ead2c7;
  transform: rotate(12deg);
}

.empty-state h2 {
  margin: 9px 0 10px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 550;
}

.empty-state > p:not(.eyebrow) {
  margin: 0 auto 24px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.modal,
.media-dialog {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal {
  width: min(94vw, 620px);
  padding: 0;
  border-radius: 14px;
}

.modal::backdrop,
.media-dialog::backdrop {
  background: rgba(24, 22, 19, 0.76);
  backdrop-filter: blur(7px);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 550;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.modal form {
  padding: 25px 30px 30px;
}

.album-modal {
  width: min(94vw, 500px);
}

.drop-zone {
  display: grid;
  min-height: 225px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  margin-top: 19px;
  padding: 30px;
  text-align: center;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(32, 30, 27, 0.04) 50%, transparent 50.3%),
    rgba(255, 253, 248, 0.4);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  background-color: rgba(255, 253, 248, 0.8);
  border-color: var(--accent);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.drop-zone strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 550;
}

.drop-zone > span:last-child {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.drop-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 5px;
  color: var(--paper-light);
  background: var(--sage);
  border-radius: 50%;
}

.drop-icon svg {
  width: 23px;
  height: 23px;
}

.upload-queue {
  display: grid;
  max-height: 210px;
  gap: 8px;
  overflow: auto;
  margin-top: 14px;
}

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.upload-item-name {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item-status {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.upload-item progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--paper-deep);
}

.upload-item progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--paper-deep);
}

.upload-item progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.upload-item progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 26px;
}

.media-dialog {
  width: min(96vw, 1180px);
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}

.media-dialog-bar {
  display: grid;
  height: 58px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.media-dialog-bar > span {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.media-dialog-actions {
  display: flex;
  justify-content: end;
  gap: 5px;
}

.media-dialog-actions a {
  text-decoration: none;
}

.media-dialog-stage {
  display: grid;
  min-height: min(70vh, 720px);
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.04), transparent 50%),
    #1e1c19;
}

.media-viewer {
  display: grid;
  min-width: 0;
  height: min(70vh, 720px);
  grid-column: 2;
  place-items: center;
  overflow: hidden;
}

.media-viewer img,
.media-viewer video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-nav {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: auto;
  color: var(--paper-light);
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.media-nav-prev {
  grid-column: 1;
}

.media-nav-next {
  grid-column: 3;
}

.media-nav:hover {
  background: rgba(255, 255, 255, 0.16);
}

.media-dialog-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 24px 19px;
}

.media-dialog-caption h2 {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
}

.media-dialog-caption p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.6rem;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 9px;
}

.toast {
  min-width: 240px;
  max-width: min(90vw, 420px);
  padding: 14px 17px;
  color: var(--paper-light);
  background: var(--ink);
  border-left: 4px solid var(--sage);
  border-radius: 5px;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  animation: toast-in 220ms ease both;
}

.toast.is-error {
  border-left-color: var(--accent);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 220px 1fr auto;
  }

  .topbar-note {
    display: none;
  }

  .search-box {
    width: 210px;
  }

  .media-grid {
    columns: 3 220px;
  }
}

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-collage {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 92px 28px 70px;
  }

  .login-brand {
    top: 28px;
    left: 28px;
  }

  .login-footnote {
    right: 28px;
    bottom: 24px;
    left: 28px;
  }

  .topbar {
    min-height: 70px;
    grid-template-columns: auto auto 1fr;
    padding: 0 15px;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .app-brand .brand-mark {
    width: 34px;
    height: 34px;
  }

  .topbar-actions {
    justify-self: end;
  }

  .search-box {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .search-box input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }

  .app-layout {
    display: block;
    min-height: calc(100vh - 70px);
  }

  .sidebar {
    position: fixed;
    z-index: 55;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 310px);
    height: 100vh;
    padding-top: 32px;
    background: var(--paper);
    box-shadow: 20px 0 50px rgba(32, 30, 27, 0.2);
    transform: translateX(-105%);
    transition: transform 220ms cubic-bezier(0.2, 0.75, 0.25, 1);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(24, 22, 19, 0.5);
    opacity: 0;
    transition:
      opacity 180ms ease,
      visibility 180ms ease;
  }

  .app-shell.sidebar-open .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .main-content {
    padding: 34px 22px 54px;
  }

  .connection-banner {
    align-items: start;
    flex-direction: column;
  }

  .media-grid {
    columns: 2 190px;
    column-gap: 13px;
  }

  .media-card {
    margin-bottom: 13px;
  }
}

@media (max-width: 620px) {
  .login-copy h1 {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .password-row {
    align-items: stretch;
    flex-direction: column;
  }

  .password-row .button {
    width: 100%;
  }

  .topbar-actions .button-ink {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .avatar-button {
    display: none;
  }

  .content-header {
    align-items: start;
    flex-direction: column;
    padding-bottom: 25px;
  }

  .content-heading h1 {
    font-size: clamp(2.7rem, 16vw, 4.2rem);
  }

  .content-actions {
    position: absolute;
    right: 22px;
  }

  .view-toggle {
    display: none;
  }

  .round-action {
    width: 43px;
    height: 43px;
  }

  .media-section {
    padding-top: 20px;
  }

  .media-grid {
    columns: 2 140px;
    column-gap: 9px;
  }

  .media-card {
    margin-bottom: 9px;
    border-radius: 3px;
  }

  .media-card-meta {
    display: block;
    padding: 8px 9px 9px;
  }

  .media-card-date {
    display: none;
  }

  .media-card-name {
    font-size: 0.67rem;
  }

  .media-card-video-badge {
    top: 7px;
    right: 7px;
    padding: 5px;
  }

  .media-card-video-badge span {
    display: none;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal-head {
    padding: 22px 20px 18px;
  }

  .modal form {
    padding: 20px;
  }

  .drop-zone {
    min-height: 190px;
  }

  .media-dialog {
    width: 100vw;
    max-width: none;
    max-height: 100vh;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .media-dialog-stage {
    min-height: calc(100vh - 152px);
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }

  .media-viewer {
    height: calc(100vh - 152px);
  }

  .media-nav {
    position: fixed;
    z-index: 3;
    bottom: 84px;
  }

  .media-nav-prev {
    left: 15px;
  }

  .media-nav-next {
    right: 15px;
  }

  .media-dialog-caption {
    align-items: start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
  }

  .toast-region {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .toast {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
