/* TimeMachine: soltanto stili specifici, senza modificare i CSS comuni. */
.tm-main { min-width: 0; }
.tm-intro { margin-bottom: 1.5rem; }
.tm-intro h1 { margin: 0 0 .4rem; }
.tm-intro p:last-child { color: var(--muted, #66717c); }
.tm-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .12em; opacity: .65; }
.tm-workspace { display: grid; gap: 1.15rem; }
.tm-workspace label { display: block; font-weight: 600; margin-bottom: .45rem; }
.tm-button { font: inherit; padding: .75rem 1rem; border-radius: 10px; border: 1px solid #afbbc7; cursor: pointer; }
.tm-button-primary { color: white; background: #283f56; border-color: #283f56; font-weight: 700; }
.tm-button-secondary { background: transparent; color: inherit; }
.tm-button:disabled { opacity: .55; cursor: not-allowed; }
.tm-search-row { display: flex; gap: .6rem; }
.tm-search-row input { flex: 1; min-width: 0; padding: .75rem; border: 1px solid #aebac5; background: var(--card-bg, #fff); color: inherit; border-radius: 10px; font: inherit; }
.tm-settings { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tm-radius-control select { font: inherit; min-width: 110px; padding: .6rem; border: 1px solid #acb8c4; border-radius: 9px; color: inherit; background: var(--card-bg, #fff); }
.tm-map-wrap { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid #c5ccd3; }
#tm-map { width: 100%; height: min(59vh, 510px); min-height: 320px; background: #e6e9ea; }
.tm-crosshair { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; transform: translate(-50%, -50%); pointer-events: none; z-index: 500; filter: drop-shadow(0 1px 2px #fff) drop-shadow(0 -1px 1px #fff); }
.tm-crosshair::before, .tm-crosshair::after { content: ''; display: block; position: absolute; background: #193e62; }
.tm-crosshair::before { width: 3px; height: 32px; left: 14px; top: 0; }
.tm-crosshair::after { height: 3px; width: 32px; top: 14px; left: 0; }
.tm-crosshair span { position: absolute; width: 12px; height: 12px; background: white; border: 2px solid #193e62; border-radius: 50%; top: 8px; left: 8px; z-index: 1; }
.tm-map-note, .tm-feedback, .tm-attribution { font-size: .89rem; color: var(--muted, #626e78); margin: 0; }
.tm-bottom-actions { display: grid; justify-items: start; gap: .45rem; }
.tm-bottom-actions .tm-button { min-width: 245px; }
.tm-attribution { margin-top: 2rem; }
.tm-alert { padding: 1rem; border: 1px solid #c8d2dc; background: rgba(100,120,145,.07); border-radius: 12px; }
.tm-alert[hidden], .tm-help[hidden], .tm-address-results[hidden] { display: none; }
.tm-alert p { margin: .35rem 0 .7rem; }
.tm-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.tm-link-button { background: none; border: 0; text-decoration: underline; color: inherit; font: inherit; cursor: pointer; }
.tm-help { margin-top: .8rem; font-size: .9rem; }
.tm-error { color: #ab3535; }
.tm-address-results { display: grid; gap: .3rem; margin-top: .5rem; }
.tm-place-option { text-align: left; font: inherit; background: transparent; color: inherit; border: 1px solid #cbd2da; padding: .7rem; border-radius: 8px; cursor: pointer; }
.tm-place-option:hover, .tm-place-option:focus-visible { background: rgba(120,150,180,.12); }
@media (max-width: 640px) {
  .tm-search-row { flex-direction: column; }
  .tm-search-row .tm-button { width: 100%; }
  #tm-map { height: 46vh; min-height: 295px; }
  .tm-bottom-actions .tm-button { width: 100%; }
}

/* Input chiari: il tema generale ATRALAB usa testo bianco. */
.tm-main .tm-search-row input,
.tm-main .tm-radius-control select {
  background: #ffffff !important;
  color: #1d2935 !important;
  -webkit-text-fill-color: #1d2935;
  color-scheme: light;
}
.tm-main .tm-search-row input::placeholder { color: #687480 !important; -webkit-text-fill-color: #687480; opacity: 1; }
.tm-main .tm-radius-control select option { background: #fff; color: #1d2935; }
.tm-main .tm-search-row input:focus-visible,
.tm-main .tm-radius-control select:focus-visible { outline: 2px solid #6092bd; outline-offset: 2px; }
.tm-monuments { display: grid; gap: .8rem; }
.tm-monuments[hidden] { display: none; }
.tm-monument-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: .7rem; }
.tm-monument { display: flex; align-items: center; gap: .7rem; text-align: left; padding: .85rem; color: inherit; background: rgba(125,147,168,.10); border: 1px solid rgba(150,165,180,.5); border-radius: 10px; cursor: pointer; font: inherit; }
.tm-monument:hover, .tm-monument:focus-visible { outline: 2px solid #6c9bbc; }
.tm-monument-number { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #284e70; font-weight: 700; }
.tm-monument-copy { display: grid; gap: .2rem; min-width: 0; }
.tm-monument-copy small { opacity: .75; }
.tm-monument-marker { display:grid; place-items:center; width:26px; height:26px; background:#284e70; color:#fff; border-radius:50%; border:2px solid white; font-weight:700; box-shadow:0 1px 5px #3338; }
.tm-search-progress { font-size: .93rem; color: inherit; }

/* Fase 3: galleria e indicatori di ricerca. */
.tm-workspace[hidden],.tm-results[hidden],.tm-loading[hidden],.tm-lightbox[hidden],#tm-photo-view[hidden],#tm-no-results[hidden],#tm-show-more[hidden] {display:none!important;}
.tm-loading{display:flex;align-items:center;gap:.7rem;padding:1rem;border:1px solid #70849a;border-radius:12px;background:rgba(100,145,180,.12);}
.tm-spinner{width:20px;height:20px;border:3px solid rgba(128,160,184,.35);border-top-color:#87b9ee;border-radius:50%;animation:tm-spin .9s linear infinite;}
@keyframes tm-spin{to{transform:rotate(360deg)}}
.tm-results{display:grid;gap:1.15rem;margin-top:1rem;min-height:350px;}
.tm-result-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;}
.tm-result-head h2{margin:0 0 .35rem;}
.tm-place-tabs{display:flex;flex-wrap:wrap;gap:.55rem;}
.tm-place-tab{background:transparent;color:inherit;border:1px solid #87929f;border-radius:22px;padding:.55rem .9rem;font:inherit;cursor:pointer;}
.tm-place-tab.tm-active{background:#284e70;color:white;border-color:#284e70;}
.tm-photo-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.8rem;margin-top:.8rem;}
.tm-photo-card{font:inherit;text-align:left;display:flex;flex-direction:column;gap:.45rem;background:rgba(130,140,150,.12);color:inherit;border:1px solid #667686;border-radius:10px;padding:.65rem;cursor:pointer;min-width:0;}
.tm-photo-card img{width:100%;height:190px;object-fit:contain;background:#e7e7e7;border-radius:6px;}
.tm-photo-card small{opacity:.75;}.tm-photo-card strong{font-size:.9rem;overflow-wrap:anywhere;}
.tm-image-missing{opacity:.6;}.tm-lightbox{position:fixed;inset:0;z-index:3000;background:rgba(0,0,0,.93);padding:1rem;overflow:auto;color:#fff;}
.tm-lightbox-inner{max-width:1100px;margin:auto;position:relative;display:grid;gap:.55rem;}
.tm-lightbox-close{justify-self:end;border:0;background:transparent;color:white;font-size:2rem;cursor:pointer;}
.tm-lightbox-stage{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:45vh;}
.tm-lightbox-stage img{max-width:calc(100% - 95px);max-height:72vh;object-fit:contain;}
.tm-lightbox-stage button{background:rgba(255,255,255,.14);color:white;border:0;border-radius:8px;font-size:2rem;cursor:pointer;padding:.2rem .65rem;}
.tm-lightbox a{color:#c4dbf7;font-size:.85rem;}.tm-lightbox small{color:#c9c9c9;}
@media(max-width:640px){.tm-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.tm-photo-card img{height:140px;}}
