:root {
  color-scheme: light;
  --ink: #1b2430;
  --muted: #657084;
  --line: #d9e0e8;
  --paper: #f7f8f5;
  --white: #ffffff;
  --green: #2f7d68;
  --green-dark: #1f5c4b;
  --coral: #d8644c;
  --blue: #4169a8;
  --gold: #c7953e;
  --shadow: 0 18px 60px rgba(32, 42, 54, 0.12);
}

html[data-edition="owner"] {
  --green: #315f87;
  --green-dark: #234662;
  --coral: #b46a3b;
}

html:not([data-edition="owner"]) .owner-only,
html[data-edition="owner"] .customer-only {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 68px);
  background: rgba(247, 248, 245, 0.92);
  border-bottom: 1px solid rgba(27, 36, 48, 0.08);
  backdrop-filter: blur(14px);
}

.brand,
.nav,
.top-actions,
.language-switch,
.hero-actions,
.section-heading,
.post-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.edition-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(47, 125, 104, 0.1);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: var(--white);
  font-size: 14px;
}

.nav {
  gap: clamp(14px, 4vw, 34px);
  color: var(--muted);
  font-size: 15px;
}

.top-actions {
  gap: 10px;
}

.edition-switch {
  display: flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.edition-switch a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.edition-switch a.active {
  background: var(--green);
  color: var(--white);
}

.message-icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--green-dark);
}

.message-icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.language-switch {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.language-option {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.language-option.active {
  background: var(--green);
  color: var(--white);
}

.ghost-button,
.primary-button,
.secondary-button,
.post-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.ghost-button {
  padding: 0 18px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  font-weight: 700;
}

.primary-button {
  background: var(--green);
  color: var(--white);
}

.primary-button:hover {
  background: var(--green-dark);
}

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

.small {
  min-height: 38px;
  padding-inline: 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  min-height: calc(100vh - 66px);
  padding: clamp(34px, 7vw, 82px) clamp(18px, 5vw, 68px) clamp(26px, 5vw, 56px);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.7;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-visual {
  min-width: 0;
}

.hero-visual img {
  display: block;
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  filter: drop-shadow(0 22px 40px rgba(32, 42, 54, 0.18));
}

.section-band {
  padding: clamp(34px, 6vw, 74px) clamp(18px, 5vw, 68px);
  border-top: 1px solid rgba(27, 36, 48, 0.08);
}

.section-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.owner-dashboard {
  background: linear-gradient(135deg, #edf3f7 0%, #f8fafb 55%, #f3eee7 100%);
}

.owner-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(49, 95, 135, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.owner-welcome div {
  display: grid;
  gap: 4px;
}

.owner-welcome span,
.owner-welcome p {
  color: var(--muted);
  font-size: 14px;
}

.owner-welcome strong {
  font-size: 22px;
}

.owner-welcome p {
  margin: 0;
}

.owner-summary-grid,
.owner-tool-grid {
  display: grid;
  gap: 14px;
}

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

.owner-stat-card {
  display: grid;
  gap: 12px;
  min-height: 130px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(32, 42, 54, 0.06);
}

.owner-stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.owner-stat-card strong {
  align-self: end;
  color: var(--green-dark);
  font-size: 42px;
  line-height: 1;
}

.owner-tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.owner-tool-grid a {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.owner-tool-grid a:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.owner-tool-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.05;
}

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

.filters,
.item-card,
.mentor-card,
.mentor-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(32, 42, 54, 0.06);
}

.filters {
  display: grid;
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 84px;
}

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

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

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 104, 0.14);
}

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

.item-card {
  overflow: hidden;
}

.item-art {
  display: grid;
  height: 142px;
  place-items: center;
  background-size: cover;
  background-position: center;
  color: var(--white);
  font-size: 46px;
  font-weight: 900;
}

.item-art.has-photo {
  color: transparent;
}

.item-body,
.mentor-card {
  padding: 16px;
}

.meta-row,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.remove-item-button {
  border-color: rgba(216, 100, 76, 0.35);
  color: var(--coral);
}

.tag {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(65, 105, 168, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.item-card h3,
.mentor-card h4 {
  margin: 12px 0 8px;
  font-size: 19px;
}

.item-card p,
.mentor-card p,
.panel-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.price {
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 900;
}

.card-footer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.contact-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfd;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 900;
}

.messages-band {
  background: #fbfcfd;
}

.message-page {
  display: none;
}

body.messages-page .main-page,
body.messages-page .activity-page,
body.activity-page-mode .main-page,
body.activity-page-mode .message-page {
  display: none;
}

body.messages-page .message-page {
  display: block;
  min-height: calc(100vh - 66px);
}

section.activity-page {
  display: none;
  background: #fbfcfd;
}

body.activity-page-mode .activity-page {
  display: block;
  min-height: calc(100vh - 66px);
}

.activity-account-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(32, 42, 54, 0.06);
}

.activity-profile-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.activity-avatar-picker {
  position: relative;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 8px;
}

.activity-avatar-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.activity-avatar-action {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 5px 2px;
  background: rgba(15, 45, 38, 0.8);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.activity-avatar-picker:hover .activity-profile-avatar,
.activity-avatar-picker:focus-within .activity-profile-avatar {
  outline: 3px solid rgba(35, 122, 94, 0.22);
  outline-offset: 2px;
}

.activity-avatar-picker.is-disabled .activity-avatar-action {
  display: none;
}

.activity-avatar-picker.is-disabled input {
  cursor: default;
}

.activity-profile-avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--green);
  color: var(--white);
  font-size: 24px;
  font-weight: 900;
}

.activity-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-profile-main h3,
.activity-profile-main p,
.activity-login-note {
  margin: 0;
}

.activity-profile-main h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-profile-main p,
.activity-login-note {
  color: var(--muted);
}

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

.activity-profile-stats div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: #eef4f1;
  text-align: center;
}

