/* Os controles da casa: a escolha, o dia e a hora (campos.js). Nenhum menu suspenso nem calendário do navegador aparece no cosmOS. */
select[hidden] { display: none !important; }

/* o campo fechado: um botão com a cara dos outros campos */
.c-campo { display: inline-flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 36px; padding: 0 10px; border-radius: 6px; font-size: 14.5px; text-align: left; color: var(--tinta); background: rgba(var(--f), .075); cursor: pointer; transition: background-color .16s ease, box-shadow .16s ease; }
.c-campo > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-campo .c-seta { flex: none; color: var(--tinta-3); transition: transform .16s var(--ease-out); }
.c-campo[aria-expanded="true"] .c-seta { transform: rotate(180deg); }
.c-campo.vazio > span { color: var(--tinta-3); }
.c-campo:disabled { opacity: .55; cursor: default; }
.c-campo:focus-visible, .c-campo[aria-expanded="true"] { outline: none; background: rgba(var(--f), .11); box-shadow: inset 0 0 0 1px rgba(var(--f), .26); }
.c-cor { flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--cor, var(--laranja)); }
input.c-hora { text-align: center; cursor: pointer; }
input.c-hora:focus { cursor: text; }
@media (hover: hover) and (pointer: fine) { .c-campo:not(:disabled):hover { background: rgba(var(--f), .11); } }

/* onde os campos moram */
.f-quando .c-campo-dia { width: auto; min-width: 148px; }
.f-quando input.c-hora { width: 74px; }
.f-et .c-campo { flex: 1; }

/* a janelinha que abre colada no campo */
.c-pop { position: fixed; z-index: 1200; max-width: calc(100vw - 16px); padding: 5px; border-radius: 8px; color: var(--tinta); background: var(--sup-folha); -webkit-backdrop-filter: blur(36px) saturate(180%); backdrop-filter: blur(36px) saturate(180%); box-shadow: var(--brilho), 0 22px 50px -18px rgba(0, 0, 0, .85); animation: c-surge .14s var(--ease-out); }
@keyframes c-surge { from { opacity: 0; transform: scale(.96); } }
:root[data-tema="claro"] .c-pop {
  color-scheme: light; --f: 0, 0, 0;
  --tinta: #1d1d1f; --tinta-2: rgba(29, 29, 31, .76); --tinta-3: rgba(29, 29, 31, .64);
  --laranja-claro: var(--marca-no-claro);
  --brilho: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 0 0 1px rgba(0, 0, 0, .07);
}

