.composer-field { position: relative; }

.composer-input {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 18px 96px 18px 18px;
  color: var(--color-neutral);
  background: transparent;
  border: 1px solid var(--color-base-300);
  border-radius: 6px;
  outline: none;
  resize: vertical;
  font: inherit;
  font-size: 1.08rem;
  line-height: 1.6;
  transition: border-color 160ms ease;
}

.composer-input:hover,
.composer-input:focus { border-color: var(--color-neutral); }

.composer-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.composer-action {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--color-neutral);
  background: var(--color-base-100);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  transition: background-color 160ms ease, opacity 160ms ease;
}

.composer-action:hover,
.composer-action:focus-visible {
  background: var(--color-base-200);
  outline: none;
}

.composer-action:disabled {
  opacity: 0.28;
  cursor: default;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--color-base-200);
  border-radius: var(--radius-box);
}

.stat-value {
  color: var(--color-neutral);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-label {
  color: var(--color-base-content);
  opacity: 0.7;
  font-size: 0.72rem;
  line-height: 1.3;
}

.note-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  background: var(--color-base-100);
  border: 1px solid var(--color-base-300);
  border-radius: var(--radius-box);
}

.note-count {
  min-width: 26px;
  padding: 1px 8px;
  color: var(--color-neutral-content);
  background: var(--color-neutral);
  border-radius: 999px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.note-link {
  color: var(--color-base-content);
  border-bottom: 1px solid var(--color-base-300);
  text-decoration: none;
  font-size: 0.8rem;
  opacity: 0.75;
}

.note-link:hover {
  color: var(--color-neutral);
  opacity: 1;
}

.script-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.script-chip {
  padding: 4px 11px;
  color: var(--color-neutral);
  background: var(--color-base-200);
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.char-table-wrap { overflow: hidden; }

.char-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.char-table th {
  padding: 10px 14px;
  color: var(--color-base-content);
  opacity: 0.7;
  font-weight: 500;
  font-size: 0.74rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-base-300);
}

.char-table td {
  padding: 9px 14px;
  border-bottom: 1px solid color-mix(in oklab, var(--color-base-300) 55%, transparent);
  vertical-align: middle;
}

.char-table tr:last-child td { border-bottom: 0; }

.char-row { cursor: pointer; }

.char-row:hover,
.char-row:focus-visible {
  background: var(--color-base-200);
  outline: none;
}

.cell-glyph {
  width: 1%;
  color: var(--color-neutral);
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.glyph-placeholder {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  padding: 2px 6px;
  color: var(--color-base-content);
  background: #fde68a;
  border-radius: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

.cell-codes {
  color: var(--color-base-content);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.cell-name { color: var(--color-neutral); }

.cell-kind {
  color: var(--color-base-content);
  opacity: 0.7;
  font-size: 0.8rem;
  white-space: nowrap;
}

.cell-count {
  width: 1%;
  color: var(--color-base-content);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cell-more {
  color: var(--color-base-content);
  opacity: 0.6;
  font-size: 0.8rem;
  text-align: center;
}

.table-empty {
  margin: 0;
  padding: 22px 16px;
  color: var(--color-base-content);
  opacity: 0.55;
  font-size: 0.92rem;
  text-align: center;
}

@media (max-width: 680px) {
  .composer-input {
    min-height: 116px;
    padding: 14px 84px 14px 14px;
  }

  .composer-actions { top: 7px; right: 7px; }

  .char-table-wrap { overflow-x: auto; }

  .char-table { min-width: 520px; }

  /* The name column is the first to go when space runs out: the glyph, its code
     and what it is are what the table is for. */
  .char-table th:nth-child(3),
  .char-table td:nth-child(3) { display: none; }

  .char-table { min-width: 0; }
}
