:root {
  color-scheme: dark;
  --bg: #2d2f8f;
  --bg-deep: #23256d;
  --panel: rgba(255, 255, 255, 0.12);
  --panel-strong: rgba(255, 255, 255, 0.2);
  --text: #ffffff;
  --muted: #d8ddff;
  --ink: #202334;
  --paper: #ffffff;
  --accent: #7b2fe8;
  --yellow: #ffc72c;
  --shadow: rgba(3, 8, 39, 0.26);
  --profile-drawer-width: 320px;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf2ff;
  --bg-deep: #dbe5ff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --text: #1f2745;
  --muted: #526078;
  --ink: #202334;
  --paper: #ffffff;
  --accent: #6630d9;
  --yellow: #d99a00;
  --shadow: rgba(35, 44, 86, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 55% 18%, rgba(102, 48, 217, 0.1) 0 9rem, transparent 9.2rem),
    radial-gradient(circle at 76% -12%, rgba(217, 154, 0, 0.13) 0 6rem, transparent 6.2rem),
    linear-gradient(135deg, var(--bg-deep), var(--bg) 58%, #f8fbff);
}

body.drawer-open {
  overflow: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 55% 18%, rgba(255, 255, 255, 0.11) 0 9rem, transparent 9.2rem),
    radial-gradient(circle at 76% -12%, rgba(255, 199, 44, 0.16) 0 6rem, transparent 6.2rem),
    linear-gradient(135deg, var(--bg-deep), var(--bg) 58%, #342f9d);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(255, 255, 255, 0.08) 46% 66%, transparent 66%),
    linear-gradient(75deg, transparent 0 70%, rgba(255, 255, 255, 0.06) 70% 82%, transparent 82%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1360px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 16px 48px;
}

.top-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 50px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.28rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.brand picture {
  display: inline-flex;
  flex: 0 0 56px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.top-actions {
  display: flex;
  grid-column: 3;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.upload-nav-button {
  grid-column: 2;
  justify-self: center;
  border: 2px solid #ffffff;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(3, 8, 39, 0.22);
}

.upload-nav-button:hover {
  background: #ffd95f;
}

.contact-link {
  color: var(--text);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  white-space: nowrap;
}

.auth-link-button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  white-space: nowrap;
}

.auth-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
  white-space: nowrap;
}

.auth-button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.auth-button.solid {
  border: 0;
  background: var(--accent);
  color: var(--text);
}

.auth-button.small {
  min-height: 36px;
  padding-inline: 14px;
}

.auth-button.full {
  width: 100%;
}

.member-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
  font-size: 1.05rem;
}

.notification-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: #ff4d6d;
  color: #ffffff;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.user-chip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
  padding: 5px 6px 5px 14px;
  font-weight: 900;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 18;
  display: grid;
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 92px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(3, 8, 39, 0.32);
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid #e3e7f2;
}

.notification-head strong {
  color: #23283a;
  font-size: 1rem;
}

.notification-close {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #eef1f8;
}

.notification-close::before,
.notification-close::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 8px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #454d63;
}

.notification-close::before {
  transform: rotate(45deg);
}

.notification-close::after {
  transform: rotate(-45deg);
}

.message-list {
  display: grid;
  max-height: 240px;
  overflow: auto;
}

.message-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf0f7;
  background: #ffffff;
  color: #343b52;
  padding: 12px 14px;
  text-align: left;
}

.message-list-item.is-unread {
  background: #f2f7ff;
}

.message-list-item strong {
  color: #202334;
  font-size: 0.94rem;
}

.message-list-item span,
.message-list-item small,
.message-list-status,
.message-detail-meta {
  color: #6f778d;
  font-size: 0.82rem;
  font-weight: 800;
}

.message-list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-list-status {
  margin: 0;
  padding: 18px 14px;
}

.message-detail {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid #e3e7f2;
  background: #fbfcff;
}

.message-detail h3,
.message-detail p {
  margin: 0;
}

.message-detail h3 {
  color: #202334;
  font-size: 1rem;
}

.message-detail-body {
  color: #343b52;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-wrap;
}

.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-photo {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--yellow), #21b6a8);
  color: #18205f;
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.78);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.guest-chip {
  padding-inline: 8px;
}

