:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --paper-2: #eef4f0;
  --mist: #edf3f8;
  --rose: #f1dfdc;
  --ink: #222629;
  --muted: #687078;
  --line: rgba(34, 38, 41, 0.14);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #fffdfa;
  --accent: #8e4b3f;
  --sage: #647c6d;
  --blue: #546f8f;
  --shadow: 0 16px 44px rgba(34, 38, 41, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(237, 243, 248, 0.74), rgba(247, 244, 239, 0.94) 34%, rgba(238, 244, 240, 0.92));
  color: var(--ink);
}

img { display: block; width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 239, 0.86);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: grid;
  gap: 4px;
}

.brand {
  font-size: 0.98rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.86rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-switch {
  position: relative;
}

.lang-switch-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}

.lang-switch-trigger:hover,
.lang-switch-trigger:focus-visible,
.lang-switch-trigger[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--ink);
  outline: none;
}

.lang-switch-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  display: grid;
  width: max-content;
  min-width: 140px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.97);
  box-shadow: 0 18px 48px rgba(34, 38, 41, 0.12);
  backdrop-filter: blur(18px);
}

.lang-switch-panel button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  color: var(--muted);
  font-size: 0.86rem;
  cursor: pointer;
  transition: color 140ms ease;
}

.lang-switch-panel button:hover,
.lang-switch-panel button:focus-visible,
.lang-switch-panel button[aria-current] {
  color: var(--ink);
  outline: none;
}

.collection-menu {
  position: relative;
}

.collection-menu-trigger {
  appearance: none;
  display: grid;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.collection-menu-trigger span {
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: width 160ms ease, transform 160ms ease;
}

.collection-menu-trigger span:nth-child(2) {
  width: 68%;
  justify-self: end;
}

.collection-menu-trigger:hover,
.collection-menu-trigger:focus-visible,
.collection-menu-trigger[aria-expanded="true"] {
  color: var(--ink);
  outline: none;
}

.collection-menu-trigger:hover span:nth-child(2),
.collection-menu-trigger:focus-visible span:nth-child(2),
.collection-menu-trigger[aria-expanded="true"] span:nth-child(2) {
  width: 100%;
}

.collection-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 20;
  display: grid;
  width: min(260px, calc(100vw - 36px));
  padding: 18px 20px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.97);
  box-shadow: 0 18px 48px rgba(34, 38, 41, 0.12);
  backdrop-filter: blur(18px);
}

.collection-menu-caption {
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.collection-menu-panel a {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 140ms ease, padding-left 140ms ease;
}

.collection-menu-panel a span {
  font-size: 0.62rem;
}

.collection-menu-panel a::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}

.collection-menu-panel a:hover,
.collection-menu-panel a:focus-visible,
.collection-menu-panel a[aria-current] {
  padding-left: 4px;
  color: var(--ink);
  outline: none;
}

.collection-menu-panel a[aria-current]::after {
  background: var(--accent);
}

.app-root {
  display: grid;
  gap: 0;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  min-height: 360px;
  padding: clamp(46px, 7vw, 92px) clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.movies-hero {
  background:
    linear-gradient(90deg, rgba(247, 244, 239, 0.94), rgba(237, 243, 248, 0.62)),
    url('https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1800&q=80') center/cover no-repeat;
}

.paintings-hero {
  background:
    linear-gradient(90deg, rgba(247, 244, 239, 0.96), rgba(241, 223, 220, 0.72)),
    url('https://images.unsplash.com/photo-1545989253-02cc26577f88?auto=format&fit=crop&w=1800&q=80') center/cover no-repeat;
}

.photos-hero {
  background:
    linear-gradient(90deg, rgba(247, 244, 239, 0.96), rgba(84, 111, 143, 0.16)),
    url('https://images.unsplash.com/photo-1502920917128-1aa500764cbd?auto=format&fit=crop&w=1800&q=80') center/cover no-repeat;
}

.admin-hero {
  min-height: 270px;
  background:
    linear-gradient(90deg, rgba(247, 244, 239, 0.96), rgba(238, 244, 240, 0.78)),
    url('https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=1800&q=80') center/cover no-repeat;
}

.hero-copy {
  display: grid;
  gap: 16px;
  max-width: 820px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1, h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 8vw, 7.4rem);
}

h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

p {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.72;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(105px, 1fr));
  gap: 10px;
}

.hero-stats div,
.wall-key {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.86);
  box-shadow: var(--shadow);
}

