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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1e1e1e;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-secondary: #888;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --error: #f87171;
  --success: #4ade80;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* Auth screen */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-container {
  text-align: center;
  max-width: 320px;
  width: 100%;
  padding: 0 20px;
}

.auth-container h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.auth-container p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.auth-container input {
  width: 100%;
  margin-bottom: 12px;
}

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

/* Layout */
header {
  padding: 32px 24px 0;
  max-width: 720px;
  margin: 0 auto;
}

header h1 {
  font-size: 1.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

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

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

/* Inputs */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.optional {
  font-weight: 400;
  color: var(--text-secondary);
}

.hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

input, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

button {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

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

/* Loading */
#loading {
  text-align: center;
  padding: 48px 0;
}

.loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Error */
#error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

#error p {
  color: var(--error);
  font-size: 0.9rem;
}

/* Results */
#results {
  margin-top: 24px;
}

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

.results-header h2 {
  font-size: 1.2rem;
}

#copy-btn {
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid var(--border);
}

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

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
}

.result-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 12px;
}

#summary-text {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Insights */
.insight {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.insight:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.insight:first-child {
  padding-top: 0;
}

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.insight-point {
  font-weight: 600;
  font-size: 0.95rem;
}

.insight-timestamp {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(167, 139, 250, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.insight-detail {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.insight-application {
  font-size: 0.88rem;
  background: rgba(167, 139, 250, 0.05);
  border-left: 2px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  line-height: 1.6;
}

/* Lists */
#actions-list, #quotes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#actions-list li {
  font-size: 0.9rem;
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

#actions-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

#quotes-list li {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-secondary);
  padding-left: 16px;
  border-left: 2px solid var(--border);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
  main {
    padding: 16px;
  }

  header {
    padding: 24px 16px 0;
  }

  .result-card {
    padding: 16px;
  }
}
