/*
 * La demo: la ventana de Tidybox (revisión por tarjetas), con los colores de la app. demo.js la mueve.
 * Es un programa de escritorio: por debajo de 760 px no se recoloca, se dibuja a 760 px y se encoge entera
 * (zoom, que demo.js ajusta al ancho disponible), como una captura de la ventana del Mac.
 */
/* Aviso de que es una demo: sobre el borde de arriba de la ventana, sin tapar nada. */
.tb-badge { display: table; position: relative; z-index: 5; margin: 44px auto -12px; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; background: #0033ff; box-shadow: 0 4px 14px -4px #0033ffa6; }  /* el azul de tidybox, con texto blanco (7,2:1) */
.tb-badge + .tb { margin-top: 0; }
.tb { position: relative; display: grid; grid-template-columns: 250px 1fr; max-width: 1120px; margin: 56px auto 0; overflow: hidden; border-radius: 18px; font-size: 14px; line-height: 1.25; text-align: left; color: #f2f2f4; background: #1d1d1f; box-shadow: 0 0 0 1px #ffffff26, 0 0 0 2px #000, 0 50px 120px -30px #000, 0 20px 50px -20px #000c; }
.tb button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tb small { display: block; font-size: 12px; font-weight: 400; color: #98989f; }
.tb b { font-weight: 600; }

.tb-side { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px 12px; background: #252528; border-right: 1px solid #000; }
.tb-lights { display: flex; gap: 8px; padding: 2px 6px 18px; }
.tb-lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.tb-lights i:nth-child(2) { background: #febc2e; } .tb-lights i:nth-child(3) { background: #28c840; }
.tb-lib { display: flex; align-items: center; gap: 8px; padding: 6px 8px 14px; font-weight: 600; }
.tb-lib span { margin-left: auto; letter-spacing: 1px; color: #c7c7cc; }
.tb-dot { width: 8px; height: 8px; border-radius: 50%; background: #30d158; }
.tb-label { margin: 14px 8px 6px; font-size: 12px; font-weight: 600; color: #98989f; }
.tb .tb-item { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid #0000; }
.tb-item .ic { font-size: 15px; color: #e5e5ea; }
.tb-item[data-act="smart"] .ic { font-size: 20px; margin: -3px -2.500px; }
.tb .tb-item[data-act]:not(.on):hover { background: #ffffff0d; }
.tb-item b { margin-left: auto; font-weight: 400; color: #98989f; font-variant-numeric: tabular-nums; }
.tb .tb-item.on { background: #ffffff1a; border-color: #ffffff1f; }
.tb-item.bump b { animation: tb-bump 0.6s; }
@keyframes tb-bump { 30% { color: var(--orange); transform: scale(1.25); } }
.tb-freed { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 22px 10px 10px; }
.tb-freed .ic { font-size: 18px; color: #98989f; }
.tb-del { display: flex !important; align-items: center; gap: 12px; padding: 10px 16px !important; border-radius: 12px; text-align: left; color: #111 !important; background: #f2f2f4 !important; transition: opacity 0.2s, transform 0.15s; }
.tb-del .ic { font-size: 19px; }
.tb-del small { color: #55555a; }
.tb-del:active { transform: scale(0.98); }
.tb-del[disabled] { opacity: 0.35; cursor: default; }

.tb-main { position: relative; display: flex; min-width: 0; }
.tb-view { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0 20px 18px; }
.tb-view[hidden] { display: none; }
.tb-bar { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0 10px; }
.tb-h { display: block; font-size: 17px; font-weight: 700; }
.tb-tools { display: flex; align-items: center; gap: 8px; color: #e5e5ea; }
.tb-seg, .tb-tool, .tb-search { display: flex; align-items: center; height: 34px; border-radius: 999px; background: #ffffff12; box-shadow: inset 0 0 0 1px #ffffff1a; }
.tb-seg { padding: 3px; gap: 2px; }
.tb-seg i { width: 34px; height: 28px; display: grid; place-items: center; border-radius: 999px; font-size: 16px; }
.tb-seg .on { background: #ffffff24; }
.tb-tool { width: 40px; justify-content: center; font-size: 17px; }
.tb-search { gap: 7px; width: 220px; padding: 0 12px; font-size: 13px; color: #98989f; }

.tb-stage { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 5vw, 70px); align-self: stretch; padding-top: 14px; }
.tb-hint { display: flex; gap: 18px; font-size: 34px; color: #ffffff1f; transition: color 0.15s; }
.tb-hint.right .ic:first-child { transform: scaleX(-1); }
.tb[data-lean="discard"] .tb-hint.left { color: var(--orange); }
.tb[data-lean="keep"] .tb-hint.right { color: #4a9bff; }
.tb-card { flex: none; width: min(300px, 100%); display: flex; flex-direction: column; align-items: center; padding: 11px 11px 14px; border-radius: 20px; text-align: center; background: #2c2c2f; box-shadow: inset 0 0 0 1px #ffffff1c, 0 18px 40px -18px #000; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.3, 1), opacity 0.28s; }
.tb-card.drag { transition: none; cursor: grabbing; }
.tb-card.out-discard { transform: translateX(-70%) rotate(-12deg); opacity: 0; }
.tb-card.out-keep { transform: translateX(70%) rotate(12deg); opacity: 0; }
.tb-card.out-later { transform: translateY(40%) scale(0.9); opacity: 0; }
.tb-card.in { transition: none; transform: scale(0.94); opacity: 0; }
.tb-art { width: 100%; aspect-ratio: 1; border-radius: 12px; }
.tb-title { margin-top: 12px; font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.tb-artist { margin-top: 4px; color: #a1a1a8; }
.tb-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 11px; margin-top: 7px; font-size: 11.500px; color: #a1a1a8; white-space: nowrap; }

.tb-scrub { display: flex; align-items: center; gap: 10px; width: min(300px, 100%); margin-top: 16px; font-size: 11px; color: #98989f; font-variant-numeric: tabular-nums; }
.tb-scrub canvas { flex: 1; min-width: 0; height: 22px; cursor: pointer; }
.tb-transport { display: flex; align-items: center; gap: 30px; margin-top: 10px; }
.tb-transport button { font-size: 20px; padding: 6px; border-radius: 50%; }
.tb-transport .big { font-size: 30px; }
.tb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(300px, 100%); margin-top: 12px; }
.tb-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 34px; border-radius: 4px; font-weight: 500; transition: filter 0.15s, transform 0.1s; }
.tb-actions button:hover { filter: brightness(1.15); }
.tb-actions button:active { transform: scale(0.97); }
.tb .tb-discard { color: var(--orange); background: #ff9f0a1f; box-shadow: inset 0 0 0 1px #ff9f0a8c; }
.tb .tb-keep { color: #fff; background: var(--blue); }
.tb-keys { margin: 12px 0 0; font-size: 11px; color: #98989f; text-align: center; }
.tb-keys button { padding: 2px 4px; border-radius: 5px; }
.tb-keys button:hover { color: #fff; background: #ffffff14; }
.tb-keys kbd { font: inherit; }
.tb :focus-visible { outline: 2px solid #4a9bff; outline-offset: 2px; }

.tb-sheet { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: #0009; }
.tb-sheet[hidden] { display: none; }
.tb-dialog { width: min(380px, 100%); padding: 22px; border-radius: 22px; }
.tb-dialog > b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.tb-dialog p { margin: 6px 0 0; color: #c7c7cc; }
.tb-dialog ul { margin: 16px 0 0; padding: 0; list-style: none; }
.tb-dialog li { display: flex; gap: 10px; padding: 9px 0; font-size: 13px; color: #d6d6db; border-top: 1px solid #ffffff1a; }
.tb-dialog li .ic { font-size: 16px; margin-top: 1px; }
.tb-sheet-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.tb-sheet-btns button { padding: 8px 16px; border-radius: 999px; font-weight: 500; background: #ffffff1f; }
.tb-sheet-btns .go { color: #111; background: #f2f2f4; }

/* Limpieza inteligente. */
.tb-smart { align-items: stretch; }
.sm-pane { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sm-pane[hidden] { display: none; }
.sm-pane > small { margin-top: 12px; font-size: 11px; }
.sm-emblem { flex: none; width: 140px; height: 140px; fill: none; }
.sm-hex, .sm-hex-back { stroke-width: 7.500; stroke-linejoin: round; stroke-linecap: round; }
.sm-hex-back { display: none; stroke: #ffffff26; }
.sm-emblem.scan { margin-top: auto; }
.sm-emblem.scan .sm-hex-back { display: block; }
.sm-emblem.scan .sm-hex { stroke-dasharray: 1; stroke-dashoffset: 1; }
.sm-emblem.scan .sm-spark { transform-origin: 50px 50px; animation: sm-pulse 0.9s ease-in-out infinite; }
@keyframes sm-pulse { 50% { transform: scale(0.82); opacity: 0.6; } }
.sm-hero { display: flex; align-items: center; gap: 56px; margin: auto 0; padding: 24px 12px; text-align: left; }
.sm-copy { max-width: 400px; }
.sm-title { display: block; font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: #0000; background: linear-gradient(#ffffffb3, #fff); -webkit-background-clip: text; background-clip: text; }
.sm-copy p { margin: 8px 0 0; font-size: 16px; line-height: 1.35; }
.sm-copy ul { display: grid; gap: 13px; margin: 24px 0 0; padding: 0; list-style: none; }
.sm-copy li { display: flex; align-items: center; gap: 10px; }
.sm-copy li .ic { font-size: 16px; }
.tb .sm-go { display: flex; align-items: center; justify-content: center; gap: 9px; width: min(290px, 100%); height: 52px; border-radius: 14px; font-size: 16px; font-weight: 600; color: #000; background: linear-gradient(135deg, #fff, #c7c7c7); box-shadow: 0 5px 12px #0006; transition: opacity 0.12s, transform 0.12s; }
.tb .sm-go:active { opacity: 0.85; transform: scale(0.985); }
.sm-go .ic { font-size: 18px; stroke-width: 1.800; }
.sm-doing { margin-top: 32px; font-size: 22px; font-weight: 700; }
.sm-step { margin-top: 6px; font-size: 13px; color: #a1a1a8; }
.sm-count { margin-top: 16px; font-size: 12px; color: #6e6e73; font-variant-numeric: tabular-nums; }
.sm-track { max-width: min(360px, 100%); margin: 3px 0 auto; font-size: 11px; color: #6e6e73; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-pane .tb-bar { align-self: stretch; text-align: left; }
.tb .sm-link { padding: 6px 12px; border-radius: 999px; font-size: 12px; color: #e5e5ea; background: #ffffff12; box-shadow: inset 0 0 0 1px #ffffff1a; }
.sm-cards { align-self: stretch; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: auto 0; padding: 12px 0; }
/* Tarjeta de un nivel, como CleanupSummaryCard en la app: título, insignia, resumen, indicador del color del nivel,
   cifra grande y «Revisar». Se usa en la demo y en la tarjeta de Funciones. */
.sm-card { position: relative; display: flex; flex-direction: column; min-height: 236px; padding: 20px; overflow: hidden; border-radius: 18px; text-align: left; color: #f2f2f4; background: radial-gradient(130px circle at calc(100% - 40px) 20px, color-mix(in srgb, var(--tint) 22%, #0000), #0000), #ffffff0d; box-shadow: inset 0 0 0 1px #ffffff14; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; animation: sm-in 0.45s both; animation-delay: var(--d); }
.sm-card:hover { transform: scale(1.012); box-shadow: inset 0 0 0 1px #ffffff29; }
.sm-card.empty { cursor: default; transform: none; }
@keyframes sm-in { from { opacity: 0; transform: translateY(14px); } }
.sm-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sm-card header b { font-size: 15px; font-weight: 600; }
.sm-card em { margin-left: 8px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 600; color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, #0000); vertical-align: 1px; }
.sm-card header small { display: block; margin-top: 6px; font-size: 12px; line-height: 1.3; color: #a1a1a8; }
.gauge { flex: none; width: 30px; height: 30px; color: var(--tint); }
.gauge .ring { fill: none; stroke: currentColor; stroke-width: 2.300; }
.gauge .dots, .gauge .hub { fill: currentColor; }
.gauge .needle { stroke: currentColor; stroke-width: 2.600; stroke-linecap: round; }
.sm-card strong { margin-top: auto; padding-top: 24px; font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.sm-card footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; margin-top: 2px; font-size: 13px; color: #a1a1a8; font-variant-numeric: tabular-nums; }
.sm-card footer button, .sm-card .rv { flex: none; padding: 6px 14px; border-radius: 8px; font: inherit; font-weight: 500; color: #3b8cff; background: #1673eb24; border: 0; cursor: pointer; }
.sm-help { padding-bottom: 8px; }
.sm-list { align-self: stretch; display: grid; gap: 5px; margin-top: 6px; }
.sm-row { display: grid; grid-template-columns: 34px minmax(0, 1.200fr) minmax(0, 1.500fr) auto; align-items: center; gap: 12px; padding: 7px 12px 7px 8px; border-radius: 10px; text-align: left; background: #ffffff0a; animation: sm-in 0.35s both; animation-delay: var(--d); }
.sm-row i { width: 34px; height: 34px; border-radius: 6px; }
.sm-row b, .sm-row span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-row span { font-size: 12px; color: #a1a1a8; }
.sm-row > span { font-variant-numeric: tabular-nums; }
.sm-more { margin: 8px 0 0; font-size: 12px; color: #98989f; }
.sm-foot { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; text-align: left; }
.tb .sm-discard { flex: none; height: 38px; padding: 0 16px; border-radius: 8px; font-weight: 500; color: var(--orange); background: #ff9f0a1f; box-shadow: inset 0 0 0 1px #ff9f0a8c; }
@media (prefers-reduced-motion: reduce) { .sm-card, .sm-row, .sm-emblem.scan .sm-spark { animation: none; } }

.tb-note { max-width: 560px; margin: 22px auto 0; text-align: center; font-size: 13px; color: #6e6e73; }

@media (max-width: 980px) {
	.tb-search { display: none; }
	.tb { grid-template-columns: 220px 1fr; }
}
@media (max-width: 760px) {
	.tb { width: 760px; max-width: none; zoom: var(--tb-zoom, 0.45); }
	.tb-badge { margin-bottom: 10px; }  /* encima de la ventana, sin pisar su título, que con el zoom queda muy arriba */
}
@media (prefers-reduced-motion: reduce) { .tb-card { transition: opacity 0.2s; } .tb-card[class*="out-"] { transform: none; } }