.hero-stats span,
.wall-key strong {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.hero-stats strong,
.wall-key span {
  display: block;
  margin-top: 4px;
  font-size: 1.75rem;
  line-height: 1;
}

.toolbar-band {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) minmax(180px, 260px);
  gap: 12px;
  padding: 18px clamp(18px, 5vw, 72px);
  background: rgba(255, 253, 250, 0.62);
  border-bottom: 1px solid var(--line);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.92);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(84, 111, 143, 0.58);
  box-shadow: 0 0 0 4px rgba(84, 111, 143, 0.12);
}

.collection-band,
.gallery-band,
.admin-list-band {
  padding: 28px clamp(18px, 5vw, 72px) 64px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title span {
  font-weight: 800;
  font-size: 1.1rem;
}

.section-title strong {
  color: var(--muted);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.movie-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.movie-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(34, 38, 41, 0.14);
}

.poster-slot {
  background: var(--mist);
}

.poster-slot img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.poster-fallback {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  color: var(--blue);
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(145deg, var(--mist), var(--rose));
}

.movie-copy {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.item-title {
  font-weight: 800;
  line-height: 1.18;
}

.muted-line {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-row span {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--sage);
  font-size: 0.78rem;
  font-weight: 700;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.photo-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(34, 38, 41, 0.14);
}

.photo-thumb {
  appearance: none;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: var(--mist);
  overflow: hidden;
  cursor: zoom-in;
}

.photo-thumb img {
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.photo-copy {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 13px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.photo-copy strong {
  font-weight: 800;
  line-height: 1.18;
}

.photo-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.photo-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.gallery-band {
  min-height: calc(100vh - 96px);
  background:
    linear-gradient(180deg, rgba(247, 244, 239, 0.92), rgba(238, 244, 240, 0.86));
}

.floor-plan-entry {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(400px, 1.15fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: center;
  min-height: calc(100vh - 89px);
  padding: clamp(42px, 7vw, 96px) clamp(18px, 7vw, 110px);
  background:
    linear-gradient(115deg, rgba(247, 244, 239, 0.98), rgba(238, 244, 240, 0.74)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(34, 38, 41, 0.035) 31px 32px);
}

.floor-plan-copy {
  display: grid;
  gap: 18px;
  align-content: center;
}

.floor-plan-copy h1 {
  max-width: 8ch;
  font-size: clamp(3.2rem, 7vw, 7rem);
}

.floor-plan {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  grid-auto-rows: minmax(180px, 1fr);
  width: 100%;
  max-width: 620px;
  justify-self: end;
  min-height: 520px;
  background: transparent;
}

.floor-room {
  appearance: none;
  position: relative;
  display: grid;
  place-items: start;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ink);
  background: rgba(255, 253, 250, 0.4);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease;
}

.floor-room::before,
.floor-room::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.floor-room-exit-none::before,
.floor-room-exit-none::after {
  display: none;
}

.floor-room-exit-right::before,
.floor-room-exit-left::before {
  top: 50%;
  width: 8px;
  height: 44px;
  background: #f8f6f1;
  transform: translateY(-50%);
}

.floor-room-exit-right::before { right: -4px; }
.floor-room-exit-left::before { left: -4px; }

.floor-room-exit-right::after,
.floor-room-exit-left::after {
  top: calc(50% - 22px);
  width: 44px;
  height: 44px;
}

.floor-room-exit-right::after {
  right: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 44px 1px no-repeat,
    radial-gradient(circle at 100% 0, transparent 43px, var(--ink) 43px 44px, transparent 44px);
}

.floor-room-exit-left::after {
  left: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 44px 1px no-repeat,
    radial-gradient(circle at 0 0, transparent 43px, var(--ink) 43px 44px, transparent 44px);
}

.floor-room-exit-down::before {
  left: 50%;
  bottom: -4px;
  width: 44px;
  height: 8px;
  background: #f8f6f1;
  transform: translateX(-50%);
}

.floor-room-exit-down::after {
  left: calc(50% - 22px);
  bottom: 0;
  width: 44px;
  height: 44px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 100% / 1px 44px no-repeat,
    radial-gradient(circle at 0 100%, transparent 43px, var(--ink) 43px 44px, transparent 44px);
}

.floor-room:hover,
.floor-room:focus-visible {
  z-index: 2;
  background: rgba(100, 124, 109, 0.16);
  outline: 0;
}

.room-number {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.room-hover {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 4px;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 9px 11px;
  border: 1px solid var(--ink);
  background: var(--surface-strong);
  box-shadow: 7px 7px 0 rgba(34, 38, 41, 0.10);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 8px));
  transition: opacity 160ms ease, transform 160ms ease;
}

.room-hover strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.25;
}

.room-hover small {
  color: var(--muted);
  font-size: 0.68rem;
}

.floor-room:hover .room-hover,
.floor-room:focus-visible .room-hover {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.floor-entrance {
  position: absolute;
  left: -4px;
  top: 68px;
  width: 8px;
  height: 44px;
  background: #f8f6f1;
}

.floor-entrance::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 44px;
  height: 44px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 44px 1px no-repeat,
    radial-gradient(circle at 0 0, transparent 43px, var(--ink) 43px 44px, transparent 44px);
}

.floor-plan-empty {
  grid-column: 1 / -1;
  align-self: center;
  margin: 24px;
}

.back-to-plan {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.back-to-plan:hover {
  color: var(--accent);
}

.hero-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.fullscreen-toggle {
  justify-self: start;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 140ms ease, border-color 140ms ease;
}

.fullscreen-toggle:hover,
.fullscreen-toggle:focus-visible,
.fullscreen-toggle[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--ink);
  outline: none;
}

/* In fullscreen the room view collapses into a slim header bar so the wall of paintings is visible without scrolling. */
:fullscreen .site-header,
:-webkit-full-screen .site-header {
  display: none;
}

:fullscreen .floor-plan-entry,
:-webkit-full-screen .floor-plan-entry {
  min-height: 100vh;
}

:fullscreen .paintings-hero,
:-webkit-full-screen .paintings-hero {
  grid-template-columns: 1fr;
  min-height: auto;
  padding: 14px clamp(16px, 3vw, 32px);
}

:fullscreen .paintings-hero .hero-copy,
:-webkit-full-screen .paintings-hero .hero-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  max-width: none;
}

:fullscreen .paintings-hero .eyebrow,
:-webkit-full-screen .paintings-hero .eyebrow {
  font-size: 0.68rem;
}

:fullscreen .paintings-hero h1,
:-webkit-full-screen .paintings-hero h1 {
  max-width: none;
  font-size: 1.05rem;
  line-height: 1.2;
}

:fullscreen .paintings-hero .wall-key,
:-webkit-full-screen .paintings-hero .wall-key {
  display: none;
}

:fullscreen .gallery-band,
:-webkit-full-screen .gallery-band {
  min-height: calc(100vh - 64px);
  padding: 0 clamp(18px, 5vw, 72px) 24px;
}

:fullscreen .painting-wall,
:-webkit-full-screen .painting-wall {
  min-height: calc(100vh - 128px);
}

.painting-wall {
  position: relative;
  display: flex;
  gap: clamp(28px, 5vw, 76px);
  align-items: flex-start;
  min-height: 640px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 58px clamp(24px, 8vw, 110px) 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.86), rgba(241, 223, 220, 0.18)),
    repeating-linear-gradient(90deg, rgba(34, 38, 41, 0.025) 0 1px, transparent 1px 92px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  scrollbar-width: thin;
}

