:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #6a6f75;
  --line: #d9d6ce;
  --accent: #0d7f66;
  --accent-dark: #095f4c;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

main {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 24px;
  min-height: 100vh;
  padding: 28px;
}

.composer {
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
}

form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.settings {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
}

.settings summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.settings form {
  margin-top: 14px;
}

.mini-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.mini-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.compact-actions {
  align-items: stretch;
}

.compact-actions button {
  flex: 1;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check input {
  width: 18px;
  height: 18px;
}

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

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[data-help] {
  position: relative;
}

[data-help]::after {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 9px);
  left: 50%;
  width: min(260px, 78vw);
  border: 1px solid rgba(32, 33, 36, 0.18);
  border-radius: 8px;
  background: #202124;
  box-shadow: 0 12px 26px rgba(32, 33, 36, 0.18);
  color: #ffffff;
  content: attr(data-help);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  padding: 10px 11px;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

[data-help]:hover::after,
[data-help]:focus-visible::after,
[data-help].help-open::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.help-tip {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  min-height: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.help-tip:hover,
.help-tip:focus-visible,
.help-tip.help-open {
  border-color: var(--accent);
  background: #e5f3ee;
  color: var(--accent-dark);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.secondary {
  min-height: 38px;
  background: #202124;
}

.secondary:hover {
  background: #3a3d40;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hint {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.media-review-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 6px 14px rgba(32, 33, 36, 0.08);
}

.media-review-toolbar strong {
  display: block;
  font-size: 13px;
}

.media-review-toolbar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.media-review-actions {
  display: flex;
  gap: 8px;
}

.media-review-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.media-option {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  opacity: 0.58;
  transition: border-color 120ms ease, opacity 120ms ease, outline-color 120ms ease;
}

.media-option:hover {
  background: #fff;
  border-color: var(--accent);
}

.media-option.selected {
  opacity: 1;
  background: #fff;
  border-color: var(--accent);
  outline: 2px solid #bfe6d9;
}

.media-check {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.58);
  box-shadow: 0 2px 7px rgba(32, 33, 36, 0.22);
}

.media-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.72);
  padding: 5px 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 850;
}

.media-option.selected .media-type-badge {
  background: var(--accent-dark);
}

.media-check::after {
  content: "";
  width: 11px;
  height: 6px;
  border-bottom: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  opacity: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

.media-option.selected .media-check {
  background: var(--accent);
}

.media-option.selected .media-check::after {
  opacity: 1;
}

.media-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #edeae3;
}

.media-thumb img,
.media-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-meta {
  display: grid;
  gap: 2px;
  padding: 9px;
}

.media-meta strong,
.media-meta small,
.media-meta em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-meta strong {
  font-size: 13px;
}

.media-meta small,
.empty {
  color: var(--muted);
  font-size: 12px;
}

.media-meta em {
  color: var(--danger);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.media-option.selected .media-meta em {
  color: var(--accent-dark);
}

.empty {
  grid-column: 1 / -1;
  margin: 0;
}

#status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.section-kpi {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.archive-head {
  margin-top: 28px;
}

.archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  align-items: start;
  gap: 14px;
  margin-top: 16px;
}

.remix-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(5, max-content);
  gap: 10px;
  margin-top: 12px;
}

.remix-bar button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
  white-space: nowrap;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ops-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.ops-panel h3 {
  font-size: 14px;
}

.compact-form {
  gap: 8px;
  margin-top: 0;
}

.asset {
  overflow: visible;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.asset-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #edeae3;
}

.asset-thumb img,
.asset-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-type {
  position: absolute;
  top: 9px;
  left: 9px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.74);
  padding: 5px 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.asset-body {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
}

.asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asset-head strong,
.asset-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.asset-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef1f2;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.asset-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-status {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-status.ok {
  background: #e5f3ee;
  color: var(--accent-dark);
}

.asset-status.warn {
  background: #fff3d8;
  color: #7a4a00;
}

.asset-body em {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.asset-body p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

.asset-body p span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f2;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.asset-actions button {
  min-height: 36px;
  padding: 0 9px;
  font-size: 13px;
}

.post {
  display: grid;
  min-width: 0;
  overflow: visible;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post-media-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #edeae3;
}

.post-media-preview img,
.post-media-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.post-media-empty {
  color: var(--muted);
  font-size: 13px;
}

.post-media-count {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.78);
  padding: 5px 8px;
  color: white;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-body {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
}

.post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.post-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-caption {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.post-mini-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.post-mini-strip span {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #edeae3;
}

.post-mini-strip img,
.post-mini-strip video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.badge {
  border-radius: 999px;
  background: #e5f3ee;
  color: var(--accent-dark);
  padding: 5px 9px;
}

.post a {
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-size: 12px;
}

.post-meta {
  gap: 6px;
}

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

.post-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.post-actions .post-publish {
  grid-column: 1 / -1;
}

dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .remix-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .remix-bar input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
    padding: 16px;
  }

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

  .media-review {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .remix-bar {
    grid-template-columns: 1fr 1fr;
  }
}