.activity-profile-stats strong {
  color: var(--green-dark);
  font-size: 22px;
}

.activity-profile-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.message-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(32, 42, 54, 0.06);
}

.conversation-list {
  min-height: 560px;
  border-right: 1px solid var(--line);
  background: #f4f7f7;
}

.conversation-list > .eyebrow {
  margin: 18px 18px 8px;
}

#conversationItems {
  display: grid;
}

.conversation-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  border: 0;
  border-top: 1px solid rgba(27, 36, 48, 0.06);
  padding: 12px 16px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.conversation-item.active,
.conversation-item:hover {
  background: var(--white);
}

.conversation-main {
  min-width: 0;
}

.conversation-main strong,
.conversation-main span,
.conversation-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-main span {
  color: var(--ink);
  font-size: 14px;
}

.conversation-main small {
  color: var(--muted);
  font-size: 12px;
}

.message-panel {
  display: grid;
  grid-template-rows: auto minmax(220px, auto) auto;
  overflow: hidden;
  box-shadow: none;
}

.chat-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.chat-header h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.chat-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.purchase-button {
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: var(--green-dark);
  color: var(--white);
  font-weight: 900;
  cursor: pointer;
}

.purchase-payment-panel {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(180px, 230px);
  gap: 14px 20px;
  padding: 20px;
  border-top: 1px solid var(--line);
  background: #f4f8f6;
}
.purchase-payment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.purchase-payment-heading span { color: var(--green-dark); font-size: 12px; font-weight: 900; }
.purchase-payment-heading h3 { margin: 4px 0 0; }
.purchase-payment-heading > button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #e3eae6; color: var(--ink); font-size: 22px; cursor: pointer; }
.purchase-payment-panel label { align-self: end; }
.purchase-payment-summary { display: grid; gap: 8px; padding: 14px; border-radius: 8px; background: var(--white); }
.purchase-payment-summary span { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.purchase-payment-summary .total { padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 900; }
.purchase-payment-panel > img { grid-column: 2; grid-row: 1 / span 3; display: block; width: 100%; border-radius: 10px; }
.purchase-payment-panel > p, .purchase-payment-panel > small, .purchase-payment-panel > .primary-button { grid-column: 1; margin: 0; }
.purchase-payment-panel > p { font-size: 13px; }
.purchase-payment-panel > p strong { overflow-wrap: anywhere; }
.purchase-payment-panel > small { color: var(--muted); line-height: 1.5; }

.message-history {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 250px;
  max-height: 430px;
  overflow: auto;
  padding: 18px;
  background: #f7f8f5;
}

.message-bubble {
  max-width: min(78%, 560px);
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(32, 42, 54, 0.08);
}

.message-bubble.mine {
  justify-self: end;
  background: var(--green);
  color: var(--white);
}

.message-bubble small {
  display: block;
  margin-top: 6px;
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
}

.message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.message-form textarea {
  min-height: 58px;
}

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

.activity-composer,
.activity-feed {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(32, 42, 54, 0.06);
}

.activity-composer textarea {
  min-height: 120px;
  resize: vertical;
}

.activity-composer.disabled-panel {
  opacity: 0.68;
}

.activity-composer.disabled-panel textarea,
.activity-composer.disabled-panel select,
.activity-composer.disabled-panel input {
  cursor: not-allowed;
}

.activity-preview {
  display: grid;
  min-height: 150px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  font-weight: 800;
}

.activity-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.activity-feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-feed-heading h3 {
  margin: 0;
  font-size: 22px;
}

.activity-feed-heading span {
  display: grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #eef4f1;
  color: var(--green-dark);
  font-weight: 900;
}

.activity-list {
  display: grid;
  gap: 12px;
}

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

.activity-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-author {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.activity-author strong,
.activity-author span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-author span,
.activity-time {
  color: var(--muted);
  font-size: 13px;
}

.activity-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #eef4f1;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.activity-card p {
  margin: 0;
  line-height: 1.55;
}

.activity-card img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
}

