/*
 * ひんだれたマルシェ App UI
 * Version: 1.4.1
 *
 * 既存テンプレートの業務ロジックは変更せず、スマホアプリとしての
 * 情報密度、固定ナビ、安全余白、カード、フォームを最終段で統一する。
 */

:root{
  --hm-app-bg:#f7f2e8;
  --hm-app-surface:#ffffff;
  --hm-app-surface-soft:#fffaf0;
  --hm-app-text:#26211d;
  --hm-app-muted:#69635e;
  --hm-app-accent:#d95367;
  --hm-app-accent-dark:#b93b52;
  --hm-app-accent-soft:#fff0f3;
  --hm-app-border:#e8dfd1;
  --hm-app-ring:#1f6feb;
  --hm-app-success:#287a45;
  --hm-app-warning:#9a5a00;
  --hm-app-danger:#aa2f45;
  --hm-app-radius:18px;
  --hm-app-radius-sm:13px;
  --hm-app-shadow:0 5px 20px rgba(72,52,32,.075);
  --hm-app-shadow-raised:0 10px 30px rgba(52,38,25,.13);
  --hm-app-header-height:60px;
  --hm-bottom-nav-space:88px;
}

html{
  scroll-padding-top:calc(var(--hm-app-header-height) + 12px);
  scroll-padding-bottom:var(--hm-bottom-nav-space);
  background:var(--hm-app-bg);
}

body.hm-marche-app{
  margin:0;
  min-width:280px;
  background:var(--hm-app-bg) !important;
  color:var(--hm-app-text) !important;
  font-size:17px;
  line-height:1.58;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  padding-bottom:0 !important;
  overscroll-behavior-y:none;
}

body.hm-marche-app *{
  -webkit-tap-highlight-color:transparent;
}

body.hm-marche-app a,
body.hm-marche-app button,
body.hm-marche-app input,
body.hm-marche-app select,
body.hm-marche-app textarea,
body.hm-marche-app summary{
  touch-action:manipulation;
}

body.hm-marche-app :focus-visible{
  outline:3px solid var(--hm-app-ring) !important;
  outline-offset:3px !important;
}

body.hm-marche-app #wrap{
  width:100%;
  min-height:100svh;
  margin:0 auto !important;
  padding:0 !important;
  background:var(--hm-app-bg);
  font-size:17px !important;
}

/* ---------- App bar ---------- */
body.hm-marche-app #site-header{
  position:sticky !important;
  top:0;
  z-index:1203 !important;
  min-height:var(--hm-app-header-height) !important;
  padding:0 !important;
  border:0 !important;
  border-bottom:1px solid rgba(232,223,209,.9) !important;
  background:rgba(255,255,255,.94) !important;
  -webkit-backdrop-filter:saturate(1.15) blur(14px);
  backdrop-filter:saturate(1.15) blur(14px);
  box-shadow:0 1px 0 rgba(255,255,255,.85) !important;
}
body.hm-marche-app #site-header.is-scrolled{
  box-shadow:0 5px 18px rgba(56,42,28,.10) !important;
}
body.hm-marche-app #site-header .header{
  min-height:var(--hm-app-header-height);
  width:min(100%,960px);
  margin:0 auto;
  padding:7px 14px !important;
  gap:12px;
}
body.hm-marche-app .app-home{
  min-width:0;
  min-height:46px !important;
  padding:5px 8px !important;
  gap:10px !important;
  border:0 !important;
  border-radius:14px !important;
  background:transparent !important;
  color:var(--hm-app-text) !important;
  opacity:1 !important;
}
body.hm-marche-app .app-home:hover,
body.hm-marche-app .app-home:active{
  background:var(--hm-app-surface-soft) !important;
  color:var(--hm-app-text) !important;
}
body.hm-marche-app .app-home img{
  width:38px !important;
  height:38px !important;
  flex:0 0 38px;
  border-radius:10px !important;
  box-shadow:0 2px 7px rgba(0,0,0,.10);
}
body.hm-marche-app .app-home__label{
  min-width:0;
  max-width:calc(100vw - 130px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:1rem !important;
  line-height:1.25 !important;
  font-weight:900 !important;
  letter-spacing:.01em;
}
body.hm-marche-app #hamburger-menu{
  width:46px !important;
  height:46px !important;
  flex:0 0 46px;
  border:1px solid var(--hm-app-border) !important;
  border-radius:50% !important;
  background:var(--hm-app-surface-soft) !important;
  color:#514a44 !important;
}
body.hm-marche-app #hamburger-menu:active{
  transform:scale(.96);
  background:#f5ecdf !important;
}
body.hm-marche-app #hamburger-menu svg{
  width:25px;
  height:25px;
}

/* メニューはWebの全幅帯ではなく、アプリのポップオーバーとして表示 */
body.hm-marche-app #nav-menu{
  top:calc(var(--hm-app-header-height) + 8px) !important;
  right:12px !important;
  left:auto !important;
  bottom:auto !important;
  width:min(330px,calc(100vw - 24px)) !important;
  max-height:calc(100svh - var(--hm-app-header-height) - 20px) !important;
  padding:8px !important;
  border:1px solid rgba(232,223,209,.96) !important;
  border-radius:22px !important;
  background:rgba(255,255,255,.985) !important;
  box-shadow:var(--hm-app-shadow-raised) !important;
  overflow:auto !important;
}
body.hm-marche-app #nav-menu ul{
  display:grid;
  gap:5px;
  margin:0 !important;
  padding:0 !important;
}
body.hm-marche-app #nav-menu li{
  margin:0 !important;
}
body.hm-marche-app #nav-menu li a{
  min-height:50px !important;
  padding:11px 13px !important;
  border:0 !important;
  border-radius:14px !important;
  background:transparent !important;
  color:var(--hm-app-text) !important;
  font-size:1rem;
  font-weight:800;
}
body.hm-marche-app #nav-menu li a:hover,
body.hm-marche-app #nav-menu li a:active{
  background:var(--hm-app-surface-soft) !important;
}
body.hm-marche-app #nav-backdrop{
  background:rgba(34,28,23,.38) !important;
  -webkit-backdrop-filter:blur(2px);
  backdrop-filter:blur(2px);
}

