/* sako-internal — script cards + beat editor */

@layer components {
  .scripts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .script-card {
    --card-accent: var(--border);

    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .script-card--published { --card-accent: var(--green); }
  .script-card--logged    { --card-accent: var(--accent); }
  .script-card--skipped   { opacity: 0.55; }

  .script-card__hook {
    font-size: var(--text-base);
    font-weight: 500;

    a {
      color: var(--ink);
      text-decoration: none;

      &:hover { color: var(--accent); text-decoration: none; }
    }
  }

  .script-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  .script-card__actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
  }

  /* ─── Beat editor ──────────────────────────────────────────── */

  .beats-editor {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }

  .beat-editor {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }

  .beat-editor__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
  }

  .beat-editor__name {
    font-weight: 600;
    flex: 1;
  }

  .beat-editor__saved { color: var(--green); }
  .beat-editor__error { color: var(--red); }

  .beat-editor__textarea {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 0;
    resize: vertical;
    min-height: 6rem;
    padding: var(--space-2) var(--space-3);
    font-family: inherit;
    font-size: var(--text-base);
    line-height: 1.6;
    background: var(--surface);
    color: var(--ink);

    &:focus { outline: none; }
  }

  /* ─── Stale widget ─────────────────────────────────────────── */

  .stale-widget {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding: var(--space-2) var(--space-3);
    background: var(--amber-bg);
    border: 1px solid var(--amber);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--amber);
  }
}
