/*
 * Automations Plugin Styles
 * UI Kit provides base element styles (body, headings, buttons, inputs, etc.)
 * Only plugin-specific layout and component rules here.
 */

html,
body {
  background-color: transparent;
}

/* Responsive equal-column grid (replaces Pico .grid) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--s);
  align-items: center;
}

/* Dialog/modal styling (replaces Pico <dialog>/<article>) */
dialog {
  border: none;
  border-radius: var(--card-border-radius);
  background: var(--card-bg);
  color: var(--text-color);
  padding: 0;
  max-width: 600px;
  width: calc(100% - var(--s4));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

dialog article {
  padding: var(--s3);
}

dialog article header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s2);
}

dialog article footer {
  margin-top: var(--s3);
  padding-top: var(--s2);
  border-top: 1px solid var(--divider-color);
}

/* Close button in dialogs */
.close-btn {
  background: none;
  border: none;
  padding: var(--s-half);
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  color: var(--text-color-muted);
}

.close-btn:hover {
  color: var(--text-color);
  background: none;
  border: none;
}

/* Figure wrapper for table overflow */
figure {
  margin: 0;
  overflow-x: auto;
}

.app {
  padding: var(--s3);
  max-width: 800px;
  margin: 0 auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s3);
  border-bottom: 1px solid var(--divider-color);
  padding-bottom: var(--s);
}

.warning-box {
  background-color: color-mix(in srgb, var(--color-warning) 15%, transparent);
  color: var(--color-warning);
  padding: var(--s);
  margin-bottom: var(--s3);
  border-radius: var(--card-border-radius);
  border: 1px solid color-mix(in srgb, var(--color-warning) 30%, transparent);
}

.input-with-toggle {
  display: flex;
  align-items: stretch;
  gap: var(--s);
}

.input-with-toggle input {
  flex: 1;
}

.regex-toggle {
  white-space: nowrap;
}

.field-error {
  display: block;
  margin-top: var(--s-half);
  color: var(--color-danger);
}