/* ---------- Page canvas ---------- */
body.hm-marche-app #content{
  width:min(100%,1040px) !important;
  max-width:1040px !important;
  margin:0 auto !important;
  padding:14px 16px 24px !important;
  color:var(--hm-app-text);
}
body.hm-marche-app #content.hm-list-page,
body.hm-marche-app #content.hm-work-detail-page,
body.hm-marche-app #content.hm-event-detail-page,
body.hm-marche-app #content.hm-submit-page,
body.hm-marche-app #content.kc-sales-page{
  padding:14px 16px 24px !important;
}
body.hm-marche-app #content > .page-title,
body.hm-marche-app #content > header.page-title{
  margin:0 0 12px !important;
  padding:2px 0 0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
body.hm-marche-app #content .page-title h1,
body.hm-marche-app #content.hm-list-page .page-title h1,
body.hm-marche-app #content.hm-work-detail-page .page-title h1,
body.hm-marche-app #content.hm-event-detail-page .page-title h1{
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  color:var(--hm-app-text) !important;
  font-size:clamp(1.48rem,6.4vw,1.78rem) !important;
  font-weight:950 !important;
  line-height:1.24 !important;
  letter-spacing:-.025em;
}
body.hm-marche-app #content .page-title h1::before{
  content:none !important;
}
body.hm-marche-app #content .page-title p,
body.hm-marche-app #content.hm-list-page .page-title p{
  margin:6px 0 0 !important;
  color:var(--hm-app-muted) !important;
  font-size:.94rem !important;
  line-height:1.55 !important;
}
body.hm-marche-app #content .page-title + *,
body.hm-marche-app #content .page-title + .sales-sort{
  margin-top:0 !important;
  padding-top:0 !important;
  border-top:0 !important;
}
body.hm-marche-app #content h2,
body.hm-marche-app #content h3{
  color:var(--hm-app-text);
  letter-spacing:-.01em;
}
body.hm-marche-app #content p,
body.hm-marche-app #content li,
body.hm-marche-app #content label{
  font-size:1rem;
}
body.hm-marche-app #content small,
body.hm-marche-app #content .field-note,
body.hm-marche-app #content .filter-hint{
  color:var(--hm-app-muted) !important;
  font-size:.92rem !important;
  line-height:1.62 !important;
}

/* ---------- App cards ---------- */
body.hm-marche-app #content .hm-card,
body.hm-marche-app #content .hm-work-card,
body.hm-marche-app #content .hm-event-card,
body.hm-marche-app #content .hm-empty-card,
body.hm-marche-app #content .filter-details,
body.hm-marche-app #content .hm-filter-card,
body.hm-marche-app #content fieldset,
body.hm-marche-app #content .kc-photo-display,
body.hm-marche-app #content .kc-logo-display,
body.hm-marche-app #content .kc-info-display,
body.hm-marche-app #content .store-notice,
body.hm-marche-app #content .account-deletion,
body.hm-marche-app #content .sales-end-setting,
body.hm-marche-app #content .sales-location-section{
  border:1px solid var(--hm-app-border) !important;
  border-radius:var(--hm-app-radius) !important;
  background:var(--hm-app-surface) !important;
  box-shadow:var(--hm-app-shadow) !important;
}
body.hm-marche-app #content fieldset{
  padding:15px !important;
  margin:12px auto !important;
}
body.hm-marche-app #content fieldset legend{
  max-width:calc(100% - 18px);
  padding:0 7px !important;
  border:0 !important;
  color:var(--hm-app-text) !important;
  font-size:1.06rem !important;
  font-weight:950 !important;
}

/* ---------- Forms ---------- */
body.hm-marche-app #content input[type="text"],
body.hm-marche-app #content input[type="email"],
body.hm-marche-app #content input[type="password"],
body.hm-marche-app #content input[type="url"],
body.hm-marche-app #content input[type="time"],
body.hm-marche-app #content input[type="date"],
body.hm-marche-app #content input[type="number"],
body.hm-marche-app #content input[type="search"],
body.hm-marche-app #content select,
body.hm-marche-app #content textarea{
  width:100% !important;
  min-height:50px !important;
  padding:12px 13px !important;
  border:1px solid #d8d0c5 !important;
  border-radius:13px !important;
  background:#fff !important;
  color:var(--hm-app-text) !important;
  font:inherit !important;
  font-size:1rem !important;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.025);
}
body.hm-marche-app #content textarea{
  min-height:126px !important;
}
body.hm-marche-app #content input:focus,
body.hm-marche-app #content select:focus,
body.hm-marche-app #content textarea:focus{
  border-color:#8caee8 !important;
  box-shadow:0 0 0 3px rgba(31,111,235,.12) !important;
}
body.hm-marche-app #content input[type="checkbox"],
body.hm-marche-app #content input[type="radio"]{
  width:22px !important;
  height:22px !important;
  flex:0 0 22px;
  accent-color:var(--hm-app-accent);
}
body.hm-marche-app #content input[type="submit"],
body.hm-marche-app #content button,
body.hm-marche-app #content .btn,
body.hm-marche-app #content .hm-primary-button,
body.hm-marche-app #content .hm-detail-button,
body.hm-marche-app #content .hm-empty-button{
  min-height:48px;
  border-radius:14px;
  font-size:1rem;
  font-weight:900;
}
body.hm-marche-app #content input[type="submit"]{
  padding:11px 18px !important;
  border:0 !important;
  background:var(--hm-app-accent) !important;
  color:#fff !important;
  box-shadow:0 5px 14px rgba(217,83,103,.22);
}
body.hm-marche-app #content input[type="submit"]:active,
body.hm-marche-app #content button:active,
body.hm-marche-app #content .btn:active{
  transform:scale(.985) !important;
}

