/* Studio di Sara — tema chiaro «cipria»: avorio rosato, rosa antico, lilla e un filo d'oro. */
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-full-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-full-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }

:root {
	--bg: #fbf3ef;
	--bg-2: #f6e8e2;
	--card: rgba(255, 255, 255, 0.82);
	--card-solid: #ffffff;
	--line: #f0dcd5;
	--line-2: #e6c9c1;
	--ink: #3d2633;
	--ink-2: #6b4f5d;
	--muted: #9b8090;
	--rose: #c2577a;
	--rose-2: #d9778f;
	--rose-deep: #9f3f66;
	--rose-soft: #f9e3e8;
	--peach: #f6cdb9;
	--peach-soft: #fdeee6;
	--lilac: #9a82c9;
	--lilac-soft: #efe8f8;
	--gold: #b8925a;
	--gold-soft: #f6ecdc;
	--sage: #6f9a7b;
	--sage-soft: #e6f0e7;
	--danger: #c0504a;
	--danger-soft: #fbe6e3;
	--grad: linear-gradient(135deg, #e48aa3 0%, #c2577a 55%, #a8487a 100%);
	--grad-magic: linear-gradient(120deg, #c9a7ea 0%, #e99bb6 50%, #f4bb9c 100%);
	--shadow: 0 1px 2px rgba(120, 60, 80, 0.06), 0 10px 30px -12px rgba(160, 80, 110, 0.22);
	--shadow-lg: 0 20px 60px -20px rgba(150, 70, 100, 0.35);
	--r: 22px;
	--r-sm: 14px;
	--display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
	--ui: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--nav-h: 72px;
	color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, a, input, textarea, select { touch-action: manipulation; }
body {
	margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
	font: 16px/1.5 var(--ui); font-feature-settings: 'ss01';
	-webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* Petali sfumati sullo sfondo, fissi */
.petals { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.petals i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; }
.petals i:nth-child(1) { width: 520px; height: 520px; background: #f8cfd9; top: -180px; right: -140px; }
.petals i:nth-child(2) { width: 460px; height: 460px; background: #ecdcf7; bottom: -160px; left: -160px; }
.petals i:nth-child(3) { width: 360px; height: 360px; background: #fde0cf; top: 40%; left: 55%; opacity: 0.45; }

a { color: var(--rose); }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3, .display { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; font-variation-settings: 'SOFT' 100, 'WONK' 0; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.08; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 18px; }
em, .it { font-family: var(--display); font-style: italic; font-weight: 400; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }

/* ---------- Struttura ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.shell > div { min-width: 0; }
.side { display: none; }
main { padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1180px; width: 100%; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 4px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 11px; box-shadow: var(--shadow); }
.brand b { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 23px; font-variation-settings: 'SOFT' 100, 'WONK' 1; white-space: nowrap; }
.brand { min-width: 0; }
.brand span { display: block; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: -3px; }

.nav { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; display: flex; justify-content: space-around; height: var(--nav-h); padding: 8px; border-radius: 26px; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 18px; text-decoration: none; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.nav a svg { width: 23px; height: 23px; }
.nav a.on { color: var(--rose-deep); }
.nav a.on svg { stroke-width: 2.3; }
.nav a.on span { font-weight: 800; }
.nav a.create { color: #fff; background: var(--grad); box-shadow: 0 8px 20px -8px rgba(194, 87, 122, 0.8); margin: 0 4px; }
.nav a.create.on { background: var(--grad); color: #fff; }

@media (min-width: 960px) {
	.shell { grid-template-columns: 250px minmax(0, 1fr); }
	.side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100dvh; padding: 26px 18px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.45); backdrop-filter: blur(10px); }
	.side .brand { margin: 0 8px 26px; }
	.side a.item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
	.side a.item svg { width: 21px; height: 21px; }
	.side a.item:hover { background: rgba(255, 255, 255, 0.7); }
	.side a.item.on { background: var(--rose-soft); color: var(--rose-deep); }
	.side a.item.create { background: var(--grad); color: #fff; margin-bottom: 10px; box-shadow: 0 10px 24px -10px rgba(194, 87, 122, 0.8); }
	.side .foot { margin-top: auto; padding: 12px; }
	.nav, .top .brand { display: none; }
	.top { justify-content: flex-end; padding-top: 18px; }
	main { padding: 8px 36px 60px; }
}

/* ---------- Componenti ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 4px; }
.card h2 > svg { width: 21px; height: 21px; color: var(--rose); vertical-align: -3px; margin-right: 4px; }
.list-plain svg { width: 16px; height: 16px; vertical-align: -3px; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card-solid); color: var(--ink); font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform 0.15s, box-shadow 0.2s, background 0.2s; white-space: nowrap; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -10px rgba(194, 87, 122, 0.85); }
.btn.magic { background: var(--grad-magic); border-color: transparent; color: #4a2340; }
.btn.soft { background: var(--rose-soft); border-color: transparent; color: var(--rose-deep); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 56px; font-size: 16.5px; padding: 0 28px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--card-solid); cursor: pointer; color: var(--ink-2); }
.icon-btn svg { width: 20px; height: 20px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin: 0 0 6px 4px; }
label.field > small { display: block; color: var(--muted); font-size: 12.5px; margin: 5px 0 0 4px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=url], textarea, select {
	width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.92);
	font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; line-height: 1.5; min-height: 110px; }
input:focus, textarea:focus, select:focus { border-color: var(--rose-2); box-shadow: 0 0 0 4px rgba(217, 119, 143, 0.16); }
input[type=color] { width: 52px; height: 44px; border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; background: #fff; cursor: pointer; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { text-decoration: none; flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px 0 6px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.chip.plain { padding: 0 16px; }
.chip .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--display); font-style: italic; font-size: 15px; }
.chip.on { border-color: var(--rose); background: var(--rose-soft); color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(194, 87, 122, 0.12); }
.chip svg { width: 18px; height: 18px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.seg button svg { width: 17px; height: 17px; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg.rose button.on { background: var(--rose); border-color: var(--rose); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; background: var(--bg-2); color: var(--ink-2); }
.badge.bozza { background: var(--lilac-soft); color: #6a54a0; }
.badge.programmato { background: var(--gold-soft); color: #8a6a37; }
.badge.pubblicato { background: var(--sage-soft); color: #44704f; }
.badge.errore { background: var(--danger-soft); color: var(--danger); }
.badge.prova { background: var(--peach-soft); color: #a05a38; }

.net { display: inline-flex; gap: 4px; }
.net svg { width: 16px; height: 16px; color: var(--ink-2); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--peach-soft); color: #7a4a33; font-size: 14px; border: 1px solid #f6d6c5; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice.lilac { background: var(--lilac-soft); border-color: #e2d6f3; color: #5b4790; }
.notice.danger { background: var(--danger-soft); border-color: #f3cfca; color: var(--danger); }
.notice.sage { background: var(--sage-soft); border-color: #d3e5d6; color: #3e6a49; }

/* ---------- Home ---------- */
.hello { margin: 6px 4px 22px; }
.hello h1 em { color: var(--rose); }
.hello p { margin: 6px 0 0; color: var(--ink-2); }
.composer { position: relative; overflow: hidden; padding: 22px; }
.composer::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: var(--grad-magic); }
.composer h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.composer h2 svg { width: 22px; height: 22px; color: var(--rose); }
.composer textarea { min-height: 120px; font-size: 17px; background: #fff; border-radius: 18px; }
.composer .row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 14px; }
.composer .lbl { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 16px 2px 8px; }
.upload-thumb { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px; border-radius: 16px; background: #fff; border: 1px dashed var(--line-2); }
.upload-thumb button { margin-left: auto; }
.upload-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.composer .go { margin-top: 20px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 4px 12px; }
.section-title h2 { font-size: 24px; }
.section-title h2 em { color: var(--rose); }
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .posts { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .posts { grid-template-columns: repeat(4, 1fr); } }
.pcard { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--card-solid); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pcard .ph { aspect-ratio: 4 / 5; background: linear-gradient(160deg, var(--rose-soft), var(--lilac-soft)); display: grid; place-items: center; color: var(--rose-2); position: relative; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .ph svg { width: 34px; height: 34px; opacity: 0.6; }
.pcard .ph .badge { position: absolute; top: 10px; left: 10px; }
.pcard .bd { padding: 11px 13px 13px; }
.pcard .t { font-weight: 700; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .m svg { width: 14px; height: 14px; vertical-align: -2px; }
.pcard .m { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.empty { text-align: center; padding: 34px 20px; color: var(--ink-2); }
.empty > svg { width: 46px; height: 46px; color: var(--rose-2); margin: 0 auto 10px; }
.empty h3 { font-family: var(--display); font-style: italic; font-size: 22px; margin-bottom: 6px; }

/* ---------- Bozza ---------- */
.post-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.post-top .ttl { flex: 1; min-width: 0; }
.post-top h1 { font-size: clamp(24px, 4.6vw, 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-top .sub .dot { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-family: var(--display); font-style: italic; font-size: 12px; overflow: hidden; }
.post-top .sub .dot img { width: 100%; height: 100%; object-fit: contain; }
.post-top .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 14px; }
.studio { display: grid; gap: 18px; }
@media (min-width: 960px) { .studio { grid-template-columns: minmax(330px, 410px) 1fr; align-items: start; } .studio .preview-col { position: sticky; top: 16px; } }

.phone { background: #fff; border-radius: 34px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; max-width: 410px; margin: 0 auto; width: 100%; }
.phone .tabs { display: flex; gap: 6px; padding: 12px 12px 0; }
.phone .tabs button { flex: 1; min-height: 40px; border-radius: 14px; border: 0; background: var(--bg); cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.phone .tabs button svg { width: 17px; height: 17px; }
.phone .tabs button.on { background: var(--ink); color: #fff; }
.ig-head, .fb-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.ig-head .av, .fb-head .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--display); font-style: italic; font-size: 15px; overflow: hidden; }
.ig-head .av img, .fb-head .av img { width: 100%; height: 100%; object-fit: cover; }
.ig-head .av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e48aa3; }
.ig-head b, .fb-head b { font-size: 13.5px; }
.fb-head small { display: block; color: #8a8d91; font-size: 12px; }
.shot { position: relative; background: linear-gradient(160deg, var(--rose-soft), var(--lilac-soft)); display: grid; place-items: center; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .ph-msg { text-align: center; padding: 20px; color: var(--rose-deep); }
.shot .ph-msg svg { width: 36px; height: 36px; margin: 0 auto 8px; opacity: 0.7; }
.ig-actions { display: flex; gap: 14px; padding: 10px 14px 4px; }
.ig-actions svg { width: 24px; height: 24px; }
.ig-actions .sp { flex: 1; }
.cap { padding: 4px 14px 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; max-height: 300px; overflow: auto; }
.cap b { margin-right: 6px; }
.cap .tags { color: #2a5db0; }
.fb-text { padding: 0 14px 12px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; max-height: 260px; overflow: auto; }
.fb-bar { display: flex; justify-content: space-around; border-top: 1px solid #eee; padding: 10px; color: #65676b; font-size: 13.5px; font-weight: 600; }

.working { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 248, 246, 0.72); backdrop-filter: blur(4px); z-index: 2; }
.working .in { text-align: center; color: var(--rose-deep); font-weight: 650; }
.spark { width: 46px; height: 46px; margin: 0 auto 10px; animation: twirl 2.4s ease-in-out infinite; color: var(--rose); }
@keyframes twirl { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.15); } }
.shimmer { background: linear-gradient(90deg, #f6e8e2 0%, #fff 40%, #f6e8e2 80%); background-size: 200% 100%; animation: sh 1.4s linear infinite; border-radius: 10px; height: 14px; margin: 8px 0; }
@keyframes sh { to { background-position: -200% 0; } }

.tools .card { padding: 18px; }
.tools h2 { display: flex; align-items: center; gap: 9px; font-size: 20px; }
.tools h2 svg { width: 21px; height: 21px; color: var(--rose); }
.img-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.history { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; }
.history button { flex: none; width: 62px; height: 62px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--bg-2); }
.history button.on { border-color: var(--rose); }
.history img { width: 100%; height: 100%; object-fit: cover; }
.panel { margin-top: 12px; padding: 16px; border-radius: 18px; background: var(--bg); border: 1px solid var(--line); }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tpls button { text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 650; font-size: 13.5px; }
.tpls button small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; margin-top: 2px; line-height: 1.3; }
.tpls button.on { border-color: var(--rose); background: var(--rose-soft); }
.quality { display: grid; gap: 8px; margin-top: 12px; }
.quality button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 8px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; text-align: left; }
.quality button b { display: block; font-size: 15px; }
.quality button small { color: var(--muted); font-size: 12.5px; }
.quality button .cr { font-weight: 800; color: var(--rose-deep); white-space: nowrap; }
.quality button:hover { border-color: var(--rose-2); }
.credits { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; color: var(--ink-2); text-decoration: none; }
.credits svg { width: 16px; height: 16px; color: var(--gold); }
.credits > svg:first-child { color: var(--rose); }
.credits { white-space: nowrap; flex: none; }
.credits .lab { font-weight: 600; color: var(--muted); }
@media (max-width: 520px) { .credits .lab { display: none; } }
.usage-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -8px 4px 18px; font-size: 13.5px; color: var(--ink-2); }
.usage-strip .k { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.usage-strip b { color: var(--ink); }
.msg .meta { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.msg.sara .meta { color: rgba(255,255,255,0.6); }
.badge.cost { background: var(--gold-soft); color: #8a6a37; }
.badge.cost svg { width: 13px; height: 13px; }
table.usage { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
table.usage th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px 6px; }
table.usage td { padding: 7px 6px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.usage td:first-child { text-align: left; }
.warn-credits { margin-top: 10px; font-size: 13.5px; color: #8a6a37; background: var(--gold-soft); padding: 10px 12px; border-radius: 12px; }

.texttabs { display: flex; gap: 6px; margin-bottom: 10px; }
.counter { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }
.counter.over { color: var(--danger); font-weight: 700; }

.chat { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow: auto; padding: 4px 2px 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
.msg.sara { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.claude { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.claude::before { content: '✦ '; color: var(--rose); }
.ask { display: flex; gap: 8px; align-items: flex-end; }
.ask textarea { min-height: 48px; height: 48px; flex: 1; border-radius: 24px; padding: 12px 18px; }
.ask .icon-btn { width: 48px; height: 48px; background: var(--grad); border: 0; color: #fff; flex: none; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.quick button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.quick button:hover { border-color: var(--rose-2); color: var(--rose-deep); }

.actionbar { position: sticky; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 20; margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; border-radius: 24px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.actionbar .btn.primary { flex: 1 1 160px; }
.actionbar .when { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; font-size: 14px; color: #44704f; padding: 2px 6px; }
.actionbar .when svg { width: 18px; height: 18px; }
@media (min-width: 960px) { .actionbar { max-width: calc(100% - 428px); margin-left: auto; } .actionbar .when { flex: 1 1 auto; } }
@media (min-width: 960px) { .actionbar { bottom: 16px; } }

/* Foglio dal basso (programma, conferme) */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(61, 38, 51, 0.32); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s; }
.sheet { width: 100%; max-width: 520px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up 0.25s ease-out; max-height: 92dvh; overflow: auto; }
.sheet h2 { margin-bottom: 6px; }
.sheet .row { display: flex; gap: 10px; }
.sheet .row > * { flex: 1; }
.sheet .btns { display: flex; gap: 10px; margin-top: 16px; }
.sheet .btns .btn { flex: 1; }
@media (min-width: 720px) { .sheet-bg { align-items: center; } .sheet { border-radius: 28px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Calendario ---------- */
.day { margin-top: 20px; }
.day h3 { font-family: var(--display); font-style: italic; font-size: 20px; margin: 0 4px 10px; color: var(--rose-deep); text-transform: capitalize; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; background: var(--card-solid); border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.row-item + .row-item { margin-top: 8px; }
.row-item .thumb { width: 58px; height: 72px; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, var(--rose-soft), var(--lilac-soft)); flex: none; }
.row-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-item .tx { flex: 1; min-width: 0; }
.row-item .tx b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .time { font-family: var(--display); font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Account ---------- */
.acc { display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; color: inherit; }
.acc .av { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: #fff; font-family: var(--display); font-style: italic; font-size: 24px; flex: none; overflow: hidden; }
.acc .av img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.acc .tx { flex: 1; min-width: 0; }
.acc .tx b { font-size: 17px; }
.acc .links { display: flex; gap: 8px; margin-top: 4px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.ok-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); margin-right: 4px; }
.no-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-right: 4px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
.fonts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fonts button { padding: 12px 8px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.fonts button .aa { display: block; font-size: 28px; line-height: 1.1; }
.fonts button small { color: var(--muted); font-size: 12px; }
.fonts button.on { border-color: var(--rose); background: var(--rose-soft); }
.logo-box { display: flex; align-items: center; gap: 12px; }
.logo-box .lg { width: 64px; height: 64px; border-radius: 16px; border: 1px dashed var(--line-2); background: #fff; display: grid; place-items: center; overflow: hidden; }
.logo-box .lg img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Accesso ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate .card { width: 100%; max-width: 420px; padding: 30px 26px; text-align: center; }
.gate .flower { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.gate h1 { font-size: 34px; margin-bottom: 4px; }
.gate h1 em { color: var(--rose); }
.gate p { color: var(--ink-2); margin: 0 0 20px; }
.gate form { text-align: left; margin-top: 16px; }
.gate .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0 4px; }
.gate .or::before, .gate .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.err { color: var(--danger); font-size: 14px; margin: 8px 0 0; min-height: 1em; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); transition: 0.25s; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 960px) { #toast { bottom: 30px; } }

.list-plain { margin: 0; padding: 0; list-style: none; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
details summary { cursor: pointer; font-weight: 650; color: var(--ink-2); padding: 6px 0; }
.spacer { height: 10px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 14px; }
.hide { display: none !important; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Telefono (iPhone 16 Pro: 402 px) ---------- */
.credits .sep { width: 1px; height: 14px; background: var(--line-2); margin: 0 3px; }
@media (max-width: 520px) {
	.top { padding-left: 14px; padding-right: 14px; }
	.brand img { width: 32px; height: 32px; border-radius: 10px; }
	.brand b { font-size: 20px; }
	.brand span { font-size: 10px; }
	.credits { padding: 6px 11px; font-size: 13px; gap: 5px; }
	main { padding-left: 14px; padding-right: 14px; }
	.card { padding: 16px; }
	.composer { padding: 18px 16px; }
	.hello { margin-bottom: 16px; }
	h1 { font-size: 30px; }
	.post-top { gap: 10px; }
	.post-top h1 { font-size: 24px; }
	.post-top .icon-btn { flex: none; }
	/* Accesso: niente riquadro, tutto nello schermo, rispetto delle zone sicure */
	.gate { padding: calc(20px + env(safe-area-inset-top)) 22px calc(20px + env(safe-area-inset-bottom)); }
	.gate .card { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
	.gate .flower { width: 64px; height: 64px; border-radius: 19px; margin-bottom: 18px; }
	.gate h1 { font-size: 32px; }
	.gate p { margin-bottom: 14px; }
}
/* Pagine di dettaglio sul telefono: via il menu, la barra azioni prende il suo posto */
@media (max-width: 959px) {
	body.detail .nav { display: none; }
	body.detail main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
	body.detail #toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
	.actionbar { bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); flex-wrap: nowrap; gap: 6px; padding: 8px; border-radius: 22px; }
	body.detail .actionbar { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); margin: 0; }
	.actionbar .btn { padding: 0 14px; min-height: 48px; }
	.actionbar .btn.primary { flex: 1 1 auto; min-width: 0; }
	.actionbar .when { display: none; }
}
.gate .link { display: block; padding: 12px 8px; min-height: 44px; margin: 6px auto 0; background: none; border: 0; color: var(--rose-deep); font-weight: 650; font-size: 14.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ask textarea { overflow-y: hidden; max-height: 140px; resize: none; }