/* a lista de escolhas */
.c-lista { display: flex; flex-direction: column; gap: 4px; max-height: min(320px, calc(100vh - 32px)); overflow-y: auto; overscroll-behavior: contain; }
.c-item { flex: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 30px; padding: 4px 10px; border-radius: 5px; text-align: left; font-size: 14px; color: var(--tinta); cursor: pointer; }
.c-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-item .ico { flex: none; color: var(--laranja-claro); visibility: hidden; }
.c-item.on { font-weight: 600; }
.c-item.on .ico { visibility: visible; }
.c-item:disabled { opacity: .45; cursor: default; }
.c-item:focus-visible { outline: none; box-shadow: none; background: rgba(var(--f), .12); }
.c-item:not(:disabled):active { background: rgba(var(--laranja-rgb), .5); }
@media (hover: hover) and (pointer: fine) { .c-item:not(:disabled):hover { background: rgba(var(--f), .1); } }
.c-pop-horas .c-lista { max-height: min(232px, calc(100vh - 32px)); }
.c-pop-horas .c-item { justify-content: center; text-align: center; }
.c-pop-horas .c-item.on { color: #fff; background: var(--laranja); }

/* o calendário */
.c-pop-cal { padding: 10px; }
.c-cal { width: 252px; }
.c-cal header { display: flex; align-items: center; gap: 2px; height: 32px; padding-left: 8px; }
.c-cal header b { flex: 1; font-size: 15px; font-weight: 600; }
.c-cal header b span { font-weight: 500; color: var(--tinta-3); }
.c-nav { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--tinta-2); cursor: pointer; transition: background-color .14s ease; }
.c-semana, .c-grade { display: grid; grid-template-columns: repeat(7, 36px); }
.c-semana span { padding: 6px 0 4px; font-size: 11px; font-weight: 600; text-align: center; color: var(--tinta-3); }
.c-dia { display: grid; place-items: center; width: 32px; height: 32px; margin: 2px; border-radius: 50%; font-size: 13.5px; font-weight: 500; color: var(--tinta); cursor: pointer; transition: background-color .12s ease; }
.c-dia.fora { color: var(--tinta-3); }
.c-dia.hoje { font-weight: 700; color: var(--laranja-claro); }
.c-dia.on { font-weight: 700; color: #fff; background: var(--laranja); }
.c-dia:focus-visible { outline: none; box-shadow: 0 0 0 1.5px rgba(var(--f), .5); }
.c-cal footer { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; box-shadow: inset 0 1px 0 rgba(var(--f), .1); }
.c-atalho { height: 30px; padding: 0 12px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--tinta); background: rgba(var(--f), .08); cursor: pointer; transition: background-color .14s ease; }
.c-atalho:first-child { color: var(--laranja-claro); }
.c-nav:focus-visible, .c-atalho:focus-visible { outline: none; box-shadow: 0 0 0 1.5px rgba(var(--f), .5); }
.c-nav:active, .c-atalho:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .c-nav:hover, .c-dia:not(.on):hover { background: rgba(var(--f), .1); }
  .c-atalho:hover { background: rgba(var(--f), .14); }
}

@media (max-width: 860px) {
  .c-campo { height: 42px; font-size: 16px; }
  .f-quando .c-campo-dia { width: 100%; }
  .f-quando input.c-hora { flex: 1; width: auto; }
  .c-item { min-height: 40px; font-size: 16px; }
  .c-cal { width: 294px; }
  .c-semana, .c-grade { grid-template-columns: repeat(7, 42px); }
  .c-dia { width: 38px; height: 38px; font-size: 15px; }
  .c-nav, .c-atalho { height: 38px; }
  .c-nav { width: 38px; }
}
@media (prefers-reduced-motion: reduce) { .c-pop { animation: none; } .c-campo .c-seta { transition: none; } }