/* ---------- Status messages ---------- */
body.hm-marche-app #content .error,
body.hm-marche-app #content .success,
body.hm-marche-app #content .updated{
  border-radius:15px !important;
  padding:12px 14px !important;
  box-shadow:none !important;
  text-align:left !important;
}
body.hm-marche-app #content .error{
  border-color:#efbcc5 !important;
  background:#fff2f4 !important;
  color:#81283b !important;
}
body.hm-marche-app #content .success{
  border-color:#b9ddc4 !important;
  background:#effaf2 !important;
  color:#1f6337 !important;
}

/* ---------- Filters / accordions ---------- */
body.hm-marche-app #content .filter-details,
body.hm-marche-app #content .hm-filter-card{
  max-width:760px !important;
  margin:10px auto 14px !important;
  overflow:hidden;
}
body.hm-marche-app #content .filter-details summary,
body.hm-marche-app #content .hm-filter-head{
  min-height:54px !important;
  padding:12px 14px !important;
  background:var(--hm-app-surface) !important;
  border:0 !important;
}
body.hm-marche-app #content .filter-details[open] summary,
body.hm-marche-app #content .hm-filter-card.is-open .hm-filter-head{
  background:var(--hm-app-surface-soft) !important;
  border-bottom:1px solid var(--hm-app-border) !important;
}
body.hm-marche-app #content .filter-panel,
body.hm-marche-app #content .hm-filter-body{
  padding:14px !important;
  border-top:0 !important;
  background:#fff !important;
}
body.hm-marche-app #content .hm-filter-toggle{
  min-width:74px;
  min-height:42px;
  margin:0 !important;
  padding:8px 12px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:12px !important;
  background:var(--hm-app-surface-soft) !important;
  color:var(--hm-app-text) !important;
}

/* ジャンル親折りたたみを設定アプリ風のグループリストに */
body.hm-marche-app .hind-kc-genre-tree,
body.hm-marche-app .store-genre-filter-tree{
  gap:8px !important;
}
body.hm-marche-app .hind-kc-genre-tree .menu-genre-block,
body.hm-marche-app .store-genre-filter-group{
  border:1px solid var(--hm-app-border) !important;
  border-radius:14px !important;
  box-shadow:none !important;
}
body.hm-marche-app .hind-kc-genre-tree .menu-genre-block > summary,
body.hm-marche-app .store-genre-filter-group > summary{
  min-height:52px !important;
  padding:11px 13px !important;
  background:#fff !important;
}
body.hm-marche-app .hind-kc-genre-tree .menu-genre-block[open] > summary,
body.hm-marche-app .store-genre-filter-group[open] > summary{
  background:var(--hm-app-surface-soft) !important;
}
body.hm-marche-app .hind-kc-genre-tree .menu-genre-panel,
body.hm-marche-app .store-genre-filter-panel{
  padding:8px 10px 11px !important;
  background:#fff !important;
}
body.hm-marche-app .hind-kc-genre-tree .menu-genre-parent,
body.hm-marche-app .hind-kc-genre-tree .menu-genre-children label,
body.hm-marche-app .store-genre-filter-parent,
body.hm-marche-app .store-genre-filter-children label{
  min-height:46px !important;
  padding:10px 8px !important;
}

/* ---------- Login / registration ---------- */
body.hm-marche-app .hm-auth-shell{
  max-width:680px !important;
}
body.hm-marche-app .hm-auth-tabs{
  position:sticky;
  top:calc(var(--hm-app-header-height) + 8px);
  z-index:20;
  gap:4px !important;
  margin:8px 0 12px !important;
  padding:4px;
  border:1px solid var(--hm-app-border);
  border-radius:15px;
  background:rgba(255,255,255,.96);
  box-shadow:0 4px 16px rgba(52,38,25,.08);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
body.hm-marche-app .hm-auth-tab{
  min-height:44px !important;
  margin:0 !important;
  border:0 !important;
  border-radius:11px !important;
  background:transparent !important;
  color:var(--hm-app-muted) !important;
  box-shadow:none !important;
}
body.hm-marche-app .hm-auth-tab[aria-selected="true"]{
  background:var(--hm-app-accent) !important;
  color:#fff !important;
  box-shadow:0 3px 10px rgba(217,83,103,.22) !important;
}
body.hm-marche-app .hm-auth-panel > form,
body.hm-marche-app #content form#reg_form,
body.hm-marche-app #content form:has(input[name="login_submit"]){
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}

/* ---------- Archive cards ---------- */
body.hm-marche-app #content.hm-list-page .hm-result-count,
body.hm-marche-app #content .artist-list-status{
  margin:8px 2px 10px !important;
  color:var(--hm-app-muted) !important;
  font-size:.94rem !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-grid,
body.hm-marche-app #content.hm-list-page .hm-event-grid{
  gap:12px !important;
  margin:12px auto 20px !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-card,
body.hm-marche-app #content.hm-list-page .hm-event-card{
  padding:12px !important;
  border-radius:17px !important;
  text-align:left !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-card h2,
body.hm-marche-app #content.hm-list-page .hm-event-card h2{
  text-align:left !important;
  font-size:1.03rem !important;
  line-height:1.45 !important;
}
body.hm-marche-app #content.hm-list-page .hm-detail-button,
body.hm-marche-app #content.hm-list-page .hm-empty-button{
  min-height:44px !important;
  padding:8px 13px !important;
  border-radius:12px !important;
}

/* 作家一覧はネイティブの連絡先リスト風 */
body.hm-marche-app #content .sales-grid{
  padding:0 !important;
}
body.hm-marche-app #content .sales-item-link{
  border-color:var(--hm-app-border) !important;
  border-radius:17px !important;
  background:#fff !important;
  box-shadow:var(--hm-app-shadow) !important;
}