.guest-photo {
  background: linear-gradient(135deg, #ffffff, var(--yellow));
  color: #202334;
}

.profile-photo.large {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
}

.view {
  padding: 42px 6px 0;
}

.gallery-guide {
  margin: 0 0 22px;
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1.18;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 38px;
}

.gallery-more-button {
  display: block;
  min-height: 42px;
  margin: 22px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 0 18px;
  font-weight: 900;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 11px, rgba(37, 167, 255, 0.16) 11px 22px);
  box-shadow: 0 18px 34px var(--shadow);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.photo-card.has-image {
  background: #12152f;
}

.photo-card.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, transparent 0 62%, rgba(0, 0, 0, 0.18));
}

.photo-card.is-empty {
  opacity: 0.45;
  cursor: pointer;
}

.photo-card.is-empty::after {
  content: "";
  position: absolute;
  width: 52px;
  height: 40px;
  right: 16px;
  bottom: 16px;
  border-radius: 8px;
  background:
    linear-gradient(var(--paper) 0 0) 11px 11px / 8px 8px no-repeat,
    linear-gradient(135deg, transparent 46%, var(--paper) 47% 56%, transparent 57%) 9px 19px / 28px 14px no-repeat,
    #45b95b;
  box-shadow: 0 3px 9px rgba(3, 8, 39, 0.16);
}

.photo-card:not(.is-empty):hover,
.photo-card.is-empty:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 42px rgba(3, 8, 39, 0.34);
}

.photo-card-picture,
.photo-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.photo-card-image {
  object-fit: cover;
}

.photo-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
  opacity: 1;
  transform: translateY(0);
}

