:root {
  --color-paper: #f4f1e8;
  --color-paper-deep: #ece7d9;
  --color-ink: #1c1b18;
  --color-ink-soft: #6b665b;
  --color-line: #d9d3c3;
  --color-accent: #d8442a;
  --color-accent-deep: #b0331d;
  --color-mark: #e0a92e;
  --font-display: Inter, Noto Sans TC, sans-serif;
  --font-body: Inter, Noto Sans TC, sans-serif;
  --font-mono: Inter, Noto Sans TC, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tool-intro {
  max-width: 64ch;
  margin-block: 24px 40px;
  color: #6b665b;
}

.counter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-toolbar-label {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: #6b665b;
  font-variant-numeric: tabular-nums;
}

.editor-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-area {
  width: 100%;
  min-height: 420px;
  padding: 24px;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  color: #1c1b18;
  background: #f4f1e8;
  border: 1.5px solid #1c1b18;
  border-radius: 2px;
  box-shadow: 6px 6px 0 rgba(28, 27, 24, 0.12);
  resize: vertical;
  transition: border-color 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.text-area::placeholder {
  color: #6b665b;
}
.text-area:focus {
  outline: none;
  border-color: #d8442a;
}

.copy-hint {
  min-height: 1.4em;
  margin: 0;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  color: #d8442a;
}

.stats-pane {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: #ece7d9;
  border: 1px solid #d9d3c3;
  border-radius: 2px;
}

.stat-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 24px;
  border-bottom: 1px solid #d9d3c3;
}

.stat-primary-value {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1;
  color: #d8442a;
  font-variant-numeric: tabular-nums;
}

.stat-primary-label {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: #6b665b;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px;
  background: #f4f1e8;
  border: 1px solid #d9d3c3;
  border-radius: 2px;
}

.stat-cell-value {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.1;
  color: #1c1b18;
  font-variant-numeric: tabular-nums;
}

.stat-cell-label {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #6b665b;
}

.stat-time {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-time-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.stat-time-label {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: #6b665b;
}

.stat-time-value {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1c1b18;
  font-variant-numeric: tabular-nums;
}

.compose-bar {
  display: flex;
  width: 100%;
  height: 14px;
  overflow: hidden;
  background: #f4f1e8;
  border: 1.5px solid #1c1b18;
  border-radius: 2px;
}

.compose-seg {
  height: 100%;
  transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.compose-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compose-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  color: #6b665b;
}

.compose-swatch {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 1px solid #1c1b18;
  border-radius: 1px;
}

.compose-item-name {
  color: #1c1b18;
}

.compose-item-value {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .counter-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .stats-pane {
    position: static;
  }
  .text-area {
    min-height: 320px;
  }
}
