/* #region zone:monitor.page.settings — ตั้งค่า */
.pref-row,
.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3) var(--s-6);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border-soft);
}
.pref-row:first-of-type,
.setting-row:first-of-type {
  padding-top: 0;
}
.pref-row:last-child,
.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.row-text {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 0;
}
.row-text strong {
  font-weight: var(--fw-medium);
}
.row-text p {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.55;
}
.row-text small {
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
/* Task 20 (2026-09-26): a small OpenAI/Anthropic brand mark beside a model/provider setting's label. */
.setting-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.setting-control {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  justify-content: flex-end;
}
.setting-control .input {
  width: 140px;
  text-align: right;
  font-family: var(--mono);
}

.setting-status {
  grid-column: 1/-1;
  font-size: var(--fs-sm);
  color: var(--danger-fg);
}
.setting-status:empty {
  display: none;
}
.usage-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

/* #endregion */
/* #region zone:monitor.page.knowledge — ความรู้ */
.prompt-list {
  margin: 0;
}
.prompt-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow-y: auto;
  margin: var(--s-3) 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--border);
  font: var(--fs-xs)/1.7 var(--mono);
  color: var(--text-2);
}
.prompt-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.publisher-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.publisher {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font: var(--fs-xs) var(--mono);
  color: var(--text-2);
}
.knowledge-grid {
  margin-top: var(--s-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-2) var(--s-8);
}

/* #endregion */
/* #region zone:monitor.page.broadcast — บรอดแคสต์ */
.feature-broadcast-sections {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.feature-section {
  min-width: 0;
}
.feature-section > .muted,
.feature-section > .feature-actions,
.feature-section > .feature-shot-grid,
.feature-section > .feature-compose-layout,
.feature-section > .feature-audience-fields,
.feature-section > .feature-quota,
.feature-section > .feature-history {
  margin-top: var(--s-4);
}
.feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* Owner-only Health clip review queue: cards remain compact without collapsing the review controls. */
.health-video-review .panel-body {
  min-width: 0;
}
.health-video-discovery {
  margin: 0;
}
.health-video-toolbar,
.health-video-actions,
.health-video-badges,
.health-video-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.health-video-toolbar {
  justify-content: space-between;
  margin-top: var(--s-4);
  gap: var(--s-3);
}
.health-video-selected {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
}
.health-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: var(--s-4);
  margin-top: var(--s-4);
}
.health-video-card {
  display: grid;
  grid-template-columns: auto minmax(108px, 36%) minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}
.health-video-card > input {
  margin: var(--s-2) 0 0;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}
