/* Shared colors, fonts, buttons and accessibility styles come from the LivingPW site. */
:root {
  --text-dim: var(--text-2);
  --text-mute: var(--muted);
  --border: var(--line);
  --danger: var(--bad);
}

.mk-bar { width: min(100% - 2 * var(--gutter), 1120px); margin-inline: auto; flex-wrap: wrap; }
.mk-nav, .mk-tools { display: flex; align-items: center; gap: 5px; }
.mk-nav { margin-left: auto; flex-wrap: wrap; }
.mk-tools { margin-left: 8px; gap: 9px; }
.mk-nav button, .cat-pills button {
  appearance: none;
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font: 570 .9rem/1.3 var(--sans);
  padding: 8px 11px;
  cursor: pointer;
}
.mk-nav button:hover, .mk-nav button[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.mk-nav button[aria-current="page"] { box-shadow: 0 -2px 0 var(--accent) inset; }
.mk-lang { font: 650 .78rem var(--mono); color: var(--text-2); padding: 6px; }
.mk-theme { flex: none; }
.mk-theme span { font-size: 1.16rem; line-height: 1; }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: .9rem; }
.btn.danger { color: var(--bad); }
.btn:disabled { cursor: wait; opacity: .7; }
.hidden { display: none !important; }

.mk-main > section { padding: clamp(24px, 4vw, 46px) 0 50px; }
.mk-hero {
  display: grid;
  grid-template-columns: 1fr 1.22fr;
  min-height: 345px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}
.mk-intro { align-self: center; padding: clamp(24px, 4vw, 47px); }
.mk-intro h1 { margin: 0 0 16px; }
.mk-intro p { margin: 0; font-size: clamp(1rem, .92rem + .4vw, 1.18rem); }
.mk-hero-art { display: block; min-width: 0; background: var(--surface-2); }
.mk-hero-art img, .mk-empty img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mk-hero-art img { object-position: 50% 53%; }
html[lang="ru"] .mk-intro h1 { font-size: clamp(1.9rem, 1.25rem + 2.3vw, 2.6rem); }

.mk-collection { padding-top: clamp(28px, 4vw, 48px); }
.mk-collection-head, .search-sort { display: flex; gap: 12px; align-items: center; }
.mk-collection-head { justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.mk-collection-head h2 { margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2rem); }
.search-sort { display: grid; grid-template-columns: minmax(9rem, 14rem) max-content; }
.search-sort input { width: 100%; min-width: 0; }
.input {
  max-width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  min-height: 42px;
  font: inherit;
  font-size: .94rem;
  color: var(--text);
  background: var(--bg-2);
}
.input::placeholder { color: var(--muted); }
.cat-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.cat-pills button { border-color: var(--line); background: var(--surface); min-height: 36px; }
.cat-pills button:hover { border-color: var(--line-2); color: var(--text); }
.cat-pills button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.mk-empty, .mk-no-results {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.mk-empty { display: grid; grid-template-columns: minmax(190px, .52fr) 1fr; }
.mk-empty picture { display: block; position: relative; }
.mk-empty img { position: absolute; inset: 0; object-position: 50% 52%; }
.mk-empty > div, .mk-no-results { align-content: center; padding: clamp(19px, 3.5vw, 35px); }
.mk-empty h3 { font-size: 1.35rem; }
.mk-empty p { max-width: 51ch; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); gap: 18px; }
.sub-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.card-media { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-media.project-art img { object-position: 50% 58%; }
.card-body { flex: 1; padding: 17px 18px; overflow-wrap: anywhere; }
.card-category { font-size: .8rem; color: var(--muted); margin-bottom: 7px; }
.card-title { line-height: 1.25; margin-bottom: 8px; }
.card-title button {
  padding: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.card-title button:hover { text-decoration: underline; text-underline-offset: .18em; }
.card-summary, .card-author { font-size: .92rem; color: var(--text-2); margin: 0; }
.card-summary { margin-bottom: 12px; }
.card-footer { display: flex; padding: 0 18px 17px; }
.like-button[aria-pressed="true"] { color: var(--link); border-color: var(--accent); background: var(--accent-soft); }
.like-heart { font-size: 1.22rem; line-height: 1; }
.like-count { color: var(--text-2); font-variant-numeric: tabular-nums; }

.panel, .audit-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(15px, 2vw, 24px);
}
.panel + .panel { margin-top: 12px; }
.mk-form { max-width: 780px; }
.form-grid, .inspect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row label { font-size: .94rem; font-weight: 600; }
.drop-zone {
  display: grid; justify-items: center; gap: 5px; width: 100%;
  padding: 26px 16px; margin-bottom: 20px;
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px dashed var(--line-2); border-radius: var(--r); cursor: pointer;
}
.drop-zone.dragover, .drop-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.mk-terms { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; color: var(--text-2); }
.mk-terms input { margin: .4em 0 0; flex: none; }
.audit-box { margin-top: 13px; font-size: .9rem; }
.audit-box summary { cursor: pointer; font-weight: 600; }
.finding { padding: 6px 10px; margin-top: 7px; border-left: 2px solid var(--line-2); color: var(--text-2); }
.finding.blocker { border-color: var(--bad); }
.finding.warning { border-color: var(--warn); }
.finding.info { border-color: var(--live); }
.pill { display: inline-block; font-size: .8rem; color: var(--muted); }
.mk-release-list article { padding: 16px 0; border-top: 1px solid var(--line); }

.mk-dialog {
  width: min(1020px, 100% - 28px); max-height: 90dvh; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--text); background: var(--bg); overflow: auto;
}
.mk-dialog::backdrop { background: rgb(8 13 19 / 70%); }
.mk-dialog-small { width: min(480px, 100% - 28px); }
.modal-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.modal-head h2 { margin: 0; font-size: 1.32rem; overflow-wrap: anywhere; }
.modal-body { padding: clamp(14px, 3vw, 23px); }
.modal-body hr { margin-block: 17px; }
.mk-inspect-copy { overflow-wrap: anywhere; }
.viewer-3d { position: relative; min-height: 245px; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
#viewerFallback { height: clamp(245px, 34vw, 350px); display: grid; place-items: center; }
#viewerFallback img { max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.viewer-3d canvas { display: block; max-width: 100%; }
.v-overlay { position: absolute; inset: auto auto 8px 8px; display: flex; gap: 6px; }
.mk-inline { display: flex; align-items: center; gap: 8px; }
.mk-inline input { min-width: 0; flex: 1; }
.mk-error { color: var(--bad); margin: 8px 0 0; }
.mk-error:empty { display: none; }
.toast {
  position: fixed; z-index: 100; bottom: 16px; right: 16px;
  max-width: min(390px, 100vw - 32px); padding: 10px 15px;
  border-radius: var(--r); background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); box-shadow: 0 3px 14px rgb(0 0 0 / 14%);
}
.mk-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  color: var(--muted); font-size: .88rem; padding-block: 20px 30px;
  box-shadow: inset 0 1px 0 var(--line);
}
.mk-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }

@media (max-width: 760px) {
  .mk-hero { grid-template-columns: 1fr; }
  .mk-break { display: none; }
  .mk-hero-art { aspect-ratio: 2.2; }
  .inspect-grid { grid-template-columns: 1fr; }
  .mk-nav { margin-left: 0; }
}
@media (max-width: 540px) {
  .site-header { position: static; }
  .mk-bar { gap: 6px 12px; padding-block: 10px; }
  .mk-tools { margin-left: auto; }
  .mk-nav { order: 1; width: 100%; }
  .mk-nav button { padding-inline: 8px; }
  .mk-hero-art { aspect-ratio: 1.9; }
  .search-sort { display: grid; grid-template-columns: minmax(0, 1fr) max-content; width: 100%; gap: 8px; }
  .search-sort input { width: 100%; }
  .mk-empty { grid-template-columns: 1fr; }
  .mk-empty picture { height: 130px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
}

/* SEC-1125 WP-14: the page policy allows no inline style attributes; these were the marketplace.js ones */
.mk-row { display: flex; justify-content: space-between; align-items: center; }
.mk-gap8 { gap: 8px; }
.mk-mb8 { margin-bottom: 8px; }
.mk-mt4 { margin-top: 4px; }
.mk-m0 { margin: 0; }
.mk-sm { font-size: 12px; }
.mk-dim { font-size: 12px; color: var(--text-dim); }
.mk-dim-c { color: var(--text-dim); }
.mk-dim-p { margin: 0 0 8px; color: var(--text-dim); }
.mk-dim13 { color: var(--text-dim); font-size: 13px; }
.mk-cur-head { font-weight: 700; color: #d8b4fe; margin-bottom: 8px; }
.mk-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.mk-rev-row { display: flex; gap: 6px; margin: 8px 0; }
.mk-grow { flex: 1; }
.mk-rev { padding: 6px 0; border-top: 1px solid var(--border); font-size: 12px; }
.mk-flagged { border-color: rgba(239, 68, 68, 0.45); }
.mk-warned { border-color: rgba(245, 158, 11, 0.45); }
.mk-mono { font-family: var(--mono); font-size: 11.5px; color: var(--accent); margin-top: 4px; word-break: break-all; }
.mk-h3 { margin: 0 0 8px; }
