@font-face {
  font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('fonts/BarlowCondensed-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/BarlowCondensed-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('fonts/AtkinsonHyperlegible-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('fonts/AtkinsonHyperlegible-700.woff2') format('woff2');
}
:root {
  color-scheme: light;
  --paper: #F5F0E6; --card: #FFFDF8; --ink: #1E1B17; --muted: #5C554B;
  --border: #8C8273; --rule: #E6DDCD; --edge: #DDD3C2; --green: #1F6F43;
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
  background: var(--paper); color: var(--ink);
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
* { box-sizing: border-box; }
body { margin: 0; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button, a, input { touch-action: manipulation; }
button, .tab { -webkit-user-select: none; user-select: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--ink); text-underline-offset: 3px; }
input { min-width: 0; font-size: 16px; caret-color: var(--ink); }
svg { flex-shrink: 0; }
::selection { background: #F2C230; color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
a:active, button:active { opacity: .7; }
.app-shell {
  position: relative; width: 100%; max-width: 440px; height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.app-header { flex-shrink: 0; padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.detail-header { padding-bottom: 4px; }
.heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1, h2 { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; line-height: 1; }
h1 { font-size: 36px; overflow-wrap: anywhere; }
h2 { font-size: 22px; }
.warning { color: #8A5A00; font-weight: 700; }
.tabs { margin-top: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px; border-radius: 14px; background: var(--rule); }
.tab { gap: 6px; min-height: 44px; border-radius: 11px; font-size: 16px; text-decoration: none; display: flex; justify-content: center; align-items: center; text-align: center; }
.tab.selected { background: var(--card); font-weight: 700; }
.app-content {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 16px 24px;
  display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain;
  scrollbar-color: var(--border) var(--paper); scrollbar-width: thin;
}
.annunci-content { padding-top: 6px; }
.sold-price { font: 700 20px 'Barlow Condensed', sans-serif; color: #A3241A; }
.app-content > * { flex-shrink: 0; }
.card { border-radius: 18px; background: var(--card); border: 1.5px solid var(--border); display: flex; flex-direction: column; }
.item-summary { display: flex; align-items: center; gap: 14px; padding: 14px; text-decoration: none; }
.photo-placeholder { width: 112px; height: 112px; flex-shrink: 0; border-radius: 12px; background: var(--rule); }
.item-info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.item-title { font-size: 26px; overflow-wrap: anywhere; }
.price-tag { position: relative; align-self: flex-start; flex-shrink: 0; padding: 2px 12px 2px 24px; background: #D9B98C; font: 700 28px 'Barlow Condensed', sans-serif; clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%); white-space: nowrap; }
.price-hole { position: absolute; left: 12px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 4px; background: var(--card); }
.target, .subtitle { font-size: 15px; color: var(--muted); }
.subtitle.warning { color: #8A5A00; }
.listing-row { border-top: 1px solid var(--rule); padding: 12px 6px 12px 14px; display: flex; align-items: center; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.portal-tag { padding: 2px 10px 2px 20px; font: 700 18px 'Barlow Condensed', sans-serif; clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); flex-shrink: 0; }
.status { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
.stats { font-size: 16px; }
.reading-note { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.external-link { align-self: flex-start; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; }
.bottom-bar { flex-shrink: 0; padding: 12px 16px max(34px, env(safe-area-inset-bottom)); border-top: 1px solid var(--edge); background: var(--paper); }
.back-link { align-self: flex-start; min-height: 44px; display: flex; align-items: center; gap: 4px; margin-left: -6px; text-decoration: none; font-size: 17px; font-weight: 700; }
.item-heading { align-items: center; }
.item-heading .price-tag { align-self: center; font-size: 28px; }
.item-heading .price-hole { background: var(--paper); }
.release { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.step { display: flex; flex-direction: column; gap: 5px; color: var(--muted); }
.step-bar { height: 5px; border-radius: 3px; background: var(--rule); }
.step-label { font-size: 15px; font-weight: 700; }
.step.done { color: var(--ink); }
.step.done .step-bar { background: var(--ink); }
.step.online { color: var(--green); }
.step.online .step-bar { background: var(--green); }
.visits-card { overflow: hidden; }
.visit-chart { display: block; padding: 16px 14px 10px; height: auto; }
.chart-baseline { stroke: var(--rule); stroke-width: 1; }
.chart-bar { fill: var(--muted); }
.chart-bar.last { fill: var(--ink); font-weight: 700; }
.chart-date { font-family: 'Atkinson Hyperlegible', sans-serif; font-size: 12px; }
.chart-value { font: 700 16px 'Barlow Condensed', sans-serif; }
.secondary-visits { border-top: 1px solid var(--rule); padding: 12px 14px; font-size: 16px; }
.data-warning { margin: 0; font-size: 14px; line-height: 1.4; color: #8A5A00; }
.secondary-visits .data-warning { margin-top: 6px; }
.contact-warning { padding: 0 14px 12px; }
.small-tag { font-size: 16px; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-metric { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.contact-metric:nth-child(even) { border-left: 1px solid var(--rule); }
.contact-value { font: 700 40px/1 'Barlow Condensed', sans-serif; }
.contact-label { font-size: 16px; font-weight: 700; }
.reply-link { align-self: stretch; border-top: 1px solid var(--rule); min-height: 52px; padding: 0 14px; justify-content: space-between; text-decoration: none; }
.timeline { margin: 0; padding: 4px 14px; list-style: none; }
.timeline li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 10px 0; font-size: 15px; overflow-wrap: anywhere; }
.timeline li + li { border-top: 1px solid var(--rule); }
.event-date { color: var(--muted); }
.masked-phone { font-variant-numeric: tabular-nums; }
.switch-hit { position: relative; display: flex; align-items: center; width: 60px; height: 44px; flex-shrink: 0; justify-content: center; }
.phone-switch { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { width: 51px; height: 31px; border-radius: 16px; padding: 2px; background: var(--border); display: flex; justify-content: flex-start; }
.switch-track::before { content: ''; width: 27px; height: 27px; border-radius: 14px; background: var(--card); box-shadow: 0 1px 3px rgba(30,27,23,.3); }
.phone-switch:checked + .switch-track { background: var(--green); justify-content: flex-end; }
.phone-switch:focus-visible + .switch-track { outline: 3px solid var(--ink); outline-offset: 3px; }
.save-row { border-top: 1px solid var(--rule); padding: 10px 14px 12px; }
.portal-heading { padding: 14px; justify-content: space-between; }
.portal-facts { margin: 0; font-size: 16px; }
.portal-facts dt { color: var(--muted); }
.portal-facts dd { margin: 0; overflow-wrap: anywhere; }
.button { min-height: 56px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--ink); color: var(--card); font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.secondary-button { border: 1.5px solid var(--border); background: var(--card); color: var(--ink); font-size: 16px; }
.save-row .button { min-height: 46px; border-radius: 12px; }
.full-width { width: 100%; }
.access-card { padding: 14px; gap: 14px; }
.access-form { display: flex; flex-direction: column; gap: 10px; }
.access-form input:not([type='hidden']) { min-height: 52px; border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--card); }
.empty-state { margin: 0; padding: 14px 0; color: var(--muted); line-height: 1.45; }
.error-message { margin: 0; color: #B42318; line-height: 1.45; }

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-thickness: 2px; }
  .button:hover { opacity: .9; }
}

.tab-count { color: var(--muted); font-weight: 400; }
.tab-bar { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 8px max(8px, env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--edge); }
.tab-bar a { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 13px; }
.tab-bar a[aria-current='page'] { color: var(--ink); font-weight: 700; }
.nav-icon { width: 64px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.tab-bar a[aria-current='page'] .nav-icon { background: var(--rule); }
.section-content { gap: 22px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-title { font-size: 22px; }
.product-heading { display: flex; flex-direction: column; gap: 14px; }
.product-heading .subtitle { margin-top: -6px; }
.item-heading { flex-wrap: wrap; }
.item-heading h1 { min-width: 0; flex: 1; }
.item-photo { width: 112px; height: 112px; flex-shrink: 0; border-radius: 12px; object-fit: cover; object-position: 50% 55%; background: var(--rule); }
.hero-photo { display: block; width: 100%; height: 300px; border-radius: 18px; object-fit: cover; object-position: 50% 58%; background: var(--rule); }
.item-summary .price-tag { font-size: 26px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.chevron { color: var(--muted); }
.listing-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.listing-details .row { flex-wrap: wrap; }
.icon-link { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.icon-link svg { width: 18px; height: 18px; }
.status-dot { width: 12px; height: 12px; flex-shrink: 0; border: 2px solid currentColor; border-radius: 50%; }
.status-dot.filled { background: currentColor; }
.positive, .last-read .filled { color: var(--green); }
.muted { color: var(--muted); }
.danger { color: #B42318; }
.reading-note.warning { color: #8A5A00; }
.release + .release { border-top: 1px solid var(--rule); }
.release .reading-note { min-width: 0; }
.release-link { margin: -10px -4px -10px auto; font-size: 15px; flex-shrink: 0; }
.card > .empty-state { padding: 14px; }
.visits-card > .data-warning { padding: 0 14px 12px; }
.timeline li:first-child .event-date { color: var(--ink); font-weight: 700; }
.portal-facts > div { border-top: 1px solid var(--rule); padding: 12px 14px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.list-row { min-height: 52px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; }
.list-row + .list-row, .logout-form { border-top: 1px solid var(--rule); }
.list-row > :last-child { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.list-row strong { font-weight: 400; }
.list-row > .muted { flex-shrink: 0; }
.list-row:has(.switch-hit) { padding: 0 10px 0 14px; }
.last-read { display: flex; align-items: center; gap: 6px; }
.logout-button { width: 100%; min-height: 52px; border: 0; border-radius: 0 0 17px 17px; background: transparent; color: #A3241A; font-size: 16px; font-weight: 700; text-align: left; padding: 0 14px; }
.nowrap { white-space: nowrap; }

/* Vendi: the approved Foto / Scheda surfaces share the existing app shell. */
.tab-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tab-bar .vendi-icon { background: var(--ink); color: var(--card); }
.vendi-header { gap: 12px; padding-bottom: 8px; }
.vendi-top { display: flex; align-items: center; justify-content: space-between; }
.circle-button, .circle-spacer { width: 44px; height: 44px; flex-shrink: 0; }
.circle-button { display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--border); border-radius: 22px; background: var(--card); }
.vendi-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: 13px; }
.vendi-steps .step-bar { height: 4px; background: var(--edge); }
.vendi-steps [aria-current] { font-weight: 700; }
.vendi-content { padding-top: 8px; gap: 16px; }
#photo-flow { display: flex; flex-direction: column; gap: 16px; }
#photo-flow h1 { font-size: 38px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-tile { position: relative; min-width: 0; aspect-ratio: 1; border-radius: 12px; background: var(--rule); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
.cover-tile { grid-column: span 2; grid-row: span 2; }
.photo-number { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; display: grid; place-items: center; background: var(--ink); color: var(--card); border-radius: 13px; font-size: 14px; font-weight: 700; }
.photo-remove { position: absolute; top: 0; right: 0; }
.photo-remove button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--card); padding: 0; }
.photo-remove svg { padding: 5px; width: 26px; height: 26px; border-radius: 13px; background: rgba(30,27,23,.78); }
.cover-tag { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px 4px 16px; background: var(--card); font: 700 15px 'Barlow Condensed', sans-serif; clip-path: polygon(10px 0,100% 0,100% 100%,10px 100%,0 50%); }
.photo-cover { position: absolute; bottom: 0; left: 0; right: 0; }
.photo-cover button { min-height: 44px; width: 100%; border: 0; border-radius: 0 0 12px 12px; background: var(--card); color: var(--ink); font-size: 13px; }
.photo-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-buttons .button { min-height: 52px; gap: 8px; padding: 0 8px; }
.photo-empty { min-height: 420px; border: 2px dashed var(--border); border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.photo-empty > svg { width: 44px; height: 44px; color: var(--muted); }
.photo-empty .button { width: min(220px, 100%); min-height: 52px; }
.needs-photo { display: block; text-align: center; font-size: 14px; color: var(--muted); margin-top: 8px; }
.button:disabled { background: var(--edge); color: var(--muted); cursor: default; }
.editor-label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 15px; }
.editor-label h2 { color: var(--ink); }
.vendi-content :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), textarea, select) { min-width: 0; width: 100%; border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); padding: 12px 14px; font: 400 17px/1.4 'Atkinson Hyperlegible', sans-serif; }
.vendi-content textarea { resize: vertical; min-height: 76px; }
.vendi-content select { min-height: 52px; }
.sheet-heading { display: flex; align-items: center; gap: 12px; }
.sheet-heading > div:last-child { min-width: 0; }
.sheet-heading h1 { font-size: 34px; }
.sheet-heading img, .sheet-placeholder { width: 64px; height: 64px; flex-shrink: 0; object-fit: cover; border-radius: 12px; background: var(--rule); }
.sheet-editor { display: flex; flex-direction: column; gap: 16px; }
.data-fields, .delivery { border: 0; padding: 0; margin: 0; min-width: 0; }
.data-fields legend, .delivery legend { padding: 0 0 8px; font: 700 22px 'Barlow Condensed', sans-serif; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.data-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.data-field-head { display: flex; align-items: center; gap: 4px; }
.vendi-content .data-field-head input { flex: 1; border: 0; background: transparent; padding: 0; min-height: 36px; font-size: 16px; color: var(--muted); }
.data-field-head .icon-link { width: 36px; height: 36px; margin-right: -6px; }
button.icon-link { border: 0; background: transparent; color: var(--ink); padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.data-field .warning { font-size: 13px; }
.vendi-content .check-field input[name=field_value] { border: 2px solid #8A5A00; }
.text-button { min-height: 44px; border: 0; background: transparent; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: underline; text-underline-offset: 3px; }
.highlights .list-row { gap: 8px; padding-right: 4px; }
.highlights .icon-link { border: 0; background: transparent; }
.vendi-content .highlights input { border: 0; padding: 6px 0; }
.vendi-content .declare-label textarea { border-color: #8A5A00; background: #FBEFD2; }
.price-editor { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 60px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--card); }
.price-editor > span { width: 92px; flex-shrink: 0; color: var(--muted); font-size: 15px; }
.vendi-content .price-editor input { border: 0; text-align: right; padding: 0; font: 700 30px 'Barlow Condensed', sans-serif; }
.price-editor strong { font: 700 24px 'Barlow Condensed', sans-serif; }
.target-editor { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.target-editor > span:first-child { width: 106px; flex-shrink: 0; font-size: 15px; }
.vendi-content .target-editor input { text-align: right; font: 700 20px 'Barlow Condensed', sans-serif; padding: 12px 8px; }
.delivery-segments { display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; padding: 3px; background: var(--rule); }
.delivery-segments label { position: relative; }
.delivery-segments input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.delivery-segments span { min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 11px; }
.delivery-segments input:checked + span { background: var(--card); font-weight: 700; }
.delivery-segments input:focus-visible + span { outline: 3px solid var(--ink); }
.writing-card { padding: 16px; gap: 14px; border-radius: 16px; }
.skeleton { display: flex; flex-direction: column; gap: 6px; }
.skeleton span { width: 90px; height: 10px; border-radius: 5px; background: var(--rule); }
.skeleton div { height: 44px; border-radius: 12px; background: #EEE7DA; animation: writing-pulse 1.4s ease-in-out infinite alternate; }
.skeleton:nth-child(4) div { width: 62%; }
.skeleton:nth-child(6) div { width: 80%; }
@keyframes writing-pulse { to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skeleton div { animation: none; } }
.sheet-error { padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1.5px solid #B42318; border-radius: 16px; background: #FBE4E1; line-height: 1.45; }
.sheet-error > strong { color: #8F1C13; font-size: 18px; }
.delete-draft summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; text-decoration: underline; }
.delete-draft form { display: flex; flex-direction: column; gap: 12px; }
.delete-draft label { min-height: 44px; display: flex; align-items: center; gap: 8px; }
#upload-status:empty, #upload-errors:empty, .save-status:empty { display: none; }
.upload-error { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
