:root {
  --ink: #0E1317;
  --panel: #151C22;
  --line: #242E37;
  --mist: #8FA0AE;
  --chalk: #E8EEF3;
  --survey: #4BA3E3;
  --plot: #F2A93B;
  --verify: #57C08D;
  --alert: #E2574C;
}

[x-cloak] { display: none !important; }

.grid-paper {
  background-image:
    linear-gradient(rgba(75, 163, 227, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 163, 227, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}

.section-title {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.label {
  display: block;
  font-size: 0.75rem;
  color: var(--mist);
  margin-bottom: 0.35rem;
}

.input, .input-sm, select.input {
  width: 100%;
  background: #0F161B;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--chalk);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-sm { width: auto; padding: 0.3rem 0.45rem; font-size: 0.75rem; }
.input:focus, .input-sm:focus {
  outline: none;
  border-color: var(--survey);
  box-shadow: 0 0 0 3px rgba(75, 163, 227, 0.18);
}

.btn, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 7px;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn { background: var(--survey); color: #06131C; border: 1px solid var(--survey); }
.btn:hover { background: #6BB6EA; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--chalk); }
.btn-ghost:hover { border-color: var(--survey); color: var(--survey); }
.btn-danger { background: var(--alert); color: #1A0A08; border: 1px solid var(--alert); }
.btn-danger:hover { background: #EA7368; }

.nav-link { padding: 0.4rem 0.7rem; border-radius: 6px; color: var(--mist); }
.nav-link:hover { color: var(--chalk); background: rgba(75, 163, 227, 0.08); }
.nav-link-on { color: var(--chalk); background: rgba(75, 163, 227, 0.14); }

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  color: var(--mist);
  cursor: pointer;
}
.chip:hover { color: var(--chalk); border-color: var(--survey); }
.chip-on { background: rgba(75, 163, 227, 0.16); border-color: var(--survey); color: var(--chalk); }
.chip-off { opacity: .45; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  border: 1px solid transparent;
}
.pill-ok { background: rgba(87, 192, 141, .14); color: var(--verify); border-color: rgba(87, 192, 141, .4); }
.pill-warn { background: rgba(242, 169, 59, .14); color: var(--plot); border-color: rgba(242, 169, 59, .4); }
.pill-ng { background: rgba(226, 87, 76, .14); color: var(--alert); border-color: rgba(226, 87, 76, .4); }

.flash {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}
.flash-success { border-color: rgba(87, 192, 141, .5); }
.flash-error { border-color: rgba(226, 87, 76, .5); }

.table-dark { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table-dark th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mist);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.4rem;
  font-weight: 500;
}
.table-dark td { border-bottom: 1px solid rgba(36, 46, 55, .6); padding: 0.6rem 0.4rem; vertical-align: middle; }
.table-dark tr:hover td { background: rgba(75, 163, 227, .04); }

/* ---- installer / reset ---- */
.installer {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--chalk);
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  background-image:
    linear-gradient(rgba(75, 163, 227, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 163, 227, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}
.installer-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem;
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 28, 34, .8);
}
.installer-head .mark { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .3em; color: var(--survey); }
.installer-head .ver { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--mist); }
.installer-head .area { margin-left: auto; font-size: 12px; color: var(--mist); }

.installer-body { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; max-width: 1000px; margin: 2.5rem auto; padding: 0 1.25rem; }
.installer-single { grid-column: 1 / -1; }
@media (max-width: 760px) { .installer-body { grid-template-columns: 1fr; } }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.step {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-left: 2px solid var(--line);
  font-size: 0.85rem;
  color: var(--mist);
}
.step-no { font-family: "JetBrains Mono", monospace; font-size: 0.7rem; opacity: .8; }
.step-now { border-left-color: var(--survey); color: var(--chalk); background: rgba(75, 163, 227, .1); }
.step-done { border-left-color: var(--verify); color: var(--verify); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.card-danger { border-color: rgba(226, 87, 76, .5); }
.h2 { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 700; }
.lead { margin: 0 0 1.25rem; font-size: .875rem; color: var(--mist); line-height: 1.7; }
.form { display: flex; flex-direction: column; gap: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .35rem; font-size: .875rem; }
.field > span { font-size: .75rem; color: var(--mist); }
.field input, .field select {
  background: #0F161B; border: 1px solid var(--line); border-radius: 7px;
  color: var(--chalk); padding: .55rem .7rem; font-size: .9rem; font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--survey); box-shadow: 0 0 0 3px rgba(75,163,227,.18); }
.check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--mist); }
.hint { font-size: .75rem; color: var(--mist); margin: 0; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.rule { border: 0; border-top: 1px solid var(--line); margin: .25rem 0; }
.mono { font-family: "JetBrains Mono", monospace; }
.right { text-align: right; }

.table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-bottom: 1.25rem; }
.table th { text-align: left; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); border-bottom: 1px solid var(--line); padding: .5rem .4rem; font-weight: 500; }
.table td { border-bottom: 1px solid rgba(36,46,55,.6); padding: .5rem .4rem; }
.req, .opt { margin-left: .5rem; font-size: .65rem; padding: .05rem .35rem; border-radius: 4px; }
.req { background: rgba(226,87,76,.14); color: var(--alert); }
.opt { background: rgba(143,160,174,.14); color: var(--mist); }

.alert { border-radius: 8px; padding: .7rem 1rem; font-size: .85rem; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--panel); }
.alert-error { border-color: rgba(226,87,76,.5); }
.alert-notice { border-color: rgba(242,169,59,.5); }

