/* 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: 62px; padding: 8px clamp(5px,2vw,32px); display: grid; grid-template-columns: auto minmax(0,760px) auto; align-items: center; justify-content: space-between; gap: 5px clamp(12px,2vw,30px); }
.template-brand { display: flex; align-items: center; justify-self: start; gap: 12px; min-width: 0; min-height: 44px; }
:is(.template-brand,.brand):hover .wordmark > :first-child { text-decoration: underline; text-underline-offset: 3px; }
.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 { color: var(--leaf); }
.template-quick { display: flex; align-items: center; min-width: 0; width: 100%; gap: 4px; padding: 3px; border-radius: 12px; background: var(--card); }
.template-quick:focus-within { outline: 2px solid var(--leaf); outline-offset: 2px; }
.template-writing-field { display: grid; flex: 1; min-width: 0; }
/* The label reserves enough lines for the entire translated placeholder. */
.template-writing-field > * { grid-area: 1 / 1; min-width: 0; min-height: 38px; padding: 8px 10px; font: 400 15px/1.45 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.template-writing-field label { opacity: 0; pointer-events: none; user-select: none; }
.template-writing-field textarea { display: block; width: 100%; field-sizing: content; resize: none; border: 0; background: transparent; color: var(--ink); }
.template-writing-field textarea:not(:placeholder-shown) { max-height: 9em; }
.template-writing-field textarea::placeholder { color: var(--soft); opacity: 1; }
.template-writing-field textarea:focus { outline: 0; }
#template-generate { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 12px; border-radius: 9px; background: var(--leaf); color: var(--brand); font-size: 13px; font-weight: 700; }
#template-generate:not(:disabled):hover { background: var(--brand); color: var(--card); }
#template-generate:disabled { opacity: .72; cursor: default; }
#template-toggle { min-height: 40px; justify-self: end; border: 1px solid #ffffff75; border-radius: 999px; padding: 7px 15px; color: var(--card); font-size: 13px; font-weight: 650; line-height: 1.3; }
#template-toggle:hover { background: #ffffff16; border-color: var(--card); }
.template-bar-actions { display: flex; align-items: center; justify-content: flex-end; gap: clamp(8px,1.2vw,18px); }
.template-bar-actions a { display: inline-flex; align-items: center; min-height: 40px; color: var(--leaf); font-size: 14px; white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; }
.owner-event-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:.9rem; margin-top:1.15rem; }
.demo-evening-copy .owner-event-actions,.dining-site[data-cuisine-style="ramen"] .owner-event-actions { justify-content:flex-start; }
.dining-site .demo-evening .owner-event-actions .demo-button { margin:0; }
.event-poster-action { display:inline-flex; align-items:center; gap:.5rem; min-height:46px; padding:.55rem .9rem; border:1px solid currentColor; border-radius:3px; background:transparent; color:var(--room-light); font:600 .93rem/1.25 var(--sans); }
.event-poster-action:hover { text-decoration:underline; text-underline-offset:.25em; }
.event-poster-action [data-nav-icon] { display:grid; place-items:center; }
.dining-site[data-cuisine-style="coffee"] .event-poster-action { color:var(--room-ink); border-radius:2rem; }
.template-result { grid-column: 2; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; font-size: 13px; }
.template-result :is(button,a) { padding: 3px; color: var(--leaf); text-decoration: underline; text-underline-offset: 3px; }
#quick-status:empty { display: none; }
.template-new-actions { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; max-width: 100%; }
.template-new-actions button { min-height: 32px; }
#prompt-dialog { --focus: var(--brand); }
#prompt-options { display: grid; gap: 7px; }
#prompt-options button { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); text-align: start; }
#prompt-options button:is(:hover,:focus-visible) { border-color: var(--brand); }
#prompt-options strong { display: block; margin-bottom: 4px; color: var(--brand); font-size: 14px; }
#prompt-options span { display: block; font: 400 14px/1.5 var(--sans); overflow-wrap: anywhere; }
#quick-guest { font-weight: 700; }
#quick-publish { padding: 4px 12px; color: var(--brand); background: var(--leaf); border-radius: 999px; font-weight: 700; text-decoration: none; }
#quick-publish:hover { background: var(--card); }
.template-preview .demo-mast { color: var(--brand); background: var(--paper); }
.template-preview .demo-mast :is(.house-signature,.demo-nav a,.locale-choice) { color: inherit; }
.template-preview .demo-mast select { background: var(--card); border-color: var(--line); }
.template-preview .demo-mast :focus-visible { outline-color: var(--brand); }
.template-preview .demo-footer :is(.house-credit > span,.owner-entry) { color: var(--leaf); }
.template-preview .demo-visit :is(.template-address-button,.house-address a) { color: var(--brand); }
#restaurant-shell[data-personal] .demo-nav { grid-auto-flow: column; grid-template-columns: none; }
#restaurant-shell[data-personal] .house-signature { white-space: normal; }
#template-generate [data-nav-icon],#template-poster [data-nav-icon] { display: flex; }
#template-poster:disabled { opacity: .65; cursor: progress; }
.template-preview { min-width: 0; }
.template-invitation { margin-bottom: .5rem; color: var(--leaf); font-weight: 600; text-wrap: pretty; }
#restaurant-shell[data-personal] .template-invitation { display: none; }
.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-week { display: grid; gap: 4px; }
.weekday-hours { border-top: 1px solid var(--line); padding: 3px 0 6px; }
.weekday-hours > label { display: flex; min-height: 40px; align-items: center; gap: 8px; color: var(--brand); font-size: 14px; cursor: pointer; }
.weekday-hours input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
.weekday-hours .text-button { min-height: 36px; padding-inline: 0; font-size: 13px; }
.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; }
.house-event { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; margin-top: 12px; padding-left: 10px; border-left: 2px solid var(--leaf); overflow-wrap: anywhere; }
.house-event span { color: var(--leaf); font-size: 12px; }
.house-event strong { font-size: 16px; }
#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; }
  .template-bar:not([hidden]) + #template-layout .house-mast { top: 0; }
  html:has(body[data-view="restaurant"] #template-bar:not([hidden])) { scroll-padding-top: 7rem; }
  #inicio { scroll-margin-top: calc(var(--template-bar-height,0px) + var(--gutter) + 55px); }
  .template-bar-inner { padding-inline: 2px; }
}
@media (max-width: 640px) {
  .template-bar-inner { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "brand action" "prompt prompt" "feedback feedback"; gap: 0 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 { grid-area: prompt; margin-top: 6px; }
  .template-writing-field > * { font-size: 16px; padding: 6px 7px; line-height: 1.35; }
  .template-result { grid-area: feedback; margin-top: 5px; }
  .template-new-actions button { min-height: 44px; }
  #template-generate { min-height: 44px; padding-inline: 8px; }
  .template-bar-actions { grid-area: action; }
  #template-toggle { max-width: 40vw; padding-inline: 10px; 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; }
}
@media (max-width: 370px) {
  .template-bar-inner { padding-inline: 0; }
  .template-writing-field > * { padding-inline: 6px; }
}
@media (max-width: 440px) {
  #template-generate [data-nav-icon] { display: none; }
}
