@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400&family=Poppins:wght@800&display=swap");

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #edf2f8;
  --ink: #1f2933;
  --muted: #64748b;
  --border: #d7e0ec;
  --primary: #1c2e4a;
  --primary-dark: #101b2e;
  --primary-soft: #e4ebf5;
  --accent: #526d91;
  --accent-soft: #e9eff7;
  --warning: #b7791f;
  --shadow: 0 16px 40px rgba(31, 41, 51, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

body,
button,
input,
select,
textarea,
label,
a,
p,
span,
small,
h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
th,
.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.profile-button,
.tab-button,
.major-button,
.status-pill,
.notification-count,
.avatar {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400 !important;
}

button,
a,
input,
select,
textarea {
  outline-color: var(--primary);
}

img {
  display: block;
  max-width: 100%;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    linear-gradient(135deg, rgba(28, 46, 74, 0.13), transparent 35%),
    linear-gradient(315deg, rgba(82, 109, 145, 0.12), transparent 42%),
    var(--bg);
}

.auth-panel {
  width: min(760px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-panel.narrow {
  width: min(460px, 100%);
}

.auth-panel .brand-wordmark,
.auth-panel .avatar-heading h1,
.auth-panel .auth-link-row a {
  color: var(--primary);
}

.auth-panel .primary-button {
  background: var(--primary);
}

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-lockup.centered {
  flex-direction: column;
  text-align: center;
  justify-content: center;
}

.brand-lockup h1,
.brand-lockup p {
  margin: 0;
}

.brand-lockup h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.brand-lockup p {
  margin-top: 6px;
  color: var(--muted);
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--primary);
  color: white;
  font-weight: 400;
  letter-spacing: 0;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 22px;
}

.tab-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 400;
}

.tab-button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(31, 41, 51, 0.08);
}

.auth-form,
.listing-form {
  display: none;
}

.auth-form.active,
.listing-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 400;
}

label span,
label small {
  font-size: 0.9rem;
}

label:has(input[required]) > span:first-child::after,
label:has(select[required]) > span:first-child::after,
label:has(textarea[required]) > span:first-child::after {
  content: " *";
  color: #b42318;
  font-size: 0.82em;
}

label small {
  color: var(--muted);
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 12px 13px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28, 46, 74, 0.13);
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 400;
}

.password-toggle:hover {
  border-color: var(--primary);
}

.password-toggle {
  transform: translateY(-50%);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: #a13424;
  font-weight: 400;
}

.form-success {
  min-height: 22px;
  margin: 0;
  color: var(--primary-dark);
  font-weight: 400;
}

.auth-link-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
  font-size: 0.92rem;
  font-weight: 400;
}

.auth-link-row a {
  color: var(--primary-dark);
}

.demo-code {
  margin: 0;
  color: var(--primary-dark);
  background: var(--surface-muted);
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-weight: 400;
}

.code-input {
  text-align: center;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button,
.profile-button {
  min-height: 42px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  background: var(--accent);
  color: white;
  padding: 0 18px;
}

.primary-button:hover,
.icon-button:hover,
.profile-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button.disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.secondary-button.disabled {
  pointer-events: none;
}

.secondary-button {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: #c9d6e8;
  padding: 0 18px;
}

.danger-button {
  background: #b42318;
  color: white;
  border-color: #b42318;
  padding: 0 18px;
}

.danger-button:hover {
  background: #8f1d15;
  border-color: #8f1d15;
  transform: translateY(-1px);
}

.ghost-button {
  background: var(--surface);
  border-color: #c9d6e8;
  color: var(--primary-dark);
  padding: 0 18px;
}

.full-width {
  width: 100%;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 600px) minmax(170px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 44px);
  background: var(--primary);
  border-bottom: 1px solid var(--primary-dark);
  box-shadow: 0 10px 26px rgba(28, 46, 74, 0.14);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  font-family: "Poppins", "Arial Rounded MT Bold", "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 800 !important;
  letter-spacing: 0;
  line-height: 1;
  text-transform: lowercase;
}

.topbar .brand-wordmark,
.topbar .page-title {
  color: white;
}

.brand-wordmark-large {
  font-size: clamp(3rem, 9vw, 5.8rem);
}

.auth-logo-corner {
  position: fixed;
  left: 20px;
  top: 18px;
  z-index: 2;
  display: inline-flex;
}

