@import url("../source-panel.css");

:root {
  --page: #f2f5f3;
  --surface: #ffffff;
  --ink: #17251d;
  --muted: #495b50;
  --line: #c5d2c8;
  --brand: #174f2d;
  --brand-dark: #0e351d;
  --accent: #d97706;
  --success: #15803d;
  --danger: #b91c1c;
  --soft: #e5ede7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.page { width: min(56rem, 94%); margin: 0 auto; }

.page-header {
  margin: 0 0 20px;
  padding: 22px;
  background: var(--brand);
  color: #fff;
  border-radius: 14px;
  text-align: center;
}

.page-header h1,
.page-header p { margin: 0 0 8px; }

.page-header p { color: #dceade; }

.card {
  margin: 0 0 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.card h2 { margin: 0 0 10px; color: var(--brand); }

.field { margin: 14px 0; }

.field label,
.field legend {
  display: block;
  margin: 0 0 6px;
  font-weight: 700;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #789383;
  border-radius: 0.5rem;
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 79, 45, 0.2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

button {
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--brand-dark);
  border-radius: 0.5rem;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

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

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

.message {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.message.ok {
  color: var(--success);
  font-weight: 700;
}

.message.bad {
  color: var(--danger);
  font-weight: 700;
}

.help {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.summary-box pre {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Choices host tweaks */
.choices { margin-bottom: 0; }

/* Flatpickr inline host */
.flatpickr-inline-host {
  margin-top: 0.5rem;
}

/* Dropzone */
.dropzone {
  min-height: 8rem;
  padding: 1.25rem;
  border: 2px dashed #789383;
  border-radius: 0.75rem;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
}

.dropzone.dz-drag-hover {
  border-color: var(--brand);
  background: #dceade;
}

.dropzone .dz-message {
  margin: 1rem 0;
  font-weight: 700;
}

.file-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

/* Picmo */
.picmo-root {
  min-height: 20rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: auto;
  background: #fff;
}

.picmo-popup-panel {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
  /* Picmo default: 8 cols × 2rem × 1.3 + chrome ≈ 23.55rem */
  width: min(100%, 23.55rem);
  max-width: 100%;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.picmo-popup-panel .picmo__picker {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

.emoji-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 3rem;
  margin-top: 0.5rem;
  font-size: 2rem;
  background: var(--soft);
  border-radius: 0.5rem;
}

/* TinyMCE hosts stay full width */
.tox-tinymce {
  border-radius: 0.5rem !important;
}

.stack-gap {
  margin-top: 1rem;
}

.full-span {
  grid-column: 1 / -1;
}

.field-with-action {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.field-with-action input {
  flex: 1 1 12rem;
  min-height: 2.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #789383;
  border-radius: 0.5rem;
}