.photo-action {
  min-width: 58px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.play-view,
.guest-view {
  display: grid;
  justify-items: center;
  gap: 24px;
}

.selected-photo-frame {
  width: min(640px, calc(100vw - 32px));
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: #000000;
  box-shadow: 0 22px 46px rgba(3, 8, 39, 0.34);
}

.selected-photo,
.ranking-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.entry-form {
  width: min(640px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
}

.entry-form label {
  font-size: 1rem;
  font-weight: 900;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.entry-row input,
.name-step input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8dcec;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  padding: 0 14px;
  outline: 0;
}

.compact-form {
  margin-top: min(18vh, 160px);
  padding: 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(3, 8, 39, 0.2);
}

.form-copy {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 800;
}

.ranking-view {
  padding-inline: 6px;
}

.ranking-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.view-kicker {
  margin: 0 0 5px;
  color: var(--yellow);
  font-size: 0.88rem;
  font-weight: 900;
}

.ranking-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.ranking-sort-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.ranking-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.ranking-self-link {
  border: 0;
  background: transparent;
  color: var(--yellow);
  padding: 0;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.contact-view {
  padding-inline: 6px;
}

.contact-head {
  margin-bottom: 24px;
}

.contact-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.contact-notice,
.contact-form {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 32px rgba(3, 8, 39, 0.18);
}

.contact-notice {
  padding: 20px;
}

.contact-notice h2 {
  margin: 0 0 14px;
  font-size: 1.16rem;
}

.contact-notice ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.contact-form {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.contact-form label {
  font-weight: 900;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid #d8dcec;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  padding: 0 14px;
  outline: 0;
}

.contact-form input,
.contact-form select {
  min-height: 48px;
}

.contact-form textarea {
  min-height: 190px;
  padding-block: 12px;
  resize: vertical;
}

.contact-message {
  min-height: 20px;
  margin: 2px 0 0;
  color: #ffe5ea;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.4;
}

.contact-message.is-success {
  color: #dfffe8;
}

.contact-submit {
  justify-self: start;
}

.profile-view {
  padding-inline: 6px;
}

.profile-page-head {
  width: min(620px, 100%);
  margin: 0 auto 24px;
}

.profile-page-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.profile-edit-panel {
  width: min(620px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 32px rgba(3, 8, 39, 0.18);
  padding: 24px;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.ranking-results {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ranking-tab {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  padding: 0 14px;
  font-weight: 900;
}

.ranking-tab.is-active {
  border-color: #ffffff;
  background: var(--yellow);
  color: #202334;
}

.like-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.45;
}

.ranking-photo-frame {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #000000;
  box-shadow: 0 18px 38px rgba(3, 8, 39, 0.28);
}

.ranking-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-item,
.ranking-empty {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  position: relative;
  min-height: 72px;
  padding: 14px 14px 46px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(3, 8, 39, 0.16);
}

.ranking-item.is-mine {
  border-color: rgba(255, 199, 44, 0.64);
  background: linear-gradient(135deg, rgba(255, 199, 44, 0.2), rgba(33, 182, 168, 0.18));
}

.ranking-item.is-focused,
.comment-item.is-focused {
  outline: 3px solid rgba(255, 199, 44, 0.84);
  outline-offset: 3px;
}

.ranking-empty {
  grid-template-columns: 1fr;
  justify-items: start;
  padding: 20px;
  color: var(--text);
  font-weight: 900;
}

.ranking-empty p {
  margin: 0;
}

.ranking-write-button {
  margin-top: 12px;
}

.rank-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  color: #263172;
  font-weight: 900;
}

.rank-crown {
  border: 1px solid rgba(255, 255, 255, 0.48);
  font-size: 1.55rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.rank-crown-gold {
  background: #fff3b8;
  color: #d49b00;
}

.rank-crown-silver {
  background: #eef2f7;
  color: #9aa4b2;
}

.rank-crown-bronze {
  background: #f7ddc5;
  color: #b66a2c;
}

.rank-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.rank-content strong {
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 1.08rem;
  text-shadow: 0 1px 2px rgba(3, 8, 39, 0.24);
}

.rank-content span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.mine-badge {
  justify-self: start;
  border: 1px solid rgba(255, 199, 44, 0.82);
  border-radius: 999px;
  background: rgba(255, 199, 44, 0.18);
  color: var(--text);
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.user-name-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.rank-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.vote-group {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.heart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 62px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 900;
}

.delete-button,
.comment-delete {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffe5ea;
  padding: 0 10px;
  font-size: 0.86rem;
  font-weight: 900;
}

.delete-button:hover,
.comment-delete:hover {
  background: rgba(198, 33, 58, 0.3);
}

.heart-icon {
  position: relative;
  width: 16px;
  height: 16px;
  background: #ff4d6d;
  transform: rotate(-45deg);
}

.heart-icon::before,
.heart-icon::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff4d6d;
}

.heart-icon::before {
  top: -8px;
  left: 0;
}

.heart-icon::after {
  top: 0;
  left: 8px;
}

.comment-toggle {
  position: absolute;
  left: 16px;
  bottom: 12px;
  width: 32px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.comment-toggle::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: rotate(45deg);
  transition: transform 140ms ease, top 140ms ease;
}

.ranking-item.is-expanded .comment-toggle::before {
  top: 11px;
  transform: rotate(225deg);
}

.comments-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.comment-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
}

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

.comment-item strong {
  font-size: 0.86rem;
}

.comment-item span,
.comment-empty {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  font-weight: 800;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.comment-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8dcec;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  padding: 0 12px;
  outline: 0;
}

.page-dim {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: rgba(6, 8, 28, 0.52);
}

.profile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 6;
  width: var(--profile-drawer-width);
  min-width: 0;
  height: 100vh;
  padding: 28px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(33, 25, 88, 0.98), rgba(18, 15, 56, 0.98));
  color: #ffffff;
  box-shadow: -24px 0 44px rgba(3, 8, 39, 0.32);
  transform: translateX(100%);
  transition: transform 240ms ease;
}

.profile-drawer.is-open {
  transform: translateX(0);
}

.drawer-edge-close {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 44px;
  height: 52px;
  border: 0;
  border-radius: 999px 0 0 999px;
  background: #ffffff;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: -9px 0 20px rgba(3, 8, 39, 0.18);
  transform: translateY(-50%);
  transition: right 240ms ease, transform 180ms ease;
}

.drawer-edge-close.is-open {
  right: var(--profile-drawer-width);
}

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

.drawer-head h2 {
  font-size: 1.45rem;
  margin: 0;
  color: #ffffff;
}

.modal-close {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid #d8dcec;
  border-radius: 50%;
  background: var(--paper);
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 10px;
  width: 16px;
  height: 2px;
  background: var(--ink);
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.drawer-view {
  display: grid;
  gap: 18px;
}

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 34px 0;
}

.avatar-edit-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  overflow: hidden;
  overflow-y: auto;
}

.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 20, 45, 0.58);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 140ms ease;
}