.wall-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 92px;
  height: 1px;
  background: rgba(34, 38, 41, 0.10);
}

.painting-piece {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  gap: 14px;
  cursor: pointer;
}

.painting-piece::before {
  content: "";
  position: absolute;
  top: 34px;
  left: calc(var(--art-width) / 2);
  width: 1px;
  height: 52px;
  background: rgba(34, 38, 41, 0.16);
}

.painting-frame {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 70px;
  padding: 10px;
  border: 1px solid rgba(34, 38, 41, 0.24);
  background: #fdfbf7;
  box-shadow: 0 18px 36px rgba(34, 38, 41, 0.16);
  color: inherit;
  cursor: zoom-in;
}

.painting-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.painting-frame:hover,
.painting-frame:focus-visible {
  box-shadow: 0 22px 46px rgba(34, 38, 41, 0.22);
  outline: 2px solid rgba(84, 111, 143, 0.5);
  outline-offset: 4px;
}

.painting-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
  color: rgba(34, 38, 41, 0.64);
  background:
    linear-gradient(145deg, rgba(84, 111, 143, 0.28), rgba(142, 75, 63, 0.18)),
    linear-gradient(45deg, rgba(100, 124, 109, 0.28), rgba(247, 244, 239, 0.38));
}

.painting-placeholder span {
  font-weight: 800;
}

.painting-label {
  appearance: none;
  position: absolute;
  right: 18px;
  bottom: 0;
  display: grid;
  gap: 3px;
  width: 88px;
  min-height: 48px;
  padding: 6px 7px;
  border: 1px solid rgba(34, 38, 41, 0.12);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(34, 38, 41, 0.10);
  cursor: pointer;
  text-align: left;
  z-index: 2;
}

