.sync-panel { margin: 0 0 24px; padding: 21px 25px; }
.sync-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.sync-heading h3, .sync-heading p { margin: 4px 0; }
.sync-heading p { font-size: 13px; }
.sync-panel a { color: var(--green); }
.sync-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.sync-panel #sync-url { font-size: 13px; }
#sync-settings { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.guide-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }

.upload-action {
 display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
 padding: 7px 13px; border: 1px solid #abc2ad; border-radius: 8px;
 background: #edf4e8; color: #285045; font-weight: 650; text-decoration: none;
}
.upload-action:hover { background: #dfeedd; }

.map-controls { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
#map-filters { flex: 1; min-width: 0; }
.map-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filter-toggle {
 display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px;
 border: 1px solid var(--line); border-radius: 9px; background: #fffefb; cursor: pointer;
 font-size: 13px; font-weight: 630; white-space: nowrap;
}
.filter-toggle input, .material-option input {
 width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: var(--green);
}
.filter-toggle:has(input:checked) { background: #edf4eb; border-color: #c3d7c5; color: #244b3c; }
.material-picker { container-type: inline-size; border: 1px solid var(--line); border-radius: 12px; background: #fffefb; }
.material-picker summary { cursor: pointer; padding: 12px 13px; font-weight: 680; }
.filter-count { float: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.material-actions {
 display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch;
 gap: 8px; margin: 0 13px 12px;
}
.material-actions input[type="search"] {
 margin: 0; width: 100%; min-width: 0; height: 42px; padding: 0 12px;
 border-radius: 9px; background: #f7faf5; font-size: 15px;
}
.material-selection-actions { display: grid; grid-template-columns: repeat(3,auto) auto; gap: 7px; }
.material-selection-actions button, .material-scope {
 display: inline-flex; justify-content: center; align-items: center; min-height: 42px;
 margin: 0; padding: 0 10px; border-radius: 9px; font-size: 13px; white-space: nowrap;
}
.material-selection-actions button:disabled { cursor: default; }
@container (max-width: 650px) {
 .material-actions { grid-template-columns: minmax(0,1fr); }
 .material-selection-actions { grid-template-columns: repeat(3,minmax(0,1fr)) minmax(0,1.55fr); }
}
@container (max-width: 399px) {
 .material-selection-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
.material-options {
 display: grid; grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr));
 align-content: start; gap: 6px; max-height: 294px; overflow: auto; padding: 2px 13px 13px;
}
.material-option {
 display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 6px;
 padding: 6px 8px; min-height: 44px; border: 1px solid #dfe7de; border-radius: 9px;
 background: #fffefb; font-size: 12px; line-height: 1.3; cursor: pointer;
}
.material-option:has(input:checked) { background: #f1f6ee; }
.material-option:hover { border-color: #9bb5a2; }
.material-option > span { overflow-wrap: anywhere; }
.material-option img, .material-option .material-placeholder { width: 27px; height: 27px; object-fit: contain; }
.map-key { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.harvested-key, .rare-key {
 min-width: 14px; height: 14px; border: 1px solid #7d8587; border-radius: 4px; background: #e4e6e6;
 color: #4b5658; font-size: 10px; text-align: center; line-height: 12px;
}
.rare-key { margin-left: 10px; border-color: #ad6e0b; background: #fff2cc; }

.map-card { box-shadow: 0 2px 8px #2a48210c; }
.map-heading { padding: 12px 14px; }
.map-heading h3 { font-size: 18px; }
.expand-map { font-size: 12px; padding: 6px 10px; min-height: 34px; }
.map-plot {
 height: auto; aspect-ratio: 16 / 9; background: #dce8db; border: 0; margin: 0 10px 10px;
 border-radius: 8px; isolation: isolate;
}
.terrain { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.terrain-point {
 position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center;
 gap: 2px; padding: 1px 3px; min-height: 23px; max-width: 160px; border-radius: 6px;
 background: #fffffff5; border: 1px solid #436349; z-index: 2; box-shadow: 0 1px 4px #162c2550; line-height: 1;
}
.terrain-point:hover, .terrain-point:focus-visible, .focused-point {
 z-index: 5; outline: 2px solid #325945; outline-offset: 2px;
}
.terrain-point.rare { border-color: #a7680c; background: #fff3d3; }
.terrain-point.is-harvested { border-color: #727d7e; background: #eaeded; color: #475254; }
.map-item.is-harvested, .resource.is-harvested { color: #4d5759; filter: grayscale(1); }
.resource.is-harvested { background: #e9ebeb; }
.marker-rewards { display: flex; flex-wrap: wrap; gap: 1px; }
.terrain-point .extra-reward, .show-all-rewards .marker-more { display: none; }
.show-all-rewards .extra-reward { display: inline-flex; }
.marker-more { color: #58645c; font-size: 8px; font-weight: 600; }
.map-item { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; }
.map-item img, .map-item .material-placeholder { width: 18px; height: 18px; object-fit: contain; }
.map-item b { font-size: 9px; white-space: nowrap; }
.material-placeholder {
 display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 5px;
 background: #e6ece1; color: #48604d; font-size: 11px; font-weight: 650;
}
.resource .material-placeholder { width: 28px; height: 28px; }
.is-harvested .material-placeholder { background: #d9dddd; color: #475254; }
.position-dot {
 position: absolute; width: 5px; height: 5px; background: #fff; border: 1px solid #203b32;
 border-radius: 50%; transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
}
.position-dot.is-harvested { background: #c8cdce; border-color: #687273; }
.map-connectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-connectors line { stroke: #213d32; stroke-width: 1; opacity: .71; }
.map-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; padding: 0 12px 11px; }
.map-highlights { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.map-highlights .map-item {
 column-gap: 3px; padding: 2px 5px; border-radius: 5px; background: #edf3e8; color: #304b3b;
}
.map-visible-count { margin-left: auto; white-space: nowrap; }
.overlay { position: absolute; inset: 0; background: #ffffffd9; }

.large-map-dialog {
 width: min(96vw, 1560px); max-width: 96vw; height: 92vh; height: 92dvh; max-height: 92dvh; padding: 16px;
}
.large-map-dialog[open] { display: flex; flex-direction: column; }
.large-map-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.large-map-toolbar h2 { margin: 0 auto 0 0; font-size: clamp(18px, 2.5vw, 24px); }
.map-zoom-controls { display: flex; align-items: center; gap: 4px; }
.map-zoom-value { min-width: 3.6em; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.large-map-toolbar button { padding: 6px 10px; min-height: 34px; font-size: 13px; }
.large-map-body { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) minmax(90px, .38fr); gap: 10px; }
.map-scroll {
 position: relative; min-width: 0; overflow: hidden; overflow: clip;
 background: #dce7db; border-radius: 8px; touch-action: none; user-select: none; cursor: grab;
}
.map-scroll.is-panning, .map-scroll.is-panning * { cursor: grabbing; }
.map-scroll:focus-visible { outline: 2px solid #81aa8b; outline-offset: 2px; }
.large-plot { position: absolute; inset: 0 auto auto 0; min-width: 0; margin: 0; border-radius: 0; }
.show-all-rewards .map-item img { width: 23px; height: 23px; }
.all-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr)); align-content: start; gap: 6px; overflow: auto; }
.point-row { text-align: left; font-size: 12px; padding: 7px 9px; }
.row-items { display: flex; flex-wrap: wrap; gap: 5px 7px; margin-top: 4px; }
.row-items img { width: 24px; height: 24px; }
.active-row { background: #e5eddb; border-color: var(--green); }
@media (min-width: 1100px) {
 .large-map-body { grid-template: minmax(0, 1fr) / minmax(0, 1fr) 245px; }
}
@media (max-width: 760px) {
 .map-controls { flex-direction: column; align-items: stretch; }
 .map-controls .history-label { margin: 0; }
}
@media (max-width: 600px) {
 .sync-heading { align-items: flex-start; flex-direction: column; }
 .large-map-dialog { padding: 10px; }
 .large-map-toolbar { gap: 5px; }
 .map-item img, .map-item .material-placeholder { width: 15px; height: 15px; }
 .terrain-point { min-height: 19px; padding: 1px 2px; }
 .terrain-point b { font-size: 8px; }
}

.site-header .brand { font-size: clamp(18px, 3vw, 24px); font-weight: 650; letter-spacing: 0; }
.guide-action {
 display: inline-flex; align-items: center; min-height: 42px; padding: 7px 13px;
 border: 1px solid var(--line); border-radius: 8px; background: #fffefb; color: var(--green);
 font-weight: 650; text-decoration: none;
}
.guide-action:hover { background: #edf4e8; }
#legacy-login { margin-top: 12px; }
#legacy-login summary, #sync-advanced summary, .bot-tools summary { cursor: pointer; font-size: 13px; color: var(--green); }
#legacy-login form { padding-top: 10px; }
#sync-advanced, .bot-tools { margin-top: 12px; }
#sync-advanced p { font-size: 13px; }
.sync-heading h2 { margin: 2px 0; font-size: 18px; }
#access-dialog input { font-family: monospace; }
#code-copy-status:empty { display: none; }
.record-panel { background: #f4eef8; border: 1px solid #e8d8ee; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.record-panel h2 { font-size: 16px; color: #543d64; margin: 0; }
.record-panel p { font-size: 13px; margin: 3px 0 0; }
.track-list { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 8px 0 0; }
.track-item { display: flex; align-items: center; gap: 9px; border-radius: 8px; padding: 6px 10px; background: #fffafc; }
.track-item strong { font-size: 13px; }
.track-item small { display: block; font-size: 11px; color: #675877; }
.track-note, .music-key, .music-icon {
 display: inline-grid; place-items: center; min-width: 16px; border: 1px solid #a689bc;
 border-radius: 5px; background: #eee1f4; color: #694188; line-height: 1.25;
}
.track-note { min-width: 24px; min-height: 24px; }
.music-key { margin-left: 10px; }
.terrain-point.music-point { border-color: #8c62a4; background: #f5e9fa; }
.point-dialog h2 { margin-top: 0; }
.point-dialog .detail-list { margin: 12px 0; max-height: min(50dvh, 400px); overflow: auto; }
@media (max-width: 600px) {
 .site-header { flex-wrap: wrap; gap: 8px; }
 .site-header .header-right { gap: 6px; }
 .site-header :is(.guide-action,.upload-action,#logout) { padding: 6px 8px; min-height: 37px; }
}