.tutoring {
  background: #eef4f1;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segment.active {
  background: var(--green);
  color: var(--white);
}

.role-panel {
  display: none;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 22px;
  align-items: start;
}

.role-panel.active {
  display: grid;
}

.panel-copy {
  padding: 26px 0;
}

.panel-copy h3 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.05;
}

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

.mentor-card {
  min-height: 188px;
}

.mentor-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #f1e3d2;
  color: var(--coral);
  font-weight: 900;
}

.rating {
  color: var(--gold);
  font-weight: 900;
}

.mentor-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.price-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.price-input-row:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 104, 0.14);
}

.currency-lock,
.rate-lock {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 12px;
  background: #eef4f1;
  color: var(--green-dark);
  font-weight: 900;
  white-space: nowrap;
}

.rate-lock {
  color: var(--muted);
  font-size: 13px;
}

.price-input-row input {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.price-input-row input:focus {
  box-shadow: none;
}

.post-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(28px, 5vw, 54px) clamp(18px, 5vw, 68px);
  background: var(--ink);
  color: var(--white);
}

.post-strip h2 {
  font-size: clamp(26px, 4vw, 44px);
}

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

.post-actions button {
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(27, 36, 48, 0.42);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.item-post-dialog {
  width: min(100%, 720px);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.auth-copy {
  padding-right: 34px;
}

.auth-copy h2 {
  font-size: clamp(28px, 5vw, 38px);
}

.auth-copy p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 22px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f7;
}

.auth-tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.active {
  background: var(--green);
  color: var(--white);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.form-grid-two,
.form-grid-three {
  display: grid;
  gap: 14px;
}

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

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

.photo-preview {
  display: grid;
  min-height: 178px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #b8c4cf;
  border-radius: 8px;
  background: #f4f7f7;
  color: var(--muted);
  font-weight: 800;
}

.photo-preview img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

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

.send-code-button {
  min-width: 122px;
  white-space: nowrap;
}

.send-code-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--coral);
  font-size: 14px;
  font-weight: 800;
}

.form-message.success {
  color: var(--green-dark);
}

@media (max-width: 980px) {
  .hero,
  .market-layout,
  .role-panel,
  .message-layout,
  .activity-account-panel,
  .activity-layout {
    grid-template-columns: 1fr;
  }

  .conversation-list {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    max-width: 560px;
  }

  .filters {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

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

  .owner-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .top-actions {
    flex-wrap: wrap;
    margin-left: auto;
  }

  .section-heading,
  .post-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .item-grid,
  .mentor-grid,
  .owner-summary-grid,
  .owner-tool-grid,
  .segmented,
  .verification-row,
  .form-grid-two,
  .form-grid-three,
  .message-form {
    grid-template-columns: 1fr;
  }

  .chat-header { grid-template-columns: 48px minmax(0, 1fr); }
  .purchase-button { grid-column: 1 / -1; width: 100%; }
  .purchase-payment-panel { grid-template-columns: 1fr; }
  .purchase-payment-panel > img,
  .purchase-payment-panel > p,
  .purchase-payment-panel > small,
  .purchase-payment-panel > .primary-button { grid-column: 1; grid-row: auto; }
  .purchase-payment-panel > img { width: min(100%, 280px); margin: auto; }

  .owner-welcome {
    align-items: flex-start;
    flex-direction: column;
  }

  .edition-switch {
    order: 3;
    width: 100%;
  }

  .edition-switch a {
    flex: 1;
    justify-content: center;
  }

  .hero {
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(40px, 13vw, 62px);
  }
}
