.settings-grid {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.tg-card {
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.settings-section {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: #fff;
}

.settings-section summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  min-height: 56px;
  padding: 14px 46px 14px 16px;
  cursor: pointer;
  list-style: none;
  background: #fff;
  line-height: 1.2;
}

.settings-section[open] summary {
  border-bottom: 1px solid #eef2f7;
  box-shadow: none;
}

.settings-section > :not(summary) {
  margin: 12px;
}

.settings-section-body {
  display: grid;
  gap: 10px;
}

.settings-section > label,
.settings-section > input,
.settings-section > textarea,
.settings-section > button {
  margin-right: 12px;
  margin-left: 12px;
}

.settings-section > input,
.settings-section > textarea {
  width: calc(100% - 24px);
}

.settings-section > button {
  justify-self: start;
}

.settings-section summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: translateY(-65%) rotate(45deg);
}

.settings-section[open] summary::after {
  transform: translateY(-35%) rotate(225deg);
}

.settings-section summary::-webkit-details-marker {
  display: none;
}

.summary-title {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}

.summary-chips {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.summary-chip {
  display: inline-flex;
  max-width: 190px;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #075985;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.summary-chip.muted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.settings-section h3 {
  margin: 0;
  font-size: 15px;
}

.settings-section code {
  display: block;
  min-height: 20px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.settings-actions,
.box-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

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

.idea-card {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.idea-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.idea-card h3 {
  margin: 8px 0;
}

.idea-card p {
  margin: 6px 0;
}

.idea-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.settings-two,
.settings-three {
  display: grid;
  gap: 10px;
}

.settings-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

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

.duration-grid {
  display: grid;
  gap: 12px;
}

.duration-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.duration-card h3 {
  font-size: 16px;
  line-height: 1.25;
}

.duration-card select {
  min-width: 132px;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
}

.duration-card button {
  grid-column: 2 / -1;
  justify-self: start;
  min-height: 34px;
}

.duration-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--blue);
}

.soft-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #edf0f5;
  border-radius: 12px;
  background: var(--inset);
}

.asset-list,
.asset-grid {
  display: grid;
  gap: 8px;
}

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

.asset-card,
.overlay-card {
  display: grid;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: var(--inset);
}

.asset-card.selected,
.media-card.selected,
.overlay-card.selected,
.thumb-card.selected {
  border-color: rgba(36, 161, 222, 0.75);
  box-shadow: 0 0 0 2px rgba(36, 161, 222, 0.14);
}

.asset-card {
  grid-template-columns: 46px 1fr auto;
}

.asset-card.text-card {
  grid-template-columns: 1fr auto auto;
}

.asset-card img,
.overlay-card img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 10px;
  background: #e5e7eb;
}

.asset-card strong,
.overlay-card strong {
  display: block;
  font-size: 13px;
}

.overlay-files {
  display: grid;
  gap: 6px;
}

.overlay-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.overlay-file-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overlay-file-row button {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
}

.asset-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.asset-card a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.thumb-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: white;
}

.thumb-card.selected::after {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(36, 161, 222, 0.8);
  border-radius: 12px;
  pointer-events: none;
  content: "";
}

.thumb-card img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  background: #e5e7eb;
}

.delete-chip {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-color: rgba(0, 0, 0, 0.72);
  background: rgba(0, 0, 0, 0.72);
}

.target-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
}

.target-row button {
  height: 32px;
  padding: 0 4px;
  background: #eef2f7;
  border-color: #eef2f7;
  color: #475569;
  font-size: 11px;
}

.target-row button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.target-row button.dark {
  background: #111827;
  border-color: #111827;
}

.upload-button,
.icon-button,
.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
}

.upload-button {
  background: #111827;
  color: white;
}

.upload-button.blue {
  background: var(--blue);
}

.upload-button input,
.icon-button input {
  display: none;
}

.icon-button {
  width: 34px;
  padding: 0;
  background: #e0f2fe;
  color: var(--blue);
}

.mini-badge {
  background: #e0f2fe;
  color: #0369a1;
}

.empty-box {
  display: flex;
  min-height: 176px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.compact-empty {
  min-height: 72px;
  padding: 12px;
}

.empty-text {
  font-style: italic;
}

@media (max-width: 620px) {
  .format-tabbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .format-settings-head {
    grid-template-columns: 1fr;
  }

  .format-settings-head h2 {
    font-size: 18px;
  }

  .settings-section summary {
    grid-template-columns: 1fr;
    padding: 14px 42px 14px 14px;
  }

  .summary-title {
    font-size: 15px;
  }

  .summary-chips {
    justify-content: flex-start;
  }

  .summary-chip {
    max-width: 100%;
    min-height: 26px;
    font-size: 10px;
  }

  .settings-two,
  .settings-three,
  .duration-card {
    grid-template-columns: 1fr;
  }

  .duration-card select,
  .duration-card button {
    width: 100%;
  }

  .settings-section > :not(summary) {
    margin: 10px;
  }

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

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

  .asset-card img,
  .overlay-card img {
    width: 52px;
    height: 52px;
  }

  .asset-card button,
  .overlay-card button,
  .target-row button,
  .upload-button,
  .icon-button {
    min-height: 40px;
  }

  .target-row {
    gap: 8px;
    padding: 8px;
  }
}
