html,
body {
  height: 100%;
}

.scratch-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.scratch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.scratch-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.scratch-tagline {
  display: none;
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
}

.scratch-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.save-status {
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.save-status.is-saving {
  color: var(--accent);
}

.save-status.is-error {
  color: #ef7878;
}

.scratch-bar-right .badge {
  align-self: center;
}

.share-menu {
  position: relative;
}

.share-menu summary {
  cursor: pointer;
  list-style: none;
}

.share-menu summary::-webkit-details-marker {
  display: none;
}

.share-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  width: 20rem;
  max-width: min(90vw, 20rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 30;
}

.share-row-label {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.share-row-hint {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 0.76rem;
}

.share-row-hint--warn {
  color: #efbe78;
}

.share-panel .link-row input {
  font-size: 0.8rem;
}

.scratch-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  padding: 1.25rem;
  box-sizing: border-box;
}

.scratch-textarea::placeholder {
  color: var(--text-faint);
}

.scratch-textarea[readonly] {
  caret-color: transparent;
  cursor: default;
}

@media (min-width: 40rem) {
  .scratch-tagline {
    display: block;
  }
}

@media (min-width: 48rem) {
  .scratch-textarea {
    font-size: 1.05rem;
    padding: 2rem 3rem;
  }
}
