:root {
  --bg: #16171a;
  --surface: #1e2024;
  --surface-alt: #25282d;
  --border: #2f333a;
  --text: #ece7dd;
  --muted: #9a968e;
  --accent: #c89d54;
  --accent-hover: #d6ab62;
  --accent-ink: #171512;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent);
  background: var(--surface);
}

.brand h1 {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  padding: 0.1rem 0.25rem;
  border-radius: 999px;
}

.lang-btn.active {
  color: var(--accent);
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 820px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

.input-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: var(--bg);
  transition: border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
}

.drop-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  padding: 0.75rem 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
}

.preview-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  background: #111214;
  border-radius: 8px;
  padding: 0.5rem;
}

.preview-wrap img {
  max-height: 210px;
  max-width: 100%;
  border-radius: 6px;
  object-fit: contain;
}

.clear-img {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  resize: vertical;
  outline: none;
}

textarea::placeholder {
  color: #6b6862;
}

.mode-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.mode-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200, 157, 84, 0.08);
}

.tone-control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tone-header {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.tone-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

.run-btn {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.run-btn:hover {
  background: var(--accent-hover);
}

.run-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.error-msg {
  color: #e07a6c;
  font-size: 0.85rem;
  text-align: center;
}

.output-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.25rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.card-head h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.muse-tag {
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid rgba(200, 157, 84, 0.4);
  background: rgba(200, 157, 84, 0.08);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.copy-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--accent);
}

.read-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--text);
}

.reply-text {
  font-size: 0.96rem;
  color: var(--text);
  white-space: pre-wrap;
}

.placeholder-text {
  color: var(--muted);
}

.privacy-footer {
  margin-top: 2.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: #6b6862;
}

.hidden {
  display: none !important;
}