.avatar-edit-button:hover .avatar-edit-overlay,
.avatar-edit-button:focus-visible .avatar-edit-overlay {
  opacity: 1;
}

.drawer-name {
  margin: 0 0 5px;
  font-size: 1.35rem;
  font-weight: 900;
}

.drawer-provider {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.drawer-menu {
  display: grid;
  gap: 8px;
}

.guest-drawer-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  line-height: 1.55;
}

.drawer-stats {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

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

.drawer-stat-grid div {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.drawer-stat-grid strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.drawer-stat-grid span,
.drawer-badges {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.drawer-menu-row {
  min-height: 50px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #ffffff;
  padding: 0;
  text-align: left;
  font-size: 1rem;
  font-weight: 900;
}

.drawer-menu-row:hover {
  color: var(--yellow);
}

.drawer-menu-row.danger {
  color: #ff8898;
}

.drawer-subhead {
  display: grid;
  gap: 12px;
}

.drawer-subhead h3 {
  margin: 0;
  font-size: 1.35rem;
}

.drawer-back {
  justify-self: start;
  min-height: 36px;
  border: 1px solid #d8dcec;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  padding: 0 12px;
  font-weight: 900;
}

.drawer-delete {
  justify-self: start;
  border-color: #f0c7d0;
  background: #fff4f6;
  color: #c6213a;
}

.profile-edit-form,
.password-change-form {
  display: grid;
  gap: 12px;
}

.profile-edit-photo-button {
  position: relative;
  justify-self: center;
  width: 112px;
  height: 112px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.profile-edit-photo-button .edit-photo {
  width: 112px;
  height: 112px;
  font-size: 2rem;
}

.profile-edit-form label,
.password-change-form label {
  color: #555d74;
  font-weight: 900;
}

.profile-edit-form input[type="text"],
.profile-edit-form textarea,
.password-change-form input {
  width: 100%;
  border: 1px solid #d8dcec;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
  font-weight: 800;
  outline: 0;
}

.profile-edit-form textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

.profile-public-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile-public-toggle input {
  width: 18px;
  height: 18px;
}

.profile-public-hint,
.profile-edit-message {
  margin: 0;
  color: #68708a;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
}

.profile-edit-message {
  min-height: 20px;
  color: #c6213a;
}

.profile-edit-message.is-success {
  color: #237a3b;
}

.profile-edit-panel label {
  color: var(--text);
}

.profile-edit-panel .profile-public-hint {
  color: var(--muted);
}

.profile-edit-panel .profile-edit-message {
  color: #ffe5ea;
}

.profile-edit-panel .profile-edit-message.is-success {
  color: #dfffe8;
}

.auth-button.danger {
  border: 1px solid #f0c7d0;
  background: #fff4f6;
  color: #c6213a;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 8, 28, 0.58);
}

.confirm-card {
  width: min(420px, 100%);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 24px 70px rgba(3, 8, 39, 0.32);
}

.confirm-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.confirm-card p {
  margin: 0 0 18px;
  color: #68708a;
  font-weight: 800;
  line-height: 1.55;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.my-title-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding-right: 4px;
}

.my-title-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid #e3e6f2;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  cursor: pointer;
}

.my-title-card:hover {
  border-color: #c7cdea;
  background: #fbfcff;
}

.my-title-thumb {
  width: 92px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1fb;
}

.my-title-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.my-title-body strong {
  overflow-wrap: anywhere;
}

.my-title-meta,
.my-title-comments,
.my-title-empty {
  margin: 0;
  color: #68708a;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.heart-button.is-liked {
  border-color: rgba(255, 77, 109, 0.9);
  background: rgba(255, 77, 109, 0.24);
}

.cookie-settings-form {
  display: grid;
  gap: 12px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 8, 28, 0.58);
}

.auth-card {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  padding: 28px;
  box-shadow: 0 24px 70px rgba(3, 8, 39, 0.32);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 900;
}

.auth-card h2 {
  margin: 0 0 18px;
  font-size: 1.7rem;
}

.modal-copy {
  margin: 0 0 16px;
  color: #616a82;
  font-weight: 700;
  line-height: 1.55;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 10px;
  background: #eef1fb;
}

.auth-switch-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5b637a;
  font-weight: 900;
}

.auth-switch-button.is-active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 5px 14px rgba(30, 36, 76, 0.12);
}

