button,button *,:where(#app,dialog),:where(#app,dialog) *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
:is(input,textarea,select,[contenteditable]:not([contenteditable="false"])),:is(input,textarea,select,[contenteditable]:not([contenteditable="false"])) *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.city-art img,.city-art svg{-webkit-user-drag:none}
/* Keep the name on its column axis; align the adjacent X to the text's ink. */
.city-top{min-height:28px;max-width:calc(100% - 68px)}
@media(max-width:700px){.city-top{max-width:calc(100% - 36px)}}
.city-name{height:28px;line-height:20px}
.remove-city svg{display:block;transform:translateY(-1px)}
/* One explicit owner prevents stale touch, hover and restored focus from
   revealing different cities at once. The previous owner fades out normally. */
#headers .city-header .remove-city{opacity:0;pointer-events:none}
#headers .city-header.controls-visible .remove-city{opacity:.8;pointer-events:auto}
/* Releasing a drag is not a request to reveal delete controls. */
#headers.controls-suppressed .city-header .remove-city{opacity:0;pointer-events:none;transition:none}
#time-dialog .edit-heading{gap:12px}
#edit-city,#language-title{min-width:0;overflow-wrap:anywhere}
#close-time{flex-shrink:0}
#language-dialog .language-heading{padding-block:6px}
.city-art{position:relative}
/* Keep the drawing small, but make the surrounding space easy to grab. */
.city-art::after{content:'';position:absolute;left:50%;top:-24px;width:104px;height:96px;transform:translateX(-50%)}
@media(max-height:430px){.city-art::after{top:-12px;width:72px;height:72px}}

#sound-toggle{touch-action:manipulation}
#sound-toggle .sound-state{color:#aaa;font-size:inherit;line-height:1}
#sound-toggle[aria-pressed="false"] .sound-state{color:#777}

/* Taps and restored focus never draw a selection box around display controls. */
html[data-input-method="pointer"] :is(#app,dialog) :is(button,input,[role="button"],[role="spinbutton"],[role="option"],#timeline):focus{outline:none!important;box-shadow:none!important}
html[data-input-method="keyboard"] .time-cell:focus-visible .clock-value{text-decoration-line:underline;text-decoration-color:#ffffff55;text-decoration-thickness:1px;text-underline-offset:6px}

/* Four mobile cities share the screen; extra cities continue sideways. */
@media(max-width:700px){
  #canvas[data-mobile-columns="4"]{overflow-x:clip;overflow-y:visible}
  #canvas[data-mobile-columns="4"] .city-top{max-width:calc(100% - 12px)}
  #canvas[data-mobile-columns="4"] .city-name{font-size:clamp(9px,2.6vw,10px);height:32px;padding-block:2px;line-height:14px;white-space:normal;overflow-wrap:anywhere;text-wrap:balance;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  #canvas[data-mobile-columns="4"] .city-art::after{width:min(104px,calc(var(--column) - 6px))}
}

/* City actions replace the small hover-only delete control. */
#headers .city-top{max-width:calc(100% - 12px)}
#headers .city-top>.remove-city{display:none}
#dot-ripple::backdrop{background:transparent;backdrop-filter:none;pointer-events:none}
#city-actions-menu{
  --city-menu-surface:#222;--city-menu-line:#414141;--city-menu-hover:#ffffff08;
  position:fixed;inset:auto;margin:0;padding:4px;width:168px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);
  border:1px solid var(--city-menu-line);border-radius:13px;background:var(--city-menu-surface);color:var(--ink);outline:none;
  box-shadow:0 10px 36px #00000024;overflow-y:auto;overscroll-behavior:contain;z-index:30;
  opacity:0;transform:translateY(-4px);transform-origin:top center;
  transition:opacity .18s ease,transform .24s cubic-bezier(.22,1,.36,1),display .18s allow-discrete,overlay .18s allow-discrete;
}
#city-actions-menu:popover-open,#city-actions-menu[open]{opacity:1;transform:none}
#city-actions-menu[popover]:not(:popover-open),#city-actions-menu:not([popover]):not([open]){display:none}
#city-actions-menu::backdrop{background:transparent;backdrop-filter:none}
#city-actions-menu .city-menu-action{display:flex;align-items:center;gap:11px;width:100%;min-height:48px;padding:10px 12px;border:0;border-radius:8px;background:transparent;color:inherit;text-align:start;font-size:13px;line-height:1.4}
#city-actions-menu .city-menu-label{min-width:0;overflow-wrap:anywhere}
#city-actions-menu .city-menu-icon{width:16px;height:16px;flex:0 0 16px;stroke-width:1.5}
#city-actions-menu .city-menu-action:disabled{opacity:.35;cursor:default}
html[dir="rtl"] :is(#city-actions-menu,#city-reorder-guide){direction:rtl}
@media(hover:hover){#city-actions-menu .city-menu-action:hover:not(:disabled){background:var(--city-menu-hover)}}
@starting-style{#city-actions-menu:popover-open,#city-actions-menu[open]{opacity:0;transform:translateY(-4px)}}
#city-reorder-guide{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:12;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;width:max-content;max-width:calc(100vw - 32px);min-height:48px;padding:3px 5px 3px 15px;border:1px solid #414141;border-radius:12px;background:#222222f5;color:#a9a9a9;box-shadow:0 5px 24px #00000014;font-size:12px;line-height:1.4}
#city-reorder-guide[hidden]{display:none}
#city-reorder-done{min-width:54px;min-height:44px;padding:8px 10px;color:var(--ink);font-size:12px}
#headers.reorder-mode .city-header,#headers.reorder-mode :is(.city-name,.city-art){cursor:pointer;touch-action:none}
#headers.reorder-mode .city-header{position:relative}
#headers.reorder-mode.is-reordering :is(.city-header,.city-name,.city-art){cursor:grabbing}
/* The destination stays in the grid while the real city follows the pointer. */
#canvas{position:relative;isolation:isolate}
.city-drop-slot{position:absolute;z-index:-1;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .28s ease,visibility 0s linear .28s,left .28s cubic-bezier(.22,1,.36,1)}
.city-drop-slot.is-visible{opacity:.65;visibility:visible;transition-delay:0s}
.city-drop-slot::before{content:'';position:absolute;inset:4px 12px 8px;border:1px dashed #ffffff80;border-radius:13px;background:#ffffff06}
#headers .city-header,.time-cell{transition:opacity .28s ease}
#headers .city-header.reorder-muted,.time-cell.reorder-muted{opacity:.38!important}
@media(max-width:700px){.city-drop-slot::before{inset-inline:4px}}
@media(prefers-reduced-motion:reduce){#city-actions-menu,.city-drop-slot,#headers .city-header,.time-cell{transition:none}}

/* The real comparison and studies share the selected drag motion treatment. */
html[data-reorder-motion] .city-drop-slot{z-index:-2;transition:opacity .22s ease,visibility 0s linear .22s}
html[data-reorder-motion] .city-drop-slot:is(.is-visible,.is-settling){opacity:.72;visibility:visible;transition-delay:0s}
html[data-reorder-motion] .city-drop-slot::before{inset:4px 8px 8px;border:1px dashed #ffffff48;border-radius:12px;background:#ffffff02}
html[data-reorder-motion] #headers.is-reordering .city-header.reorder-muted,html[data-reorder-motion] #app.is-reordering .time-cell.reorder-muted{opacity:.2!important;transition:opacity .16s ease}
html[data-reorder-motion] :is(.city-header,.time-cell).is-dragging{--reorder-text-mask:var(--bg);text-shadow:0 0 5px var(--reorder-text-mask),0 0 12px var(--reorder-text-mask)}
html[data-reorder-motion] .reorder-motion-surface{position:absolute;z-index:-1;pointer-events:none;inset:auto;isolation:isolate}
html[data-reorder-motion] .reorder-motion-surface::before{content:'';position:absolute;inset:4px 8px 8px;border:1px solid #ffffff0d;border-radius:14px;background:#ffffff04;box-shadow:0 5px 18px #00000012}
html[data-reorder-motion="2"] .city-drop-slot::before{border-style:dotted;border-color:#ffffff60;background:#ffffff03;border-radius:14px}
html[data-reorder-motion="3"] .reorder-motion-surface::before{inset:4px 6px;border-color:#ffffff1a;background:#ffffff06;border-radius:14px;box-shadow:0 10px 26px #00000018}
html[data-reorder-motion="3"] .city-drop-slot::before{border-color:#ffffff38;background:none}
html[data-reorder-motion="4"] .city-drop-slot::before{border-color:#ffffff62;background:#ffffff04}
html[data-reorder-motion="5"] .city-drop-slot::before{border-style:dotted;border-color:#ffffff62;background:none}
html[data-reorder-motion="5"] #headers .city-header.reorder-muted,html[data-reorder-motion="5"] .time-cell.reorder-muted{opacity:.52!important}
@media(max-width:700px){html[data-reorder-motion] .city-drop-slot::before{inset-inline:3px}html[data-reorder-motion] .reorder-motion-surface::before{inset-inline:3px}}
@media(prefers-reduced-motion:reduce){html[data-reorder-motion] .city-drop-slot{transition:none}}
