:root {
  color-scheme: light dark;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 260px;
  background: Canvas;
  color: CanvasText;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 8px;

  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color, #333);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__logo {
  width: 25px;
  height: 25px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  opacity: 0.7;
}

.subject {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;

  overflow: hidden;
  text-overflow: ellipsis;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.section-headline {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 4px 0;
}
/* ---------------------------------------------------------
   Sections
--------------------------------------------------------- */

.editor,
.details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.details {
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #333);
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.section-headline {
  margin: 0;

  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.section-description {
  margin: 0;

  font-size: 11px;
  line-height: 1.4;

  opacity: 0.55;
}

/* ---------------------------------------------------------
   Details Grid
--------------------------------------------------------- */

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

/* ---------------------------------------------------------
   Labels
--------------------------------------------------------- */

.field label,
.editor label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;

  opacity: 0.7;
}

/* ---------------------------------------------------------
   Inputs
--------------------------------------------------------- */

.input-text,
.input-select,
textarea {
  width: 100%;
  box-sizing: border-box;

  border: 1px solid var(--input-border, #444);
  border-radius: 5px;

  background: var(--input-background, #202020);
  color: inherit;

  font: inherit;

  outline: none;

  transition:
    border-color 120ms ease,
    background-color 120ms ease;
}

.input-text,
.input-select {
  height: 34px;
  padding: 0 9px;

  font-size: 12px;
}

.input-select {
  cursor: pointer;
}

textarea {
  min-height: 180px;
  padding: 9px 10px;

  resize: vertical;

  font-size: 13px;
  line-height: 1.45;
}

/* ---------------------------------------------------------
   Focus
--------------------------------------------------------- */

.input-text:focus,
.input-select:focus,
textarea:focus {
  border-color: var(--input-focus, #777);
  background: var(--input-background-focus, #242424);
}

/* ---------------------------------------------------------
   Placeholder
--------------------------------------------------------- */

.input-text::placeholder,
textarea::placeholder {
  color: inherit;
  opacity: 0.35;
}

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */

@media (max-width: 320px) {
  .details-grid {
    grid-template-columns: 1fr;
  }

  .field--full {
    grid-column: auto;
  }
}

.input-text {
  width: 100%;
  padding: 8px;
  border: 1px solid color-mix(in srgb, CanvasText 22%, transparent);
  border-radius: 6px;
  background: Canvas;
  color: CanvasText;
  font: inherit;
  line-height: 1.45;
  outline: none;
}

.input-text:focus {
  border-color: Highlight;
}

label {
  font-size: 12px;
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 100px;
  flex: 1;
  resize: vertical;
  border: 1px solid color-mix(in srgb, CanvasText 22%, transparent);
  border-radius: 6px;
  padding: 10px;
  background: Canvas;
  color: CanvasText;
  font: inherit;
  line-height: 1.45;
  outline: none;
}

textarea:focus {
  border-color: Highlight;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  opacity: 0.65;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

button {
  appearance: none;
  border: 0;
  border-radius: 5px;
  padding: 8px 14px;
  background: Highlight;
  color: HighlightText;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: default;
  opacity: 0.55;
}

.footer {
  margin-top: auto;
  padding-top: 10px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  border-top: 1px solid var(--border-color, #333);

  font-size: 10px;
  line-height: 1.2;

  opacity: 0.55;
}

#save-state[data-state="saving"] {
  opacity: 1;
}

#save-state[data-state="error"] {
  opacity: 1;
}