.painting-label em,
.painting-label strong {
  overflow: hidden;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.painting-label em {
  color: var(--muted);
  font-size: 0.42rem;
}

.painting-label strong {
  color: var(--ink);
  font-size: 0.5rem;
}

.painting-label span,
.painting-label small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.44rem;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.painting-label span {
  white-space: nowrap;
}

.painting-label small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px) 0;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px clamp(18px, 5vw, 72px) 0;
}

.admin-tab {
  appearance: none;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.admin-tab:hover,
.admin-tab:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
  outline: none;
}

.admin-tab[aria-current="true"] {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.login-form {
  width: min(380px, calc(100% - 36px));
  margin: 0 clamp(18px, 5vw, 72px) 40px;
}

.logout-button {
  justify-self: start;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.logout-button:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.admin-panel,
.admin-list {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.88);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.room-control {
  display: grid;
  gap: 10px;
  align-content: start;
}

.new-room-field {
  padding-left: 12px;
  border-left: 2px solid rgba(142, 75, 63, 0.24);
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.admin-image-preview {
  width: min(180px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

.form-actions,
.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.primary {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  padding: 12px 15px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.primary:hover {
  background: var(--accent);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.text-button.danger {
  color: #8d2f25;
}

.status-line {
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(247, 244, 239, 0.72);
}

.status-line[data-tone="success"] {
  border-color: rgba(100, 124, 109, 0.42);
  color: var(--sage);
}

.status-line[data-tone="warning"] {
  border-color: rgba(142, 75, 63, 0.38);
  color: var(--accent);
}

.admin-list-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding-top: 0;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.admin-painting-grid {
  display: grid;
  gap: 12px;
}

.admin-painting-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.admin-painting-thumb {
  overflow: hidden;
  width: 96px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

.admin-painting-thumb img {
  height: 100%;
  object-fit: cover;
}

.admin-painting-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-painting-copy em,
.admin-painting-copy strong,
.admin-painting-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-painting-copy em {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-painting-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}

.empty-note {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 250, 0.72);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 38, 41, 0.72);
}

.modal-card {
  position: relative;
  width: min(1060px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.painting-viewer {
  z-index: 40;
  padding: clamp(18px, 4vw, 56px);
}

.painting-viewer .modal-backdrop {
  background: rgba(247, 244, 239, 0.95);
}

.painting-viewer-content {
  position: absolute;
  inset: clamp(18px, 4vw, 56px);
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.painting-viewer-content::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(30px, 7vh, 68px);
  height: 1px;
  background: rgba(34, 38, 41, 0.1);
}

.painting-viewer-content img {
  position: relative;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - clamp(36px, 8vw, 112px));
  padding: clamp(8px, 1.4vw, 16px);
  border: 1px solid rgba(34, 38, 41, 0.24);
  background: #fdfbf7;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  box-shadow: 0 22px 54px rgba(34, 38, 41, 0.18);
}

.painting-viewer-content .painting-placeholder {
  width: min(720px, 90vw);
  height: min(720px, 80vh);
}

.viewer-close-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.88);
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.viewer-close-button::before,
.viewer-close-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.viewer-close-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.viewer-close-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.viewer-close-button:hover,
.viewer-close-button:focus-visible {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  outline: none;
  transform: rotate(4deg);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 24px;
}

.detail-media {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.poster-detail img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.painting-detail {
  display: grid;
  place-items: center;
  min-height: 360px;
}

.painting-detail img {
  max-height: 70vh;
  object-fit: contain;
}

.detail-copy {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-right: 28px;
}

.detail-copy h2 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.detail-title-en {
  margin-bottom: -6px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero-band,
  .floor-plan-entry,
  .admin-grid,
  .admin-list-band,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    width: 100%;
  }

  .toolbar-band {
    grid-template-columns: 1fr;
  }

  .painting-wall {
    min-height: 500px;
    padding-left: 22px;
    padding-right: 22px;
  }

  .floor-plan-entry {
    min-height: auto;
  }

  .floor-plan {
    max-width: none;
    justify-self: stretch;
  }

  .floor-plan-copy h1 {
    max-width: 11ch;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: center;
    flex-direction: row;
  }

  h1 {
    font-size: clamp(2.7rem, 16vw, 4.4rem);
  }

  .floor-plan {
    grid-template-columns: repeat(2, minmax(80px, 1fr));
    grid-auto-rows: 130px;
    min-height: 480px;
  }

  .room-hover {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-painting-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .admin-row-actions {
    grid-column: 1 / -1;
  }

  dl div {
    grid-template-columns: 1fr;
  }
}