.auth-step {
  display: none;
}

.auth-step.is-active {
  display: grid;
  gap: 14px;
}

.auth-form label {
  color: #555d74;
  font-weight: 900;
}

.field-hint {
  margin: -8px 0 0;
  color: #7a8298;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d8dcec;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  padding: 0 14px;
  outline: 0;
}

.oauth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid #d8dcec;
  border-radius: 8px;
  background: #ffffff;
  color: #2f3648;
  font-weight: 900;
}

.oauth-button span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #f3f5fb;
  color: #1a73e8;
  font-size: 0.9rem;
  font-weight: 900;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8a91a6;
  font-size: 0.78rem;
  font-weight: 900;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e1e5f1;
}

.auth-text-link {
  justify-self: end;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: 0.86rem;
  font-weight: 900;
}

.terms-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1e5f1;
  border-radius: 10px;
  background: #fbfcff;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #454d63;
  font-size: 0.86rem;
  line-height: 1.45;
}

.terms-check input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
  padding: 0;
}

.terms-accordion {
  border-radius: 8px;
  background: #f0f3fb;
}

.terms-accordion summary {
  cursor: pointer;
  padding: 9px 10px;
  color: #555d74;
  font-size: 0.82rem;
  font-weight: 900;
}

.terms-accordion p {
  margin: 0;
  padding: 0 10px 10px;
  color: #667087;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.55;
}

.user-popover {
  position: fixed;
  z-index: 19;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 14px;
  box-shadow: 0 18px 48px rgba(3, 8, 39, 0.32);
}

.user-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.user-popover-head div,
.user-popover-details {
  display: grid;
  gap: 4px;
}

.user-popover-head strong {
  color: #202334;
  font-size: 1rem;
}

.user-popover-head span,
.user-popover-details p,
.message-recipient {
  margin: 0;
  color: #606a82;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.45;
}

.message-compose-card {
  gap: 16px;
}

.message-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.message-compose-head h2 {
  margin: 4px 0 0;
}

.message-compose-form {
  display: grid;
  gap: 10px;
}

.message-compose-form label {
  color: #4c556b;
  font-size: 0.86rem;
  font-weight: 900;
}

.message-compose-form textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid #d7ddeb;
  border-radius: 8px;
  background: #ffffff;
  color: #202334;
  padding: 10px 12px;
  line-height: 1.5;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: #c6213a;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.4;
}

.consent-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 21;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: min(720px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #202334;
  padding: 16px;
  box-shadow: 0 18px 48px rgba(3, 8, 39, 0.32);
}

.consent-banner strong {
  display: block;
  margin-bottom: 4px;
  color: #202334;
  font-size: 1rem;
}

.consent-banner p {
  margin: 0;
  color: #545d75;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
}

