:root {
  color-scheme: light;
  --page-bg: #f2f5f4;
  --panel-bg: #ffffff;
  --surface-muted: #f7f9f8;
  --text: #26332f;
  --text-muted: #68756f;
  --border: #d9e1de;
  --border-strong: #bdcbc6;
  --accent: #2f7f73;
  --accent-dark: #25675e;
  --accent-soft: #e7f2ef;
  --danger: #a74444;
  --danger-soft: #fbefef;
  --focus: #1c7167;
  --notice: var(--accent-dark);
  --notice-soft: var(--accent-soft);
  --notice-border: #a9c6c0;
  --shadow: 0 10px 28px rgba(38, 51, 47, 0.07);
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(190, 225, 218, 0.2), transparent 30rem),
    var(--page-bg);
  font-family: "Segoe UI", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="color"],
input[type="range"],
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

:focus-visible {
  outline: 3px solid rgba(28, 113, 103, 0.3);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 9px 13px;
  color: #ffffff;
  background: var(--accent-dark);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transform: translateY(calc(-100% - 14px));
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 10px clamp(14px, 2.2vw, 32px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  border-radius: 7px;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.brand-block h1 {
  margin: 0;
  color: #21302b;
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 750;
  letter-spacing: 0.025em;
  line-height: 1.25;
}

.brand-block p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.header-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
}

.header-info-actions,
.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-info-actions {
  flex: 0 0 auto;
}

.button.header-help-button {
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--notice);
  background: #ffffff;
  border-color: var(--notice-border);
  font-size: 20px;
  font-weight: 850;
}

.button.header-help-button:not(:disabled):hover {
  color: var(--accent-dark);
  background: var(--notice-soft);
  border-color: var(--notice);
}

.button.header-updates-button {
  min-height: 40px;
  padding: 7px 10px;
  color: var(--accent-dark);
  background: #ffffff;
  border-color: var(--notice-border);
  font-size: 13px;
}

.button.header-updates-button:not(:disabled):hover {
  color: var(--accent-dark);
  background: var(--notice-soft);
  border-color: var(--notice);
}

.updates-icon {
  color: var(--notice);
  font-size: 15px;
}