/* ---------- Detail pages ---------- */
body.hm-marche-app #content.hm-work-detail-page .hm-card,
body.hm-marche-app #content.hm-event-detail-page .hm-card{
  margin:10px 0 !important;
  padding:14px !important;
}
body.hm-marche-app #content .kc-back-nav{
  margin:6px 0 10px !important;
  padding:0 !important;
}
body.hm-marche-app #content .kc-back-button{
  width:auto !important;
  min-height:42px !important;
  padding:8px 12px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:12px !important;
  background:#fff !important;
  box-shadow:none !important;
}

/* ---------- Sales management ---------- */
body.hm-marche-app #content.kc-sales-page .kc-step,
body.hm-marche-app #content.kc-sales-page .sales-control,
body.hm-marche-app #content.kc-sales-page .sales-end-setting,
body.hm-marche-app #content.kc-sales-page .sales-location-section{
  border:1px solid var(--hm-app-border) !important;
  border-radius:18px !important;
  background:#fff !important;
  box-shadow:var(--hm-app-shadow) !important;
}
body.hm-marche-app #content.kc-sales-page .sales-control{
  bottom:calc(var(--hm-bottom-nav-space) + 8px) !important;
}

/* ---------- Empty states ---------- */
body.hm-marche-app #content .empty-state,
body.hm-marche-app #content .hm-empty-card{
  max-width:680px;
  margin:12px auto !important;
  padding:17px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:20px !important;
  background:#fff !important;
  box-shadow:var(--hm-app-shadow) !important;
  text-align:left !important;
}
body.hm-marche-app #content .empty-state > p:first-child,
body.hm-marche-app #content .hm-empty-card > p:first-child{
  color:var(--hm-app-text) !important;
  font-weight:950 !important;
}

/* ---------- Bottom app tab bar ---------- */
body.hm-marche-app #site-footer{
  margin-top:auto !important;
  padding:0 0 var(--hm-bottom-nav-space) !important;
  border:0 !important;
  background:transparent !important;
}
body.hm-marche-app #site-footer .footer-copy{
  padding:16px 12px 5px !important;
  color:var(--hm-app-muted) !important;
  font-size:.82rem !important;
}
body.hm-marche-app #fixed-footer-menu{
  position:fixed !important;
  z-index:1202 !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  width:100% !important;
  max-width:none !important;
  transform:none !important;
  padding:5px max(8px,env(safe-area-inset-right,0px)) calc(5px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px)) !important;
  border:0 !important;
  border-top:1px solid rgba(218,210,199,.95) !important;
  border-radius:0 !important;
  background:rgba(255,255,255,.97) !important;
  -webkit-backdrop-filter:saturate(1.15) blur(16px);
  backdrop-filter:saturate(1.15) blur(16px);
  box-shadow:0 -5px 22px rgba(52,38,25,.09) !important;
  overflow:visible !important;
}
body.hm-marche-app #fixed-footer-menu::before{
  content:none !important;
}
body.hm-marche-app #fixed-footer-menu ul{
  width:min(100%,760px);
  margin:0 auto !important;
  gap:3px !important;
}
body.hm-marche-app #fixed-footer-menu li{
  min-height:58px !important;
}
body.hm-marche-app #fixed-footer-menu a{
  position:relative;
  min-height:58px !important;
  padding:5px 2px 4px !important;
  gap:2px !important;
  border-radius:13px !important;
  color:#3d3834 !important;
  box-shadow:none !important;
}
body.hm-marche-app #fixed-footer-menu a::before{
  content:"";
  position:absolute;
  top:3px;
  left:50%;
  width:52px;
  height:30px;
  transform:translateX(-50%);
  border-radius:999px;
  background:transparent;
  z-index:-1;
}
body.hm-marche-app #fixed-footer-menu a img,
body.hm-marche-app #fixed-footer-menu a svg{
  width:25px !important;
  height:25px !important;
  stroke-width:2.15;
}
body.hm-marche-app #fixed-footer-menu a .label{
  display:block !important;
  color:inherit;
  font-size:.76rem !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  letter-spacing:0 !important;
  white-space:nowrap;
}
body.hm-marche-app #fixed-footer-menu a.is-current{
  color:var(--hm-app-accent) !important;
  background:transparent !important;
  box-shadow:none !important;
}
body.hm-marche-app #fixed-footer-menu a.is-current::before{
  background:var(--hm-app-accent-soft);
}
body.hm-marche-app #fixed-footer-menu a.is-current .label{
  font-weight:950 !important;
}

/* ---------- Small phone ---------- */
@media (max-width:430px){
  body.hm-marche-app #content,
  body.hm-marche-app #content.hm-list-page,
  body.hm-marche-app #content.hm-work-detail-page,
  body.hm-marche-app #content.hm-event-detail-page,
  body.hm-marche-app #content.hm-submit-page,
  body.hm-marche-app #content.kc-sales-page{
    padding-left:14px !important;
    padding-right:14px !important;
  }
  body.hm-marche-app #content.hm-list-page .hm-work-grid,
  body.hm-marche-app #content.hm-list-page .hm-event-grid{
    grid-template-columns:1fr !important;
  }
  body.hm-marche-app #fixed-footer-menu a .label{
    font-size:.74rem !important;
  }
}

@media (max-width:340px){
  body.hm-marche-app .app-home__label{
    display:block !important;
    font-size:.94rem !important;
  }
  body.hm-marche-app #site-header .header{
    padding-left:8px !important;
    padding-right:8px !important;
  }
  body.hm-marche-app #fixed-footer-menu a img,
  body.hm-marche-app #fixed-footer-menu a svg{
    width:23px !important;
    height:23px !important;
  }
  body.hm-marche-app #fixed-footer-menu a .label{
    font-size:.69rem !important;
  }
}

