html,
body,
.wrapper {
  height: stretch;
}

body {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
}

button,
textarea,
.rename {
  background: var(--color-surface-container-highest);
  color: var(--color-on-surface);
}

.rename-form {
  background: inherit;
  padding: 0;
  border: none;
  margin: 0;
  position-anchor: --name;
  left: anchor(right);
  align-self: anchor-center;
}

.rename {
  field-sizing: content;
}

.gemini-form {
  background: var(--color-surface-container);
  color: var(--color-on-surface);
  padding: 12px;
  max-width: 80vw;
}

.gemini-form:popover-open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gemini-key {
  background: var(--color-surface-container-highest);
  color: var(--color-on-surface);
  width: stretch;
}

.gemini-hint {
  margin: 0;
  font-size: 0.75em;
  opacity: 0.7;
}

.gemini-actions {
  display: flex;
  gap: 8px;
  justify-content: end;
}

.wrapper {
  display: flex;
  flex-direction: column;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

@scope(.name-row) {
  display: flex;
  align-items: center;
  gap: 8px;
  :scope::before {
    content: '名前：';
    anchor-name: --name;
  }
  > img {
    max-width: 70vw;
    height: 1em;
  }
  body:has(:popover-open) :scope * { visibility: hidden }
}

@scope(.comment-row) {
  display: flex;
  :scope::before { content: 'コメント：' }
  > .comment {
    resize: none;
    field-sizing: content;
    flex: 1;
    width: min-content;
    overflow-wrap: anywhere;
    font-family: system-ui, sans-serif;
  }
}

.comment-submit-button {
  align-self: end;
}

.comment-list {
  flex: 1;
}
