/* Palmline - page-specific styles (loaded after styles.css) */

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 56px 0 40px; }
.hero h1 { margin-bottom: 0.4em; }
.underline-ink { background: linear-gradient(transparent 62%, rgba(31, 79, 163, 0.22) 62%); }
.hero-fig svg { width: 100%; height: auto; display: block; }
.svg-hand { font-family: var(--f-hand); font-size: 20px; fill: #1f4fa3; font-weight: 700; }
.pipeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.pipeline .card { position: relative; padding-top: 34px; }
.step-n { position: absolute; top: -14px; left: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--paper); border: 2px solid var(--blue); color: var(--blue); font-family: var(--f-hand); font-weight: 700; font-size: 1.3rem; display: grid; place-items: center; line-height: 1; }
.annot-inline { font-family: var(--f-hand); color: var(--red); font-size: 1.15rem; }
.align-center { align-items: center; }
.checks { list-style: none; padding: 0; }
.checks li { padding-left: 28px; position: relative; margin-bottom: 8px; }
.checks li::before { content: "\2713"; position: absolute; left: 0; color: var(--blue); font-weight: 700; font-family: var(--f-hand); font-size: 1.3rem; line-height: 1.2; }
pre.schema { margin: 0; overflow-x: auto; font-size: 0.8rem; line-height: 1.5; color: var(--ink); background: #fffdf8; border: 1px solid var(--rule); border-radius: 4px; padding: 14px; }

/* ---------- Missions ---------- */
.toolbar { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; margin-bottom: 14px; }
.count-line { font-family: var(--f-hand); font-size: 1.3rem; color: var(--blue); margin-bottom: 14px; }
.mission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.m-card { text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 16px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform 0.12s, border-color 0.12s; }
.m-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.m-card h3 { margin: 0; font-size: 1.05rem; }
.m-id { font-family: var(--f-mono); font-size: 0.74rem; color: var(--ink-faint); }
.m-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.m-sum { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.empty { border: 2px dashed var(--rule); padding: 28px; text-align: center; color: var(--ink-soft); border-radius: var(--radius); }
.detail-back { position: fixed; inset: 0; z-index: 90; background: rgba(29, 36, 51, 0.45); display: none; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.detail-back.open { display: flex; }
.detail { position: relative; background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--red); border-radius: var(--radius); max-width: 760px; width: 100%; padding: 26px 28px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5); }
.detail .close { position: absolute; top: 10px; right: 10px; }
.detail ol, .detail ul { padding-left: 22px; margin: 0 0 1em; }
.detail li { margin-bottom: 6px; }
.detail h4 { font-family: var(--f-hand); color: var(--red); font-size: 1.5rem; font-weight: 700; margin: 18px 0 6px; }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.kv div { border: 1px dashed var(--rule); padding: 8px 10px; border-radius: 4px; font-size: 0.88rem; }
.kv b { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }

/* ---------- Practice ---------- */
.practice { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stage { position: relative; background: #11151f; border-radius: 4px; overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage canvas { pointer-events: none; }
.stage .placeholder { position: relative; color: #cfd6e6; text-align: center; padding: 20px; font-family: var(--f-hand); font-size: 1.5rem; line-height: 1.2; }
.meter { height: 12px; border: 1px solid var(--ink-faint); border-radius: 3px; background: #fffdf8; overflow: hidden; margin: 6px 0 4px; }
.meter > i { display: block; height: 100%; width: 0; background: var(--blue); transition: width 0.2s, background 0.2s; }
.status-line { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; }
.indicator { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-faint); display: inline-block; }
.dot.ok { background: var(--green); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--red); }
.panel-item { padding: 14px 0; border-bottom: 1px dashed var(--rule); }
.panel-item:last-child { border-bottom: 0; }

/* ---------- Plotter ---------- */
.plotter-wrap { position: relative; background: #fffdf8; border: 1px solid var(--rule); border-radius: 4px; touch-action: none; }
#plot { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.controls { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 10px 14px; align-items: end; margin-top: 14px; }
.controls .grow { grid-column: span 2; }
.readout { font-family: var(--f-mono); font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Contribute ---------- */
.form-card { max-width: 760px; }
.field { margin-bottom: 16px; }
.field .err { color: var(--red); font-size: 0.82rem; min-height: 1.1em; margin-top: 3px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); border-bottom-color: var(--red); }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg label { display: flex; align-items: center; gap: 8px; font-weight: 500; border: 1px solid var(--rule); border-radius: 4px; padding: 10px 14px; cursor: pointer; margin: 0; background: #fffdf8; }
.seg label:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check-row input { margin-top: 4px; }
.success { text-align: center; padding: 20px 10px; }
.success .stamp-big { display: inline-block; font-family: var(--f-hand); font-size: 2.2rem; color: var(--green); border: 3px solid var(--green); border-radius: 8px; padding: 0 18px; transform: rotate(-3deg); margin-bottom: 14px; }

/* ---------- Rewards ---------- */
.tier-note { font-family: var(--f-hand); color: var(--red); font-size: 1.15rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px dashed var(--blue); }
.timeline li { position: relative; padding: 0 0 18px 18px; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--blue); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .mission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .search { grid-column: 1 / -1; }
  .practice { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) {
  .pipeline { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero { padding-top: 32px; }
  .mission-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { padding: 22px 16px; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls .grow { grid-column: 1 / -1; }
}
