:root {
  color-scheme: light;
  --paper: #f7f8f4;
  --paper-strong: #ffffff;
  --ink: #1d2420;
  --muted: #707a74;
  --line: #e1e5dd;
  --forest: #124733;
  --forest-dark: #0b3424;
  --accent: #e13b25;
  --accent-dark: #b92d1d;
  --ash: #8a918c;
  --shadow: 0 18px 50px rgba(22, 35, 28, 0.1);
  --soft-shadow: 0 8px 22px rgba(22, 35, 28, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-feature-settings: "palt";
  background:
    linear-gradient(180deg, #f9faf6 0%, var(--paper) 46%, #f4f6f0 100%);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 0 0 32px;
  background: transparent;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 112px;
  padding: 20px 34px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.16), transparent 220px),
    linear-gradient(135deg, #0b3424, #15533b);
  color: #f8fbf7;
  box-shadow: 0 12px 32px rgba(11, 52, 36, 0.18);
}

.site-header > .brand-lockup {
  display: flex;
}

.header-menu {
  position: relative;
  flex: 0 0 auto;
}

.menu-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.menu-button span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #f8fbf7;
  box-shadow: none;
}

.menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.menu-popover[hidden] {
  display: none;
}

.menu-popover button,
.menu-popover a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--forest-dark);
  text-align: left;
  text-decoration: none;
  font-weight: 700;
}

.menu-popover button:hover,
.menu-popover button:focus-visible,
.menu-popover a:hover,
.menu-popover a:focus-visible {
  background: rgba(44, 85, 65, 0.08);
}

.brand-lockup,
.mini-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-mark,
.mini-mark,
.summit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--forest-dark);
  color: #fffaf0;
}

.brand-mark {
  width: 64px;
  height: 46px;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f8fbf7;
}

.mini-mark {
  width: 42px;
  height: 42px;
}

.summit-badge {
  width: 92px;
  height: 92px;
  margin-left: 0;
  background: linear-gradient(145deg, #0e3e2c, #18543d);
  box-shadow: var(--soft-shadow);
}

.brand-mark img,
.mini-mark img,
.summit-badge img {
  display: block;
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18));
}

.brand-mark img {
  width: 100%;
  height: 100%;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.progress-head .eyebrow {
  margin: 0 0 8px;
  color: var(--forest);
  font-size: 18px;
  font-weight: 800;
}

.site-header .eyebrow {
  display: none;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  color: inherit;
  font-size: clamp(28px, 4.8vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: none;
}

.site-header h1 {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif;
  font-size: clamp(28px, 4.6vw, 40px);
  font-weight: 700;
  line-height: 1.18;
}

h2 {
  font-size: 20px;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbf7;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.content-page {
  padding: 34px;
}

.content-page > .eyebrow {
  color: var(--forest);
}

.content-page h2 {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 850;
  line-height: 1.08;
}

.content-section {
  margin: 0 0 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.content-section h3 {
  margin: 0 0 14px;
  color: var(--forest-dark);
  font-size: 24px;
  line-height: 1.25;
}

.content-section p {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.9;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fffaf0;
  font-weight: 900;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  padding: 34px;
}

.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.progress-panel,
.controls-panel,
.share-panel {
  padding: 0;
}

.progress-panel,
.controls-panel {
  position: static;
}

.share-panel {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(78, 72, 60, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: var(--shadow);
}

.progress-head,
.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.progress-head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 112px;
  margin-bottom: 20px;
}

.progress-head h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(66px, 10vw, 88px);
  font-weight: 800;
  line-height: 0.95;
}

.progress-head h2 span:first-child {
  color: var(--accent);
}

.progress-head h2 span:last-child {
  color: var(--ink);
  font-size: 0.54em;
  font-weight: 700;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(31, 41, 35, 0.58);
}

.share-modal[hidden] {
  display: none;
}

.share-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--forest-dark);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.rate-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--paper) 58%, transparent 59%),
    conic-gradient(var(--accent) calc(var(--rate, 0) * 1%), #dde2da 0);
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
}

.progress-track {
  overflow: hidden;
  height: 14px;
  margin: 0 0 28px;
  border-radius: 999px;
  background: #dfe3dc;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d91e0f);
  transition: width 180ms ease;
}

.taunt {
  display: none;
}

.map-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.72), transparent 260px),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

#mountainMap {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.93;
}

.map-legend {
  position: absolute;
  z-index: 1;
  top: 24px;
  left: 24px;
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  border: 1px solid rgba(225, 229, 221, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ash);
}

.legend-dot.climbed {
  background: var(--accent);
}

