:root{
  --bg:#ffffff;
  --card:#ffffff;
  --text:#0f172a;         /* slate-900 */
  --muted:#475569;        /* slate-600 */
  --line:#e2e8f0;         /* slate-200 */
  --accent:#14b8a6;       /* teal-500 */
  --accent2:#2563eb;      /* blue-600 */
  --danger:#e11d48;       /* rose-600 */
  --ok:#059669;           /* emerald-600 */
  --warn:#d97706;         /* amber-600 */
  --shadow:0 10px 28px rgba(2,6,23,.10);
  --radius:16px;
  --max:1120px;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  font-size:16px;
  color:var(--text);
  line-height:1.7;
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(37,99,235,.10), transparent),
    radial-gradient(900px 500px at 90% 0%, rgba(20,184,166,.10), transparent),
    linear-gradient(180deg, #ffffff, #f8fafc);
}
a{color:inherit}
.container{max-width:var(--max);margin:0 auto;padding:0 16px}
.hidden{display:none!important}
.row{display:flex;gap:12px;align-items:center}
.col{display:flex;flex-direction:column;gap:10px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card.pad{padding:14px}
.badge{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--line);
  background:rgba(2,6,23,.03);
  color:var(--muted);font-size:14px;white-space:nowrap
}
label.badge{
  min-height:44px;
  cursor:pointer;
}
.badge.ok{color:var(--ok);border-color:rgba(5,150,105,.25);background:rgba(5,150,105,.06)}
.badge.warn{color:var(--warn);border-color:rgba(217,119,6,.25);background:rgba(217,119,6,.06)}
.badge.danger{color:var(--danger);border-color:rgba(225,29,72,.25);background:rgba(225,29,72,.06)}
.btn{
  cursor:pointer;
  border:1px solid var(--line);
  background:#ffffff;
  color:var(--text);
  padding:12px 16px;border-radius:12px;font-weight:700;
  font-size:16px;
  min-height:44px;
  display:inline-flex;align-items:center;justify-content:center;
  transition:background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:hover{background:#f8fafc}
.btn.primary{border-color:rgba(20,184,166,.45);background:rgba(20,184,166,.10)}
.btn.primary:hover{background:rgba(20,184,166,.14)}
.btn.danger{border-color:rgba(225,29,72,.35);background:rgba(225,29,72,.08)}
.btn.danger:hover{background:rgba(225,29,72,.12)}
.input, select, textarea{
  width:100%;
  padding:10px 12px;border-radius:12px;
  border:1px solid var(--line);
  background:#ffffff;
  color:var(--text);
  font-size:16px;
  min-height:48px;
  outline:none;
  transition:border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, select:focus, textarea:focus{
  border-color:rgba(20,184,166,.55);
  box-shadow:0 0 0 4px rgba(20,184,166,.14);
}
textarea{min-height:140px;resize:vertical}
hr{border:0;border-top:1px solid var(--line);margin:14px 0}
small{color:var(--muted)}
h1,h2,h3{margin:0 0 8px 0;line-height:1.3}
h1{font-size:28px}
h2{font-size:20px}
h3{font-size:16px}





/* Home hero */
.home-hero{
  position:relative;
  min-height:220px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:url('/assets/haikei.jpg') center/cover no-repeat;
}
.home-hero-inner{
  position:relative;
  min-height:220px;
  padding:20px 16px 16px;
}
.home-hero-copy{
  min-height:184px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:flex-start;
}
.hero-title, .hero-sub{
  color:#fff;
  text-shadow:0 2px 8px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.35);
}
.hero-title{
  font-size:26px;
  font-weight:900;
  letter-spacing:.2px;
  line-height:1.16;
  word-break:keep-all;
}
.hero-title-line{
  display:block;
  white-space:nowrap;
}
.hero-sub{
  position:static;
  font-weight:800;
  line-height:1.2;
}
@media (max-width: 767px){
  .home-hero{
    min-height:220px;
    background-position:center;
  }
  .home-hero-inner{
    min-height:220px;
    padding:16px 0 14px;
  }
  .home-hero-copy{
    min-height:190px;
    padding:0 14px;
  }
  .hero-title{
    font-size:clamp(24px, 6.5vw, 30px);
    line-height:1.12;
    letter-spacing:.01em;
  }
  .hero-sub{
    font-size:clamp(18px, 4.4vw, 22px);
  }
}


/* search result photo cards */
.search-card{
  overflow:hidden;
  outline:none;
}
.search-card.is-selected{
  border-color:rgba(20,184,166,.65);
  box-shadow:0 10px 28px rgba(20,184,166,.16);
}
.search-card:focus-visible{
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 3px rgba(37,99,235,.16);
}
.search-card-photo{
  display:block;
  width:100%;
  margin:0 0 12px 0;
  border-radius:14px;
  border:1px solid var(--line);
  overflow:hidden;
  background:linear-gradient(135deg, rgba(20,184,166,.08), rgba(37,99,235,.08));
  color:var(--muted);
  text-decoration:none;
}
.search-card-photo img{
  display:block;
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
}
.search-card-photo-placeholder{
  min-height:142px;
  aspect-ratio:16/9;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:12px;
  font-weight:800;
}
.search-card-photo-icon{
  font-size:28px;
  line-height:1;
}
.search-card-photo:hover{
  border-color:rgba(20,184,166,.45);
  box-shadow:0 8px 22px rgba(2,6,23,.08);
}

/* listing detail main photo */
.listing-side-media{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.listing-visual-card{
  margin:0;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:linear-gradient(135deg, rgba(20,184,166,.08), rgba(37,99,235,.08));
}
.listing-visual-card figcaption{
  padding:8px 10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  background:#fff;
  border-top:1px solid var(--line);
}
.listing-visual-img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  background:#f8fafc;
}
.listing-photo-placeholder{
  min-height:220px;
  padding:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.listing-photo-placeholder-icon{
  font-size:34px;
  line-height:1;
  margin-bottom:6px;
}

/* listing detail photo gallery */
.gallery{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
  margin-top:12px;
}
.gallery img{
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  display:block;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
}


.gallery-card{
  margin:0;
  position:relative;
}
.gallery-note{
  position:absolute;
  inset:auto 12px 12px 12px;
  padding:8px 10px;
  border-radius:12px;
  background:rgba(15,23,42,.80);
  color:#fff;
  font-size:12px;
}
.map-action-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.map-action-row > .btn,
.map-action-row > a.btn{
  text-decoration:none;
}
.detail-row{
  box-shadow:none;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}
@media (max-width: 760px){
  .stack-sm{
    flex-direction:column;
    align-items:stretch !important;
  }
  .stack-sm > *{
    min-width:0 !important;
    width:100%;
  }
  .detail-row{
    align-items:flex-start;
  }
  .detail-row .btn{
    flex:0 0 auto;
  }
}
@media (max-width: 520px){
  h1{font-size:22px}
  .container{padding:0 12px}
  .card.pad{padding:12px}
  .btn{padding:12px 14px}
  .map-action-row > .btn,
  .map-action-row > a.btn{
    flex:1 1 calc(50% - 8px);
  }
  .gallery{
    grid-template-columns:1fr;
  }
  .search-card-photo-placeholder{
    min-height:120px;
  }
  .listing-photo-placeholder{
    min-height:180px;
  }
}


/* Search results: desktop map/list layout */
.sr-wrap{
  align-items:flex-start !important;
  gap:14px;
  flex-wrap:wrap;
}
.sr-pane-map{
  flex:1 1 520px !important;
  height:clamp(480px, calc(100vh - 180px), 680px) !important;
  min-height:480px !important;
  overflow:hidden;
  align-self:flex-start;
}
.sr-pane-map #map{
  height:100% !important;
  min-height:0 !important;
}
.sr-pane-list{
  flex:1 1 360px !important;
  min-width:300px;
}
@media (min-width:768px){
  .sr-pane-map{
    position:sticky;
    top:86px;
  }
}

/* Search results: mobile map/list tabs */
.sr-tabs{
  display:none;
}
.sr-tab{
  flex:1;
  padding:12px;
  background:#fff;
  border:none;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
  color:var(--muted);
  min-height:48px;
}
.sr-tab.active{
  background:rgba(20,184,166,.10);
  color:var(--text);
}
@media (max-width:767px){
  .sr-tabs{
    display:flex;
    gap:0;
    border-radius:12px;
    overflow:hidden;
    border:1px solid var(--line);
    margin-bottom:12px;
  }
  .sr-wrap{
    display:block !important;
  }
  .sr-pane-map{
    min-height:0 !important;
    flex:none !important;
    height:auto !important;
  }
  .sr-pane-map #map{
    height:42vh !important;
    min-height:220px !important;
  }
  .sr-pane-map.sr-hidden,
  .sr-pane-list.sr-hidden{
    display:none !important;
  }
  .sr-pane-list{
    margin-top:12px;
  }
}

/* Listing detail: fixed CTA bar (mobile only) */
.listing-cta-bar{
  display:none;
}
@media (max-width:767px){
  .listing-cta-bar{
    display:flex;
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    padding:10px 12px;
    padding-bottom:calc(10px + env(safe-area-inset-bottom));
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(10px);
    border-top:1px solid var(--line);
    gap:8px;
    z-index:100;
  }
  .listing-cta-bar .btn{
    flex:1;
  }
  .listing-cta-bar .btn-chat{
    flex:2;
  }
  /* pad the page content so CTA bar doesn't overlap */
  body.has-cta-bar main{
    padding-bottom:80px !important;
  }
}

/* Favourite active state */
.btn.fav-active{
  background:rgba(251,146,60,.10);
  border-color:rgba(251,146,60,.45);
  color:#c2410c;
}
.btn.fav-active:hover{
  background:rgba(251,146,60,.16);
}

/* Small secondary action link (e.g. 誤情報を報告) */
.btn.btn-sub{
  font-size:13px;
  padding:8px 12px;
  min-height:36px;
  color:var(--muted);
  border-color:transparent;
  background:transparent;
}
.btn.btn-sub:hover{
  background:rgba(2,6,23,.04);
  border-color:var(--line);
}
body.auth-pending .auth-protected { display: none; }
body:not(.auth-pending) .auth-loading { display: none; }
.auth-loading { padding: 48px 0; }

/* publisher photo management */
.photo-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}
.photo-grid-manage{
  margin-top:12px;
}
.photo-slot{
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  background:#fff;
  box-shadow:0 8px 22px rgba(15,23,42,.04);
}
.photo-slot-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.photo-slot-title{
  font-weight:900;
}
.photo-preview{
  display:none;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fafc;
}
.photo-status{
  min-height:20px;
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}
.photo-status.danger{
  color:#b91c1c;
  font-weight:800;
}
.photo-file-label{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:42px;
  margin-top:10px;
  border:1px dashed rgba(15,23,42,.22);
  border-radius:12px;
  background:#f8fafc;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
}
.photo-file-label:hover{
  border-color:rgba(20,184,166,.60);
  background:rgba(20,184,166,.06);
}
.photo-file-label input{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
.photo-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.photo-actions .btn{
  min-height:34px;
  padding:7px 10px;
  font-size:13px;
}
.photo-upload-status{
  align-items:center;
  gap:8px;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fafc;
  color:var(--muted);
  font-weight:800;
  font-size:13px;
}
.photo-upload-status.is-busy::before{
  content:"";
  width:14px;
  height:14px;
  border:2px solid rgba(15,23,42,.18);
  border-top-color:rgba(15,23,42,.65);
  border-radius:999px;
  animation:slidersSpin .75s linear infinite;
}
.photo-upload-status.ok{
  color:#166534;
  background:#f0fdf4;
  border-color:#bbf7d0;
}
.photo-upload-status.danger{
  color:#b91c1c;
  background:#fef2f2;
  border-color:#fecaca;
}
@keyframes slidersSpin{
  to{ transform:rotate(360deg); }
}
@media (max-width: 640px){
  .photo-actions .btn{
    flex:1 1 calc(50% - 8px);
  }
}

/* Photo reporting / moderation helpers */
.gallery-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.photo-report-btn {
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 999px;
}
.photo-report-thumb {
  width: 112px;
  height: 74px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.photo-report-thumb-placeholder {
  width: 112px;
  height: 74px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

/* Google Places custom suggestions */
.place-suggest-wrap{
  position:relative;
}
.place-suggestions{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 6px);
  z-index:80;
  overflow:hidden;
  max-height:300px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  box-shadow:0 16px 36px rgba(2,6,23,.16);
}
.place-suggestion-item{
  width:100%;
  min-height:48px;
  padding:10px 12px;
  border:0;
  border-bottom:1px solid rgba(226,232,240,.8);
  background:#fff;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.place-suggestion-item:last-of-type{
  border-bottom:0;
}
.place-suggestion-item:hover,
.place-suggestion-item.is-active{
  background:rgba(20,184,166,.08);
}
.place-suggestion-main{
  display:block;
  font-weight:800;
  line-height:1.35;
}
.place-suggestion-sub{
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}
.place-suggestions-footer{
  padding:6px 10px;
  border-top:1px solid rgba(226,232,240,.85);
  color:var(--muted);
  font-size:11px;
  text-align:right;
  background:#f8fafc;
}


/* SliderS controlled address suggestions.
   Google Places is used as a data source only; the Google default .pac-container
   widget is intentionally hidden to avoid external UI/CSS changes producing
   rows of "!" icons in the home search field. */
.address-search-wrap{position:relative;width:100%}
.address-suggestions{
  position:absolute;
  z-index:10000;
  top:calc(100% + 6px);
  left:0;
  right:0;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 18px 40px rgba(2,6,23,.18);
  overflow:hidden;
}
.address-suggestion-item{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  padding:10px 12px;
  border:0;
  border-bottom:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.address-suggestion-item:last-child{border-bottom:0}
.address-suggestion-item:hover,
.address-suggestion-item:focus{background:#f8fafc;outline:none}
.address-suggestion-main{font-weight:800;line-height:1.35}
.address-suggestion-sub{font-size:13px;color:var(--muted);line-height:1.35}

/* Google Places Autocomplete dropdown — ensure it appears above dialogs and drawers.
   index.page.js uses AutocompleteService (no .pac-container); this rule applies
   only to pages that use the native Autocomplete widget (e.g. publisher_edit). */
.pac-container{z-index:99999!important}

/* Publisher edit: required field highlight (soft red, non-alarming) */
input.required-empty,
select.required-empty,
textarea.required-empty {
  border-color: #f3a6a6 !important;
  background: #fff5f5 !important;
}
label.required-empty {
  outline: 2px solid #f3a6a6;
  outline-offset: 2px;
  background: #fff5f5 !important;
}

/* Publish confirmation dialog — scrollable body, fixed header/footer */
.pub-confirm-dialog {
  border: none;
  padding: 0;
  border-radius: 16px;
  width: min(560px, calc(100vw - 28px));
  max-height: min(86dvh, 720px);
  background: var(--card, #fff);
  color: var(--text, #0f172a);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}
/* [open] 時だけ flex + 固定中央配置（Safari でも画面外に出ない） */
.pub-confirm-dialog[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
.pub-confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}
.pub-confirm-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pub-confirm-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.pub-confirm-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  padding: 16px 20px;
}
.pub-confirm-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
/* Publish summary inside the confirm dialog */
.pub-sum-body { display: flex; flex-direction: column; gap: 8px; }
.pub-sum-title { font-weight: 900; font-size: 16px; line-height: 1.4; word-break: break-all; }
.pub-sum-row { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.5; }
.pub-sum-label { color: var(--muted); font-size: 12px; flex-shrink: 0; min-width: 60px; }
.pub-sum-pr { font-size: 14px; }
.pub-sum-pr-text {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.7;
  border-left: 3px solid var(--line);
  padding-left: 10px;
  word-break: break-all;
}
