:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #2a2a2a;
  --success: #22c55e;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
}

.auth-status {
  font-size: 0.875rem;
}

.auth-status .logged-in {
  color: var(--success);
}

.auth-status a {
  color: var(--accent);
  text-decoration: none;
}

.auth-status a:hover {
  text-decoration: underline;
}

.nav-links {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.nav-links a {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a:hover {
  text-decoration: underline;
}

.main {
  flex: 1;
}

.section {
  margin-bottom: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.status-link {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.status-link:hover {
  background: var(--accent);
  color: white;
}

.resume-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: -0.5rem 0 0.75rem 0;
}

.resume-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-label {
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
}

.file-label:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-input {
  font-size: 0.85rem;
  color: var(--text);
}

.file-input::file-selector-button {
  padding: 0.4rem 0.75rem;
  background: var(--border);
  border: none;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.file-name {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.resume-divider {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.25rem 0;
}

.tailored-list {
  margin-top: 1rem;
}
.tailored-item {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tailored-item summary {
  cursor: pointer;
  font-size: 0.95rem;
}
.tailored-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: normal;
}
.tailored-text {
  margin: 1rem 0 0.5rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}
.tailored-item .copy-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.tailored-item .copy-btn:hover {
  background: var(--accent);
  color: white;
}

.nav-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.profile-form .form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.profile-form .form-row input.short {
  flex: 0 0 80px;
}

.card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

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

.tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form input,
.form textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.form input::placeholder,
.form textarea::placeholder {
  color: var(--text-muted);
}

.form textarea {
  resize: vertical;
  min-height: 120px;
}

.form button {
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.form button:hover {
  background: var(--accent-hover);
}

.form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary-btn {
  padding: 0.5rem 1rem;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.secondary-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
}
.secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.tailored-cta {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.hidden {
  display: none !important;
}

.message {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.message a {
  color: var(--accent);
  text-decoration: none;
}

.message a:hover {
  text-decoration: underline;
}

.message.error {
  color: var(--error);
}

.message.success {
  color: var(--success);
}

.analyze-progress {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-fill {
  height: 100%;
  width: 30%;
  background: var(--accent);
  border-radius: 3px;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(233%); }
  100% { transform: translateX(-100%); }
}
.progress-status {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
}
.progress-elapsed {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.result h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
}

.result ul {
  margin: 0;
  padding-left: 1.25rem;
}

.result li {
  margin-bottom: 0.25rem;
}

.footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--accent);
}

.past-analyses {
  margin-top: 1.5rem;
}

.past-analyses h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.past-analysis-item {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.past-analysis-item:last-child {
  border-bottom: none;
}

.past-analysis-item summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.past-analysis-item summary:hover {
  color: var(--text);
}

.past-date {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-left: 0.5rem;
}

.past-analysis-detail {
  margin-top: 0.5rem;
  padding-left: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.past-analysis-detail p {
  margin: 0.25rem 0;
}
