:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-input: #1c2128;
  --border: #30363d;
  --text-main: #e6edf3;
  --text-muted: #7d8590;
  --primary: #4493f8;
  --radius: 10px;
  --positive: #e05252;
  --doubtful: #d4a847;
  --negative: #38a169;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-card: #ffffff;
  --bg-input: #f0f2f5;
  --border: #d0d7de;
  --text-main: #1f2328;
  --text-muted: #656d76;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text-main); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.6; padding: 1.5rem 1rem 3rem; }
.tool-wrapper { max-width: 660px; margin: 0 auto; }

.tool-header { text-align: center; margin-bottom: 2rem; }
.tool-header__badge { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(68,147,248,0.1); border: 1px solid rgba(68,147,248,0.3); color: var(--primary); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0.8rem; border-radius: 20px; margin-bottom: 1rem; }
.tool-header h1 { font-size: 1.6rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.5rem; }
.tool-header p { color: var(--text-muted); max-width: 520px; margin: 0 auto; font-size: 0.9rem; }

.input-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.input-field { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-main); font-size: 0.9rem; padding: 0.55rem 0.75rem; transition: border-color 0.15s; }
.input-field:focus { outline: none; border-color: var(--primary); }

.gen-btn { width: 100%; padding: 0.85rem; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: opacity 0.15s; }
.gen-btn:hover { opacity: 0.88; }

/* Protocol card */
.protocol-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.protocol-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.protocol-title { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.2rem; }
.protocol-subtitle { font-size: 0.82rem; color: var(--text-muted); }

/* Sensitivity alert */
.sensitivity-alert { background: rgba(212,168,71,0.08); border: 1px solid rgba(212,168,71,0.3); border-radius: 8px; padding: 0.85rem 1.1rem; margin: 1rem 1.5rem 0; font-size: 0.85rem; color: var(--doubtful); }

/* Steps */
.protocol-section { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.protocol-section:last-child { border-bottom: none; }
.protocol-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.75rem; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 0; }
.tl-line { display: flex; flex-direction: column; align-items: center; margin-right: 1rem; }
.tl-dot { width: 12px; height: 12px; background: var(--primary); border-radius: 50%; flex-shrink: 0; margin-top: 0.35rem; }
.tl-bar { width: 2px; background: var(--border); flex-grow: 1; min-height: 1.5rem; }
.timeline-item:last-child .tl-bar { display: none; }
.tl-content { padding-bottom: 1.25rem; flex: 1; }
.tl-time { font-size: 0.8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.tl-action { font-size: 0.88rem; color: var(--text-main); font-weight: 600; margin-bottom: 0.2rem; }
.tl-detail { font-size: 0.83rem; color: var(--text-muted); line-height: 1.55; }

/* Reaction guide */
.reaction-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .reaction-grid { grid-template-columns: 1fr; } }
.reaction-item { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem; }
.reaction-symbol { font-size: 0.82rem; font-weight: 800; margin-bottom: 0.3rem; }
.reaction-symbol.pos { color: var(--positive); }
.reaction-symbol.doubt { color: var(--doubtful); }
.reaction-symbol.neg { color: var(--negative); }
.reaction-text { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }
.reaction-meaning { font-size: 0.8rem; font-weight: 600; color: var(--text-main); margin-bottom: 0.2rem; }

.prep-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.prep-list li { display: flex; gap: 0.6rem; font-size: 0.86rem; color: var(--text-muted); }
.prep-list li::before { content: '→'; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.prep-list a { color: var(--primary); }

.disclaimer { background: var(--bg-card); border: 1px solid var(--border); border-top: 3px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 0.8rem; color: var(--text-muted); margin-top: 1.5rem; }
.disclaimer strong { color: var(--text-main); }