.page-title {
  justify-self: center;
  font-weight: 400;
  font-size: 1.05rem;
}

.search-wrap {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 120px;
  gap: 10px;
}

.search-wrap input,
.search-wrap select {
  min-height: 46px;
  border-radius: 999px;
  padding-inline: 20px;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--primary-dark);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button,
.profile-button {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  color: white;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}

.icon-button:hover,
.profile-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.plus-button {
  font-size: 1.7rem;
  line-height: 1;
}

.bell-icon {
  position: relative;
  width: 17px;
  height: 19px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 4px 4px;
}

.bell-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.bell-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.message-icon {
  position: relative;
  width: 20px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.message-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -6px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: var(--primary);
  transform: skewY(-35deg);
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: white;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 400;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-dark);
  color: white;
  font-size: 0.85rem;
  font-weight: 400;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar {
  width: 86px;
  height: 86px;
  font-size: 1.4rem;
  border: 3px solid var(--surface);
  box-shadow: 0 8px 24px rgba(28, 46, 74, 0.18);
}

.notification-popover {
  position: absolute;
  top: 64px;
  right: clamp(16px, 4vw, 44px);
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
}

.notification-item {
  display: block;
  padding: 12px;
  border-radius: 6px;
}

.notification-item:hover {
  background: var(--surface-muted);
}

.notification-item strong {
  display: block;
  margin-bottom: 3px;
}

.notification-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

.market-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  width: min(1220px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.sidebar h2,
.section-heading h1,
.section-heading h2 {
  margin: 0;
}

.major-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.major-button {
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 400;
}

.major-button:hover,
.major-button.active {
  background: var(--surface-muted);
  color: var(--primary-dark);
}

.listing-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.listing-card {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, border 160ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(28, 46, 74, 0.38);
}

.listing-photo {
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
  overflow: hidden;
}

.listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-body {
  padding: 12px;
}

.listing-body h3 {
  margin: 0 0 7px;
  font-size: 1rem;
  line-height: 1.25;
}

.listing-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 400;
}

.status-pill.sold {
  background: var(--accent-soft);
  color: var(--primary-dark);
}

.empty-state {
  margin-top: 24px;
  padding: 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state p {
  margin-top: 6px;
  color: var(--muted);
}

.detail-shell,
.form-shell,
.chat-shell,
.dashboard-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.detail-shell {
  display: grid;
  gap: 18px;
}

.back-link {
  color: var(--primary-dark);
  font-weight: 400;
}

.item-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.seller-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
}

.item-gallery,
.item-info,
.listing-form,
.purchase-panel,
.chat-panel,
.profile-summary,
.dashboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.item-gallery {
  padding: 14px;
}

.hero-photo {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-muted);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.thumb-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.item-info {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.item-info h1,
.purchase-panel h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.15;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.item-description {
  padding-top: 4px;
  white-space: pre-wrap;
  color: #344054;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.seller-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  color: var(--primary-dark);
}

.seller-avatar {
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
  flex: 0 0 auto;
}

.contact-panel {
  max-width: 380px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: grid;
}

.contact-panel[hidden] {
  display: none;
}

.contact-close {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #8a94a3;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  padding: 0;
  justify-self: start;
}

.contact-panel h2 {
  margin: 18px 0 14px;
  color: #8a94a3;
  font-size: 1.15rem;
}

.contact-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  color: #006fc9;
  border-bottom: 1px solid var(--border);
}

.contact-row:hover {
  color: var(--primary);
}

.contact-icon {
  position: relative;
  width: 24px;
  height: 24px;
  color: currentColor;
}

.contact-mail-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.contact-mail-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 11px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.contact-phone-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 13px;
  height: 13px;
  border-left: 5px solid currentColor;
  border-bottom: 5px solid currentColor;
  border-radius: 4px 0 4px 4px;
  transform: rotate(-45deg);
}

.contact-muted {
  margin: 12px 0 0;
  color: var(--muted);
}

.form-shell {
  width: min(760px, calc(100% - 32px));
}

.listing-form,
.purchase-panel {
  padding: 24px;
}

.avatar-panel {
  width: min(880px, 100%);
}

.avatar-heading {
  text-align: center;
  margin-bottom: 22px;
}

.avatar-heading h1,
.avatar-heading p {
  margin: 0;
}

