.workspace {
  min-width: 0;
  padding: 28px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-head p {
  margin: 0 0 5px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.page-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
}

button,
.button {
  gap: 8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric,
.panel,
.post-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.metric {
  padding: 16px;
}

.metric span,
.post-card span,
td small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.1;
}

.dashboard-grid,
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head > a,
.panel-head > span {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
  color: var(--ok);
}

.status.warn {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
  color: var(--warning);
}

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

.post-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.post-card img,
.post-card video,
.image-empty {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  background: var(--surface-muted);
}

.image-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.post-card-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.post-card-body strong {
  display: block;
  word-break: break-word;
}

.post-card-body p {
  margin: 0;
  color: var(--muted);
}

.actions,
.filter-form,
.row-form,
.inline-form,
.schedule-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.row-form {
  flex-wrap: nowrap;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

select,
input {
  padding: 0 10px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--primary);
}

.schedule-form {
  display: grid;
  gap: 14px;
}

.schedule-settings {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) minmax(100px, 0.5fr) minmax(210px, 1fr) max-content max-content;
  align-items: end;
  gap: 14px;
}

.schedule-settings label {
  min-width: 0;
}

.schedule-settings label:not(.check-field) input {
  width: 100%;
}

.schedule-settings .check-field {
  min-width: auto;
}

.check-field {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--text);
  white-space: nowrap;
}

.schedule-table th:first-child,
.schedule-table td:first-child {
  width: 120px;
}

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2),
.schedule-table th:nth-child(3),
.schedule-table td:nth-child(3) {
  width: 240px;
}

.schedule-table td {
  vertical-align: middle;
}

.schedule-table select,
.schedule-table input[type="time"] {
  width: 180px;
}

.schedule-table input[type="checkbox"] {
  display: block;
  margin-left: 2px;
}

.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 13px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.definition-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.definition-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
}

.definition-list dt {
  color: var(--muted);
  font-weight: 800;
}

.definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.notice {
  margin-bottom: 16px;
  border: 1px solid var(--notice-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--notice-bg);
  color: var(--notice-text);
  font-weight: 700;
}

.notice.error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
}

.notice.success {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
  color: var(--ok);
}

pre {
  max-width: 100%;
  overflow: auto;
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
}

.log-output {
  max-height: 70vh;
}

@media (max-width: 1180px) {
  .metrics,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .workspace {
    padding: 18px;
  }

  .page-head,
  .dashboard-grid,
  .account-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .metrics,
  .post-grid {
    grid-template-columns: 1fr;
  }

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

  .schedule-table select,
  .schedule-table input[type="time"] {
    width: 100%;
  }

  .definition-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