.land {
  fill: #d8d8cf;
  stroke: rgba(35, 38, 34, 0.22);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.map-inset-divider {
  fill: none;
  stroke: rgba(35, 38, 34, 0.18);
  stroke-width: 1.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.inset-land {
  stroke: rgba(35, 38, 34, 0.28);
}

.mountain-dot {
  fill: var(--ash);
  stroke: var(--paper);
  stroke-width: 2;
  transition: r 120ms ease, fill 120ms ease, opacity 120ms ease;
}

.mountain-dot.is-climbed {
  fill: var(--accent);
}

.mountain-dot.is-selected {
  r: 8;
  stroke: #ffffff;
  stroke-width: 3.2;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.search-box {
  display: block;
  flex: 1 0 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  position: relative;
}

.search-box span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-box input,
.toolbar select {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 0 18px;
  outline: none;
  font-size: 18px;
  font-weight: 650;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search-box::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 19px;
  height: 19px;
  background: var(--muted);
  opacity: 0.58;
  transform: translateY(-50%);
  mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27m21%2021-4.35-4.35M10.5%2018a7.5%207.5%200%201%201%200-15%207.5%207.5%200%200%201%200%2015Z%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.1%27%20stroke-linecap%3D%27round%27/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

.search-box input {
  padding-left: 48px;
}

.search-box input::placeholder {
  color: #a0a7a2;
}

.toolbar select {
  width: auto;
  min-height: 44px;
  padding: 0 38px 0 18px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 20px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 15px) 50% / 7px 7px no-repeat,
    rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 700;
  appearance: none;
}

.search-box input:focus,
select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(18, 71, 51, 0.11);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.segment {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.segment.is-active {
  background: var(--forest);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(18, 71, 51, 0.18);
}

.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mountain-list {
  display: grid;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.mountain-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.mountain-row.is-selected {
  border-color: rgba(225, 59, 37, 0.42);
  background: rgba(225, 59, 37, 0.035);
  box-shadow: none;
}

.mountain-row input {
  width: 28px;
  height: 28px;
  margin: 0;
  appearance: none;
  border: 2px solid #a5aca7;
  border-radius: 8px;
  background: transparent;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.mountain-row input:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(225, 59, 37, 0.22);
}

.mountain-row input:checked::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
  mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M5%2012.6l4.3%204.3L19%207.2%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%273.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E") center / 78% 78% no-repeat;
}

.mountain-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  font-weight: 800;
  font-size: 20px;
}

.mountain-kana {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.mountain-detail {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.elevation {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.text-button,
.ghost-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--forest-dark);
  font-weight: 750;
}

.text-button {
  min-height: 38px;
  padding: 0 14px;
}

.ghost-button {
  min-height: 40px;
  padding: 0 14px;
}

#shareCanvas {
  display: block;
  width: 100%;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe7d7;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #fffaf0;
}

.map-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  margin: 22px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--soft-shadow);
}

.share-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  object-fit: contain;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--forest-dark);
}

.privacy-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .progress-panel,
  .controls-panel {
    grid-column: 1;
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 0 24px;
  }

  .site-header {
    min-height: 76px;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
  }

  .brand-lockup {
    flex: 1 1 auto;
    gap: 12px;
  }

  .brand-mark {
    width: 44px;
    height: 34px;
    margin-top: 0;
  }

  .menu-button {
    width: 40px;
    height: 40px;
    gap: 4px;
  }

  .menu-button span {
    width: 24px;
    height: 3px;
  }

  h1 {
    font-size: clamp(20px, 5.6vw, 25px);
  }

  .site-header h1 {
    font-size: clamp(21px, 5.8vw, 26px);
    font-weight: 700;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 22px 16px;
  }

  .progress-head {
    grid-template-columns: 58px minmax(0, 1fr) 74px;
    gap: 12px;
    margin-bottom: 18px;
  }

  .summit-badge {
    display: inline-flex;
    width: 58px;
    height: 58px;
  }

  .progress-head .eyebrow {
    margin-bottom: 4px;
    font-size: 15px;
  }

  .progress-head h2 {
    gap: 8px;
    font-size: clamp(44px, 13vw, 62px);
  }

  .rate-ring {
    width: 74px;
    height: 74px;
    font-size: 22px;
  }

  .progress-track {
    height: 12px;
    margin-bottom: 20px;
  }

  .map-wrap {
    border-radius: 18px;
  }

  .map-legend {
    top: 22px;
    left: 20px;
    gap: 10px;
    font-size: 15px;
  }

  .legend-dot {
    width: 14px;
    height: 14px;
  }

  .toolbar {
    gap: 12px 8px;
    margin-top: 18px;
  }

  .search-box input,
  .toolbar select {
    min-height: 48px;
    border-radius: 12px;
    font-size: 18px;
  }

  .search-box input {
    padding: 0 16px 0 48px;
  }

  .toolbar select,
  .segment {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
  }

  .list-meta {
    margin-top: 18px;
    font-size: 13px;
  }

  .mountain-list {
    max-height: none;
    min-height: 0;
  }

  .mountain-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 72px;
    padding: 12px 2px;
  }

  .mountain-row input {
    width: 28px;
    height: 28px;
  }

  .mountain-name {
    gap: 6px 12px;
    font-size: 20px;
  }

  .mountain-kana,
  .mountain-detail {
    font-size: 14px;
  }

  .elevation {
    font-size: 16px;
  }

  .map-share-button {
    min-height: 58px;
    margin-top: 18px;
    border-radius: 12px;
    font-size: 20px;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}