.avatar-heading p {
  margin-top: 6px;
  color: var(--muted);
}

.avatar-form {
  display: grid;
  gap: 18px;
}

.avatar-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 14px;
}

.avatar-choice {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: var(--radius);
}

.avatar-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-choice-image,
.avatar-choice-initials {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface-muted);
  transition: transform 160ms ease, border 160ms ease, box-shadow 160ms ease;
  overflow: hidden;
}

.avatar-choice-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-choice-initials {
  color: var(--primary-dark);
  font-size: 1.8rem;
}

.avatar-choice:hover .avatar-choice-image,
.avatar-choice:hover .avatar-choice-initials,
.avatar-choice input:checked + .avatar-choice-image,
.avatar-choice input:checked + .avatar-choice-initials {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(28, 46, 74, 0.16);
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.photo-preview-tile {
  position: relative;
  min-width: 0;
}

.photo-preview-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.photo-remove-button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(16, 27, 46, 0.78);
  color: white;
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.photo-remove-button:hover {
  background: #b42318;
}

.condition-field {
  display: grid;
  gap: 7px;
}

.condition-field > span {
  font-size: 0.9rem;
}

.condition-picker {
  position: relative;
}

.condition-current {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9d6e8;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 0 14px;
  cursor: pointer;
  text-align: left;
}

.condition-menu {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.condition-option {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
  cursor: pointer;
  text-align: left;
}

.condition-option:hover,
.condition-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.condition-option span {
  color: var(--muted);
  font-size: 0.86rem;
}

.purchase-panel {
  display: grid;
  gap: 18px;
}

.purchase-summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.purchase-summary img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.success-box {
  background: var(--surface-muted);
  border: 1px solid rgba(28, 46, 74, 0.25);
  border-radius: var(--radius);
  color: var(--primary-dark);
  padding: 14px;
  font-weight: 400;
}

.chat-shell {
  width: min(860px, calc(100% - 32px));
}

.chat-panel {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.chat-context {
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  color: var(--muted);
  font-weight: 400;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  overflow: auto;
}

.message {
  max-width: min(72%, 520px);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-muted);
}

.message.own {
  align-self: flex-end;
  background: var(--primary);
  color: white;
}

.message.system {
  align-self: center;
  max-width: min(86%, 620px);
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-align: center;
}

.message time {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  opacity: 0.75;
}

.message-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.messages-shell {
  width: min(900px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.messages-inbox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.conversation-list {
  display: grid;
  gap: 10px;
}

.conversation-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.conversation-row:hover {
  background: var(--primary-soft);
  border-color: #c9d6e8;
}

.conversation-row .avatar {
  width: 48px;
  height: 48px;
}

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

.conversation-main h3,
.conversation-main p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-main p {
  color: var(--muted);
  font-size: 0.9rem;
}

.conversation-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.unread-pill {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  padding: 0 7px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: start;
}

.profile-summary,
.dashboard-section {
  padding: 20px;
}

.profile-summary {
  display: grid;
  gap: 12px;
}

.profile-summary h1 {
  margin: 0;
}

.profile-row {
  display: grid;
  gap: 3px;
}

.profile-row span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.profile-row strong {
  overflow-wrap: anywhere;
}

.dashboard-section {
  grid-column: 2;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.compact-item:hover {
  border-color: rgba(28, 46, 74, 0.35);
}

.compact-item strong {
  overflow-wrap: anywhere;
}

.compact-item span,
.compact-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 880px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search-wrap,
  .page-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .search-wrap {
    grid-template-columns: 1fr 150px 120px;
  }

  .market-shell,
  .item-layout,
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .major-list {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .dashboard-section {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .auth-panel,
  .listing-form,
  .purchase-panel,
  .profile-summary,
  .dashboard-section {
    padding: 18px;
  }

  .two-columns,
  .purchase-summary,
  .message-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding-inline: 14px;
  }

  .search-wrap {
    grid-template-columns: 1fr;
  }

  .brand-wordmark {
    font-size: 1.62rem;
  }

  .brand-wordmark-large {
    font-size: clamp(2.6rem, 14vw, 4.2rem);
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup.centered {
    align-items: center;
  }

  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .listing-body h3 {
    font-size: 0.92rem;
  }

  .message {
    max-width: 88%;
  }
}
