/* ---------- variações de skin ---------- */
html[data-ring="dashed"] .lock-ring::before { border-style: dashed; }
html[data-ring="double"] .lock-ring::before { border-style: double; border-width: 11px; }
html[data-ring="neon"] .lock-ring::before { border-width: 4px; filter: drop-shadow(0 0 10px rgb(var(--c1) / .7)); }
html[data-ring="neon"] .lock-ring:not(.ok):not(.warn):not(.bad)::before { border-color: rgb(var(--c1) / .8); }

html:not([data-pattern="none"]) .fluid::before { content: ""; position: absolute; inset: 0; }
html[data-pattern="dots"] .fluid::before {
	background-image: radial-gradient(rgb(var(--line-rgb) / .12) 1.6px, transparent 1.8px);
	background-size: 22px 22px;
}
html[data-pattern="grid"] .fluid::before {
	background-image: linear-gradient(rgb(var(--line-rgb) / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(var(--line-rgb) / .07) 1px, transparent 1px);
	background-size: 28px 28px;
}
html[data-pattern="stars"] .fluid::before {
	background-image:
		radial-gradient(1.6px 1.6px at 20px 30px, rgb(var(--ink-rgb)), transparent),
		radial-gradient(1.2px 1.2px at 90px 80px, rgb(255 255 255 / .8), transparent),
		radial-gradient(2px 2px at 150px 20px, rgb(255 255 255 / .9), transparent),
		radial-gradient(1.2px 1.2px at 60px 140px, rgb(255 255 255 / .7), transparent),
		radial-gradient(1.6px 1.6px at 190px 120px, #fff, transparent);
	background-size: 210px 180px;
	opacity: .55;
}
html[data-pattern="waves"] .fluid::before {
	background-image: repeating-radial-gradient(circle at 50% 120%, transparent 0 22px, rgb(var(--line-rgb) / .06) 22px 24px);
}

/* mascote: o "rosto" do afinador */
.mascot {
	position: absolute;
	left: 14.6%;
	top: 14.6%;
	transform: translate(-50%, -50%);
	z-index: 3;
	width: clamp(40px, 7dvh, 54px);
	height: clamp(40px, 7dvh, 54px);
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(22px, 3.8dvh, 30px);
	line-height: 1;
	background: rgb(var(--panel-rgb) / .92);
	border: 1px solid rgb(var(--c1) / .55);
	box-shadow: 0 0 22px rgb(var(--c1) / .35);
	user-select: none;
}

.lock-ring.ok .mascot { animation: hop .9s ease-in-out infinite; }

@keyframes hop {
	0%, 100% { transform: translate(-50%, -50%); }
	50% { transform: translate(-50%, calc(-50% - 6px)); }
}

@media (prefers-reduced-motion: reduce) {
	.lock-ring.ok .mascot { animation: none; }
}

/* ---------- linha de baixo: afinação + skin ---------- */
.controls {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.controls .tuning-btn {
	flex: 1;
	width: auto;
	min-width: 0;
}

.skin-btn {
	flex: 0 0 auto;
	width: 54px;
	padding: 0;
	border-radius: 999px;
	font-size: 24px;
	line-height: 1;
	background: rgb(var(--panel-rgb) / calc(.55 * var(--glass)));
	border: 1px solid rgba(148, 163, 184, .28);
	-webkit-backdrop-filter: blur(calc(14px * var(--glass)));
	backdrop-filter: blur(calc(14px * var(--glass)));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.skin-btn:active { transform: scale(.95); }

/* ---------- painéis ---------- */
.sheet-panel .row { display: flex; gap: 8px; }

.tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	margin-bottom: 12px;
	border-radius: 999px;
	background: rgb(var(--panel-rgb) / .7);
	border: 1px solid var(--panel-border);
}

.tab {
	flex: 1;
	width: auto;
	padding: 9px 6px;
	border-radius: 999px;
	font-size: 13px;
	background: transparent;
	color: var(--muted);
	box-shadow: none;
}

.tab[aria-selected="true"] {
	background: linear-gradient(135deg, var(--a1), var(--a2));
	color: #fff;
}

.sheet-sub {
	margin: 0 0 12px;
	text-align: center;
	font-size: 13px;
	color: var(--muted);
}

.skin-list { display: grid; gap: 8px; }

.skin-card {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 18px;
	border: 1px solid var(--panel-border);
	background: rgb(var(--panel-rgb) / .6);
	text-align: left;
	cursor: pointer;
}

.skin-card:focus-visible { outline: 2px solid rgb(var(--c2)); outline-offset: 2px; }

.skin-card[aria-current="true"] {
	border-color: transparent;
	background:
		linear-gradient(rgb(var(--panel-rgb) / .94), rgb(var(--panel-rgb) / .94)) padding-box,
		linear-gradient(135deg, var(--a1), var(--a2)) border-box;
}

.sw {
	width: 48px;
	height: 48px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	border: 1px solid rgba(255, 255, 255, .18);
}

.sk-name { font-size: 15px; font-weight: 800; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.sk-meta { margin-top: 2px; font-size: 12px; color: var(--muted); }
.sk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--muted); text-align: right; }
.sk-rank { font-size: 13px; font-weight: 900; color: #f5f5d6; }
.sk-check { color: var(--green); font-weight: 900; }

.mini-btn {
	width: auto;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	background: rgb(var(--panel-rgb) / .8);
	border: 1px solid var(--panel-border);
	color: #cbd5e1;
	box-shadow: none;
}

.sheet-foot {
	position: sticky;
	/* o painel tem espaço interno embaixo (18px + a barra de início do iPhone); o rodapé compensa isso para encostar na base */
	bottom: calc(-18px - env(safe-area-inset-bottom));
	margin: 12px -16px calc(-18px - env(safe-area-inset-bottom));
	padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
	background: linear-gradient(180deg, transparent, rgb(var(--base-rgb) / .96) 38%);
}

.btn2 {
	margin-top: 8px;
	padding: 14px;
	font-size: 16px;
	background: rgb(var(--panel-rgb) / .8);
	border: 1px solid rgba(148, 163, 184, .3);
	color: #e2e8f0;
	box-shadow: none;
}

.empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- editor ---------- */
.ed-preview {
	position: sticky;
	top: -10px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	margin: 0 0 14px;
	border-radius: 20px;
	border: 1px solid var(--panel-border);
	background: rgb(var(--panel-rgb) / .97);
	box-shadow: 0 8px 24px rgb(0 0 0 / .35);
}

.pv-ring {
	position: relative;
	flex: 0 0 66px;
	width: 66px;
	height: 66px;
	border-radius: 999px;
	border: 5px solid rgb(var(--c1) / .75);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--note-font);
	font-size: 34px;
	font-weight: 900;
	color: #fff;
}

html[data-ring="dashed"] .pv-ring { border-style: dashed; }
html[data-ring="double"] .pv-ring { border-style: double; border-width: 8px; }
html[data-ring="neon"] .pv-ring { border-width: 3px; box-shadow: 0 0 14px rgb(var(--c1) / .7); }

.pv-ring .pv-mascot {
	position: absolute;
	left: -8px;
	top: -8px;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-family: Arial, sans-serif;
	background: rgb(var(--panel-rgb));
	border: 1px solid rgb(var(--c1) / .6);
}

.pv-info { min-width: 0; flex: 1; }
.pv-name { font-size: 15px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-phrase { margin-top: 2px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-btn { display: inline-block; margin-top: 6px; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); }

.ed-sec { margin-bottom: 16px; }
.ed-label { margin-bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.inp {
	width: 100%;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid var(--panel-border);
	background: rgb(0 0 0 / .28);
	color: #fff;
	font-size: 16px;
	font-family: Arial, sans-serif;
	outline: none;
}

.inp:focus { border-color: rgb(var(--c2)); }
.inp + .inp { margin-top: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
	width: auto;
	padding: 9px 13px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	color: var(--text);
	background: rgb(var(--panel-rgb) / .7);
	border: 1px solid var(--panel-border);
	box-shadow: none;
}

.chip[aria-pressed="true"] {
	border-color: transparent;
	background:
		linear-gradient(rgb(var(--panel-rgb) / .96), rgb(var(--panel-rgb) / .96)) padding-box,
		linear-gradient(135deg, var(--a1), var(--a2)) border-box;
	border: 1px solid transparent;
}

.chip.emo { padding: 6px 10px; font-size: 22px; line-height: 1.2; }

.presets { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }

.preset {
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 999px;
	border: 2px solid rgba(255, 255, 255, .2);
	box-shadow: none;
}

.preset[aria-pressed="true"] { border-color: #fff; }

.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.col { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }

.col input[type="color"] {
	width: 100%;
	height: 38px;
	padding: 0;
	border: 1px solid var(--panel-border);
	border-radius: 12px;
	background: none;
}

.ed-err { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.35; color: #fecaca; background: rgb(239 68 68 / .16); border: 1px solid rgb(239 68 68 / .35); }
.ed-err[hidden] { display: none; }
.ed-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

.share-box {
	margin: 0 0 14px;
	padding: 12px 14px;
	border-radius: 14px;
	background: rgb(0 0 0 / .28);
	border: 1px solid var(--panel-border);
	font-size: 14px;
	color: #cbd5e1;
	word-break: break-all;
	text-align: center;
}

/* ---------- aviso (skin aberta por link) ---------- */
.toast {
	position: fixed;
	left: 50%;
	bottom: calc(env(safe-area-inset-bottom) + 14px);
	z-index: 20;
	width: min(calc(100% - 28px), 432px);
	padding: 14px;
	border-radius: 22px;
	transform: translate(-50%, 140%);
	transition: transform 260ms ease;
	background: rgb(var(--panel-rgb) / .97);
	border: 1px solid rgb(var(--c1) / .5);
	box-shadow: 0 16px 40px rgb(0 0 0 / .5);
}

.toast.show { transform: translate(-50%, 0); }
.toast[hidden] { display: none; }
.toast-text { margin: 0 0 10px; font-size: 14px; line-height: 1.4; color: #e2e8f0; }
.toast-text b { color: #fff; }
.toast .row .btn2 { margin-top: 0; flex: 1; }
.toast .row .go { flex: 1.4; margin-top: 0; padding: 12px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
	.toast { transition: none; }
}

/* telas estreitas: o nome da afinação tem prioridade sobre as notas */
@media (max-width: 430px) {
	.controls .tuning-btn { gap: 8px; padding-left: 14px; padding-right: 12px; }
	.controls .tuning-btn .t-chev { display: none; }
	.controls .t-notes { gap: 2px; }
	.controls .t-notes span { min-width: 17px; padding: 4px 2px; font-size: 10px; }
	.controls .tuning-btn .t-name { font-size: 14px; }
}

/* rodapé do editor/galeria: um botão principal e duas ações pequenas */
.sheet-foot .row { margin-top: 8px; }
.sheet-foot .row .btn2 { flex: 1; margin-top: 0; padding: 11px 8px; font-size: 14px; }

/* painéis sólidos: o desfoque atrás de áreas com rolagem falha em alguns navegadores */
.sheet-panel {
	background: linear-gradient(180deg, rgb(var(--panel-rgb)), rgb(var(--base-rgb)));
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

.ed-preview { background: rgb(var(--panel-rgb)); }

.toast .row { display: flex; gap: 8px; }
.privacy { margin: 14px 0 0; text-align: center; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* pré-visualização do editor: faixa de largura total, sem cantos por onde o conteúdo apareça */
.ed-preview {
	margin: 0 -16px 14px;
	padding: 12px 16px;
	border-radius: 0;
	border-width: 1px 0;
	box-shadow: 0 10px 20px rgb(0 0 0 / .3);
}


/* ---------- janelas (galeria, editor, avisos): sempre escuras, qualquer que seja a skin ---------- */
.sheet, .toast {
	--panel-rgb: 15 23 42;
	--base-rgb: 2 6 23;
	--ink: #ffffff;
	--ink2: #e2e8f0;
	--text: #f8fafc;
	--muted: #94a3b8;
	--ink-rgb: 255 255 255;
	--line-rgb: 255 255 255;
	color: #f8fafc;
}

/* a pré-visualização do editor mostra as cores reais da skin */
.ed-preview { background: var(--base); color: var(--sk-ink, #fff); }
.ed-preview .pv-phrase { color: var(--sk-muted, #94a3b8); }
.ed-preview .pv-ring { color: var(--sk-ink, #fff); }

/* ---------- tema claro (fundo claro): ajustes da tela principal ---------- */
html[data-tone="light"] .state-pill { color: var(--ink2); border-color: rgb(0 0 0 / .18); }
html[data-tone="light"] .state-pill.ok { color: #166534; background: rgb(34 197 94 / .2); border-color: rgb(22 163 74 / .55); }
html[data-tone="light"] .state-pill.warn { color: #92400e; background: rgb(245 158 11 / .2); border-color: rgb(217 119 6 / .55); }
html[data-tone="light"] .state-pill.bad { color: #991b1b; background: rgb(239 68 68 / .16); border-color: rgb(220 38 38 / .5); }
html[data-tone="light"] .lock-card { border-color: rgb(0 0 0 / .14); box-shadow: 0 18px 44px rgb(0 0 0 / .16), inset 0 1px 0 rgb(255 255 255 / .6); }
html[data-tone="light"] .note { text-shadow: none; }
html[data-tone="light"] .notes button { border: 1px solid rgb(0 0 0 / .16); box-shadow: 0 4px 12px rgb(0 0 0 / .12); }
html[data-tone="light"] .tuning-btn,
html[data-tone="light"] .skin-btn { border-color: rgb(0 0 0 / .2); box-shadow: none; }
html[data-tone="light"] .mini-bars span { background: rgb(0 0 0 / .14); }
html[data-tone="light"] .mascot { background: rgb(var(--base-rgb) / .9); }

/* ---------- editor: estilo do afinador, texto e fundo ---------- */
.disp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.disp-card {
	width: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 4px 10px;
	border-radius: 18px;
	font-size: 12px;
	font-weight: 800;
	color: var(--text);
	background: rgb(var(--panel-rgb) / .7);
	border: 1px solid var(--panel-border);
	box-shadow: none;
}

.disp-card[aria-pressed="true"] {
	border-color: transparent;
	background:
		linear-gradient(rgb(var(--panel-rgb) / .96), rgb(var(--panel-rgb) / .96)) padding-box,
		linear-gradient(135deg, var(--a1), var(--a2)) border-box;
	border: 1px solid transparent;
}

.disp-ic svg { display: block; width: 38px; height: 38px; }

.text-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.text-row .col { width: 120px; }

.media-box { display: flex; align-items: center; gap: 12px; margin-top: 14px; }

.media-thumb {
	position: relative;
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgb(0 0 0 / .3);
	border: 1px solid var(--panel-border);
}

.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-thumb .none { font-size: 28px; opacity: .6; }
.media-thumb .play { position: relative; font-size: 22px; color: #fff; text-shadow: 0 1px 6px rgb(0 0 0 / .7); }

.media-right { flex: 1; min-width: 0; }
.media-status { margin-bottom: 8px; font-size: 13px; color: #cbd5e1; }
.media-right .row { flex-wrap: wrap; }
.media-right .row .btn2,
.file-btn { margin-top: 0; flex: 1 1 auto; }

.file-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 11px 10px;
	border-radius: 30px;
	font-size: 14px;
	font-weight: 900;
	color: #e2e8f0;
	background: rgb(var(--panel-rgb) / .8);
	border: 1px solid rgba(148, 163, 184, .3);
	cursor: pointer;
	text-align: center;
}

.btn2[hidden], .dim-row[hidden] { display: none; }

.dim-row { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); }
.dim-row input[type="range"] { display: block; width: 100%; margin: 8px 0 0; accent-color: rgb(var(--c1)); }

/* ícone do estilo escolhido, na pré-visualização */
.pv-ring .pv-an, .pv-ring .pv-st { display: none; width: 32px; height: 32px; }
.pv-ring .pv-an svg, .pv-ring .pv-st svg { display: block; width: 100%; height: 100%; }
html[data-display="analog"] .pv-ring .pv-d, html[data-display="strobe"] .pv-ring .pv-d { display: none; }
html[data-display="analog"] .pv-ring .pv-an { display: block; }
html[data-display="strobe"] .pv-ring .pv-st { display: block; }

/* declaração de direitos (foto/vídeo publicado) e botão de denunciar */
.chip.consent { display: block; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 16px; text-align: left; white-space: normal; font-size: 13px; font-weight: 600; line-height: 1.4; }
.chip.consent[hidden] { display: none; }
.mini-btn.flag { color: #fca5a5; }
.toast .mini-btn.flag { display: block; width: 100%; }

/* com foto ou vídeo no fundo, o texto ganha uma sombra suave para continuar legível em qualquer cena */
html[data-media="1"][data-tone="dark"] .note,
html[data-media="1"][data-tone="dark"] .octave,
html[data-media="1"][data-tone="dark"] .alt-note .n,
html[data-media="1"][data-tone="dark"] .alt-note .o,
html[data-media="1"][data-tone="dark"] .guidance-main,
html[data-media="1"][data-tone="dark"] .guidance-sub,
html[data-media="1"][data-tone="dark"] .freq,
html[data-media="1"][data-tone="dark"] .brand { text-shadow: 0 1px 10px rgb(0 0 0 / .65), 0 0 2px rgb(0 0 0 / .5); }
html[data-media="1"][data-tone="light"] .note,
html[data-media="1"][data-tone="light"] .octave,
html[data-media="1"][data-tone="light"] .alt-note .n,
html[data-media="1"][data-tone="light"] .alt-note .o,
html[data-media="1"][data-tone="light"] .guidance-main,
html[data-media="1"][data-tone="light"] .guidance-sub,
html[data-media="1"][data-tone="light"] .freq,
html[data-media="1"][data-tone="light"] .brand { text-shadow: 0 1px 10px rgb(255 255 255 / .7), 0 0 2px rgb(255 255 255 / .6); }

/* sobre foto/vídeo o texto de apoio usa a cor principal (não a "apagada") e uma sombra mais forte */
html[data-media="1"] .guidance-sub,
html[data-media="1"] .freq { color: var(--ink2); }

html[data-media="1"][data-tone="dark"] .note,
html[data-media="1"][data-tone="dark"] .octave,
html[data-media="1"][data-tone="dark"] .alt-note .n,
html[data-media="1"][data-tone="dark"] .alt-note .o,
html[data-media="1"][data-tone="dark"] .guidance-main,
html[data-media="1"][data-tone="dark"] .guidance-sub,
html[data-media="1"][data-tone="dark"] .freq,
html[data-media="1"][data-tone="dark"] .brand { text-shadow: 0 1px 3px rgb(0 0 0 / .85), 0 2px 14px rgb(0 0 0 / .7); }

/* topo: só o nome à esquerda e o botão Instalar à direita (o selo de estado fica escondido) */
.state-pill[hidden] { display: none; }
.top { min-height: 38px; }

/* ---------- conta, formulários e estatísticas ---------- */
.acct-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px 14px;
	margin-bottom: 4px;
	border-radius: 18px;
	border: 1px solid var(--panel-border);
	background: linear-gradient(135deg, rgb(var(--c1) / .16), rgb(var(--c2) / .12));
}

.acct-txt { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; }
.acct-txt b { font-size: 15px; color: #fff; }
.acct-txt span { font-size: 12px; color: #cbd5e1; line-height: 1.35; }
.acct-btns { display: flex; gap: 8px; }
.acct-card .mini-btn { padding: 8px 14px; font-size: 13px; font-weight: 800; }

.fld { display: block; margin-bottom: 10px; }
.fld span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.show-pw { margin: -2px 0 10px; }
.auth-links { margin-top: 10px; flex-wrap: wrap; }
.auth-links .btn2 { flex: 1 1 auto; margin-top: 0; font-size: 14px; padding: 11px 8px; }

.code-box {
	margin: 0 0 12px;
	padding: 16px 10px;
	border-radius: 16px;
	border: 1px dashed rgb(var(--c2) / .8);
	background: rgb(0 0 0 / .3);
	text-align: center;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: .06em;
	color: #fff;
	user-select: all;
	-webkit-user-select: all;
}

.danger-btn { color: #fca5a5; }
.danger-go { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.sk-stats { margin-top: 4px; font-size: 12px; color: #cbd5e1; line-height: 1.4; }

.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat-tile { padding: 12px; border-radius: 16px; border: 1px solid var(--panel-border); background: rgb(var(--panel-rgb) / .7); text-align: center; }
.stat-n { font-size: 26px; font-weight: 900; color: #fff; line-height: 1.1; }
.stat-l { margin-top: 4px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.chart { margin: 12px 0 6px; padding: 8px 6px 2px; border-radius: 16px; border: 1px solid var(--panel-border); background: rgb(0 0 0 / .22); }
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar { fill: var(--a1); }
.chart .bar.zero { fill: rgb(148 163 184 / .25); }
.chart .cl { fill: #94a3b8; font-size: 9px; font-family: Arial, sans-serif; }

/* login com Google */
.g-wrap { margin-top: 14px; text-align: center; }
.or-sep { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--panel-border); }
.g-holder { display: flex; justify-content: center; min-height: 44px; }
.priv-link { display: block; margin-top: 10px; font-size: 12px; color: #93c5fd; text-align: center; }
.privacy .priv-link { display: inline; margin: 0 0 0 4px; }

/* botão ✓ "Pronto" sobre o campo em edição (fecha o teclado) */
.inp { padding-right: 54px; }

.done-btn {
	position: absolute;
	z-index: 30;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	font-weight: 900;
	line-height: 1;
	color: #fff;
	background: linear-gradient(135deg, var(--a1), var(--a2));
	box-shadow: 0 4px 12px rgb(0 0 0 / .45);
}

.done-btn[hidden] { display: none; }

/* anel "vazio": sem o círculo em volta da nota (o estado continua visível nas barrinhas, no ✓ e nos textos) */
html[data-ring="none"] .lock-ring::before,
html[data-ring="none"] .lock-ring::after,
html[data-ring="progress"] .lock-ring::before,
html[data-ring="progress"] .lock-ring::after,
html[data-ring="orb"] .lock-ring::before,
html[data-ring="orb"] .lock-ring::after,
html[data-ring="clock"] .lock-ring::before,
html[data-ring="clock"] .lock-ring::after {
	border-color: transparent !important;
	box-shadow: none !important;
	background: none !important;
	animation: none !important;
	filter: none !important;
}

html[data-ring="none"] .pv-ring { border-color: transparent; box-shadow: none; }


/* ---------- anéis que acompanham a afinação: Progresso, Orbe e Relógio ---------- */
.lock-ring { --orb: var(--c1); --tick: var(--ink2); --closeness: 0; }
.lock-ring.ok { --orb: 34 197 94; --tick: var(--green); --prog: var(--green); }
.lock-ring.warn { --orb: 245 158 11; --tick: var(--yellow); --prog: var(--yellow); }
.lock-ring.bad { --orb: 239 68 68; --tick: var(--red); --prog: var(--red); }

.ring-prog, .ring-orb, .ring-clock { display: none; position: absolute; inset: 0; pointer-events: none; }
html[data-ring="progress"] .ring-prog { display: block; width: 100%; height: 100%; overflow: visible; }
html[data-ring="orb"] .ring-orb { display: block; }
html[data-ring="clock"] .ring-clock { display: block; }

/* Progresso: o anel se completa conforme a corda chega perto da afinação */
.rp-bg { fill: none; stroke: var(--ring-idle); stroke-width: 6; }
.rp-fg {
	fill: none;
	stroke: var(--prog, var(--ink2));
	stroke-width: 6;
	stroke-linecap: round;
	stroke-dasharray: calc(var(--closeness) * 100) 100;
	transform: rotate(-90deg);
	transform-origin: 50% 50%;
	transition: stroke-dasharray 220ms ease, stroke 200ms ease;
}
.lock-ring.ok .rp-fg { filter: drop-shadow(0 0 3px rgb(34 197 94 / .9)); }

/* Orbe: um brilho sem linha, que cresce e acende conforme a corda chega perto */
.ring-orb {
	inset: 6%;
	border-radius: 999px;
	background: radial-gradient(circle, rgb(var(--orb) / .9) 0%, rgb(var(--orb) / .38) 46%, transparent 72%);
	transform: scale(calc(.5 + .5 * var(--closeness)));
	opacity: calc(.4 + .6 * var(--closeness));
	filter: blur(1.5px);
	transition: transform 260ms ease, opacity 260ms ease, background 200ms ease;
}
.lock-ring:not(.ok):not(.warn):not(.bad) .ring-orb { animation: orbBreath 3.4s ease-in-out infinite; }
.lock-ring.ok .ring-orb { animation: orbBreath 1.2s ease-in-out infinite; }
@keyframes orbBreath { 0%, 100% { transform: scale(calc(.5 + .5 * var(--closeness))); } 50% { transform: scale(calc(.58 + .5 * var(--closeness))); } }

/* Relógio: 36 marquinhas ao redor da nota que vão acendendo no sentido horário */
.ring-clock i { position: absolute; left: 50%; top: 0; width: 0; height: 50%; transform-origin: 0 100%; transform: rotate(calc(var(--i) * 10deg)); }
.ring-clock i::after {
	content: "";
	position: absolute;
	left: -2.5px;
	top: 0;
	width: 5px;
	height: 22%;
	border-radius: 3px;
	background: var(--tick);
	opacity: calc(.16 + .84 * clamp(0, var(--n, 0) - var(--i), 1));
	transition: opacity 160ms ease, background 200ms ease;
}
.lock-ring.ok .ring-clock i::after { box-shadow: 0 0 8px rgb(34 197 94 / .8); }

@media (prefers-reduced-motion: reduce) {
	.lock-ring .ring-orb { animation: none !important; }
	.rp-fg, .ring-orb, .ring-clock i::after { transition: none; }
}

/* miniatura do editor */
html[data-ring="progress"] .pv-ring { border-color: rgb(var(--ink-rgb) / .18); border-top-color: var(--a1); border-right-color: var(--a1); box-shadow: none; }
html[data-ring="orb"] .pv-ring { border-color: transparent; box-shadow: 0 0 22px 4px rgb(var(--c1) / .7), inset 0 0 18px rgb(var(--c1) / .45); }
html[data-ring="clock"] .pv-ring { border-style: dotted; border-width: 5px; border-color: var(--a1); box-shadow: none; }

/* paletas prontas: 7 por linha em qualquer tela (14 paletas = 2 linhas completas) */
.presets { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.preset { width: 100%; max-width: 54px; height: auto; aspect-ratio: 1; justify-self: center; }

/* caixa de confirmação (no lugar do confirm() do navegador) */
.cbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgb(0 0 0 / 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background 180ms ease, backdrop-filter 180ms ease; }
.cbox.show { background: rgb(0 0 0 / .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* a caixa de confirmação é sempre escura, não importa a cor do afinador (em afinadores claros o texto branco sumia) */
.cbox-card { --panel-rgb: 15 23 42; --base-rgb: 2 6 23; --panel-border: rgba(148, 163, 184, .3); --muted: #94a3b8; --c1: 255 43 214; --c2: 124 58 237; width: min(100%, 340px); padding: 20px 18px 16px; border-radius: 22px; text-align: center; background: rgb(15 23 42 / .98); border: 1px solid rgb(255 255 255 / .18); box-shadow: 0 20px 50px rgb(0 0 0 / .55); transform: scale(.94); opacity: 0; transition: transform 180ms ease, opacity 180ms ease; }
.cbox.show .cbox-card { transform: none; opacity: 1; }
.cbox-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.cbox-text { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: #cbd5e1; }
.cbox .row { display: flex; gap: 10px; }
.cbox .row .btn2 { flex: 1; margin-top: 0; }
.cbox .row .go { flex: 1.2; margin-top: 0; padding: 12px; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .cbox, .cbox-card { transition: none; } }

/* com uma janela aberta, o fundo do sistema (a faixa que o iPhone deixa abaixo da página) fica na cor do fundo das janelas */
html { transition: background-color 220ms ease; }
/* com foto/vídeo de fundo, a faixa embaixo da página usa a cor da borda de baixo da imagem */
html[data-media="1"] { background-color: rgb(var(--edge-b-rgb, var(--base-rgb))); background-image: linear-gradient(rgb(var(--edge-t-rgb, var(--base-rgb))), rgb(var(--edge-b-rgb, var(--base-rgb)))); background-repeat: no-repeat; }
html:has(.sheet.open) { background: #020617; }

/* selo dos afinadores da conta oficial (@afina2) */
.badge-of { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; vertical-align: 2px; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); }

/* fonte monoespaçada (estilo terminal): vale também para os textos do afinador, não só para a nota */
html[data-font="mono"] .guidance-main,
html[data-font="mono"] .guidance-sub,
html[data-font="mono"] .freq,
html[data-font="mono"] #startBtn { font-family: var(--note-font); }

/* botão de compartilhar o afinador (ao lado do 🎨) */
.share-btn { width: 50px; color: var(--ink, #fff); display: inline-flex; align-items: center; justify-content: center; }
.share-btn svg { display: block; }

/* com o botão de compartilhar, as notas da afinação saem do botão (elas já aparecem na fileira de cima) para o nome caber */
.controls .t-notes { display: none; }
.controls .tuning-btn .t-chev { display: inline; }

/* editor em passos */
.ed-step[hidden] { display: none; }
.ed-steps { display: flex; gap: 6px; margin: 0 0 14px; }
.ed-stp { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-width: 0; padding: 8px 4px; border-radius: 999px; font-size: 13px; color: var(--muted); background: rgb(var(--panel-rgb) / .7); border: 1px solid var(--panel-border); box-shadow: none; }
.ed-stp .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(148,163,184,.25); color: #fff; }
.ed-stp.done .n { background: rgb(34 197 94 / .7); }
.ed-stp[aria-current="step"] { color: #fff; border-color: var(--a1, #ff2bd6); }
.ed-stp[aria-current="step"] .n { background: linear-gradient(135deg, var(--a1), var(--a2)); }
.adv-btn { margin: 10px 0; padding: 10px; font-size: 14px; }
.adv-btn[hidden], .ed-adv[hidden], .ed-steps[hidden] { display: none; }
@media (max-width: 360px) { .ed-stp .l { font-size: 12px; } }

/* ---------- editor "toque e edite" ---------- */
html[data-editing] main.app { transform-origin: 50% 0; transform: translateY(var(--ed-top, 56px)) scale(var(--ed-s, .9)); transition: transform .25s ease; }
html[data-editing] main.app, html[data-editing] main.app * { cursor: pointer; -webkit-user-select: none; user-select: none; }
html[data-editing] .mascot, html[data-editing] .guidance, html[data-editing] #startBtn, html[data-editing] #audioNotes, html[data-editing] #tuningBtn { outline: 1.5px dashed rgba(255, 255, 255, .38); outline-offset: 4px; }
html[data-editing] .ed-sel { outline: 2.5px solid #ff2bd6 !important; outline-offset: 4px; box-shadow: 0 0 22px rgba(255, 43, 214, .6); }
html[data-editing]:has(.sheet.open) { background: var(--base); }
.sheet.ed-mode { background: transparent !important; pointer-events: none; }
.sheet.ed-mode .sheet-panel { pointer-events: auto; max-height: clamp(210px, 31dvh, 270px); padding-top: 12px; }
.sheet.ed-mode .sheet-handle, .sheet.ed-mode .sheet-title { display: none; }
/* a gaveta do editor fica sempre colada na base, também no computador (lá os outros painéis abrem no centro) */
.sheet.ed-mode { align-items: flex-end !important; }
.ed-grp[hidden], .ed-dh [hidden] { display: none; }
.ed-dh { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.ed-dh b { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #cbd5e1; }
.ed-x { width: auto; padding: 6px 12px; font-size: 13px; background: rgb(var(--panel-rgb) / .8); border: 1px solid rgba(148, 163, 184, .3); color: #e2e8f0; box-shadow: none; border-radius: 999px; }
.ed-hintbox p { margin: 0 0 6px; font-size: 15px; color: #e2e8f0; }
.ed-more { display: grid; gap: 8px; } .ed-more .btn2 { margin: 0; padding: 12px; font-size: 15px; text-align: left; }
#edTop { --panel-rgb: 15 23 42; --base-rgb: 2 6 23; position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: linear-gradient(rgba(2, 6, 23, .94), rgba(2, 6, 23, .6)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
.ed-ib { flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); box-shadow: none; }
.ed-ib:disabled { opacity: .35; }
.ed-name { flex: 1; min-width: 0; width: auto; padding: 9px 12px; border-radius: 999px; font-size: 15px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .08); border: 1px dashed rgba(255, 255, 255, .35); box-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-pub { flex: 0 0 auto; width: auto; padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff2bd6, #7c3aed); border: 0; box-shadow: 0 6px 18px rgba(124, 58, 237, .45); }
.ed-grp .ed-sec + .ed-sec, .ed-grp .colors + .ed-sec { margin-top: 14px; }
.ed-grp > .ed-sec:only-child > .ed-label:first-child { display: none; }
.colors.cols4 { grid-template-columns: repeat(4, 1fr); gap: 6px; } .colors.cols4 .col { align-items: stretch; text-align: center; white-space: nowrap; }

/* fundo selecionado no editor: o mesmo contorno rosa dos outros elementos, mas na tela inteira */
html[data-ed-bg]::after { content: ""; position: fixed; inset: 0; z-index: 39; pointer-events: none; border: 2.5px solid #ff2bd6; box-shadow: inset 0 0 26px rgba(255, 43, 214, .6); }

/* mais texturas de fundo */
html[data-pattern="stripes"] .fluid::before { background-image: repeating-linear-gradient(45deg, rgb(var(--line-rgb) / .08) 0 2px, transparent 2px 16px); }
html[data-pattern="checker"] .fluid::before { background-image: conic-gradient(rgb(var(--line-rgb) / .07) 25%, transparent 0 50%, rgb(var(--line-rgb) / .07) 0 75%, transparent 0); background-size: 48px 48px; }
html[data-pattern="diamonds"] .fluid::before { background-image: linear-gradient(45deg, rgb(var(--line-rgb) / .16) 0 2px, transparent 2px), linear-gradient(-45deg, rgb(var(--line-rgb) / .16) 0 2px, transparent 2px); background-size: 34px 34px; }
html[data-pattern="rays"] .fluid::before { background-image: repeating-conic-gradient(from 0deg at 50% 38%, rgb(var(--line-rgb) / .08) 0 5deg, transparent 5deg 14deg); }
html[data-pattern="plus"] .fluid::before { background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc0NCcgaGVpZ2h0PSc0NCc+PHBhdGggZD0nTTIyIDE2djEyTTE2IDIyaDEyJyBzdHJva2U9J3doaXRlJyBzdHJva2Utb3BhY2l0eT0nLjE2JyBzdHJva2Utd2lkdGg9JzEuOCcgc3Ryb2tlLWxpbmVjYXA9J3JvdW5kJyBmaWxsPSdub25lJy8+PC9zdmc+"); background-size: 44px 44px; }
html[data-pattern="zigzag"] .fluid::before { background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc0MCcgaGVpZ2h0PScxNic+PHBhdGggZD0nTTAgMTEgMTAgNSAyMCAxMSAzMCA1IDQwIDExJyBzdHJva2U9J3doaXRlJyBzdHJva2Utb3BhY2l0eT0nLjEzJyBzdHJva2Utd2lkdGg9JzEuNicgZmlsbD0nbm9uZScvPjwvc3ZnPg=="); background-size: 40px 16px; }
html[data-pattern="noise"] .fluid::before { background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNjAnIGhlaWdodD0nMTYwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nLjg1JyBudW1PY3RhdmVzPScyJyBzdGl0Y2hUaWxlcz0nc3RpdGNoJy8+PGZlQ29sb3JNYXRyaXggdmFsdWVzPScwIDAgMCAwIDEgMCAwIDAgMCAxIDAgMCAwIDAgMSAwIDAgMCAuOSAwJy8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScgZmlsdGVyPSd1cmwoI24pJyBvcGFjaXR5PScuMjInLz48L3N2Zz4="); background-size: 160px 160px; }
html[data-tone="light"][data-pattern="plus"] .fluid::before, html[data-tone="light"][data-pattern="zigzag"] .fluid::before, html[data-tone="light"][data-pattern="noise"] .fluid::before { filter: invert(1); }

/* títulos do editor com destaque e respiro em cima e embaixo */
.ed-label { margin: 24px 0 12px; padding: 7px 10px; border-radius: 0 10px 10px 0; background: linear-gradient(90deg, rgb(var(--c1, 255 43 214) / .24), rgb(var(--c2, 124 58 237) / .09) 62%, rgb(var(--c2, 124 58 237) / 0)); border-left: 3px solid var(--a1, #ff2bd6); font-size: 15px; font-weight: 800; letter-spacing: .06em; line-height: 1.2; color: #fff; }
.ed-grp > .ed-label:first-child, .ed-grp > .ed-sec:first-child > .ed-label:first-child, .ed-sec:first-child > .ed-label:first-child { margin-top: 4px; }
.ed-dh b { font-size: 17px; letter-spacing: .04em; color: #fff; }
.ed-grp .ed-sec + .ed-sec, .ed-grp .colors + .ed-sec { margin-top: 0; }

/* área do mostrador (a mesma caixa tracejada para digital, analógico e estroboscópico) */
.ed-area { display: none; position: fixed; z-index: 30; pointer-events: none; box-sizing: border-box; border: 1.5px dashed rgba(255, 255, 255, .38); border-radius: 18px; }
html[data-editing] .ed-area { display: block; }
.ed-area.ed-sel { border: 2.5px solid #ff2bd6; box-shadow: 0 0 22px rgba(255, 43, 214, .6); }

/* cor do texto: o campo de cor e o botão "Automática" na mesma linha, com a mesma altura */
.ed-grp .text-row { align-items: stretch; gap: 10px; }
.ed-grp .text-row .col { width: auto; flex: 1; min-width: 0; }
.ed-grp .text-row .col span { display: none; }
.ed-grp .text-row .col input[type="color"] { height: 46px; }
.ed-grp .text-row .chip { flex: 0 0 auto; height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; margin: 0; }

/* botão "+" (Meus afinadores / criar) ao lado do compartilhar */
.skin-btn.plus-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--ink, #fff); }
.skin-btn.plus-btn svg { display: block; }

/* botão "Salvar" (sem publicar) na barra de cima do editor */
.ed-save { flex: 0 0 auto; width: auto; padding: 10px 14px; border-radius: 999px; font-size: 15px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .28); box-shadow: none; }
#edTop { gap: 6px; }
.ed-name { padding: 9px 10px; }

/* link da política de privacidade: só o link, sem sublinhado */
.priv-link, .privacy .priv-link { text-decoration: none; }
.mini-btn.mini-danger { color: #fca5a5; border-color: rgba(248,113,113,.45); }

/* editor, painel Fundo: o brilho verde de "afinada" liga e desliga de forma suave; a legenda explica o que a pessoa está vendo */
html[data-editing] .fluid i { transition: opacity .6s ease; }
html[data-ed-glow="off"] .fluid i { opacity: 0 !important; }
#edGlowNote { position: fixed; left: 50%; bottom: calc(var(--ed-ph, 0px) + 10px); transform: translateX(-50%); z-index: 31; max-width: calc(100vw - 24px); padding: 7px 14px; border-radius: 999px; background: rgba(8, 12, 24, .82); border: 1px solid rgba(255, 255, 255, .18); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: center; white-space: nowrap; pointer-events: none; }
#edGlowNote[hidden] { display: none; }

/* fontes de largura fixa (Digital e Máquina) ocupam mais espaço: o texto de apoio encolhe com a largura da tela para não quebrar a linha */
html[data-font="mono"] .guidance-sub,
html[data-font="typewriter"] .guidance-sub { font-size: clamp(10px, calc((100vw - 76px) / 24), 14px); }

/* cartões de "Meus afinadores": miniatura e texto em cima, botões numa linha na base */
.skin-card.mine-card { grid-template-columns: 48px 1fr; align-items: start; row-gap: 10px; }
.mine-card .sk-actions { grid-column: 1 / -1; display: flex; gap: 6px; }
.mine-card .sk-actions .mini-btn { flex: 1 1 auto; padding: 8px 6px; text-align: center; white-space: nowrap; }
.mine-card .sk-actions { flex-wrap: wrap; }
@media (max-width: 340px) { .mine-card .sk-actions .mini-btn { padding: 8px 4px; font-size: 11px; } }

/* editor mais compacto: fontes, botões, campos e células de cor um pouco menores (cabe mais coisa na gaveta de baixo) */
.ed-grp .chip { padding: 7px 11px; font-size: 13px; }
.ed-grp .chip.emo { padding: 4px 8px; font-size: 19px; }
.ed-grp .chip.consent { padding: 8px 11px; font-size: 12px; }
.ed-grp .inp { padding: 9px 12px; border-radius: 12px; }   /* a fonte dos campos fica em 16px: menor que isso faz o iPhone dar zoom ao tocar */
.ed-grp .btn2 { padding: 10px 12px; font-size: 14px; }
.ed-grp .presets { gap: 8px 6px; margin-bottom: 6px; }
.ed-grp .preset { max-width: 34px; border-width: 1.5px; }
.ed-grp .col { font-size: 10.5px; }
.ed-grp .col input[type="color"] { height: 32px; border-radius: 10px; }
.ed-grp .text-row .col input[type="color"] { height: 38px; }
.ed-grp .text-row .chip { height: 38px; padding: 0 16px; }
.ed-grp .disp-card { padding: 9px 4px 8px; gap: 4px; font-size: 11.5px; border-radius: 16px; }
.ed-grp .disp-ic svg { width: 30px; height: 30px; }
.ed-grp .ed-label { margin: 18px 0 9px; padding: 5px 10px; font-size: 13.5px; }
.ed-grp > .ed-label:first-child, .ed-grp > .ed-sec:first-child > .ed-label:first-child, .ed-sec:first-child > .ed-label:first-child { margin-top: 2px; }
.ed-dh b { font-size: 15px; }
.ed-x { padding: 5px 10px; font-size: 12.5px; }
.ed-hintbox p { font-size: 14px; }
.ed-grp .ed-hint { font-size: 11.5px; }
.dim-row { font-size: 11.5px; }
.ed-save, .ed-pub { padding: 8px 12px; font-size: 14px; }
.ed-name { font-size: 14px; padding: 8px 10px; }
.ed-ib { width: 36px; height: 36px; font-size: 16px; }

/* paleta escolhida: circulada com um anel branco por fora */
.ed-grp .preset[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px #0b1220, 0 0 0 4px rgba(255, 255, 255, .95); }

/* ===== padrão único dos elementos do editor =====
   mesma altura, mesma fonte e mesmo alinhamento em todos os painéis: botões de escolha, campos, células de cor, rótulos e textos de apoio */
.ed-grp { --ed-h: 36px; --ed-fs: 13px; --ed-fs-s: 11px; --ed-r: 12px; --ed-gap: 8px; }
.ed-grp .chip, .ed-grp .btn2, .ed-grp .inp { min-height: var(--ed-h); font-size: var(--ed-fs); border-radius: var(--ed-r); }
.ed-grp .chip { display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; }
.ed-grp .chip.emo { font-size: 19px; border-radius: 999px; }
.ed-grp .chip.consent { display: block; padding-top: 8px; padding-bottom: 8px; text-align: left; }
.ed-grp .inp { font-size: 16px; }   /* 16px nos campos: menos que isso o iPhone dá zoom ao tocar */
.ed-grp .chips { gap: var(--ed-gap); }
/* todas as células de cor: mesmo tamanho, legenda centralizada embaixo, em qualquer grupo (fundo, texto, botão) */
.ed-grp .colors, .ed-grp .colors.cols4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ed-grp .col { display: flex; flex-direction: column; align-items: stretch; gap: 3px; text-align: center; font-size: var(--ed-fs-s); white-space: nowrap; }
.ed-grp .col input[type="color"], .ed-grp .text-row .col input[type="color"] { height: var(--ed-h); border-radius: var(--ed-r); }
.ed-grp .text-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; align-items: start; }
.ed-grp .text-row .col { grid-column: span 3; width: auto; }
.ed-grp .text-row .chip { grid-column: 4; height: var(--ed-h); padding: 0 8px; }
/* rótulos e textos de apoio */
.ed-grp .ed-label { font-size: 13px; }
.ed-grp .ed-hint, .dim-row { font-size: var(--ed-fs-s); }
.ed-hintbox p { font-size: 12.5px; }
.ed-grp .chip:not(.consent), .ed-grp .btn2, .ed-grp .inp { box-sizing: border-box; height: var(--ed-h); min-height: 0; }

/* gaveta do editor: sempre escura e opaca (igual à barra de cima), qualquer que seja a cor do afinador, e "sangra" para baixo.
   No iPhone a área desenhada às vezes termina antes do fim da tela; com o fundo da página escuro na edição e a gaveta se estendendo para baixo,
   a faixa que sobra fica da mesma cor da gaveta, sem aparecer uma cor clara sob ela. */
html[data-editing] { background: #020617 !important; }
.sheet.ed-mode .sheet-panel {
	--panel-rgb: 15 23 42; --base-rgb: 2 6 23;
	background: linear-gradient(180deg, rgb(15 23 42), rgb(2 6 23) 70%);
	box-shadow: 0 -20px 60px rgba(0, 0, 0, .5), 0 90px 0 0 rgb(2 6 23);   /* cópia deslocada 90px para baixo: cobre a faixa que sobra embaixo (a gaveta tem no mínimo 128px de altura, então não deixa vão) */
	-webkit-backdrop-filter: none; backdrop-filter: none;
}

/* na edição a barra de cima já cobre o notch e a gaveta já cobre a barra de início: o afinador não precisa reservar esse espaço de novo (era o vão grande no topo e embaixo) */
html[data-editing] body { padding-top: 0; padding-bottom: 0; }

/* botões de escolha do editor: peso normal, e negrito só no que está selecionado */
.ed-grp .chip { font-weight: 400; }
.ed-grp .chip[aria-pressed="true"] { font-weight: 700; }
.ed-grp .chip.consent { font-weight: 400; }
.ed-grp .chip.consent[aria-pressed="true"] { font-weight: 700; }

/* a lista de afinadores esconde o painel (e o escurecimento) quando Entrar / Criar conta abre por cima */
.sheet.quiet { background: transparent !important; }
.sheet.quiet .sheet-panel { visibility: hidden; }

/* tela de estatísticas: uma fonte pequena e única (os números grandes dos quadros são a única exceção) */
.stats-pane, .stats-pane .inst-note, .stats-pane .ed-hint, .stats-pane .chip, .stats-pane .btn2, .stats-pane .stat-l, .stats-pane .chart text { font-size: 11.5px; line-height: 1.4; letter-spacing: 0; }
.stats-pane .chart text { font-size: 9px; }
.stats-pane .stat-n { font-size: 20px; }
.stats-pane .chip { padding: 6px 10px; font-weight: 400; }
.stats-pane .chip[aria-pressed="true"] { font-weight: 700; }
.stats-pane .btn2 { padding: 10px; }

/* com o teclado aberto, a gaveta do editor fica acima dele */
html[data-editing] #editSheet { bottom: var(--kb, 0px); transition: bottom .18s ease; }
html[data-editing] #editSheet .sheet-panel { max-height: calc(clamp(210px, 31dvh, 270px)); }

/* código de 6 números do login por e-mail */
.fld .inp.code-inp { font-size: 26px; font-weight: 800; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
/* atalho "Pôr uma foto no afinador" no topo de Meus afinadores */
.quick-card { display: block; width: 100%; margin: 4px 0 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,.18); background: linear-gradient(135deg, rgb(var(--c1) / .30), rgb(var(--c3, var(--c1)) / .30)); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.quick-card b { display: block; font-size: 16px; margin-bottom: 3px; }
.quick-card span { display: block; font-size: 13px; opacity: .85; line-height: 1.35; }
.toast .row { display: flex; gap: 8px; } .toast .row button { flex: 1; margin: 0; }
.hear-btn { display: flex; align-items: center; justify-content: center; gap: 8px; } .hear-btn svg { flex: none; }   /* ícone e texto na mesma linha */
