*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; background: #fff; color: #111; line-height: 1.6; font-size: 16px; }
a { color: #2c5282; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 680px; margin: 0 auto; padding: 0 24px; }
header { padding: 72px 0 48px; border-bottom: 1px solid #e8e8e8; }
header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
header p { margin-top: 12px; font-size: 1.05rem; color: #444; max-width: 480px; }
.features { padding: 48px 0; border-bottom: 1px solid #e8e8e8; }
.features h2 { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #666; margin-bottom: 20px; }
.features ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.features li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; color: #333; }
.features li::before { content: "—"; color: #2c5282; font-weight: 700; flex-shrink: 0; }
footer { padding: 32px 0 64px; font-size: 0.85rem; color: #888; display: flex; gap: 24px; flex-wrap: wrap; }
footer a { color: #666; }

/* ---- Browser warning ---- */
.browser-warning {
  display: none;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #664d03;
  margin-bottom: 20px;
}

/* ---- Sync section ---- */
.sync { padding: 48px 0; border-bottom: 1px solid #e8e8e8; }
.sync h2 { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #666; margin-bottom: 20px; }
.sync-intro { font-size: 0.95rem; color: #555; margin-bottom: 20px; }

#btn-connect {
  display: inline-block;
  background: #2c5282;
  color: #fff;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
}
#btn-connect:hover:not(:disabled) { background: #1a365d; }
#btn-connect:disabled { background: #999; cursor: not-allowed; }

#status {
  margin-top: 16px;
  font-size: 0.9rem;
  color: #555;
  min-height: 1.4em;
}
#status[data-type="busy"]  { color: #2c5282; }
#status[data-type="done"]  { color: #276749; }
#status[data-type="error"] { color: #c53030; }

#results {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-ok  { font-size: 0.9rem; color: #276749; display: flex; align-items: center; gap: 12px; }
.result-err { font-size: 0.9rem; color: #c53030; }

.btn-file-download {
  background: none;
  border: 1px solid #276749;
  border-radius: 4px;
  color: #276749;
  font-size: 0.8rem;
  padding: 2px 10px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.btn-file-download:hover { background: #276749; color: #fff; }

/* ---- Vocabulary section ---- */
.vocab { padding: 48px 0; border-bottom: 1px solid #e8e8e8; }

.vocab-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.vocab-header h2 { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #666; }

.vocab-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: #555;
}
.vocab-controls select {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.875rem;
  cursor: pointer;
}

.vocab-count { font-size: 0.85rem; color: #888; margin-bottom: 20px; }

.pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 0.875rem;
  color: #555;
}
.pagination button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 0.875rem;
  cursor: pointer;
  color: #2c5282;
  transition: background 0.1s, border-color 0.1s;
}
.pagination button:hover:not(:disabled) { background: #f0f4ff; border-color: #2c5282; }
.pagination button:disabled { color: #bbb; border-color: #eee; cursor: not-allowed; }

.table-wrap { overflow-x: auto; }

#vocab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
#vocab-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #e8e8e8;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}
#vocab-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  color: #333;
}
#vocab-table tr:last-child td { border-bottom: none; }
#vocab-table tr:hover td { background: #fafafa; }

.word-cell {
  font-weight: 600;
  color: #2c5282;
  white-space: nowrap;
}
.context-cell {
  color: #555;
  font-style: italic;
  max-width: 320px;
}

/* ---- Setup notes ---- */
details.setup-notes {
  margin-top: 24px;
  font-size: 0.875rem;
}
details.setup-notes summary {
  cursor: pointer;
  color: #666;
  -webkit-user-select: none;
  user-select: none;
}
details.setup-notes summary:hover { color: #111; }
.setup-notes-body {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #555;
  line-height: 1.6;
}
.setup-notes-body strong { color: #333; }
.setup-notes-body code {
  background: #f4f4f4;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.85em;
}
