:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #65716f;
  --paper: #f7f3ea;
  --panel: #fffdf7;
  --line: #d8d1c3;
  --accent: #0d7f70;
  --accent-dark: #07594f;
  --berry: #9f3f5f;
  --shadow: 0 18px 45px rgb(31 36 32 / 14%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgb(13 127 112 / 12%), transparent 38%),
    linear-gradient(315deg, rgb(159 63 95 / 12%), transparent 42%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
  padding-bottom: 64px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--berry);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(4rem, 15vw, 10rem);
  font-weight: 900;
  margin: 0;
  background: linear-gradient(to bottom right, var(--ink), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 12px 24px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: rgb(255 253 247 / 84%);
  box-shadow: var(--shadow);
}

.status-panel span {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}

/* Notifications */
.notification-area {
  position: relative;
  display: flex;
  align-items: center;
}

.icon-button {
  background: transparent;
  padding: 0 8px;
  min-height: 0;
  font-size: 1.2rem;
  position: relative;
}

.icon-button:hover {
  background: transparent;
  transform: scale(1.1);
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--berry);
  color: white;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.text-button {
  background: transparent;
  color: var(--accent);
  padding: 0;
  min-height: 0;
  font-size: 0.75rem;
  font-weight: 700;
}

.text-button:hover {
  background: transparent;
  text-decoration: underline;
}

.notification-list {
  overflow-y: auto;
  padding: 8px 0;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0eee6;
  text-align: left;
  font-size: 0.85rem;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.unread {
  background: #fdfaf0;
}

.notification-item .actor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.notification-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notification-time {
  font-size: 0.7rem;
  color: var(--muted);
}

/* Control Panel */
.side-panel {
  display: grid;
  gap: 24px;
}

.control-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #fffdf7;
  border: 1px solid #f0eee6;
  border-radius: 6px;
}

.stat-item.full {
  grid-column: 1 / -1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.stat-item strong {
  font-size: 1.1rem;
  color: var(--accent);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.upload-panel,
.gallery-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upload-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

input[type="file"] {
  padding: 10px 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 16px;
  font-weight: 900;
  cursor: pointer;
}

button.hidden,
.hidden {
  display: none;
}

.button-link {
  display: inline-grid;
  min-height: 44px;
  align-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-dark);
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.account-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.account-bar strong {
  overflow-wrap: anywhere;
}

.gallery-panel {
  min-height: 480px;
  padding: 20px;
}

.gallery-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #ebe5d8;
  border-bottom: 1px solid var(--line);
}

.image-card .meta {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.image-card strong,
.image-card a {
  overflow-wrap: anywhere;
}

.image-card strong {
  font-size: 0.92rem;
}

.image-card span,
.image-card a {
  color: var(--muted);
  font-size: 0.82rem;
}

.meta-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.copy-button {
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.copy-button:hover {
  background: var(--paper);
  color: var(--ink);
}

.copy-button.copied {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.reactions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0eee6;
}

.react-button {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.react-button:hover {
  background: var(--paper);
  border-color: var(--muted);
}

.react-button.reacted {
  border-color: var(--berry);
  background: #fff5f8;
  color: var(--berry);
}

.checkbox-label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.checkbox-label input {
  width: 20px;
  min-height: 20px;
}

.hint {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 24px, 620px);
    padding: 24px 0;
  }

  .masthead,
  .workspace {
    grid-template-columns: 1fr;
  }

  .status-panel {
    min-width: 0;
  }

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

  .account-bar {
    grid-template-columns: 1fr;
  }
}

.footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
