* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 24px;
}

#app {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--text-primary);
}

h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

button {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  padding: 12px 24px;
  background: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
}

button:hover {
  background: var(--accent-green-bright);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-visible);
}

.secondary-btn:hover {
  background: var(--bg-secondary);
}

input, textarea {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  padding: 12px;
  border: 1px solid var(--border-visible);
  background: var(--bg-secondary);
  width: 100%;
  color: var(--text-primary);
  border-radius: 4px;
}

input:focus, textarea:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

textarea {
  min-height: 200px;
  resize: vertical;
}

.auth-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.auth-container {
  max-width: 400px;
  width: 100%;
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-visible);
  border-radius: 8px;
}

.auth-container h2 {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-form .form-group:last-of-type {
  margin-bottom: 24px;
}

.auth-form button {
  width: 100%;
}

.auth-toggle {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
}

.link-button {
  background: none;
  border: none;
  color: var(--accent-green);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.link-button:hover {
  color: var(--accent-green-bright);
}

.error {
  color: var(--accent-red);
  font-size: 12px;
  margin-bottom: 16px;
}

.writing-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-visible);
}

.header-left h1 {
  margin-bottom: 4px;
}

.header-left p {
  font-size: 14px;
  color: var(--text-secondary);
}

.header-right {
  text-align: right;
}

.streak {
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--accent-green);
  font-weight: 500;
}

.longest-streak {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-visible);
}

.tab {
  padding: 12px 0;
  background: none;
  border: none;
  border-radius: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text-primary);
  background: none;
}

.tab.active {
  color: var(--accent-green);
  border-bottom-color: var(--accent-green);
}

.practice-section {
  background: var(--bg-secondary);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border-visible);
  border-radius: 8px;
}

.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.status {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 4px;
}

.status.complete {
  background: var(--accent-green);
  color: var(--bg-primary);
}

.constraint-banner {
  background: var(--accent-green);
  color: var(--bg-primary);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 4px;
}

.constraint-banner h3 {
  margin-bottom: 4px;
  color: var(--bg-primary);
}

.constraint-banner p {
  color: var(--bg-primary);
}

.section-description {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.editor-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.word-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.save-status {
  font-size: 12px;
  color: var(--accent-green);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  margin-top: 8px;
  overflow: hidden;
  border-radius: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-green);
  transition: width 0.3s;
}

.circle-sentence-container {
  margin-top: 16px;
}

#circled-sentence-display {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 4px;
  border: 1px solid var(--border-visible);
}

#circled-sentence-display strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-green);
}

.history-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-select {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border-visible);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
}

.filter-select:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.history-entry {
  background: var(--bg-primary);
  border: 1px solid var(--border-visible);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}

.history-entry-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.history-entry-header:hover {
  background: var(--bg-elevated);
}

.history-entry-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-entry-date {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.history-entry-type {
  font-size: 12px;
  color: var(--text-secondary);
}

.history-entry-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.history-entry-content {
  padding: 0 16px 16px;
  display: none;
  border-top: 1px solid var(--border-visible);
  padding-top: 16px;
}

.history-entry-content.expanded {
  display: block;
}

.history-entry-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
}

.expand-icon {
  transition: transform 0.2s;
}

.expand-icon.rotated {
  transform: rotate(180deg);
}