.consent-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.consent-actions .auth-button.ghost {
  border-color: #cfd6e6;
  background: #f3f5fb;
  color: #30384f;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 13px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #243174;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 14px 34px rgba(3, 8, 39, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.photo-card:focus-visible,
button:focus-visible,
.photo-action:focus-visible,
.gallery-more-button:focus-visible,
.auth-button:focus-visible,
.auth-link-button:focus-visible,
.contact-link:focus-visible,
.auth-switch-button:focus-visible,
.heart-button:focus-visible,
.notification-button:focus-visible,
.notification-close:focus-visible,
.message-list-item:focus-visible,
.user-name-button:focus-visible,
.ranking-self-link:focus-visible,
.ranking-tab:focus-visible,
.admin-tab:focus-visible,
.delete-button:focus-visible,
.comment-delete:focus-visible,
.comment-toggle:focus-visible,
.user-chip:focus-visible,
.drawer-edge-close:focus-visible,
.drawer-menu-row:focus-visible,
.drawer-back:focus-visible,
.my-title-card:focus-visible,
.avatar-edit-button:focus-visible,
.modal-close:focus-visible,
.entry-row input:focus-visible,
.compact-form input:focus-visible,
.auth-form input:focus-visible,
.comment-form input:focus-visible,
.profile-edit-form input:focus-visible,
.profile-edit-form textarea:focus-visible,
.message-compose-form textarea:focus-visible,
.report-form select:focus-visible,
.report-form textarea:focus-visible,
.cookie-settings-form input:focus-visible,
.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible,
a[href]:focus-visible {
  outline: 3px solid rgba(255, 199, 44, 0.82);
  outline-offset: 3px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 18px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.upload-form,
.suggestion-panel,
.admin-image-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  width: min(980px, 100%);
}

.upload-preview-panel,
.upload-fields,
.suggestion-card,
.admin-image-card {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 18px;
}

.upload-preview-panel,
.upload-fields,
.suggestion-card,
.source-extra-fields,
.upload-consents,
.report-form,
.admin-image-body {
  display: grid;
  gap: 12px;
}

.suggestion-panel {
  grid-template-columns: minmax(0, 1fr);
}

.suggestion-card {
  line-height: 1.55;
}

.suggestion-card h2,
.suggestion-card p {
  margin: 0;
}

.admin-upload-notice {
  width: min(980px, 100%);
  margin: -4px 0 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.5;
}

.upload-form label,
.report-form label {
  font-weight: 900;
}

.upload-form input,
.upload-form select,
.upload-form textarea,
.report-form select,
.report-form textarea,
.admin-reason-input {
  width: 100%;
  border: 1px solid #dfe3ee;
  border-radius: 8px;
  background: #ffffff;
  color: #202334;
  padding: 11px 12px;
}

.upload-preview {
  display: grid;
  min-height: 260px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-weight: 900;
}

.upload-preview img,
.admin-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-attribution-check,
.upload-consents .terms-check {
  align-items: start;
}

.form-actions,
.admin-image-actions,
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-badge {
  align-self: center;
  border-radius: 999px;
  background: rgba(255, 199, 44, 0.96);
  color: #202334;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.photo-report-action {
  background: rgba(255, 255, 255, 0.84);
  color: #202334;
}

.report-card {
  width: min(520px, calc(100vw - 28px));
}

.admin-head {
  align-items: center;
}

.admin-tab {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0 14px;
  font-weight: 900;
}

.admin-tab.is-active {
  background: var(--yellow);
  color: #202334;
}

.admin-image-list {
  display: grid;
  gap: 16px;
}

.admin-image-card {
  width: 100%;
  color: var(--text);
}

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

.admin-image-preview {
  min-height: 240px;
  max-height: 360px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.admin-image-body h2,
.admin-image-body p {
  margin: 0;
}

.admin-image-meta,
.admin-image-source {
  color: var(--muted);
  font-weight: 800;
}

:root[data-theme="light"] .contact-notice,
:root[data-theme="light"] .contact-form,
:root[data-theme="light"] .profile-edit-panel,
:root[data-theme="light"] .suggestion-card,
:root[data-theme="light"] .ranking-item,
:root[data-theme="light"] .ranking-empty,
:root[data-theme="light"] .compact-form {
  border-color: #ccd5ea;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

:root[data-theme="light"] .auth-button.ghost,
:root[data-theme="light"] .ranking-tab,
:root[data-theme="light"] .admin-tab,
:root[data-theme="light"] .heart-button,
:root[data-theme="light"] .delete-button,
:root[data-theme="light"] .comment-delete,
:root[data-theme="light"] .comment-toggle {
  border-color: #c7d0e6;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

:root[data-theme="light"] .ranking-tab.is-active,
:root[data-theme="light"] .admin-tab.is-active,
:root[data-theme="light"] .upload-nav-button {
  border-color: #fff6d6;
  background: #ffc72c;
  color: #202334;
}

:root[data-theme="light"] .comments-panel {
  background: rgba(49, 59, 94, 0.08);
}

:root[data-theme="light"] .comment-item {
  background: #ffffff;
}

:root[data-theme="light"] .contact-message,
:root[data-theme="light"] .profile-edit-panel .profile-edit-message {
  color: #a11228;
}

:root[data-theme="light"] .contact-message.is-success,
:root[data-theme="light"] .profile-edit-panel .profile-edit-message.is-success {
  color: #17642e;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ranking-layout {
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  }

  .contact-layout {
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --profile-drawer-width: 86vw;
  }

  .app-shell {
    padding: 12px 12px 34px;
  }

  .top-bar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .brand {
    font-size: 1.15rem;
    gap: 8px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .brand picture {
    flex-basis: 42px;
  }

  .auth-actions,
  .member-actions,
  .guest-chip,
  .user-chip,
  .upload-nav-button,
  .top-actions {
    grid-column: auto;
    justify-self: start;
  }

  .upload-nav-button {
    order: 2;
  }

  .top-actions {
    order: 3;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .page-head,
  .admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-form,
  .admin-image-card {
    grid-template-columns: 1fr;
  }

  .notification-panel {
    right: auto;
    left: 0;
  }

  .view {
    padding-top: 26px;
  }

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

  .photo-card-actions {
    top: 10px;
    right: 10px;
  }

  .entry-row {
    grid-template-columns: 1fr;
  }

  .ranking-head {
    align-items: start;
    flex-direction: column;
  }

  .ranking-head-actions {
    justify-content: flex-start;
  }

  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .ranking-photo-frame {
    width: min(100%, 420px);
    justify-self: center;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .profile-drawer {
    min-width: 0;
    padding: 22px 18px;
    width: var(--profile-drawer-width);
  }

  .drawer-edge-close {
    width: 36px;
    height: 36px;
    font-size: 1.45rem;
  }

  .my-title-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .my-title-thumb {
    width: 72px;
  }

  .consent-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr;
    width: auto;
  }

  .consent-actions {
    justify-content: stretch;
  }

  .consent-actions .auth-button {
    flex: 1;
  }
}

@media (max-width: 640px) {
  :root {
    --profile-drawer-width: 88vw;
  }

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

  .photo-card {
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(3, 8, 39, 0.22);
  }

  .photo-card::before {
    background: linear-gradient(to bottom, transparent 0 58%, rgba(0, 0, 0, 0.22));
  }

  .photo-card-image {
    height: 100%;
    object-fit: cover;
  }

  .photo-card-actions {
    top: 7px;
    right: 7px;
    gap: 4px;
  }

  .photo-action {
    min-width: 44px;
    min-height: 28px;
    padding: 0 7px;
    font-size: 0.72rem;
  }

  .photo-card.is-empty::after {
    width: 38px;
    height: 30px;
    right: 10px;
    bottom: 10px;
    border-radius: 6px;
    background:
      linear-gradient(var(--paper) 0 0) 8px 8px / 6px 6px no-repeat,
      linear-gradient(135deg, transparent 46%, var(--paper) 47% 56%, transparent 57%) 7px 14px / 21px 11px no-repeat,
      #45b95b;
  }

  .ranking-list {
    gap: 10px;
  }

  .ranking-item,
  .ranking-empty {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 12px 46px;
  }

  .rank-number {
    width: 28px;
    height: 28px;
    font-size: 0.82rem;
  }

  .rank-content {
    gap: 4px;
  }

  .rank-content strong {
    font-size: 0.95rem;
  }

  .rank-content span {
    font-size: 0.78rem;
  }

  .rank-actions {
    grid-column: 2;
    justify-content: flex-start;
    gap: 6px;
  }

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

  .comment-form .auth-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .top-actions,
  .auth-actions,
  .member-actions {
    width: 100%;
  }

  .auth-actions,
  .member-actions {
    flex-wrap: wrap;
  }

  .auth-button.small,
  .auth-link-button {
    min-height: 34px;
  }

  .top-actions {
    gap: 8px;
  }

  .contact-link,
  .auth-link-button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  .gallery-guide {
    margin-bottom: 18px;
    font-size: 1.35rem;
  }

  .ranking-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .rank-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .confirm-modal,
  .auth-modal {
    padding: 12px;
  }

  .auth-card,
  .confirm-card {
    padding: 20px;
  }

  .profile-drawer {
    padding: 20px 14px;
    width: var(--profile-drawer-width);
  }

  .drawer-edge-close {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }

  .drawer-stat-grid {
    grid-template-columns: 1fr;
  }
}