.summary { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.summary li { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(36,46,55,.6); padding-bottom: .4rem; }
.summary span { color: var(--mist); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
:focus-visible { outline: 2px solid var(--survey); outline-offset: 2px; }

/* ---- land panel ---- */
.land-list { margin-top: .75rem; display: flex; flex-direction: column; }
.land-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  padding: .4rem 0; border-bottom: 1px solid rgba(36, 46, 55, .6); font-size: .85rem;
}
.land-row dt { color: var(--mist); white-space: nowrap; }
.land-row dd { margin: 0; text-align: right; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.est-badge {
  display: inline-block; margin-left: .4rem; padding: .05rem .4rem; border-radius: 4px;
  font-size: .65rem; background: rgba(242, 169, 59, .16); color: var(--plot);
  border: 1px solid rgba(242, 169, 59, .45); font-family: "Zen Kaku Gothic New", sans-serif;
}
.src-tag { font-family: "JetBrains Mono", monospace; font-size: .6rem; color: var(--mist); opacity: .8; }
.land-mini { margin-top: .5rem; display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--mist); }
.land-mini li { display: flex; justify-content: space-between; gap: .75rem; line-height: 1.6; }

/* ---- 3D viewer ---- */
#scene-root { display: block; background: #0E1317; }
#scene-root canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.legend {
  display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: .5rem; vertical-align: middle;
}
.legend-solid { background: #3D4C58; }
.legend-estimated { background: #4A4034; }
.legend-volume { background: rgba(75, 163, 227, .45); border: 1px solid var(--survey); }
.legend-far { background: transparent; border-top: 2px dashed var(--plot); height: 0; }
.hidden { display: none !important; }
.legend-shadow { background: #E2574C; }

.ok-badge {
  display: inline-block; margin-left: .4rem; padding: .05rem .4rem; border-radius: 4px;
  font-size: .65rem; background: rgba(87, 192, 141, .16); color: var(--verify);
  border: 1px solid rgba(87, 192, 141, .45);
}

/* ---- language switcher ---- */
.lang-button {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line); border-radius: 7px;
  padding: .3rem .6rem; font-size: .8rem; color: var(--mist); cursor: pointer;
}
.lang-button:hover { color: var(--chalk); border-color: var(--survey); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 40;
  min-width: 12rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: .3rem; list-style: none; margin: 0;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.lang-item {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  padding: .4rem .55rem; border-radius: 6px; font-size: .85rem;
  color: var(--chalk); background: transparent; cursor: pointer; text-align: left;
}
.lang-item:hover { background: rgba(75,163,227,.12); }
.lang-item-on { background: rgba(75,163,227,.18); }
/* Google翻訳のバナーを抑止して自前のスイッチャーだけを見せる */
.goog-te-banner-frame, .skiptranslate iframe { display: none !important; }
body { top: 0 !important; }