/* Desktopではスマホアプリのキャンバスとして中央に収める */
@media (min-width:961px){
  body.hm-marche-app #wrap{
    max-width:1180px;
  }
  body.hm-marche-app #fixed-footer-menu{
    left:50% !important;
    right:auto !important;
    width:min(760px,calc(100% - 32px)) !important;
    bottom:10px !important;
    transform:translateX(-50%) !important;
    border:1px solid var(--hm-app-border) !important;
    border-radius:22px !important;
  }
}

@media (prefers-reduced-motion:reduce){
  body.hm-marche-app *,
  body.hm-marche-app *::before,
  body.hm-marche-app *::after{
    scroll-behavior:auto !important;
    transition:none !important;
    animation:none !important;
  }
}

/* ======================================================================
   v1.4.0 全画面仕上げ：Webページ感を減らし、アプリの画面構造へ統一
   ====================================================================== */

/* 固定タブの選択背景をアイコン・文字の背面に確実に表示 */
body.hm-marche-app #fixed-footer-menu a{
  isolation:isolate;
  z-index:0;
}
body.hm-marche-app #fixed-footer-menu a::before{ z-index:0 !important; }
body.hm-marche-app #fixed-footer-menu a > *{
  position:relative;
  z-index:1;
}
body.hm-marche-app #fixed-footer-menu a .label{
  font-size:max(13px,.76rem) !important;
}

/* 汎用の情報ページは、本文をひとまとまりの設定画面カードとして表示 */
body.hm-marche-app #content.hm-static-page .page-content,
body.hm-marche-app #content.hm-post-index-page .post-list article,
body.hm-marche-app #content.hm-author-archive-page .author-archive-list{
  margin:0 0 14px !important;
  padding:16px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:var(--hm-app-radius) !important;
  background:var(--hm-app-surface) !important;
  box-shadow:var(--hm-app-shadow) !important;
}
body.hm-marche-app #content.hm-static-page .page-content > :first-child,
body.hm-marche-app #content.hm-post-index-page article > :first-child{ margin-top:0 !important; }
body.hm-marche-app #content.hm-static-page .page-content > :last-child,
body.hm-marche-app #content.hm-post-index-page article > :last-child{ margin-bottom:0 !important; }
body.hm-marche-app #content.hm-static-page h2,
body.hm-marche-app #content.hm-static-page h3{
  text-align:left !important;
  margin:1.15rem 0 .55rem !important;
  font-size:1.08rem !important;
}
body.hm-marche-app #content.hm-static-page :is(ul,ol){
  margin:.5rem 0 1rem !important;
  padding-left:1.4rem !important;
  list-style:initial !important;
}
body.hm-marche-app #content.hm-static-page li{ margin:.3rem 0; }
body.hm-marche-app #content.hm-error-page .error-404{
  padding:20px 0 !important;
  text-align:left !important;
}
body.hm-marche-app #content.hm-error-page .page-content{ text-align:center; }
body.hm-marche-app #content.hm-error-page .button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  padding:10px 16px;
  border-radius:14px;
  background:var(--hm-app-accent);
  color:#fff;
  font-weight:900;
}

/* 通常投稿・投稿者一覧もカード型のアプリ画面に */
body.hm-marche-app #content.hm-post-index-page{
  display:grid;
  gap:12px;
}
body.hm-marche-app #content.hm-post-index-page .post-list{
  display:grid;
  gap:12px;
}
body.hm-marche-app #content.hm-post-index-page .entry-title{
  margin:0 0 7px !important;
  text-align:left !important;
  font-size:1.08rem !important;
}
body.hm-marche-app #content.hm-post-index-page .entry-content p{ margin:0 !important; }
body.hm-marche-app #content.hm-author-archive-page .author-archive-list{
  display:grid;
  gap:0;
  padding:0 14px !important;
  list-style:none !important;
}
body.hm-marche-app #content.hm-author-archive-page .author-archive-item{
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  gap:10px;
  align-items:center;
  min-height:54px;
  padding:10px 2px;
  border-bottom:1px solid var(--hm-app-border);
}
body.hm-marche-app #content.hm-author-archive-page .author-archive-item:last-child{ border-bottom:0; }
body.hm-marche-app #content.hm-author-archive-page .archive-date{
  color:var(--hm-app-muted);
  font-size:.86rem;
}
body.hm-marche-app #content.hm-author-archive-page .archive-title a{
  color:var(--hm-app-text);
  font-weight:850;
}

/* ページ送りは小さな丸の羅列ではなく、押しやすいアプリ操作へ */
body.hm-marche-app #content .custom-pagination,
body.hm-marche-app #content .navigation.pagination{
  margin:18px 0 8px !important;
}
body.hm-marche-app #content .page-numbers{
  gap:6px !important;
}
body.hm-marche-app #content a.page-numbers,
body.hm-marche-app #content span.page-numbers{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-width:44px !important;
  min-height:44px !important;
  padding:8px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:12px !important;
  background:#fff !important;
  color:var(--hm-app-text) !important;
}
body.hm-marche-app #content span.page-numbers.current{
  border-color:var(--hm-app-accent) !important;
  background:var(--hm-app-accent) !important;
  color:#fff !important;
}