.health-video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}
.health-video-body {
  min-width: 0;
}
.health-video-heading h3 {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
}
.health-video-heading p,
.health-video-meta {
  margin: var(--s-1) 0 0;
}
.health-video-badges,
.health-video-tags,
.health-video-actions {
  margin-top: var(--s-2);
}
.health-video-actions .btn {
  flex: 1 1 auto;
}
.health-video-preview-frame {
  display: block;
  width: min(100%, 52rem);
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-md);
  background: #000;
}
@media (max-width: 480px) {
  .health-video-grid {
    grid-template-columns: 1fr;
  }
  .health-video-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .health-video-thumb {
    grid-column: 2;
  }
  .health-video-body {
    grid-column: 1 / -1;
  }
  .health-video-toolbar {
    align-items: stretch;
  }
  .health-video-toolbar .btn {
    width: 100%;
  }
}
.feature-shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: var(--s-3);
}
.feature-shot-grid + .muted {
  margin-top: var(--s-5);
}
.feature-empty {
  grid-column: 1/-1;
  padding: var(--s-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text-2);
  text-align: center;
}
.feature-shot {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  min-width: 0;
}
.feature-shot img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: var(--r-sm);
}
.feature-line-preview {
  max-width: 390px;
  background: #dce9df;
  color: #182b28;
  border-radius: 18px;
  padding: var(--s-4);
  display: grid;
  gap: var(--s-2);
}
.feature-line-preview img {
  max-width: 100%;
  border-radius: var(--r-md);
}
.feature-line-preview p {
  background: white;
  border-radius: var(--r-md);
  padding: var(--s-3);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.feature-preview-button {
  background: #06c755;
  color: #fff;
  border-radius: var(--r-sm);
  text-align: center;
  padding: var(--s-2);
}
.feature-compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(240px, 390px);
  gap: var(--s-6);
  align-items: start;
}
.feature-compose-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
}
.feature-compose-form .field {
  gap: var(--s-2);
}
.feature-compose-form .field-error:empty {
  display: none;
}
.feature-message {
  display: block;
  width: 100%;
}
.feature-preview-column {
  min-width: 0;
}
.feature-preview-column .section-label {
  margin-bottom: var(--s-3);
}
.feature-line-preview {
  width: 100%;
  min-height: 90px;
}
.feature-line-preview p {
  margin: 0;
}
.feature-audience-fields {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-width: 560px;
}
.feature-audience-fields .select {
  width: 100%;
}
.feature-audience-fields .field-error:empty {
  display: none;
}
.feature-section > .feature-actions {
  margin-top: var(--s-4);
}
.feature-section > .feature-actions + .muted {
  margin-top: var(--s-3);
}
.feature-history {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.feature-broadcast-sections {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.general-line-preview {
  max-width: 390px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-4);
  background: var(--line-bg);
  border-radius: var(--r-lg);
}
.general-line-preview .phone-bubble {
  margin: 0;
  max-width: 100%;
}
.general-line-preview img {
  max-width: 100%;
  border-radius: var(--r-md);
}
.broadcast-history-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.feature-section > .field,
.feature-section > .select,
.feature-section > .variant-list,
.feature-section > .section-label,
.feature-section > .general-line-preview {
  margin-top: var(--s-3);
}
.feature-history p {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
.guide-section {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.guide-section > .select {
  margin-top: 0;
}
.guide-section > .btn {
  align-self: flex-start;
}
.guide-feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--s-2);
  min-width: 0;
}
.guide-feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  min-width: 0;
}
.guide-feature-item > input {
  flex: none;
  margin-top: 2px;
}
.guide-feature-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.guide-card-preview:empty {
  display: none;
}
.weather-broadcast {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: var(--s-4);
}
.weather-live-source,
.weather-member-settings {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.weather-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  margin-top: var(--s-3);
}
.weather-core-form > .field:nth-child(4),
.weather-core-form > .field:nth-child(5) {
  grid-column: 1/-1;
}
.weather-advanced {
  margin-top: var(--s-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: var(--s-3);
}
.weather-advanced > summary {
  cursor: pointer;
  color: var(--text-2);
  font-weight: var(--fw-semibold);
}
.weather-advanced[open] > summary {
  margin-bottom: var(--s-3);
}
.weather-line-preview {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--line-bg);
  margin-top: var(--s-3);
}
.weather-line-preview[hidden] {
  display: none;
}
.weather-delivery .btn:disabled {
  opacity: 0.5;
  color: var(--text-2);
  cursor: not-allowed;
}
.weather-delivery {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-soft);
}
.weather-delivery > .form-actions {
  margin-top: 0;
}
.weather-delivery > p:empty {
  display: none;
}
@media (max-width: 900px) {
  .weather-broadcast {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .weather-form-grid {
    grid-template-columns: 1fr;
  }
  .weather-form-grid .field {
    grid-column: 1 !important;
  }
}
@container content (max-width:800px) {
  .feature-compose-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 699px) {
  .feature-compose-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.option-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.option-row-label {
  font-size: var(--fs-xs);
  color: var(--text-3);
  min-width: 56px;
}

.variant-list {
  display: grid;
  gap: var(--s-2);
}
.variant {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  width: 100%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.variant:hover {
  border-color: var(--text-faint);
}
.variant[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.counter {
  font: var(--fs-xs) var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  text-align: right;
}
.counter.is-over {
  color: var(--danger-fg);
}
.composer textarea#broadcast-draft {
  min-height: 180px;
}

.phone {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: var(--u-radius-dialog);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  padding: var(--s-3);
  box-shadow: var(--shadow-raised);
}

.phone-sender {
  font-size: 11px;
  color: #1f2a3a;
}
.phone-bubble {
  background: var(--line-bubble);
  color: var(--line-ink);
  border-radius: 4px 16px 16px 16px;
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font);
}
.phone-bubble.is-empty {
  color: #6b7480;
  font-style: normal;
}
.phone-time {
  font-size: 10px;
  color: #2a3648;
  align-self: flex-end;
}

/* #endregion */