/* o período: os atalhos à esquerda e dois meses lado a lado; o começo e o fim em laranja, o que fica entre os dois numa faixa */
.c-pop-int { padding: 10px; }
.c-int { display: flex; gap: 12px; }
.c-int-atalhos { flex: none; display: flex; flex-direction: column; gap: 4px; width: 148px; padding-right: 10px; box-shadow: inset -1px 0 0 rgba(var(--f), .1); }
.c-int-atalhos .c-atalho { width: 100%; text-align: left; color: var(--tinta); background: none; }
.c-int-atalhos .c-atalho:first-child { color: var(--tinta); }
.c-int-atalhos .c-atalho.on { font-weight: 600; color: #fff; background: var(--laranja); }
.c-int-lado { display: flex; flex-direction: column; min-width: 0; }
.c-int-meses { position: relative; display: flex; gap: 18px; }
.c-int-mes header { display: flex; align-items: center; justify-content: center; height: 32px; }
.c-int-mes header b { font-size: 15px; font-weight: 600; }
.c-int-mes header b span { font-weight: 500; color: var(--tinta-3); }
.c-int-volta, .c-int-vai { position: absolute; top: 1px; z-index: 1; }
.c-int-volta { left: 0; } .c-int-vai { right: 0; }
.c-int .c-grade { row-gap: 2px; }
.c-int .c-dia { width: 36px; height: 32px; margin: 0; border-radius: 7px; }
.c-int .c-vazio { display: block; height: 32px; }
.c-int .c-dia.entre { border-radius: 0; color: var(--tinta); background: rgba(var(--laranja-rgb), .2); }
.c-int .c-dia.ini, .c-int .c-dia.fim { font-weight: 700; color: #fff; background: var(--laranja); }
.c-int .c-dia.ini:not(.so) { border-radius: 7px 0 0 7px; }
.c-int .c-dia.fim:not(.so) { border-radius: 0 7px 7px 0; }
.c-int footer { display: flex; align-items: center; gap: 12px; min-height: 38px; margin-top: 8px; padding-top: 8px; box-shadow: inset 0 1px 0 rgba(var(--f), .1); }
.c-int-texto { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-int-comparar { flex: none; font-size: 13px; color: var(--tinta-2); }
.c-int-comparar span { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .c-int .c-dia.entre:hover { background: rgba(var(--laranja-rgb), .32); }
  .c-int-atalhos .c-atalho:not(.on):hover { background: rgba(var(--f), .1); }
}
@media (max-width: 860px) {
  .c-int { flex-direction: column; gap: 8px; }
  .c-int-atalhos { flex-direction: row; flex-wrap: wrap; width: 294px; padding: 0 0 8px; gap: 6px; box-shadow: inset 0 -1px 0 rgba(var(--f), .1); }
  .c-int-atalhos .c-atalho { width: auto; flex: 1 0 auto; text-align: center; background: rgba(var(--f), .08); }
  .c-int .c-dia { width: 42px; height: 40px; }
  .c-int .c-vazio { height: 40px; }
  .c-int-mes header { height: 38px; }
  .c-int footer { flex-direction: column; align-items: stretch; gap: 6px; width: 294px; }
  .c-int-comparar { min-height: 36px; }
  .c-int-comparar span { max-width: none; flex: 1; }
}

/* a cor: uma fileira de bolinhas (a cor de cada uma vem da classe que pinta a peça, --nt-tinta) */
.c-pop-paleta { padding: 8px; }
.c-paleta { display: grid; grid-template-columns: repeat(5, 30px); gap: 6px; }
.c-tinta { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--tinta); background-color: var(--nt-amostra, var(--nt-tinta, rgba(var(--f), .08))); box-shadow: 0 0 0 1px rgba(var(--f), .16); cursor: pointer; transition: box-shadow .14s ease, transform .14s var(--ease-out); }
.c-tinta.sem { background-color: transparent; }
.c-tinta.sem:not(.on)::after { content: ""; width: 1.5px; height: 62%; border-radius: 1px; background: rgba(var(--f), .45); transform: rotate(45deg); }
.c-tinta.on { box-shadow: 0 0 0 2px var(--tinta); }
.c-tinta:active { transform: scale(.92); }
.c-tinta:focus-visible { outline: none; box-shadow: 0 0 0 1.5px rgba(var(--f), .5); }
@media (hover: hover) and (pointer: fine) { .c-tinta:not(.on):hover { box-shadow: 0 0 0 1.5px rgba(var(--f), .5); } }
@media (max-width: 860px) { .c-paleta { grid-template-columns: repeat(5, 40px); gap: 8px; } .c-tinta { width: 40px; height: 40px; } }

/* várias escolhas (etiquetas): a busca fica presa no alto da lista */
.c-marcas { display: flex; flex-direction: column; gap: 5px; min-width: 216px; }
.c-busca { width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; outline: 0; font-size: 14px; color: var(--tinta); background: rgba(var(--f), .08); }
.c-busca::placeholder { color: var(--tinta-3); opacity: 1; }
.c-busca:focus { background: rgba(var(--f), .12); box-shadow: inset 0 0 0 1px rgba(var(--f), .22); }
.c-item.c-criar .ico { visibility: visible; }
.c-nada { margin: 0; padding: 8px 10px; font-size: 13px; color: var(--tinta-3); }
@media (max-width: 860px) { .c-busca { height: 40px; font-size: 16px; } }
.c-item.c-editar { flex: none; margin-top: 4px; color: var(--tinta-2); }
.c-marcas:has(.c-editar) .c-lista { padding-bottom: 4px; border-bottom: 1px solid rgba(var(--f), .1); }