/* 投稿・編集フォームはカードを縦に積むネイティブ入力画面 */
body.hm-marche-app #content.hm-submit-page .hm-submit-form{
  width:100%;
  max-width:760px !important;
  margin:0 auto !important;
}
body.hm-marche-app #content.hm-submit-page .hm-form-card,
body.hm-marche-app #content.hm-profile-page .kc-upload-section,
body.hm-marche-app #content.hm-profile-page .kc-upload-box{
  margin:0 0 12px !important;
  padding:15px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:var(--hm-app-radius) !important;
  background:#fff !important;
  box-shadow:var(--hm-app-shadow) !important;
}
body.hm-marche-app #content.hm-submit-page .hm-form-card h2,
body.hm-marche-app #content.hm-profile-page .kc-upload-section > h2{
  margin:0 0 12px !important;
  padding:0 0 9px !important;
  border-bottom:1px solid var(--hm-app-border) !important;
  text-align:left !important;
  font-size:1.08rem !important;
  font-weight:950 !important;
}
body.hm-marche-app #content.hm-submit-page .hm-field{ margin:0 0 13px !important; }
body.hm-marche-app #content.hm-submit-page .hm-field:last-child{ margin-bottom:0 !important; }
body.hm-marche-app #content.hm-submit-page .hm-help,
body.hm-marche-app #content.hm-profile-page .kc-upload-help,
body.hm-marche-app #content.hm-profile-page .kc-save-note{
  color:var(--hm-app-muted) !important;
  font-size:.92rem !important;
  line-height:1.65 !important;
}
body.hm-marche-app #content.hm-submit-page .hm-submit-area{
  position:sticky;
  z-index:15;
  bottom:calc(var(--hm-bottom-nav-space) + 8px);
  display:flex !important;
  gap:8px !important;
  justify-content:center !important;
  flex-wrap:wrap !important;
  margin:14px 0 8px !important;
  padding:8px !important;
  border:1px solid rgba(232,223,209,.96) !important;
  border-radius:18px !important;
  background:rgba(255,255,255,.96) !important;
  box-shadow:0 8px 24px rgba(52,38,25,.13) !important;
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
}
body.hm-marche-app #content.hm-submit-page .hm-submit-area > *{
  flex:1 1 210px;
  width:auto !important;
  margin:0 !important;
}

/* 主要・副次・危険操作の意味を見た目で統一 */
body.hm-marche-app #content :is(.kc-save-button,.hm-primary-button,.hm-detail-button,.hm-empty-button),
body.hm-marche-app #content #sales-button,
body.hm-marche-app #content #sales-modal-next,
body.hm-marche-app #content #sales-modal-set{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:48px !important;
  padding:10px 16px !important;
  margin:0 !important;
  border:1px solid var(--hm-app-accent) !important;
  border-radius:14px !important;
  background:var(--hm-app-accent) !important;
  color:#fff !important;
  font-weight:900 !important;
  text-decoration:none !important;
  box-shadow:0 5px 14px rgba(217,83,103,.20) !important;
}
body.hm-marche-app #content :is(.hm-small-button,.kc-file-trigger,.hm-file-trigger,.kc-back-button,.hm-clear-link),
body.hm-marche-app #content :is(#show-delete-form,#cancel-delete-form,#edit-sales-info,#open-sales-prepare,#get-current-location,#open-google-map,#sales-modal-close,#sales-modal-back){
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:44px !important;
  padding:9px 13px !important;
  margin:0 !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:13px !important;
  background:#fff !important;
  color:var(--hm-app-text) !important;
  font-weight:850 !important;
  text-decoration:none !important;
  box-shadow:none !important;
}
body.hm-marche-app #content :is(.hm-danger-button,input[name="delete_menu"],input[name="delete_event"]),
body.hm-marche-app #content #delete-form-container input[type="submit"]{
  border-color:var(--hm-app-danger) !important;
  background:var(--hm-app-danger) !important;
  color:#fff !important;
}

/* 作品ジャンル：投稿・検索とも同じ親折りたたみ部品に見せる */
body.hm-marche-app .hm-work-genre-accordion,
body.hm-marche-app .hm-work-genre-tree{
  display:grid !important;
  gap:8px !important;
}
body.hm-marche-app :is(.hm-genre-details,.hm-work-genre-group){
  overflow:hidden;
  border:1px solid var(--hm-app-border) !important;
  border-radius:14px !important;
  background:#fff !important;
}
body.hm-marche-app :is(.hm-genre-details,.hm-work-genre-group) > summary{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  min-height:52px !important;
  padding:11px 13px !important;
  background:#fff !important;
  color:var(--hm-app-text) !important;
  font-weight:900 !important;
  cursor:pointer;
  list-style:none;
}
body.hm-marche-app :is(.hm-genre-details,.hm-work-genre-group)[open] > summary{
  background:var(--hm-app-surface-soft) !important;
  border-bottom:1px solid var(--hm-app-border) !important;
}
body.hm-marche-app :is(.hm-genre-children,.hm-work-genre-options){
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:4px 8px !important;
  padding:9px 10px 11px !important;
  border:0 !important;
  background:#fff !important;
}
body.hm-marche-app :is(.hm-genre-children,.hm-work-genre-options) label,
body.hm-marche-app .hm-work-genre-all{
  display:flex !important;
  align-items:flex-start !important;
  gap:8px !important;
  min-height:46px !important;
  margin:0 !important;
  padding:10px 8px !important;
  border-radius:10px !important;
  font-weight:750 !important;
}
body.hm-marche-app .hm-work-genre-all{
  grid-column:1/-1;
  background:var(--hm-app-surface-soft) !important;
}
body.hm-marche-app .hm-genre-count,
body.hm-marche-app .menu-genre-selected-count,
body.hm-marche-app .store-genre-filter-count{
  flex:0 0 auto;
  padding:3px 8px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:999px !important;
  background:#fff !important;
  color:var(--hm-app-muted) !important;
  font-size:.82rem !important;
  white-space:nowrap;
}

