:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #20242a;
  --muted: #68707a;
  --line: #d9dee6;
  --brand: #1668dc;
  --brand-strong: #0f52b5;
  --danger: #c9353d;
  --success: #248a52;
  --warn: #9a6a00;
  --shadow: 0 12px 32px rgba(25, 35, 50, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 5px;
  font-size: 18px;
}

.status-badge {
  min-width: 84px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--brand-strong);
  text-align: center;
  font-weight: 700;
}

.empty-state,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.empty-state {
  padding: 32px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.upload-panel {
  grid-row: span 2;
}

.panel {
  padding: 18px;
}

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

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.compact {
  margin-bottom: 10px;
}

.upload-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  white-space: nowrap;
}

.upload-button,
.primary-button {
  background: var(--brand);
  color: #fff;
}

.upload-button:hover,
.primary-button:hover {
  background: var(--brand-strong);
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.upload-button input {
  display: none;
}

.asset-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.asset-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.asset-preview {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  border-radius: 6px;
  background: #eef1f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-preview audio {
  width: 88px;
}

.asset-body {
  min-width: 0;
}

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

.asset-label {
  color: var(--brand-strong);
  font-size: 17px;
}

.asset-state {
  color: var(--muted);
  font-size: 12px;
}

.asset-name {
  overflow: hidden;
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-usage-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.asset-usage,
.params-grid input,
.params-grid select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.asset-usage,
.params-grid input,
.params-grid select {
  min-height: 34px;
  padding: 6px 8px;
}

.asset-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.asset-actions button {
  flex: 1;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.delete-button {
  color: var(--danger);
}

textarea {
  min-height: 178px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.params-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.check-row {
  align-content: end;
  grid-template-columns: 20px 1fr;
  min-height: 58px;
  color: var(--text) !important;
  font-size: 14px !important;
}

.check-row input {
  width: 16px;
  min-height: 16px;
}

.actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.validation-box,
.result-box,
.upload-log {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.validation-item {
  border-radius: 6px;
  padding: 9px 10px;
  background: #f1f3f7;
}

.validation-item.blocking {
  background: #fff0f1;
  color: var(--danger);
}

.validation-item.warning {
  background: #fff8e6;
  color: var(--warn);
}

.validation-item.ok {
  background: #edf8f1;
  color: var(--success);
}

.result-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.result-box a {
  color: var(--brand-strong);
  font-weight: 700;
}

.upload-log {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .asset-list {
    grid-template-columns: 1fr;
  }

  .asset-card {
    grid-template-columns: 84px minmax(0, 1fr);
  }

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

  .actions-row {
    flex-direction: column;
  }
}
