:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #5e6b66;
  --line: #d8ded7;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --mint: #dff3df;
  --mint-strong: #166c4f;
  --blue: #2563eb;
  --blue-soft: #edf3ff;
  --coral: #c84f36;
  --coral-soft: #ffe8df;
  --gold: #a06a00;
  --shadow: 0 18px 45px rgba(39, 51, 47, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(223, 243, 223, 0.58), rgba(251, 252, 248, 0.82) 360px),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 800;
}

h2 {
  font-size: 1.1rem;
  line-height: 1.25;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 20px;
  background: linear-gradient(180deg, rgba(243, 250, 240, 0.98), rgba(243, 250, 240, 0.84));
  backdrop-filter: blur(12px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 68px;
  height: 68px;
  border: 1px solid rgba(23, 32, 28, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

#sessionLine {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.menu-button span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.feature-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.feature-menu.is-open {
  display: grid;
  gap: 4px;
}

.feature-menu button,
.feature-menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-weight: 750;
}

.feature-menu button:hover,
.feature-menu a:hover,
.feature-menu .is-current {
  background: var(--mint);
  color: var(--mint-strong);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(300px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.intro-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 420px;
  padding: 18px 10px;
}

.intro-panel h2 {
  max-width: 760px;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.intro-panel p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--mint-strong);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-note,
.privacy-note,
.array-note {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.privacy-note {
  margin: 14px 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--mint-strong);
  background: var(--mint);
  border: 1px solid rgba(22, 108, 79, 0.22);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
}

.status-pill.is-blocked {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: rgba(200, 79, 54, 0.26);
}

.form-grid,
.message-composer,
.photo-details,
.owner-form {
  display: grid;
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-details {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.message-composer {
  grid-template-columns: 0.7fr 1.5fr auto;
  margin-bottom: 14px;
}

.owner-form {
  grid-template-columns: minmax(180px, 1fr) auto;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input {
  height: 42px;
  padding: 0 12px;
}

input[readonly] {
  color: var(--muted);
  background: #f8faf6;
}

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.primary-button,
.ghost-button,
.vote-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  align-self: end;
  padding: 0 14px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

.primary-button:hover {
  background: #26312d;
}

.accent-button {
  background: var(--coral);
}

.accent-button:hover {
  background: #a8422d;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
  font-weight: 800;
}

.readout {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.readout span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.readout strong {
  font-size: 1.08rem;
}

.upload-layout {
  display: grid;
  gap: 14px;
}

.upload-drop {
  min-height: 92px;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(22, 108, 79, 0.5);
  border-radius: 8px;
  background: #f8fbf6;
  text-align: center;
}

.upload-drop span {
  color: var(--mint-strong);
  font-size: 1rem;
}

.upload-drop input {
  max-width: 360px;
  padding-top: 8px;
}

.image-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8f3;
}

.image-preview img {
  width: 100%;
  height: min(42vw, 310px);
  min-height: 210px;
  object-fit: contain;
  background: #ffffff;
}

.activity-list {
  display: grid;
  gap: 8px;
  max-height: 138px;
  margin: 0;
  padding: 0 0 0 22px;
  color: var(--muted);
  overflow: auto;
  font-size: 0.9rem;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.post-upload-preview {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.post-upload-preview img {
  width: 92px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
}

.post-upload-preview span {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.feed-list {
  display: grid;
  gap: 14px;
}

.post-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.post-topline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(22, 108, 79, 0.9)),
    #2563eb;
  flex: 0 0 auto;
}

.post-date,
.media-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.post-text {
  margin-top: 12px;
  line-height: 1.5;
}

.post-media {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf6;
}

.post-media img {
  width: 96px;
  height: 66px;
  border-radius: 6px;
  object-fit: cover;
}

.vote-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.vote-button {
  padding: 0 12px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.vote-button.is-active {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.dislike-button.is-active {
  background: var(--coral);
  border-color: var(--coral);
}

.vote-summary {
  min-width: 0;
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: right;
}

.wide-field {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f4f7f2;
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  font-size: 0.92rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.message-text-cell {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
  line-height: 1.4;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.read-true {
  color: var(--mint-strong);
  font-weight: 800;
}

.read-false {
  color: var(--coral);
  font-weight: 800;
}

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

.owner-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.owner-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: var(--blue-soft);
}

.owner-card strong {
  overflow-wrap: anywhere;
}

.owner-card p,
.owner-card span,
.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .home-grid,
  .photo-details {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    min-height: auto;
    padding: 18px 0 4px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .brand-lockup,
  .panel-heading {
    align-items: stretch;
  }

  .topbar {
    flex-direction: row;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .intro-panel h2 {
    font-size: 2.25rem;
  }

  .form-grid,
  .message-composer,
  .owner-form,
  .composer,
  .post-upload-preview,
  .vote-row,
  .post-media {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button,
  .vote-button {
    width: 100%;
  }

  .feature-menu {
    right: 0;
    width: min(240px, calc(100vw - 28px));
  }

  .vote-summary {
    text-align: left;
  }

  .post-media img {
    width: 100%;
    height: 120px;
  }
}
