:root {
  --page-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;

  --text-main: #0f172a;
  --text-body: #1f2937;
  --text-muted: #667085;
  --text-subtle: #475467;

  --input-border: #d7deea;
  --input-border-soft: #e4e9f2;
  --input-focus: #93c5fd;

  --line-soft: #edf1f7;

  --button-secondary-bg: #eef2f7;
  --button-secondary-text: #334155;

  --button-primary-bg: #2563eb;
  --button-primary-text: #ffffff;

  --notice-bg: #fff7ed;
  --notice-border: #fdba74;
  --notice-text: #9a3412;
}

* {
  box-sizing: border-box;
}

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

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

h1 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* ===== Card ===== */

form.controls {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 24px 22px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: visible;
}

/* ===== Instruction ===== */

.intro-hint {
  text-align: center;
  margin: 0 0 18px;
  font-size: 0.96rem;
  line-height: 1.35;
  color: var(--text-subtle);
  font-weight: 600;
}

/* ===== Layout ===== */

.row {
  margin: 16px 0;
}

.row.center {
  text-align: center;
  margin-top: 22px;
}

.row.dual-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.page-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-left: 4px;
  vertical-align: middle;
}

.about-inline {
  font-size: 0.75rem;
  color: #64748b;
  text-decoration: none;

  margin-left: 10px;

  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 6px;

  vertical-align: middle;
}

.about-inline:hover {
  background: #f1f5f9;
}

/* ===== Labels ===== */

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-body);
}

label::first-letter {
  margin-right: 4px;
}

.label-icon {
  display: inline-block;
  font-size: 0.82rem;
  line-height: 1;
  opacity: 0.7;
  margin-right: 6px;
  vertical-align: baseline;
}

.secondary-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ===== Inputs ===== */

select,
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: #ffffff;
  color: var(--text-main);
  font: inherit;
  font-size: 1rem;
}

select:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ===== Progress ===== */

.progress-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #dde5ef;
}

.progress-fill {
  height: 100%;
  background: #4a90e2;
  width: 0%;
  transition: width 0.2s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 54px;
  justify-content: flex-end;
}

.progress-star {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

.progress-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

/* ===== Search ===== */

.search-row {
  position: relative;
  z-index: 100;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-row input[type="text"] {
  padding: 10px 12px;
  font-size: 0.96rem;
  border-color: var(--input-border-soft);
}

.search-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  z-index: 50;
}

.search-suggestions.is-visible {
  display: block;
}

.search-suggestion {
  display: block;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--text-main);
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion:hover,
.search-suggestion:focus {
  background: #f8fafc;
  outline: none;
}

.search-suggestion-main {
  font-size: 0.98rem;
}

.field-help {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #4b5563;
  font-weight: 500;
}

/* ===== Notice ===== */

.notice {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffaf5;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #92400e;
  font-size: 0.92rem;
  line-height: 1.35;
}

.notice b {
  font-weight: 600;
}

/* ===== Buttons ===== */

.learn-btn,
.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 44px;
  padding: 10px 18px;

  border-radius: 999px;
  border: 1px solid #e2e8f0;

  background: #f1f5f9;
  color: #1f2937;

  font-weight: 600;
  font-size: 0.94rem;

  cursor: pointer;

  transition: transform 0.12s ease,
              filter 0.12s ease,
              background 0.12s ease,
              box-shadow 0.12s ease;
}

.learn-btn.is-primary {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}
.search-btn.is-primary {
  background: #e2e8f0;
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* hover */

.search-btn:hover:not(:disabled) {
  background: #dbe3ee;
  transform: translateY(-1px);
}

.learn-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

/* disabled */

.learn-btn:disabled,
.search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* loading */

.learn-btn.loading {
  opacity: 0.72;
  filter: grayscale(0.25);
  transform: none;
  box-shadow: none;
}

/* dimmed (when search active) */

.learn-btn.is-dimmed {
  opacity: 0.7;
}
