/* The editor sits around the same restaurant page the guest interacts with. */
.template-bar { position: sticky; top: 0; z-index: 9; background: var(--brand); color: var(--card); --focus: var(--leaf); }
.template-bar-inner { width: min(1392px,calc(100% - var(--gutter) * 2)); margin: auto; min-height: 64px; padding: 8px clamp(5px,2vw,32px); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.template-brand,.template-quick { display: flex; align-items: center; gap: 12px; min-width: 0; }
.template-brand img { width: 38px; height: 38px; padding: 4px; object-fit: contain; background: var(--leaf); border-radius: 8px; }
.template-brand strong { display: block; font-size: 16px; line-height: 1.2; }
.template-brand small { display: block; margin-bottom: 3px; font: 600 9px/1 var(--sans); letter-spacing: .13em; color: var(--leaf); }
.template-quick label { font-size: 13px; }
.template-quick input { min-width: 0; width: clamp(150px,23vw,315px); min-height: 40px; padding: 8px 13px; border: 1px solid #ffffff75; border-radius: 8px; color: var(--ink); background: var(--card); font-size: 15px; }
#template-toggle { min-height: 40px; border-radius: 999px; padding: 7px 17px; background: var(--leaf); color: var(--brand); font-size: 14px; font-weight: 650; line-height: 1.3; }
#template-toggle:hover { background: white; }
#template-poster { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 7px 15px; color: var(--card); border: 1px solid #ffffff80; border-radius: 999px; font-size: 14px; font-weight: 650; line-height: 1.3; white-space: nowrap; }
#template-poster [data-nav-icon] { display: flex; }
#template-poster:hover { background: #ffffff16; border-color: var(--card); }
#template-poster:disabled { opacity: .65; cursor: progress; }
.template-preview { min-width: 0; }
.template-bar:not([hidden]) + #template-layout .house-mast { top: var(--template-bar-height,64px); }
html:has(body[data-view="restaurant"] #template-bar:not([hidden])) { scroll-padding-top: calc(82px + var(--template-bar-height,64px)); }
#template-editor { min-width: 0; background: var(--card); color: var(--ink); padding: 18px 20px 22px; border-bottom: 1px solid var(--line); }
.template-editor-head,.template-editor-foot,.template-photo { display: flex; align-items: center; justify-content: space-between; gap: 7px; flex-wrap: wrap; }
.template-editor-head h2 { color: var(--brand); font-size: 20px; line-height: 1.3; }
.template-editor-head .close-modal { width: 40px; height: 40px; font-size: 24px; }
.template-hint { display: block; color: var(--soft); font-size: 12px; line-height: 1.5; }
.template-editor-head + p { margin: 0 0 14px; }
.template-field { min-width: 0; display: grid; gap: 5px; margin: 10px 0; font-size: 13px; font-weight: 650; color: var(--brand); }
.template-field :is(input,textarea,select),.template-time-row input {
  display: block; width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: white; color: var(--ink); font: 400 14px/1.45 var(--sans);
}
.template-field textarea { resize: vertical; }
.template-photo { justify-content: flex-start; }
#template-details details { margin-top: 10px; padding: 9px 0 2px; border-top: 1px solid var(--line); }
#template-details summary { padding: 4px 0; cursor: pointer; color: var(--brand); font-weight: 650; }
#template-details fieldset { border: 0; padding: 0; margin: 13px 0 9px; min-width: 0; }
#template-details legend { padding: 0 0 4px; color: var(--brand); font-size: 13px; font-weight: 650; }
#template-days { display: flex; flex-wrap: wrap; gap: 4px; }
#template-days label { position: relative; display: inline-flex; }
#template-days input { position: absolute; opacity: 0; }
#template-days span { display: grid; place-items: center; min-width: 32px; min-height: 34px; padding: 3px 6px; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
#template-days input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--card); }
#template-days input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.template-time-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) 31px; gap: 4px; align-items: center; margin: 4px 0; }
.template-time-row input { padding-inline: 5px; }
.template-time-row button { min-height: 38px; font-size: 19px; color: var(--brand); }
#template-status:empty { display: none; }
#template-status { margin-top: 9px; }
.template-editor-foot { margin-top: 15px; }
.template-preview #template-sign { position: absolute; inset: 0 auto auto 0; pointer-events: none; }
#restaurant-shell[data-personal] .house-signature { max-width: 38%; overflow-wrap: anywhere; }
#restaurant-shell[data-personal] .house-hero h1 { font-size: clamp(44px,6.1vw,91px); line-height: 1.04; overflow-wrap: anywhere; }
#personal-intro,.house-address address { white-space: pre-line; overflow-wrap: anywhere; }
#restaurant-shell[data-personal] #menu-title > [lang="pt"],#restaurant-shell[data-personal] #visit-title > [lang="pt"],
#restaurant-shell[data-personal] .house-visit h3 span[lang="pt"] { display: none; }
#restaurant-shell[data-personal] :is(#menu-title,#visit-title) small { display: block; margin: 0; color: inherit; font: 400 clamp(30px,3.4vw,50px)/1.15 var(--serif); letter-spacing: -.04em; }
.template-address-button { color: var(--leaf); text-decoration: underline; text-underline-offset: 4px; min-height: 42px; }
.personal-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: clamp(22px,4vw,62px); padding: 3px 0; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.personal-menu li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--brand); }
.personal-menu strong { min-width: 0; overflow-wrap: anywhere; font: 500 clamp(21px,2.15vw,31px)/1.25 var(--serif); }
.personal-menu .item-price { flex: none; max-width: 45%; overflow-wrap: anywhere; text-align: end; font-size: 15px; font-variant-numeric: tabular-nums; }
@media (min-width: 1051px) {
  #template-layout.is-editing { display: grid; grid-template-columns: clamp(296px,23vw,360px) minmax(0,1fr); align-items: start; }
  #template-editor { position: sticky; top: var(--template-bar-height,64px); max-height: calc(100dvh - var(--template-bar-height,64px)); overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--line); }
  .is-editing .house-mast-row { gap: 10px; padding-inline: 0; }
  .is-editing .house-nav { gap: 1px; }
  .is-editing .house-nav a { padding-inline: 10px; }
  .is-editing .house-hero h1 { font-size: clamp(52px,5.5vw,83px); }
  .is-editing .house-intro { padding-left: clamp(24px,3vw,48px); }
  .is-editing .dish-line { flex-wrap: wrap; gap: 3px 10px; }
}
@media (max-width: 1050px) {
  #template-editor { width: min(100%,720px); margin: 0 auto; }
}
@media (max-width: 900px) {
  .template-bar { position: static; }
  html:has(body[data-view="restaurant"] #template-bar:not([hidden])) { scroll-padding-top: 16px; }
  #inicio { scroll-margin-top: calc(var(--template-bar-height,0px) + var(--gutter) + 55px); }
  .template-bar-inner { padding-inline: 2px; }
  .template-quick label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
}
@media (max-width: 640px) {
  .template-bar-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "brand action" "name poster"; gap: 7px 8px; padding-block: 8px 10px; }
  .template-brand { grid-area: brand; gap: 8px; }
  .template-brand img { width: 32px; height: 32px; }
  .template-brand small { font-size: 8px; }
  .template-brand strong { font-size: 14px; }
  .template-quick { display: contents; }
  .template-quick input { grid-area: name; width: 100%; min-height: 39px; font-size: 16px; }
  #template-toggle { grid-area: action; max-width: 43vw; padding-inline: 12px; font-size: 12px; }
  #template-poster { grid-area: poster; justify-self: end; padding-inline: 11px; font-size: 12px; }
  #template-editor { padding-inline: var(--gutter); }
  .template-field :is(input,textarea,select),.template-time-row input { font-size: 16px; }
  #restaurant-shell[data-personal] .house-hero h1 { font-size: clamp(34px,9.8vw,56px); }
  #restaurant-shell[data-personal] .house-signature { max-width: 60%; }
  .personal-menu { grid-template-columns: 1fr; }
}

/* Global brand controls belong to the creator shell; restaurant themes stay independent. */
.template-bar .template-quick input{min-height:48px;font-size:16px;line-height:1.5}
.template-bar .template-quick button,.template-bar-actions button{min-height:48px;padding:10px 16px;border-radius:999px;font-size:14px;line-height:1.5}
.template-bar .template-quick{border-radius:12px}
.template-bar button:focus-visible,.template-bar input:focus-visible{outline:3px solid var(--xx-focus);outline-offset:3px}
