/* Shared interface tokens and input sizes across the map, account and admin. */
:root{--orange:var(--brand-action,#1f1f1f);--action-ink:var(--brand-surface,#ffffff);--social-friend:var(--brand-friend-position,#b54a32);--social-public:var(--brand-public-position,#276ca6);--touch-size:var(--brand-touch-target,44px)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--mobile-green,#6f543f);outline-offset:3px}
.primary{background:var(--orange);color:var(--action-ink)}
.map-marker.selected{z-index:5}.map-marker.selected .event-pin{outline:3px solid var(--orange);outline-offset:3px}
.map-pick-controls{position:fixed;z-index:46;bottom:24px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;flex-wrap:wrap;max-width:calc(100% - 32px);width:max-content;background:var(--paper);color:var(--ink);padding:14px 16px;border-radius:14px;box-shadow:0 6px 24px #1f1f1f20}
.map-pick-controls p{font-size:13px;line-height:1.5;margin:0;max-width:36ch}.map-pick-controls button{min-height:var(--touch-size);padding:10px 14px;border-radius:10px;font:inherit;font-size:13px;cursor:pointer}.map-pick-controls .pick-confirm{background:var(--mobile-green,#6f543f);color:var(--action-ink)}
.map-pick-reticle{display:none;position:absolute;left:50%;top:50%;width:24px;height:24px;transform:translate(-50%,-50%);border:2px solid var(--ink);border-radius:50%;box-shadow:0 0 0 2px var(--paper);pointer-events:none;z-index:9}.map-pick-reticle:before,.map-pick-reticle:after{content:'';position:absolute;background:var(--ink)}.map-pick-reticle:before{width:34px;height:2px;left:-7px;top:9px}.map-pick-reticle:after{width:2px;height:34px;left:9px;top:-7px}body[data-map-picking] .map-pick-reticle{display:block}
.audience-hint{font-size:12px;line-height:1.6;color:var(--muted);margin:-4px 0 15px;overflow-wrap:anywhere}
dialog summary{min-height:var(--touch-size);padding:10px 0;cursor:pointer}
/* The visual glyph may stay compact; the actionable box uses the shared floor. */
button:not(.vertex),.file-button,.access-header a,.editor-header a,.gate>a{min-height:var(--touch-size);min-width:var(--touch-size)}
.brand{min-height:var(--touch-size);min-width:var(--touch-size)}
.access-header a,.editor-brand,.gate>a{display:inline-flex;align-items:center;justify-content:center}
@media(min-width:1151px){.editor-actions a{display:inline-flex;align-items:center;justify-content:center}}
.empty-state button,.location-methods button{min-height:var(--touch-size);min-width:var(--touch-size);padding:10px 12px;font-size:var(--brand-type-control)}
.empty-state button{display:block;margin-top:8px;text-align:left}
.maplibregl-ctrl-group button{width:var(--touch-size);height:var(--touch-size)}
.access-header .text-button{padding-inline:10px}
.mobile-preview-page header a{display:inline-flex;align-items:center;min-height:var(--touch-size);min-width:var(--touch-size);font-size:var(--brand-type-control)}
.check{min-height:var(--touch-size)}
.timeline-footer{flex-wrap:wrap;gap:6px 14px}
.time-ticks,.timeline-footer{font-variant-numeric:tabular-nums}
/* Editor controls retain their own layout while sharing the same hit areas. */
.map-toolbar{right:76px}.camera-controls{right:14px;flex-wrap:wrap;bottom:92px}
.editor-footer button,.camera-controls button,.properties-heading button{min-height:var(--touch-size);font-size:var(--brand-type-control)}
@media(max-width:480px){.map-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.map-toolbar button{padding:6px;font-size:var(--brand-type-control);overflow-wrap:anywhere}.drawing-controls{top:170px}.camera-controls{bottom:100px}.editor-footer div{gap:8px}}
 .mode-tabs button,.filter-row button,.social-actions button,.region-navigation button,.map-pill,.day-buttons button,.timeline-header button,.view-controls button,.dialog-heading .icon-button,.detail-close,.help-button,#account-button,#details-button,#data-about,.delete-plan{min-height:var(--touch-size);min-width:var(--touch-size)}
 .view-controls .icon-button,.view-button{height:var(--touch-size);width:var(--touch-size)}
 input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,form textarea,.date-picker{min-height:var(--touch-size)}
 .search-box{min-height:var(--touch-size)}.search-box input{min-height:var(--touch-size);padding-block:10px}
 .date-picker,#plan-date{min-width:var(--touch-size)}input[type="range"]{height:var(--touch-size);min-height:var(--touch-size)}
 .dialog-heading .icon-button,.detail-panel .detail-close{width:var(--touch-size);height:var(--touch-size)}
 #toggle-pistes,#toggle-freeride,#locate-button,#try-tomorrow,#mobile-time,.filter-row button{min-height:var(--touch-size);min-width:var(--touch-size)}
body[data-map-picking] #mobile-map-time{display:none}
@media(max-width:900px){.map-pick-controls{bottom:calc(var(--mobile-nav) + 16px);left:16px;right:16px;transform:none;max-width:none;width:auto}.map-pick-controls p{width:100%;max-width:none}.map-pick-controls .pick-confirm{flex:1}.map-pick-controls button{font-size:14px}}
@media(max-width:900px) and (min-height:621px){dialog,#event-dialog,#presence-dialog,#auth-dialog{max-height:calc(100dvh - var(--mobile-nav) - var(--mobile-top) - 200px)!important}}
@media(max-width:900px) and (max-height:620px){body:has(dialog[open]) #mobile-header,body:has(#detail-panel:not([hidden])) #mobile-header{display:none}dialog,#event-dialog,#presence-dialog,#auth-dialog,.detail-panel{max-height:calc(100dvh - var(--mobile-nav) - 104px)!important}}
/* Mobile browsers can shrink only the visual viewport when the keyboard opens. */
body[data-keyboard-open] :is(dialog,#event-dialog,#presence-dialog,#auth-dialog)[open]{inset:auto 0 auto!important;top:calc(var(--visible-viewport-top,0px) + 8px)!important;bottom:auto!important;margin:0 auto!important;width:calc(100% - 24px)!important;max-width:520px!important;max-height:calc(var(--visible-viewport-height,100dvh) - 16px)!important;overflow-y:auto!important;scroll-padding-block:12px}
body[data-keyboard-open] #mobile-panel{top:calc(var(--visible-viewport-top,0px) + 8px);bottom:auto;height:calc(var(--visible-viewport-height,100dvh) - 16px);max-height:calc(var(--visible-viewport-height,100dvh) - 16px)}
body[data-keyboard-open] #mobile-header,body[data-keyboard-open] #mobile-nav,body[data-keyboard-open] #mobile-map-time,body[data-keyboard-open] .mobile-map-tools{visibility:hidden}
body[data-keyboard-open] #mobile-panel-content{min-height:0;overflow:auto;scroll-padding-block:12px}
.skip-link{position:fixed;z-index:100;left:12px;top:12px;transform:translateY(-160%);padding:12px 16px;background:var(--brand-surface);color:var(--brand-pine);border:2px solid var(--brand-focus);border-radius:8px;min-height:44px;font-size:1rem}.skip-link:focus{transform:none}.skip-link+.skip-link{left:200px}
.vertex,.vertex.midpoint{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;background:transparent;box-shadow:none;touch-action:none}
.vertex:before{content:'';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:16px;height:16px;box-sizing:border-box;border:2px solid var(--brand-surface);border-radius:50%;background:var(--brand-action);box-shadow:0 1px 5px #1f1f1f60}
.vertex.midpoint:before{width:11px;height:11px;background:var(--brand-pine)}.vertex:focus-visible{z-index:10}
.list-progress{padding:12px 14px;font-size:var(--brand-type-meta);color:var(--muted)}.list-more{display:block;width:calc(100% - 28px);margin:0 14px 14px;padding:10px 14px;border:1px solid var(--brand-border);border-radius:var(--brand-radius-control);font-size:var(--brand-type-control);font-weight:700}
.m-person,.m-event-row,.m-group{content-visibility:auto;contain-intrinsic-size:auto 90px}
@media(forced-colors:active){
  button,input,select,textarea,dialog,.detail-panel,.mobile-sheet,.map-pick-controls{border:1px solid ButtonText!important}
  button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid Highlight!important}
  .primary,.m-primary,.mobile-mode button.selected,.mode-tabs button.active,.m-chip.selected{background:Highlight!important;color:HighlightText!important}
  .marker-label,.avatar,.m-avatar,.place-bubble{background:Canvas!important;color:CanvasText!important;border:1px solid CanvasText!important}
  .vertex:before{background:Highlight!important;border-color:CanvasText!important}
  .map-marker.selected .avatar{outline:3px solid Highlight!important}
}

/* Adapt: a map beside the task on tablets and short, wide phones. */
@media (min-width:560px) and (max-width:900px) {
  :root { --adapt-panel-width:min(380px,calc(100vw - 248px)); }
  body:not([data-keyboard-open]) #mobile-panel {
    inset:96px max(12px,env(safe-area-inset-right,0px)) calc(var(--mobile-nav) + 12px) auto;
    width:var(--adapt-panel-width);height:auto;max-height:none;border-radius:16px;padding:12px 18px 0;
  }
  body:not([data-keyboard-open]) #detail-panel {
    inset:96px max(12px,env(safe-area-inset-right,0px)) calc(var(--mobile-nav) + 12px) auto!important;
    width:var(--adapt-panel-width)!important;max-height:none!important;border-radius:16px!important;
  }
  body[data-mobile-panel]:not([data-keyboard-open]) #mobile-map-time { left:max(12px,env(safe-area-inset-left,0px));right:calc(var(--adapt-panel-width) + 24px); }
  #mobile-scheduled-tools { flex-wrap:wrap; }
  body:not([data-keyboard-open]) :is(dialog,#event-dialog,#presence-dialog,#auth-dialog)[open] {
    inset:12px max(12px,env(safe-area-inset-right,0px)) calc(var(--mobile-nav) + 12px) auto!important;
    width:min(520px,calc(100vw - 24px))!important;max-width:520px!important;max-height:calc(100dvh - var(--mobile-nav) - 24px)!important;
    margin:0!important;border-radius:16px!important;padding:18px!important;
  }
}
@media (min-width:560px) and (max-width:900px) and (max-height:500px) {
  :root { --mobile-nav:calc(64px + env(safe-area-inset-bottom,0px)); }
  #mobile-nav { padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom,0px)); }
  #mobile-nav button { min-height:52px;gap:4px;padding-top:4px; }
  #mobile-nav .mobile-create { margin-top:-8px;padding-top:0; }
  #mobile-nav .mobile-create>svg { width:22px;height:22px;padding:9px; }
  body:not([data-keyboard-open]) #mobile-panel,body:not([data-keyboard-open]) #detail-panel { top:max(8px,env(safe-area-inset-top,0px))!important; }
  body[data-mobile-panel]:not([data-keyboard-open]) #mobile-header,body:has(#detail-panel:not([hidden])):not([data-keyboard-open]) #mobile-header {
    display:flex;left:max(12px,env(safe-area-inset-left,0px));right:calc(var(--adapt-panel-width) + 24px);top:max(8px,env(safe-area-inset-top,0px));
  }
  body[data-mobile-panel] #mobile-header button { height:52px; }
  body[data-mobile-panel] #mobile-destination small { display:none; }
  body[data-mobile-panel] .mobile-map-tools { left:max(12px,env(safe-area-inset-left,0px));right:auto;top:72px; }
  body[data-mobile-panel] #mobile-scheduled-tools { display:none!important; }
  .mobile-sheet-heading h2 { font-size:22px; }
  .mobile-sheet-heading { margin-bottom:8px; }
  .mobile-sheet-grip { display:none; }
}
@media (max-width:900px) and (max-height:700px) {
  body:not([data-keyboard-open]) :is(dialog,#event-dialog,#presence-dialog,#auth-dialog)[open] { max-height:calc(100dvh - var(--mobile-nav) - 24px)!important; }
}
@media (max-width:360px) {
  body :is(#event-dialog,#presence-dialog,dialog) .form-row,#mobile-panel-content .form-row { grid-template-columns:minmax(0,1fr); }
  #mobile-panel-content { overflow-wrap:anywhere; }
}
body[data-keyboard-open] #event-submit { position:static;box-shadow:none; }
@media (max-width:900px) and (max-height:500px) { #event-submit { position:static;box-shadow:none; } }

@media (min-width:560px) and (max-width:700px) and (max-height:500px) { body[data-mobile-panel] #mobile-search,body:has(#detail-panel:not([hidden])) #mobile-search { display:none; } }

.list-pagination{padding:12px 14px;border-top:1px solid var(--brand-border)}.list-pagination .list-progress{padding:0;margin:0 0 10px;line-height:1.6}.list-page-actions{display:flex;gap:8px}.list-page-actions button{flex:1;min-height:44px;padding:10px 8px;border:1px solid var(--brand-control-border);border-radius:var(--brand-radius-control);font:inherit;font-size:var(--brand-type-control);color:var(--brand-pine);background:var(--brand-field)}.list-page-actions button:disabled{opacity:.55;cursor:default}

/* Polish: keep binary options together and focus visible inside scrolling lists. */
@media (max-width:900px) {
  #mobile-panel-content label.m-check {
    flex-direction:row;align-items:flex-start;gap:12px;
    min-height:44px;padding-block:10px;margin-bottom:4px;text-align:left;
  }
  #mobile-panel-content label.m-check>input[type=checkbox] {
    flex:0 0 22px;width:22px;min-height:22px;height:22px;margin:0;padding:0;
    border-radius:4px;accent-color:var(--brand-selection);
  }
  #mobile-panel-content :is(.m-person,.m-event-row,.m-menu-row,.m-map-filter,.m-back):focus-visible {
    outline-offset:-3px;border-radius:var(--brand-radius-control);
  }
  #mobile-panel-content .m-date-chip:focus-within { outline-offset:-3px; }
  .m-menu-row,.m-map-filter { overflow-wrap:anywhere; }
}
@media (hover:hover) {
  :is(.m-person,.m-event-row,.m-menu-row,.m-map-filter,.list-page-actions button):enabled:hover {
    background:var(--brand-selection-surface);
  }
}

/* Taste redesign: a full map canvas with a compact field desk. */
@media (min-width:901px) {
  body .topbar { height:68px;padding:12px 24px;gap:16px;border:0; }
  body .topbar .brand>img { width:154px;height:36px; }
  body .topbar .prototype { display:none; }
  body .topbar .account-button { margin-left:auto;max-width:180px; }
  body .app { position:relative;display:block;height:calc(100dvh - 68px);padding:0; }
  body .app>.map-section { position:absolute;inset:0;height:100%;min-height:0;border-radius:0; }
  body .app>.sidebar {
    position:absolute;z-index:16;inset:16px auto 40px 16px;width:320px;
    border:0;border-radius:16px;box-shadow:var(--brand-shadow-raised);overflow:hidden;
  }
  body .sidebar-intro { padding:24px 22px 18px; }
  body .sidebar-intro h1 { font-size:23px;line-height:1.25;letter-spacing:-.03em; }
  body .sidebar-intro h1 span { color:var(--brand-pine); }
  body .sidebar-intro p { margin-top:10px;font-size:13px;line-height:1.6; }
  body .sidebar .mode-tabs { margin:0 16px;padding:4px;gap:2px;border-radius:12px; }
  body .sidebar .mode-tabs button { padding:10px 6px;gap:5px;font-size:12px; }
  body .sidebar .social-actions { margin:12px 16px 0;gap:8px; }
  body .sidebar .social-actions button { padding:10px;font-size:12px; }
  body .sidebar .search-box { margin:16px 16px 0;border-radius:10px; }
  body .sidebar .filter-row { padding:10px 16px;gap:4px; }
  body .sidebar .filter-row button { padding:8px 10px; }
  body .sidebar .list-heading { padding:8px 22px 12px; }
  body .sidebar .date-tools { padding:14px 16px 0; }
  body .sidebar .empty-state { margin:4px 16px 16px;padding:20px 6px; }
  body .sidebar .empty-state h3 { font-size:16px;line-height:1.4; }
  body .sidebar .empty-state p { margin-top:8px;font-size:13px;line-height:1.65; }
  body .sidebar-footer { padding:12px 16px;background:var(--brand-field);border:0;gap:10px; }
  body .sidebar-footer p { font-size:11px;line-height:1.55; }
  body .region-navigation { left:356px;top:16px;right:88px;gap:8px; }
  body[data-view=region] .map-options { left:356px;top:78px; }
  body .map-bottom { left:356px;right:24px;bottom:30px; }
  body .map-bottom .now-hint { width:max-content;max-width:100%;padding:12px 16px;gap:12px; }
  body .now-hint>span:nth-child(2) { max-width:28ch;line-height:1.5; }
  body .map-bottom .timeline { padding:18px 22px;max-width:680px;margin-left:auto; }
  body .timeline-header strong { font-size:27px;letter-spacing:-.03em; }
  body .view-controls { right:24px;top:16px; }
  body[data-view=country] .map-caption { left:356px;top:24px; }
  body .country-sidebar { padding:24px 22px; }
  body .country-sidebar h1 { font-size:30px;line-height:1.15; }
  body .country-sidebar h1>span { color:var(--brand-pine); }
  body .country-sidebar .country-intro { max-width:none;font-size:14px; }
  body .destination-card { margin-top:24px;padding:18px;text-align:left; }
}
@media (min-width:901px) and (max-width:1100px) {
  body .app>.sidebar { width:292px; }
  body .region-navigation,body[data-view=region] .map-options,body .map-bottom,body[data-view=country] .map-caption { left:328px; }
  body .region-navigation>div button { padding-inline:8px; }
  body .now-hint>span:nth-child(2) { display:none; }
}
@media (max-width:900px) {
  body #mobile-header { gap:8px; }
  body #mobile-header button { height:56px;border-radius:14px;box-shadow:var(--brand-shadow); }
  body #mobile-destination { gap:10px;padding:10px 12px; }
  body #mobile-destination small { font-size:10px;line-height:1.2;margin-bottom:3px; }
  body #mobile-destination strong { font-size:15px; }
  body #mobile-nav { border:0;box-shadow:0 -4px 24px #1f1f1f12; }
  body #mobile-nav button { gap:5px;font-size:11px;font-weight:600; }
  body #mobile-nav button.selected>svg { background:transparent;box-shadow:none; }
  body #mobile-nav button.selected { color:var(--brand-pine); }
  body #mobile-nav button.selected:not(.mobile-create) { background:var(--brand-mint);border-radius:12px; }
  body .mobile-sheet { border-radius:22px 22px 0 0;padding-inline:20px; }
  body .mobile-sheet-heading { margin-bottom:16px; }
  body .mobile-sheet-heading h2 { font-size:24px;letter-spacing:-.03em; }
  body .mobile-sheet-grip { width:32px;margin-bottom:8px; }
  body .m-search { border-radius:12px; }
  body .m-filter-line { gap:8px;flex-wrap:wrap; }
  body .m-event-row { gap:14px;padding-block:20px; }
  body .m-event-row time { border-radius:8px;font-variant-numeric:tabular-nums; }
  body .m-event-row strong { font-size:16px;line-height:1.4;font-weight:750; }
  body .m-empty { margin-block:18px;padding-block:14px;font-size:14px;line-height:1.65;max-width:32ch; }
  body .m-tabs { padding-bottom:12px;border-bottom:1px solid var(--brand-border); }
  body .m-person { padding-block:16px; }
}
@media (prefers-reduced-motion:no-preference) {
  :is(.mode-tabs button,.filter-row button,.m-chip,#mobile-nav button,.social-actions button) {
    transition:background-color .18s ease-out,color .18s ease-out;
  }
}

/* Mobile Taste: choose how much of the map or list stays in view. */
@media (max-width:900px) {
  body .mobile-sheet-heading { gap:6px; }
  body .mobile-sheet-heading h2 { flex:1;min-width:0;font-size:22px;line-height:1.25; }
  body #mobile-panel-expand { background:var(--brand-field);border-radius:12px; }
  body #mobile-panel-expand[aria-expanded=true] { background:var(--brand-mint); }
  body .m-tabs { gap:4px;padding:4px;margin-bottom:16px;border:0;border-radius:12px;background:var(--brand-field); }
  body .m-tabs .m-chip { border:0;font-size:14px; }
  body .m-date-chip { gap:7px;font-variant-numeric:tabular-nums; }
  body .m-date-chip>svg { width:17px;height:17px;flex-shrink:0; }
  body .m-person strong { font-size:16px;line-height:1.4; }
  body .m-person small { line-height:1.55; }
  body .m-subtitle { margin-top:20px;font-size:14px; }
  body .m-filter-line>span { flex-basis:100%;font-size:12px; }
  body .m-group { padding:16px;background:var(--brand-field);border-radius:12px; }
  body .m-group h3 { font-size:18px;line-height:1.35;overflow-wrap:anywhere; }
  body #mobile-nav .mobile-create { margin-top:-10px;gap:5px; }
  body #mobile-nav .mobile-create>svg { padding:11px;width:22px;height:22px;border-radius:14px; }
}
@media (max-width:559px) {
  body:not([data-keyboard-open]):is([data-mobile-panel=events],[data-mobile-panel=company]) #mobile-panel {
    height:min(56dvh,520px);
  }
  body:not([data-keyboard-open])[data-sheet-expanded]:is([data-mobile-panel=events],[data-mobile-panel=company]) #mobile-panel {
    height:calc(100dvh - var(--mobile-nav) - var(--mobile-top) - 76px);
  }
  body[data-mobile-panel=events] .m-empty { margin:8px 0 18px;padding-block:10px; }
}
@media (min-width:560px) {
  #mobile-panel-expand { display:none; }
}
body[data-keyboard-open] #mobile-panel-expand { display:none; }
@media(max-width:480px){.editor-header .editor-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-header .editor-actions button{min-width:0;white-space:normal;overflow-wrap:anywhere}.editor-header #publish{grid-column:1/-1}}
