/* Functional refinements that preserve the existing StarEntry palette. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button[aria-busy="true"]::after {
  content: " …";
}
.list-row {
  color: var(--text);
  text-align: left;
  text-decoration: none;
  width: 100%;
  overflow-wrap: anywhere;
}
.list-row:hover {
  border-color: var(--gold2);
}
.list-row span {
  font-size: 12px;
  line-height: 1.5;
}
.card p,
.section-head p {
  font-size: 14px;
  line-height: 1.6;
}
.text-button,
.small-button,
dialog header button {
  min-height: 44px;
}
.text-button {
  padding: 8px 12px;
}
.toolbar {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.form-error {
  color: var(--danger);
  background: var(--surface2);
  border: 1px solid var(--danger);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 19px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  font-size: 15px;
}
.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.upload-box svg {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
}
.upload-box:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.upload-feedback {
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.round-button {
  display: grid;
  place-items: center;
}
.round-button svg {
  width: 22px;
  height: 22px;
}
.media-preview {
  display: block;
  width: 100%;
  max-height: 55dvh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--bg);
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  max-width: 90%;
  align-self: flex-start;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.chat-bubble.mine {
  align-self: flex-end;
  background: #332914;
  border-color: #695120;
}
.chat-bubble p,
.preserve-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.chat-bubble p {
  margin: 0 0 8px;
}
.chat-bubble small {
  color: var(--muted);
  font-size: 12px;
}
.pagination {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 12px;
}
.pagination button {
  min-height: 44px;
}
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  line-height: 1.5;
}
.details dt {
  color: var(--muted);
}
.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
dialog {
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
dialog footer {
  flex-wrap: wrap;
  gap: 8px;
}
dialog footer .primary-button {
  margin: 0;
  width: auto;
}
dialog header {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
dialog header h2 {
  padding-right: 12px;
  overflow-wrap: anywhere;
}
dialog header button {
  flex-shrink: 0;
}
#sheetBody {
  max-height: 60dvh;
}
#sheetTitle:focus {
  outline: 0;
}
#sheetError {
  font-size: 14px;
}
@media (max-width: 420px) {
  dialog footer button {
    flex: 1 1 40%;
  }
  .form-grid {
    gap: 8px;
  }
  .pagination {
    gap: 6px;
  }
  .pagination button {
    padding: 8px;
  }
  .stat span {
    font-size: 12px;
  }
}