/* 作家一覧：検索を上、結果をコンパクトなアプリリストとして表示 */
body.hm-marche-app #content.hm-artist-list-page{
  padding-bottom:24px !important;
}
body.hm-marche-app #content.hm-artist-list-page .result-count{
  margin:7px 2px 10px !important;
  color:var(--hm-app-muted) !important;
  font-size:.91rem !important;
}
body.hm-marche-app #content.hm-artist-list-page .filter-area{
  margin:0 0 12px !important;
}
body.hm-marche-app #content.hm-artist-list-page .sales-grid{
  max-width:900px !important;
  margin:12px auto 22px !important;
  gap:10px !important;
}
body.hm-marche-app #content.hm-artist-list-page .sales-item-link{
  min-height:100px !important;
  padding:11px !important;
  border-radius:17px !important;
}
body.hm-marche-app #content.hm-artist-list-page .sales-more{
  min-height:38px !important;
  padding:6px 11px !important;
  border-radius:11px !important;
  font-size:.86rem !important;
  box-shadow:none !important;
}
body.hm-marche-app #content.hm-artist-list-page .menu-ad-section{
  margin:0 0 12px !important;
  padding:12px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:17px !important;
  background:#fff !important;
  box-shadow:var(--hm-app-shadow) !important;
}
body.hm-marche-app #content.hm-artist-list-page .menu-ad-header h2{
  margin:0 !important;
  text-align:left !important;
  font-size:.92rem !important;
  color:var(--hm-app-muted) !important;
}

/* 一覧カードは情報量を絞り、画像・名称・主要情報を優先 */
body.hm-marche-app #content.hm-list-page .hm-work-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-card{
  min-width:0;
  padding:9px !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-thumb{
  overflow:hidden;
  border-radius:13px;
  background:var(--hm-app-surface-soft);
}
body.hm-marche-app #content.hm-list-page .hm-work-thumb img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:13px !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-price{
  margin:2px 0 !important;
  color:var(--hm-app-accent-dark) !important;
  font-weight:950 !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-store{
  margin:2px 0 !important;
  color:var(--hm-app-muted) !important;
  font-size:.88rem !important;
}
body.hm-marche-app #content.hm-list-page .hm-work-card .hm-detail-button{
  width:100%;
  min-height:42px !important;
  padding:7px 8px !important;
  margin-top:5px !important;
  font-size:.9rem !important;
}

/* マイページは設定アプリのセクション一覧として表示 */
body.hm-marche-app #content.hm-mypage{
  max-width:760px !important;
}
body.hm-marche-app #content.hm-mypage > section{
  margin:0 0 12px !important;
  padding:15px !important;
}
body.hm-marche-app #content.hm-mypage > section h2{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 11px !important;
  padding:0 0 9px !important;
  border-bottom:1px solid var(--hm-app-border) !important;
  text-align:left !important;
  font-size:1.08rem !important;
}
body.hm-marche-app #content.hm-mypage > section h2 a{
  display:inline-flex;
  min-height:36px;
  align-items:center;
  padding:5px 9px;
  border-radius:10px;
  background:var(--hm-app-accent-soft);
  color:var(--hm-app-accent-dark);
  font-size:.84rem;
  white-space:nowrap;
}
body.hm-marche-app #content.hm-mypage .kc-info-display p{
  grid-template-columns:1fr !important;
  gap:2px !important;
  margin:10px 0 !important;
}
body.hm-marche-app #content.hm-mypage .menu-genre-badges,
body.hm-marche-app #content.hm-profile-page .menu-genre-selected{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
body.hm-marche-app #content.hm-mypage .badge,
body.hm-marche-app #content.hm-profile-page .badge{
  display:inline-flex !important;
  margin:0 !important;
  padding:5px 9px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:999px !important;
  background:var(--hm-app-surface-soft) !important;
  color:#5f4630 !important;
  font-size:.84rem !important;
  font-weight:800 !important;
}

/* プロフィール編集：各保存範囲が分かる独立カード */
body.hm-marche-app #content.hm-profile-page{
  max-width:780px !important;
}
body.hm-marche-app #content.hm-profile-page > fieldset,
body.hm-marche-app #content.hm-profile-page > .kc-upload-section{
  margin:0 0 13px !important;
}
body.hm-marche-app #content.hm-profile-page .kc-upload-box{
  box-shadow:none !important;
  background:var(--hm-app-surface-soft) !important;
}
body.hm-marche-app #content.hm-profile-page .kc-image-card{
  padding:10px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:15px !important;
  background:#fff !important;
}
body.hm-marche-app #content.hm-profile-page .kc-delete-link{
  display:inline-flex;
  min-height:42px;
  align-items:center;
  padding:7px 10px;
  color:var(--hm-app-danger) !important;
  font-weight:850;
}
body.hm-marche-app #content.hm-profile-page input[type="file"]{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  overflow:hidden !important;
  clip:rect(0 0 0 0) !important;
  clip-path:inset(50%) !important;
  white-space:nowrap !important;
}

/* 作家詳細はプロフィール画面風 */
body.hm-marche-app #content.hm-store-detail-page{
  max-width:820px !important;
}
body.hm-marche-app #content.hm-store-detail-page .store-main,
body.hm-marche-app #content.hm-store-detail-page .store-sns,
body.hm-marche-app #content.hm-store-detail-page .kcpm-follow{
  margin:0 0 12px !important;
  padding:15px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:var(--hm-app-radius) !important;
  background:#fff !important;
  box-shadow:var(--hm-app-shadow) !important;
}
body.hm-marche-app #content.hm-store-detail-page .store-header{
  margin:0 0 12px !important;
  padding:14px !important;
  border:1px solid var(--hm-app-border);
  border-radius:20px;
  background:#fff;
  box-shadow:var(--hm-app-shadow);
}
body.hm-marche-app #content.hm-store-detail-page .store-title{
  margin:8px 0 0 !important;
  font-size:1.45rem !important;
  line-height:1.25 !important;
}
body.hm-marche-app #content.hm-store-detail-page .store-thumbnail img{
  max-height:260px;
  object-fit:contain;
  border-radius:17px !important;
}
body.hm-marche-app #content.hm-store-detail-page .sns-list{
  display:grid !important;
  gap:7px !important;
}
body.hm-marche-app #content.hm-store-detail-page .sns-link{
  display:flex !important;
  align-items:center;
  min-height:48px;
  padding:10px 12px;
  border:1px solid var(--hm-app-border);
  border-radius:13px;
  background:var(--hm-app-surface-soft);
  color:var(--hm-app-text);
  font-weight:850;
}

