/* Histriphy Studio 21.1.1 — Universal Import UI */
.geo-builder-top-button[data-universal-import="true"]::after {
  content: "GPKG · SHP · KML";
  display: none;
}
.geo-builder-top-button.is-format-busy { opacity: .72; cursor: progress; }

.histriphy-format-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 24px; font-family: inherit; }
.histriphy-format-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.68); backdrop-filter: blur(5px); }
.histriphy-format-dialog { position: relative; width: min(540px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px)); display: flex; flex-direction: column; overflow: hidden; color: var(--text, #f5f2eb); background: var(--panel, #11100f); border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.histriphy-format-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 22px 16px; border-bottom: 1px solid var(--line, rgba(255,255,255,.1)); }
.histriphy-format-dialog h2 { margin: 3px 0 6px; font-size: 20px; line-height: 1.2; }
.histriphy-format-dialog header p { margin: 0; color: var(--muted, #98938c); font-size: 12px; line-height: 1.5; }
.histriphy-format-kicker { color: var(--accent, #f4b63f); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.histriphy-format-close { flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 10px; color: inherit; background: transparent; font-size: 21px; cursor: pointer; }
.histriphy-format-actions-row { display: flex; gap: 8px; padding: 12px 22px 0; }
.histriphy-format-actions-row button { padding: 6px 9px; border: 0; background: transparent; color: var(--muted, #98938c); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.histriphy-format-layer-list { overflow: auto; display: grid; gap: 8px; padding: 12px 22px 18px; }
.histriphy-format-layer-option { display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 11px; background: rgba(255,255,255,.025); cursor: pointer; }
.histriphy-format-layer-option:hover { border-color: rgba(244,182,63,.42); }
.histriphy-format-layer-option input { position: absolute; opacity: 0; pointer-events: none; }
.histriphy-format-check { width: 16px; height: 16px; border: 1px solid rgba(255,255,255,.24); border-radius: 4px; position: relative; }
.histriphy-format-layer-option input:checked + .histriphy-format-check { background: var(--accent, #f4b63f); border-color: var(--accent, #f4b63f); }
.histriphy-format-layer-option input:checked + .histriphy-format-check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #17130b; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.histriphy-format-option-copy { min-width: 0; display: grid; gap: 3px; }
.histriphy-format-option-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.histriphy-format-option-copy small { color: var(--muted, #8f8980); font-size: 10px; }
.histriphy-format-dialog footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px 20px; border-top: 1px solid var(--line, rgba(255,255,255,.1)); }
.histriphy-format-dialog footer button { min-height: 38px; padding: 0 15px; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.histriphy-format-secondary { border: 1px solid var(--line, rgba(255,255,255,.13)); color: inherit; background: transparent; }
.histriphy-format-primary { border: 1px solid var(--accent, #f4b63f); color: #17130b; background: var(--accent, #f4b63f); }

html[data-theme="light"] .histriphy-format-backdrop { background: rgba(23,20,15,.36); }
html[data-theme="light"] .histriphy-format-dialog { color: #1a1814; background: #fff; border-color: rgba(26,24,20,.13); box-shadow: 0 24px 80px rgba(45,37,25,.2); }
html[data-theme="light"] .histriphy-format-layer-option { background: #fbfaf8; border-color: rgba(26,24,20,.11); }
html[data-theme="light"] .histriphy-format-check { border-color: rgba(26,24,20,.25); }
html[data-theme="light"] .histriphy-format-close { border-color: rgba(26,24,20,.12); }

@media (max-width: 820px) {
  .histriphy-format-modal { padding: 14px; }
  .histriphy-format-dialog { width: min(500px, calc(100vw - 20px)); max-height: calc(100vh - 28px); }
  .histriphy-format-dialog header { padding: 18px 17px 14px; }
  .histriphy-format-actions-row { padding-left: 17px; padding-right: 17px; }
  .histriphy-format-layer-list { padding-left: 17px; padding-right: 17px; }
  .histriphy-format-dialog footer { padding: 13px 17px 17px; }
}


/* 21.1.1: make format support explicit instead of hiding it behind a file input. */
.histriphy-format-home { width: min(680px, calc(100vw - 32px)); }
.histriphy-format-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:18px 22px 10px; overflow:auto; }
.histriphy-format-card { min-width:0; display:grid; gap:4px; padding:15px; border:1px solid var(--line, rgba(255,255,255,.1)); border-radius:12px; background:rgba(255,255,255,.025); }
.histriphy-format-card.is-ready { border-color:rgba(244,182,63,.2); }
.histriphy-format-card.is-next { opacity:.52; }
.histriphy-format-card strong { font-size:13px; }
.histriphy-format-card small { color:var(--muted,#98938c); font-size:10px; line-height:1.4; }
.histriphy-format-badge { width:max-content; color:var(--accent,#f4b63f); font-size:9px; font-weight:900; letter-spacing:.08em; }
.histriphy-format-card.is-next .histriphy-format-badge { color:var(--muted,#98938c); }
.histriphy-format-home-note { display:flex; gap:8px; align-items:baseline; margin:4px 22px 8px; padding:11px 12px; border-radius:10px; background:rgba(244,182,63,.07); color:var(--muted,#98938c); font-size:10px; }
.histriphy-format-home-note strong { color:var(--text,#f5f2eb); font-size:10px; }
html[data-theme="light"] .histriphy-format-card { background:#fbfaf8; border-color:rgba(26,24,20,.11); }
html[data-theme="light"] .histriphy-format-card.is-ready { border-color:rgba(177,123,25,.3); }
html[data-theme="light"] .histriphy-format-home-note { background:rgba(177,123,25,.08); }
html[data-theme="light"] .histriphy-format-home-note strong { color:#1a1814; }
@media (max-width:620px){ .histriphy-format-grid{grid-template-columns:1fr;padding-left:17px;padding-right:17px}.histriphy-format-home-note{margin-left:17px;margin-right:17px;align-items:flex-start;flex-direction:column;gap:3px} }

/* 21.2.0 — Universal Export Center */
.histriphy-universal-export-modal{position:fixed;inset:0;z-index:100100;display:grid;place-items:center;padding:24px;font-family:inherit}
.histriphy-universal-export-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.72);backdrop-filter:blur(6px)}
.histriphy-universal-export-dialog{position:relative;width:min(700px,calc(100vw - 32px));max-height:min(760px,calc(100vh - 42px));overflow:auto;color:var(--text,#f5f2eb);background:var(--panel,#11100f);border:1px solid var(--line,rgba(255,255,255,.12));border-radius:16px;box-shadow:0 26px 90px rgba(0,0,0,.58)}
.histriphy-universal-export-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px;border-bottom:1px solid var(--line,rgba(255,255,255,.1))}
.histriphy-universal-export-dialog header>div>span{color:var(--accent,#f4b63f);font-size:9px;font-weight:900;letter-spacing:.13em}
.histriphy-universal-export-dialog h2{margin:4px 0 6px;font-size:22px;line-height:1.15}.histriphy-universal-export-dialog header p{margin:0;color:var(--muted,#98938c);font-size:12px;line-height:1.5}
.histriphy-universal-export-dialog header>button{width:34px;height:34px;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:9px;color:inherit;background:transparent;font-size:21px;cursor:pointer}
.histriphy-export-scope{display:flex;gap:7px;padding:15px 22px 0}.histriphy-export-scope button,.histriphy-export-scope>span{min-height:34px;padding:0 12px;display:inline-flex;align-items:center;border:1px solid var(--line,rgba(255,255,255,.11));border-radius:8px;color:var(--muted,#98938c);background:transparent;font:inherit;font-size:10px;font-weight:800;cursor:pointer}.histriphy-export-scope button.is-active{color:var(--text,#f5f2eb);border-color:rgba(244,182,63,.42);background:rgba(244,182,63,.07)}
.histriphy-export-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:15px 22px 22px}.histriphy-export-grid button{min-width:0;display:grid;gap:5px;text-align:left;padding:15px;border:1px solid var(--line,rgba(255,255,255,.1));border-radius:11px;color:inherit;background:rgba(255,255,255,.025);font:inherit;cursor:pointer}.histriphy-export-grid button:hover{border-color:rgba(244,182,63,.46);background:rgba(244,182,63,.05)}.histriphy-export-grid button:disabled{opacity:.5;cursor:progress}.histriphy-export-grid button span{color:var(--accent,#f4b63f);font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.histriphy-export-grid button strong{font-size:13px}.histriphy-export-grid button small{color:var(--muted,#98938c);font-size:10px}
.histriphy-universal-export-dialog footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 22px 18px;border-top:1px solid var(--line,rgba(255,255,255,.1))}.histriphy-export-status{min-height:18px;color:var(--muted,#98938c);font-size:10px}.histriphy-universal-export-dialog footer button{min-height:36px;padding:0 14px;border:1px solid var(--line,rgba(255,255,255,.12));border-radius:8px;color:inherit;background:transparent;font:inherit;font-size:11px;font-weight:800;cursor:pointer}
html[data-theme="light"] .histriphy-universal-export-backdrop{background:rgba(23,20,15,.38)}html[data-theme="light"] .histriphy-universal-export-dialog{color:#1a1814;background:#fff;border-color:rgba(26,24,20,.13);box-shadow:0 24px 80px rgba(45,37,25,.22)}html[data-theme="light"] .histriphy-export-grid button{background:#fbfaf8;border-color:rgba(26,24,20,.11)}html[data-theme="light"] .histriphy-export-grid button:hover{border-color:rgba(177,123,25,.4);background:rgba(177,123,25,.05)}
@media(max-width:820px){.histriphy-universal-export-modal{padding:12px}.histriphy-universal-export-dialog{width:min(620px,calc(100vw - 18px));max-height:calc(100vh - 24px)}.histriphy-export-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding-left:16px;padding-right:16px}.histriphy-universal-export-dialog header{padding:18px 16px}.histriphy-export-scope{padding-left:16px;padding-right:16px}.histriphy-universal-export-dialog footer{padding-left:16px;padding-right:16px}}
@media(max-width:560px){.histriphy-export-grid{grid-template-columns:1fr}}