.updates-new-badge,
.release-latest-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  color: var(--notice);
  background: var(--notice-soft);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.updates-new-badge[hidden] {
  display: none;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:not(:disabled):hover {
  border-color: #95aaa3;
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button-secondary {
  color: var(--accent-dark);
  background: #ffffff;
  border-color: #a9c6c0;
}

.button-secondary:not(:disabled):hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.button-quiet {
  color: #59655f;
  background: var(--surface-muted);
}

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

.button-primary:not(:disabled):hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #ddbcbc;
}

.button-danger:not(:disabled):hover {
  background: #f7e2e2;
  border-color: #c98787;
}

.button-compact {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
}

.button-large {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}

.workspace {
  display: grid;
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 16px clamp(12px, 1.8vw, 24px) 24px;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  gap: clamp(14px, 1.5vw, 22px);
  align-items: start;
}

.settings-panel {
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scrollbar-gutter: stable;
}

.panel-section {
  padding: 20px;
  border-bottom: 1px solid #e7ecea;
}

.panel-section:last-child {
  border-bottom: 0;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.section-number {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.section-heading-row h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.section-note {
  padding-top: 16px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.count-badge {
  min-width: 42px;
  padding: 3px 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.axis-input-grid,
.two-column-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: #53615c;
  font-size: 12px;
  font-weight: 700;
}

.field-full {
  width: 100%;
}

.map-title-input {
  margin-bottom: 12px;
}

.layout-position-control {
  display: grid;
  margin-bottom: 13px;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid #e1e8e5;
  border-radius: 6px;
  gap: 8px;
}

.field-label {
  color: #53615c;
  font-size: 12px;
  font-weight: 700;
}

.outside-label-options {
  padding-top: 3px;
  border-top: 1px solid #dde6e2;
}

.outside-label-options[hidden] {
  display: none;
}

.layout-position-control .field-help {
  margin-top: 0;
  line-height: 1.5;
}

.field input[type="text"],
.field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 550;
}

.field input[type="text"]:hover,
.field select:hover {
  border-color: #98aea7;
}

.field input[type="text"]:focus,
.field select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(47, 127, 115, 0.14);
}

.drop-zone {
  display: grid;
  min-height: 178px;
  place-items: center;
  align-content: center;
  padding: 18px;
  text-align: center;
  background: #f8fbfa;
  border: 1.5px dashed #a8c1ba;
  border-radius: 7px;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.drop-zone.is-dragging {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: scale(1.01);
}

.drop-zone-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  place-items: center;
  color: var(--accent);
  background: #ffffff;
  border: 1px solid #b8d2cb;
  border-radius: 50%;
  font-size: 23px;
  line-height: 1;
}

.drop-zone p {
  margin: 1px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.drop-zone p strong {
  color: #3b4a45;
  font-size: 13px;
}

.drop-zone .button {
  min-height: 36px;
  margin: 7px 0 4px;
  font-size: 12px;
}

.drop-zone small {
  margin-top: 5px;
  color: #7d8984;
  font-size: 10px;
}

.library-actions {
  display: grid;
  margin-top: 12px;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  gap: 9px;
}

.library-actions[hidden],
.library-selection-actions[hidden],
.library-action-row[hidden] {
  display: none;
}

.library-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.library-actions .button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
}

.library-selection-actions {
  display: grid;
  gap: 8px;
}

.library-selection-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.library-selection-summary strong {
  color: var(--accent-dark);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.library-actions .library-cancel-button {
  width: auto;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 10px;
}

.library-selection-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.library-empty,
.selection-empty {
  margin: 12px 0 0;
  padding: 12px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
}

.image-library {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.library-card {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 3px;
  overflow: hidden;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: left;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.library-card:hover {
  border-color: var(--accent);
  box-shadow: 0 5px 13px rgba(47, 127, 115, 0.12);
  transform: translateY(-1px);
}

.library-card.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 127, 115, 0.2);
}

.library-card.is-selected:hover {
  box-shadow:
    0 0 0 2px rgba(47, 127, 115, 0.24),
    0 5px 13px rgba(47, 127, 115, 0.12);
}

.library-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  pointer-events: none;
}

.library-card-add {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  border: 2px solid #ffffff;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.library-card-select {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: transparent;
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(38, 51, 47, 0.16);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.library-card.is-selected .library-card-select {
  color: #ffffff;
  background: var(--accent);
}

.character-settings {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 15px;
}

.character-settings[hidden] {
  display: none;
}

.range-label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.range-label-row output {
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.field-help {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.field.is-disabled {
  opacity: 0.58;
}

.field.is-disabled input {
  cursor: not-allowed;
}

input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.color-control {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.color-control input[type="color"] {
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.color-control input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-control input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 4px;
}

.color-control span {
  min-width: 0;
  overflow: hidden;
  color: #59655f;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
}

.segmented-control {
  display: grid;
  padding: 3px;
  background: #edf2f0;
  border-radius: 6px;
  grid-template-columns: repeat(2, 1fr);
}

.segmented-control button {
  min-height: 35px;
  color: #5c6863;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.segmented-control button[aria-pressed="true"] {
  color: var(--accent-dark);
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(31, 62, 54, 0.1);
}

.switch-row {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.switch-row > span:first-child {
  display: grid;
  gap: 1px;
}

.switch-row strong {
  color: #53615c;
  font-size: 12px;
}

.switch-row small {
  color: var(--text-muted);
  font-size: 10px;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 23px;
  background: #bdc7c3;
  border-radius: 999px;
  transition: background-color 120ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  content: "";
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 120ms ease;
}

.switch-row input:checked + .switch {
  background: var(--accent);
}

.switch-row input:checked + .switch::after {
  transform: translateX(17px);
}

.switch-row input:focus-visible + .switch {
  outline: 3px solid rgba(28, 113, 103, 0.3);
  outline-offset: 2px;
}

.character-batch-panel {
  display: grid;
  padding: 11px;
  background: var(--accent-soft);
  border: 1px solid #c8ddd8;
  border-radius: 6px;
  gap: 10px;
}

.character-batch-copy {
  display: grid;
  gap: 2px;
}

.character-batch-copy strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.character-batch-copy small {
  color: #5f6f69;
  font-size: 10px;
  line-height: 1.5;
}

.character-batch-panel .button {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  font-size: 12px;
}

.character-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.preset-swatch {
  display: grid;
  min-width: 0;
  padding: 4px 2px;
  color: #67736e;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 8px;
  line-height: 1.2;
  text-align: center;
}

.preset-swatch:hover,
.preset-swatch.is-active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #b9d3cd;
}

.swatch {
  display: block;
  width: 100%;
  aspect-ratio: 1.45;
  margin-bottom: 4px;
  border: 1px solid rgba(45, 60, 55, 0.13);
  border-radius: 3px;
}

.swatch-white {
  background: #fffdf8;
}

.swatch-beige {
  background: #f7f0df;
}

.swatch-blue {
  background: #eef8fb;
}

.swatch-green {
  background: #eff8f2;
}

.swatch-gradient {
  background: linear-gradient(135deg, #fff4cf, #d9eff2);
}

.appearance-group {
  display: grid;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e5ebe8;
  gap: 11px;
}

.appearance-group h3,
.appearance-fieldset legend {
  margin: 0;
  padding: 0;
  color: #3f4e49;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.appearance-fieldset {
  min-width: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
}

.appearance-fieldset:disabled > .field,
.appearance-fieldset:disabled > .appearance-color-fields,
.appearance-fieldset:disabled > .background-image-fields,
.appearance-fieldset:disabled > .transparent-note {
  opacity: 0.58;
}

.appearance-group-last {
  padding-bottom: 1px;
}

.appearance-color-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr;
  gap: 9px;
}

.appearance-color-fields.color-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appearance-color-fields[hidden] {
  display: none;
}

.background-image-fields {
  display: grid;
  gap: 9px;
}

.background-image-fields[hidden],
.background-image-preview[hidden],
.appearance-note[hidden] {
  display: none;
}

.appearance-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.55;
}

.transparent-note {
  padding: 10px 11px;
  color: #50605a;
  background:
    linear-gradient(45deg, #edf1ef 25%, transparent 25%),
    linear-gradient(-45deg, #edf1ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1ef 75%),
    linear-gradient(-45deg, transparent 75%, #edf1ef 75%),
    #ffffff;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.background-image-preview {
  display: grid;
  min-width: 0;
  align-items: center;
  padding: 7px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 9px;
}

.background-image-preview img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 1px solid rgba(45, 60, 55, 0.14);
  border-radius: 4px;
}

.background-image-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.background-image-copy strong {
  overflow: hidden;
  color: #3f4e49;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.background-image-copy small {
  color: var(--text-muted);
  font-size: 9px;
  line-height: 1.4;
}

.background-image-remove {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 10px;
}

.export-section {
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
}

.export-options {
  display: grid;
  margin-bottom: 14px;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 9px;
  color: #53615c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.checkbox-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.checkbox-row.is-disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.privacy-note {
  margin: 12px 0 0;
  padding: 10px 11px;
  color: #64716c;
  background: #f1f6f4;
  border-left: 3px solid #8fbab0;
  border-radius: 0 4px 4px 0;
  font-size: 10px;
  line-height: 1.55;
}

.canvas-panel {
  min-width: 0;
  padding: clamp(12px, 1.5vw, 20px);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.canvas-panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 850px);
  margin: 0 auto 10px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.canvas-panel-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.map-help {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 13px;
  color: var(--text-muted);
  font-size: 10px;
}

kbd {
  padding: 2px 5px;
  color: #4d5a55;
  background: #ffffff;
  border: 1px solid #cbd5d1;
  border-bottom-width: 2px;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  font-family: inherit;
  font-size: 9px;
}

.map-view-toolbar {
  display: flex;
  width: min(100%, 850px);
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 4px;
  padding: 4px 6px;
  background: #f5f8f7;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.map-view-label {
  color: #52615b;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.map-zoom-step {
  flex: 0 0 38px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 20px;
  font-weight: 500;
}

.map-zoom-range {
  display: flex;
  flex: 1 1 180px;
  max-width: 230px;
  align-items: center;
}

.map-zoom-output {
  flex: 0 0 48px;
  color: var(--accent-dark);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center;
}

.map-view-action {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 12px;
  white-space: nowrap;
}

.map-view-action[aria-pressed="true"] {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.map-view-action[aria-pressed="true"]:hover {
  color: #ffffff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.map-view-help {
  width: min(100%, 850px);
  margin: 0 auto 4px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.map-viewport {
  width: min(100%, 850px);
  height: clamp(280px, calc(100vh - 215px), 832px);
  height: clamp(280px, calc(100dvh - 215px), 832px);
  margin: 0 auto;
  overflow: auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
    #e8eeeb;
  border: 1px solid #ced9d5;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.map-viewport-inner {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
}

.map-frame {
  display: grid;
  flex: 0 0 auto;
  width: fit-content;
  margin: 0;
  padding: clamp(5px, 0.65vw, 8px);
  place-items: center;
  background: #e8eeeb;
  border: 1px solid #d2dcd8;
  border-radius: 7px;
}

.map-composition {
  --map-axis-color: #71827c;
  --map-axis-start-color: #71827c;
  --map-axis-end-color: #71827c;
  --map-axis-horizontal: #71827c;
  --map-axis-vertical: #71827c;
  --map-axis-inset: 8%;
  --map-axis-arrow-base-size: 14px;
  --map-axis-arrow-size: 12px;
  --map-axis-line-width: 2.5px;
  --map-axis-opacity: 1;
  --map-boundary-color: #71827c;
  --map-text-color: #26332f;
  --map-font-family: "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --map-view-scale: 1;
  position: relative;
  flex: 0 0 auto;
  width: var(--map-display-size, 800px);
  max-width: none;
  aspect-ratio: 1;
  overflow: hidden;
  color: var(--map-text-color);
  container-type: inline-size;
  font-family: var(--map-font-family);
  isolation: isolate;
}

.map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border: 0;
  box-shadow:
    inset 0 0 0 1px rgba(68, 86, 80, 0.12),
    0 3px 12px rgba(38, 51, 47, 0.08);
  font-family: inherit;
  touch-action: manipulation;
  user-select: none;
}

.map-inner-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: transparent;
  pointer-events: none;
}

.map-composition.is-layout-outside {
  background: #fffdf8;
  border: 0;
  box-shadow:
    inset 0 0 0 1px rgba(68, 86, 80, 0.14),
    0 3px 12px rgba(38, 51, 47, 0.08);
}

.map-composition.is-layout-outside .map-stage {
  inset: auto;
  top: 16.75%;
  left: 12.5%;
  width: 75%;
  height: 75%;
  border: 0;
  box-shadow: none;
}

.map-composition.is-layout-outside .map-stage::after {
  position: absolute;
  inset: 0;
  z-index: 6;
  box-shadow: inset 0 0 0 2px var(--map-boundary-color);
  opacity: 0.72;
  pointer-events: none;
  content: "";
}

.map-stage.is-drop-target {
  outline: 4px solid rgba(47, 127, 115, 0.34);
  outline-offset: -4px;
}

.map-composition:not(.is-layout-outside) .map-stage:focus-visible {
  outline-offset: -4px;
}

.axis-line {
  position: absolute;
  z-index: 1;
  opacity: var(--map-axis-opacity);
  pointer-events: none;
}

.axis-line::before,
.axis-line::after {
  position: absolute;
  z-index: 1;
  content: "";
}

.axis-shaft {
  position: absolute;
  z-index: 0;
}

.axis-horizontal {
  top: 50%;
  right: var(--map-axis-inset);
  left: var(--map-axis-inset);
  height: calc(var(--map-axis-line-width) * var(--map-scale, 1));
  transform: translateY(-50%);
}

.axis-horizontal .axis-shaft {
  top: 0;
  right: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  bottom: 0;
  left: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  background: var(--map-axis-horizontal);
}

.axis-horizontal::before {
  top: 50%;
  left: 0;
  width: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  height: calc(var(--map-axis-arrow-base-size) * var(--map-scale, 1));
  background: var(--map-axis-start-color);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  transform: translateY(-50%);
}

.axis-horizontal::after {
  top: 50%;
  right: 0;
  width: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  height: calc(var(--map-axis-arrow-base-size) * var(--map-scale, 1));
  background: var(--map-axis-end-color);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: translateY(-50%);
}

.axis-vertical {
  top: var(--map-axis-inset);
  bottom: var(--map-axis-inset);
  left: 50%;
  width: calc(var(--map-axis-line-width) * var(--map-scale, 1));
  transform: translateX(-50%);
}

.axis-vertical .axis-shaft {
  top: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  right: 0;
  bottom: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  left: 0;
  background: var(--map-axis-vertical);
}

.axis-vertical::before {
  top: 0;
  left: 50%;
  width: calc(var(--map-axis-arrow-base-size) * var(--map-scale, 1));
  height: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  background: var(--map-axis-start-color);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateX(-50%);
}

.axis-vertical::after {
  bottom: 0;
  left: 50%;
  width: calc(var(--map-axis-arrow-base-size) * var(--map-scale, 1));
  height: calc(var(--map-axis-arrow-size) * var(--map-scale, 1));
  background: var(--map-axis-end-color);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%);
}

.map-title {
  position: absolute;
  top: 2.1%;
  left: 2.25%;
  z-index: 2;
  display: -webkit-box;
  width: 27.5%;
  max-height: 2.35em;
  overflow: hidden;
  color: var(--map-text-color);
  font-size: 18px;
  font-size: clamp(
    calc(11px * var(--map-view-scale)),
    2.65cqw,
    calc(21px * var(--map-view-scale))
  );
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.16;
  overflow-wrap: anywhere;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  pointer-events: none;
}

.map-composition.is-layout-outside .map-title {
  top: 1.35%;
  left: 8%;
  display: block;
  width: 84%;
  max-height: none;
  font-size: clamp(
    calc(15px * var(--map-view-scale)),
    4.25cqw,
    calc(34px * var(--map-view-scale))
  );
  line-height: 1.08;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: unset;
}

.map-title[hidden] {
  display: none;
}

.axis-label {
  position: absolute;
  z-index: 2;
  display: -webkit-box;
  max-width: 31%;
  overflow: hidden;
  color: var(--map-text-color);
  font-size: clamp(
    calc(12px * var(--map-view-scale)),
    3.1cqw,
    calc(25px * var(--map-view-scale))
  );
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  pointer-events: none;
}

.axis-label-top {
  top: 2.1%;
  left: 50%;
  transform: translateX(-50%);
}

.axis-label-bottom {
  bottom: 2.1%;
  left: 50%;
  transform: translateX(-50%);
}

.axis-label-left {
  top: 50%;
  left: 2.1%;
  transform: translateY(-50%);
}

.axis-label-right {
  top: 50%;
  right: 2.1%;
  transform: translateY(-50%);
}

.map-composition.is-layout-outside .axis-label {
  max-width: 56%;
  font-size: clamp(
    calc(11px * var(--map-view-scale)),
    3cqw,
    calc(24px * var(--map-view-scale))
  );
}

.map-composition.is-layout-outside .map-title,
.map-composition.is-layout-outside .axis-label {
  cursor: help;
  pointer-events: auto;
}

.map-composition.is-layout-outside .axis-label-top {
  top: 11.8%;
}

.map-composition.is-layout-outside .axis-label-bottom {
  bottom: 1.55%;
}

.map-composition.is-layout-outside .axis-label-top,
.map-composition.is-layout-outside .axis-label-bottom {
  display: block;
  width: 56%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: unset;
}

.map-composition.is-layout-outside .axis-label-left,
.map-composition.is-layout-outside .axis-label-right {
  top: 54.25%;
  max-width: 9.5%;
  max-height: 62%;
  -webkit-line-clamp: 3;
}

.map-composition.is-layout-outside .axis-label-left {
  left: 2.35%;
}

.map-composition.is-layout-outside .axis-label-right {
  right: 2.35%;
}

.map-composition.is-layout-outside:not(.is-side-labels-vertical) .axis-label-left,
.map-composition.is-layout-outside:not(.is-side-labels-vertical) .axis-label-right {
  display: block;
  width: 9.5%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-line-clamp: unset;
}

.map-composition.is-layout-outside.is-side-labels-vertical .axis-label-left,
.map-composition.is-layout-outside.is-side-labels-vertical .axis-label-right {
  display: block;
  width: auto;
  max-width: 2.2em;
  overflow: hidden;
  letter-spacing: 0.08em;
  line-height: 1.08;
  text-orientation: upright;
  white-space: nowrap;
  writing-mode: vertical-rl;
  -webkit-line-clamp: unset;
}

.map-composition.is-layout-outside.is-side-labels-vertical .axis-label-left {
  left: 5.625%;
  transform: translate(-50%, -50%);
}

.map-composition.is-layout-outside.is-side-labels-vertical .axis-label-right {
  right: 5.625%;
  transform: translate(50%, -50%);
}

.map-empty-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: min(48%, 270px);
  padding:
    calc(18px * var(--map-view-scale))
    calc(16px * var(--map-view-scale));
  place-items: center;
  color: #6e7b76;
  background: rgba(255, 255, 255, 0.86);
  border: 1px dashed rgba(80, 105, 97, 0.35);
  border-radius: calc(7px * var(--map-view-scale));
  font-size: clamp(
    calc(9px * var(--map-view-scale)),
    1.7cqw,
    calc(13px * var(--map-view-scale))
  );
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-empty-hint[hidden] {
  display: none;
}

.map-empty-hint small {
  margin-top: 3px;
  font-size: 0.82em;
}

.map-empty-icon {
  display: grid;
  width: clamp(
    calc(24px * var(--map-view-scale)),
    5cqw,
    calc(38px * var(--map-view-scale))
  );
  height: clamp(
    calc(24px * var(--map-view-scale)),
    5cqw,
    calc(38px * var(--map-view-scale))
  );
  margin-bottom: calc(5px * var(--map-view-scale));
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  font-size: clamp(
    calc(17px * var(--map-view-scale)),
    3.5cqw,
    calc(27px * var(--map-view-scale))
  );
  line-height: 1;
}

.placement-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  container-type: inline-size;
  pointer-events: none;
}

.character-node {
  position: absolute;
  z-index: 5;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.character-node:active {
  cursor: grabbing;
}

.character-portrait {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e8ecea;
  border-style: solid;
  box-sizing: border-box;
}

.character-portrait.is-circle {
  border-radius: 50%;
}

.character-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.character-node.is-selected .character-portrait {
  outline: 3px solid var(--accent);
  outline: max(2px, 0.38cqw) solid var(--accent);
  outline-offset: 3px;
  outline-offset: max(2px, 0.34cqw);
  box-shadow: 0 5px 16px rgba(26, 83, 73, 0.2);
}

.character-node:focus-visible .character-portrait {
  outline: 3px solid var(--focus);
  outline: max(2px, 0.38cqw) solid var(--focus);
  outline-offset: 4px;
  outline-offset: max(3px, 0.45cqw);
}

.character-name {
  position: absolute;
  top: calc(100% + 6px);
  top: calc(100% + 0.75cqw);
  display: block;
  padding: 2px 5px;
  padding: max(1px, 0.25cqw) max(4px, 0.65cqw);
  overflow: hidden;
  color: var(--map-text-color);
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(61, 79, 73, 0.22);
  border-radius: 999px;
  font-size: 12px;
  font-size: clamp(
    calc(8px * var(--map-view-scale)),
    1.55cqw,
    calc(13px * var(--map-view-scale))
  );
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  right: clamp(-12px, calc(-12px * var(--map-view-scale)), -3px);
  bottom: clamp(-12px, calc(-12px * var(--map-view-scale)), -3px);
  z-index: 3;
  display: none;
  width: clamp(12px, calc(24px * var(--map-view-scale)), 24px);
  height: clamp(12px, calc(24px * var(--map-view-scale)), 24px);
  padding: 0;
  background: transparent;
  border: 0;
  cursor: nwse-resize;
  touch-action: none;
}

.resize-handle::after {
  position: absolute;
  right: clamp(2px, calc(4px * var(--map-view-scale)), 4px);
  bottom: clamp(2px, calc(4px * var(--map-view-scale)), 4px);
  width: clamp(7px, calc(11px * var(--map-view-scale)), 11px);
  height: clamp(7px, calc(11px * var(--map-view-scale)), 11px);
  content: "";
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(23, 58, 50, 0.24);
}

.character-node.is-selected .resize-handle {
  display: block;
}

.character-node.is-near-right .resize-handle {
  right: 0;
}

.character-node.is-near-bottom .resize-handle {
  bottom: 0;
}

.selection-status {
  width: min(100%, 850px);
  min-height: 20px;
  margin: 6px auto 0;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.site-footer {
  display: flex;
  width: min(100%, 1360px);
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 auto;
  padding: 0 clamp(12px, 1.8vw, 24px) 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent-dark);
  font-weight: 750;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

.info-dialog {
  width: min(620px, calc(100vw - 32px));
  max-width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #cdd8d4;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(23, 42, 36, 0.24);
}

.info-dialog::backdrop {
  background: rgba(32, 47, 42, 0.42);
  backdrop-filter: blur(2px);
}

body.has-info-dialog::before {
  position: fixed;
  z-index: 1000;
  background: rgba(32, 47, 42, 0.42);
  content: "";
  inset: 0;
}

.info-dialog.is-fallback-open {
  position: fixed;
  z-index: 1001;
  inset: 0;
}

.info-dialog-shell {
  display: grid;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.info-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 15px;
  background: #fbfcfc;
  border-bottom: 1px solid var(--border);
}

.info-dialog-kicker {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.info-dialog-header h2 {
  margin: 0;
  color: #21302b;
  font-size: 20px;
  line-height: 1.35;
}

.info-dialog-close {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: #5c6964;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
}

.info-dialog-close:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.info-dialog-content {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 20px;
  scrollbar-gutter: stable;
}

.info-dialog-lead {
  margin: 0 0 16px;
  color: #53625c;
  font-size: 13px;
  line-height: 1.7;
}

.help-steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 8px;
}

.help-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  padding: 11px 12px;
  background: #f7f9f8;
  border: 1px solid #e0e7e4;
  border-radius: 7px;
}

.help-step-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
}

.help-steps strong,
.info-dialog-note strong {
  color: #293a34;
  font-size: 13px;
}

.help-steps p,
.info-dialog-note p {
  margin: 3px 0 0;
  color: #61706a;
  font-size: 11px;
  line-height: 1.65;
}

.info-dialog-section {
  margin-top: 18px;
}

.info-dialog-section h3 {
  margin: 0 0 9px;
  color: #2c3c36;
  font-size: 14px;
}

.help-tip-grid,
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.help-tip-grid > div,
.shortcut-grid > div {
  display: grid;
  min-width: 0;
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  gap: 2px;
}

.help-tip-grid strong {
  color: var(--accent-dark);
  font-size: 11px;
}

.help-tip-grid span,
.shortcut-grid dd {
  color: #65736e;
  font-size: 10px;
  line-height: 1.5;
}

.shortcut-grid {
  margin: 0;
}

.shortcut-grid dt,
.shortcut-grid dd {
  margin: 0;
}

.shortcut-grid dt {
  min-height: 24px;
}

.info-dialog-note {
  margin-top: 18px;
  padding: 11px 12px;
  background: #edf6f3;
  border-left: 3px solid #77aa9f;
  border-radius: 0 6px 6px 0;
}

.info-dialog-contact {
  margin: 15px 0 0;
  color: #65736e;
  font-size: 11px;
  line-height: 1.6;
}

.info-dialog-contact a {
  color: var(--accent-dark);
  font-weight: 750;
  text-underline-offset: 3px;
}

.info-dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 11px 20px;
  background: #fbfcfc;
  border-top: 1px solid var(--border);
}

.info-dialog-footer .button {
  min-width: 92px;
}

.release-card {
  padding: 15px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.release-card + .release-card {
  margin-top: 11px;
}

.release-card.is-latest {
  background: linear-gradient(145deg, #ffffff, #f8fbfa);
  border-color: #a9c9c2;
  box-shadow: inset 3px 0 0 var(--accent);
}

.release-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.release-card time {
  color: var(--accent-dark);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.release-card h3 {
  margin: 7px 0 8px;
  color: #293a34;
  font-size: 15px;
}

.release-card ul {
  display: grid;
  margin: 0;
  padding-left: 1.35em;
  color: #5d6c66;
  font-size: 11px;
  line-height: 1.65;
  gap: 4px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 15px;
  color: #ffffff;
  background: #253a34;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(18, 36, 31, 0.23);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: #8a3838;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(285px, 330px) minmax(0, 1fr);
    gap: 14px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .canvas-panel {
    padding: 14px;
  }

  .map-help span:nth-child(2) {
    display: none;
  }

  .header-actions .button-label {
    display: none;
  }
}

@media (max-width: 880px) {
  .site-header {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .brand-block p {
    max-width: 360px;
  }

  .header-controls {
    flex-wrap: wrap;
  }

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

  .settings-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .canvas-panel {
    grid-row: auto;
  }
}

@media (max-width: 660px) {
  .map-view-toolbar {
    display: grid;
    grid-template-columns: 42px minmax(76px, 1fr) 48px 42px;
    gap: 7px;
  }

  .map-view-label {
    grid-column: 1 / -1;
    text-align: center;
  }

  .map-zoom-step {
    width: 42px;
    min-height: 42px;
  }

  .map-zoom-range {
    width: 100%;
    min-width: 0;
  }

  .map-zoom-output {
    width: auto;
  }

  #actualSizeButton {
    grid-column: 1;
  }

  #fitMapButton {
    grid-column: 2 / -1;
  }

  .map-view-action {
    min-height: 42px;
  }

  .map-view-help {
    padding: 0 4px;
  }
}

@media (max-width: 620px) {
  .site-header {
    display: grid;
    gap: 8px;
  }

  .header-controls {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .header-info-actions,
  .header-actions {
    justify-content: flex-start;
  }

  .brand-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .brand-block p {
    font-size: 11px;
  }

  .workspace {
    padding: 10px 8px 22px;
  }

  .panel-section {
    padding: 18px 16px;
  }

  .library-actions .button {
    min-height: 40px;
  }

  .image-library {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 6px 6px 8px;
    grid-auto-columns: 68px;
    grid-auto-flow: column;
    grid-template-columns: none;
    justify-content: start;
  }

  .canvas-panel {
    padding: 10px;
  }

  .canvas-panel-header {
    align-items: flex-start;
  }

  .map-help {
    display: none;
  }

  .map-view-label {
    display: none;
  }

  .map-viewport {
    height: min(72vh, 620px);
    height: min(72dvh, 620px);
    min-height: 280px;
  }

  .map-frame {
    padding: 4px;
  }

  .selection-status {
    font-size: 10px;
  }

  .site-footer {
    display: grid;
    padding-bottom: 22px;
    text-align: center;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }

  .info-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .info-dialog-shell {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .info-dialog-header {
    padding: 14px 14px 12px;
  }

  .info-dialog-content {
    padding: 14px;
  }

  .info-dialog-footer {
    padding: 10px 14px;
  }
}

@media (max-width: 390px) {
  .header-info-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .header-updates-button {
    width: 100%;
  }

  .header-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .header-actions .button-quiet {
    grid-column: 1 / -1;
  }

  .axis-input-grid,
  .two-column-fields {
    grid-template-columns: 1fr;
  }

  .preset-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-panel-header h2 {
    font-size: 18px;
  }

  .appearance-color-fields.color-pair {
    grid-template-columns: 1fr;
  }

  .help-tip-grid,
  .shortcut-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