/* 出店管理のダイアログはスマホでは下から現れるシート */
body.hm-marche-app #content.kc-sales-page .sales-control,
body.hm-marche-app #content.kc-sales-page .kc-prep-panel,
body.hm-marche-app #content.kc-sales-page .kc-prepared-info{
  margin:0 0 12px !important;
  padding:15px !important;
  border:1px solid var(--hm-app-border) !important;
  border-radius:18px !important;
  background:#fff !important;
  box-shadow:var(--hm-app-shadow) !important;
}
body.hm-marche-app .kc-modal{
  align-items:flex-end !important;
  padding:0 !important;
}
body.hm-marche-app .kc-modal-backdrop{
  background:rgba(34,28,23,.48) !important;
  -webkit-backdrop-filter:blur(2px);
  backdrop-filter:blur(2px);
}
body.hm-marche-app .kc-modal-box{
  width:100% !important;
  max-width:680px !important;
  max-height:calc(92svh - env(safe-area-inset-top,0px)) !important;
  padding:18px 16px calc(16px + env(safe-area-inset-bottom,0px)) !important;
  border-radius:24px 24px 0 0 !important;
  box-shadow:0 -12px 38px rgba(34,28,23,.22) !important;
}
body.hm-marche-app .kc-modal-box::before{
  content:"";
  display:block;
  width:42px;
  height:5px;
  margin:-7px auto 12px;
  border-radius:999px;
  background:#d6d0c8;
}
body.hm-marche-app .kc-modal-title{
  margin:0 0 10px !important;
  text-align:left !important;
  font-size:1.25rem !important;
}
body.hm-marche-app .kc-step{
  padding:0 !important;
  border:0 !important;
  box-shadow:none !important;
}
body.hm-marche-app .kc-modal-actions{
  position:sticky;
  bottom:0;
  margin:14px -4px -4px !important;
  padding:8px 4px 0;
  background:linear-gradient(to bottom,rgba(255,255,255,0),#fff 18px);
}

/* 下部タブに隠れない安全余白。テンプレ内の過大な9rem/190px指定も解消 */
body.hm-marche-app #content,
body.hm-marche-app #content.hm-list-page,
body.hm-marche-app #content.hm-submit-page,
body.hm-marche-app #content.kc-sales-page{
  padding-bottom:28px !important;
}
body.hm-marche-app #site-footer{
  min-height:var(--hm-bottom-nav-space);
}

@media (max-width:560px){
  body.hm-marche-app :is(.hm-genre-children,.hm-work-genre-options){
    grid-template-columns:1fr !important;
  }
  body.hm-marche-app #content.hm-author-archive-page .author-archive-item{
    grid-template-columns:1fr;
    gap:2px;
  }
  body.hm-marche-app #content.hm-artist-list-page .sales-grid{
    grid-template-columns:1fr !important;
  }
  body.hm-marche-app #content.hm-artist-list-page .sales-item-link{
    grid-template-columns:72px minmax(0,1fr) !important;
  }
  body.hm-marche-app #content.hm-artist-list-page .sales-logo-wrap{
    width:72px !important;
    height:72px !important;
  }
}

@media (max-width:360px){
  body.hm-marche-app #content.hm-list-page .hm-work-grid{
    grid-template-columns:1fr !important;
  }
  body.hm-marche-app #fixed-footer-menu a .label{
    font-size:12.5px !important;
  }
}

@media (min-width:681px){
  body.hm-marche-app .kc-modal{
    align-items:center !important;
    padding:18px !important;
  }
  body.hm-marche-app .kc-modal-box{
    border-radius:24px !important;
  }
}

/* キーボード利用時だけ表示するスキップリンク */
body.hm-marche-app .hm-skip-link{
  position:fixed;
  z-index:99999;
  top:8px;
  left:8px;
  transform:translateY(-140%);
  min-height:44px;
  padding:10px 14px;
  border-radius:12px;
  background:#111;
  color:#fff;
  font-weight:900;
  text-decoration:none;
  transition:transform .12s ease;
}
body.hm-marche-app .hm-skip-link:focus{
  transform:translateY(0);
}
body.hm-marche-app #content[tabindex="-1"]:focus{
  outline:none !important;
}

/* アプリ画面では各ページ末尾のWeb型コピーライトを表示しない。サイト情報画面で確認できる。 */
body.hm-marche-app #site-footer .footer-copy{
  display:none !important;
}

/* =========================================================
   v1.4.1 出店ウィザード：hidden属性をアプリ用ボタン装飾より優先
   =========================================================
   v1.4.0ではボタンの display:inline-flex !important が hidden を上書きし、
   最終確認でも「とじる・戻る・次へ・セットする」が同時表示されていました。
   hiddenが付いた操作は必ず非表示にし、現在の段階で必要な操作だけを残します。
*/
body.hm-marche-app #content #sales-modal-close[hidden],
body.hm-marche-app #content #sales-modal-back[hidden],
body.hm-marche-app #content #sales-modal-next[hidden],
body.hm-marche-app #content #sales-modal-set[hidden]{
  display:none !important;
}

/* 出店ウィザードの操作列。最終確認は「とじる・戻る・セットする」の3操作。 */
body.hm-marche-app #content .kc-modal-actions{
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:8px !important;
}
body.hm-marche-app #content .kc-modal-actions > button{
  flex:1 1 0 !important;
  width:auto !important;
  min-width:0 !important;
}
@media (max-width:360px){
  body.hm-marche-app #content .kc-modal-actions{ gap:6px !important; }
  body.hm-marche-app #content .kc-modal-actions > button{
    padding-left:8px !important;
    padding-right:8px !important;
  }
}

