/* Browser-only loading UI; offline artwork captures do not load this file. */
.hex-map-view { position:relative; }
#hex-render-status { position:absolute; inset:0; z-index:3; display:grid; place-items:center; margin:0; padding:16px; border-radius:0; background:rgb(223 225 221 / .25); pointer-events:none; }
#hex-render-status[hidden] { display:none; }
.hex-map-viewport.is-updating #hex-map { filter:grayscale(1); opacity:.4; }
.hex-loading-card { box-sizing:border-box; width:300px; max-width:100%; padding:22px; border:1px solid #c5c6b8; border-radius:12px; background:#fffdf6; box-shadow:0 5px 24px rgb(36 39 31 / .18); color:#30352c; text-align:center; }
.hex-loading-card strong { display:block; margin:10px 0 6px; font-size:16px; }
.hex-loading-card p { margin:0 0 16px; color:#626858; font-size:13px; line-height:1.4; }
.hex-loading-spinner { display:block; width:26px; height:26px; box-sizing:border-box; margin:0 auto; border:3px solid #d9ddcf; border-top-color:#657449; border-radius:50%; animation:hex-loading-spin .9s linear infinite; }
.hex-loading-progress { display:flex; align-items:center; gap:10px; }
.hex-loading-progress progress { display:block; flex:1; min-width:0; height:9px; appearance:none; border:0; border-radius:5px; overflow:hidden; background:#e2e5da; accent-color:#657449; }
.hex-loading-progress progress::-webkit-progress-bar { background:#e2e5da; border-radius:5px; }
.hex-loading-progress progress::-webkit-progress-value { background:#657449; border-radius:5px; }
.hex-loading-progress progress::-moz-progress-bar { background:#657449; border-radius:5px; }
#hex-render-percent { min-width:34px; color:#4d5741; font-size:12px; font-variant-numeric:tabular-nums; text-align:right; }
@keyframes hex-loading-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .hex-loading-spinner { animation:none; } }

.hex-world-settings { margin:0 0 20px; background:#fff; border:1px solid #ddd; border-radius:12px; }
.hex-world-settings>summary { padding:12px 16px; min-height:44px; cursor:pointer; font-weight:600; }
.hex-world-form { padding:0 16px 14px; }
.hex-world-fields { display:grid; grid-template-columns:minmax(140px,1fr) minmax(150px,1.3fr) repeat(2,minmax(80px,.65fr)); gap:12px; }
.hex-world-fields label { display:flex; flex-direction:column; gap:6px; font-size:13px; }
.hex-world-fields .button { width:100%; min-width:0; text-align:left; }
.hex-world-options,.hex-world-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px 20px; margin-top:14px; }
.hex-world-options label { display:flex; align-items:center; gap:6px; min-height:32px; font-size:13px; }
.hex-world-actions output { font-size:13px; color:#63675b; }
.hex-world-form .hex-muted { margin:12px 0 0; }
@media(max-width:700px) { .hex-world-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } .hex-world-options { gap:6px 14px; } .hex-world-options label { min-height:44px; } }

.hex-world-options input[type="checkbox"] { accent-color:#68754b; }
.hex-marker-palette .hex-marker-card { min-width:0; white-space:normal; line-height:1.25; }

/* Desktop detail loads retain the small corner indicator. */
@media(min-width:761px) {
  .hex-map-viewport.is-refining + #hex-render-status { inset:auto 10px 10px auto; padding:0; max-width:calc(100% - 20px); background:none; }
  .hex-map-viewport.is-refining + #hex-render-status .hex-loading-card { width:230px; padding:12px; }
  .hex-map-viewport.is-refining + #hex-render-status .hex-loading-spinner { display:none; }
  .hex-map-viewport.is-refining + #hex-render-status strong { margin:0 0 4px; font-size:13px; }
  .hex-map-viewport.is-refining + #hex-render-status p { margin:0 0 6px; font-size:11px; }
}
/* Keep progress outside the phone map without changing its camera dimensions. */
@media(max-width:760px) {
  #hex-render-status { position:static; inset:auto; padding:0; place-items:stretch; background:none; border-top:1px solid var(--hex-border); }
  #hex-render-status .hex-loading-card { display:grid; grid-template-columns:16px minmax(0,1fr) minmax(90px,.65fr); align-items:center; gap:3px 8px; width:auto; padding:10px 12px; border:0; border-radius:0; box-shadow:none; text-align:left; }
  #hex-render-status .hex-loading-spinner { grid-row:1 / 3; width:16px; height:16px; margin:0; border-width:2px; }
  #hex-render-status strong { grid-column:2; margin:0; font-size:12px; line-height:1.4; }
  #hex-render-status p { grid-column:2; margin:0; font-size:11px; line-height:1.4; overflow-wrap:anywhere; }
  #hex-render-status .hex-loading-progress { grid-column:3; grid-row:1 / 3; gap:6px; }
  #hex-render-status progress { height:6px; }
  #hex-render-percent { min-width:28px; font-size:11px; }
}
#hex-sections-background,#hex-sections-foreground,#hex-live-grid { pointer-events:none; }

#hex-live-grid[hidden] { display:none; }
.tool-sidebar-layout .hex-workspace { grid-template-columns:minmax(0,1fr); }
.tool-sidebar-layout .hex-palette { grid-template-columns:repeat(6,minmax(0,1fr)); }

.hex-file-actions { display:flex; align-items:center; justify-self:end; gap:8px; }
.hex-file-actions .hex-download { width:auto; margin:0; }
#hex-file-status { margin:0; padding:12px 18px; font-size:12px; color:var(--hex-muted); overflow-wrap:anywhere; background:#fff; }
#hex-file-status:empty { display:none; }
#hex-file-error { margin:0 0 18px; padding:12px; border:1px solid #b07a55; border-radius:8px; overflow-wrap:anywhere; }

#hex-generation-limit { position:absolute; inset:0; z-index:4; display:grid; grid-template-columns:minmax(0,1fr); box-sizing:border-box; place-items:center; padding:16px; background:rgb(243 236 216 / .35); }
#hex-generation-limit[hidden],.hex-generation-actions[hidden],#hex-generation-retry[hidden] { display:none; }
.hex-map-viewport.is-generation-limited #hex-map { opacity:.45; }
.hex-generation-card { width:340px; }
.hex-generation-card strong { outline:none; }
.hex-generation-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:10px; }
.hex-generation-actions .button { min-height:44px; }
#hex-generation-countdown { font-size:16px; font-weight:600; font-variant-numeric:tabular-nums; color:#30352c; }

.hex-export-settings { margin:0; padding:12px 16px; border-top:1px solid var(--hex-border); background:#fff; }
.hex-export-settings>summary { width:fit-content; gap:8px; font-weight:600; list-style:none; }
.hex-export-settings>summary::-webkit-details-marker { display:none; }
.hex-export-settings>summary span { display:inline-block; }
.hex-export-settings[open]>summary span { transform:rotate(180deg); }
.hex-export-options { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:12px; padding:14px; border:1px solid var(--hex-border); border-radius:8px; }
.hex-export-options label { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-height:44px; font-size:13px; }
.hex-export-options select { max-width:100%; }
.hex-export-options input { accent-color:var(--hex-accent); }
#hex-export-status { flex-basis:100%; margin:0; font-size:12px; color:var(--hex-muted); }
#hex-export-progress { flex:1 1 160px; max-width:100%; accent-color:var(--hex-accent); }
#hex-export-progress[hidden],#hex-export-cancel[hidden],#hex-export-download[hidden] { display:none; }

.hex-regenerate-controls { display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; padding:12px 16px; border-bottom:1px solid var(--hex-border); background:#fff; }
.hex-regenerate-controls p { flex:1 1 180px; margin:0; color:var(--hex-muted); font-size:12px; line-height:1.5; }
.hex-regenerate-controls .button:not(:disabled) { background:var(--hex-accent); border-color:var(--hex-accent); color:#fff; }
.hex-regenerate-controls .button:disabled { opacity:.55; cursor:default; }

.hex-workspace { grid-template-columns:minmax(0,1fr); }
.hex-map-column>.hex-grid-settings { margin:0; padding:0 16px; border-top:0; border-bottom:1px solid var(--hex-border); }
.hex-map-column>.hex-grid-settings label { max-width:300px; }
.hex-map-column>.hex-grid-settings input[type="range"] { display:block; max-width:300px; }

.hex-library { box-sizing:border-box; width:min(560px,calc(100% - 24px)); max-height:85vh; padding:20px; border:1px solid var(--hex-border,#d6d8ce); border-radius:8px; color:var(--text-primary,#34382f); }
.hex-library::backdrop { background:rgb(0 0 0 / .4); }
.hex-library-heading { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.hex-library h2 { margin:0; }
#hex-library-save { margin:20px 0; }
#hex-library-save label { display:grid; gap:8px; }
#hex-library-save input { width:100%; box-sizing:border-box; min-width:0; }
#hex-library-save>div { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
#hex-library-list { padding:0; list-style:none; }
#hex-library-list li { display:flex; gap:8px; align-items:center; border-top:1px solid #ddd; padding:12px 0; }
#hex-library-list li span { flex:1; min-width:0; overflow-wrap:anywhere; }
#hex-library-error { color:#904327; }
.hex-cell-editor { display:flex; flex-wrap:wrap; gap:12px; align-items:center; padding:16px; border-top:1px solid var(--hex-border); background:#fff; }
.hex-cell-editor[hidden],.hex-library [hidden] { display:none; }
.hex-cell-editor label { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.hex-cell-editor p { flex-basis:100%; font-size:12px; margin:0; color:var(--hex-muted); }

.hex-map-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; }
.hex-map-toolbar .hex-map-title { min-width:0; overflow-wrap:anywhere; }
.hex-map-toolbar .hex-map-options { grid-column:1 / -1; width:100%; }
.hex-library-auth-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.hex-library-auth-actions .button { min-height:44px; }
#hex-library-auth p { margin:20px 0 0; line-height:1.6; }
@media(max-width:760px) { .hex-file-actions .button { padding:8px 10px; font-size:12px; } }
@media(max-width:380px) { .hex-file-actions { grid-column:1 / -1; } }

/* Match the camera aspect so phone layouts do not letterbox the map. */
.hex-study .hex-map-viewport { aspect-ratio:var(--hex-map-aspect,1.5); }
