/* Reloj de tarjetas del encabezado (referencia: reloj "flip"): tarjetas grises con el número grande
   en fuente condensada, una línea en la mitad y el volteo de la mitad de arriba al cambiar.
   Todo el tamaño sale de una sola medida (1em = 10 px en un celular de 390 px). */
/* ---------- Encabezado sin recuadro: logo y textos a la izquierda, reloj arriba a la derecha ---------- */
body #view-notes .notebooks-hero {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 0 !important;
  height: auto !important;
  padding: 4px 2px !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body #view-notes .notebooks-hero .notebook-identity { position: static !important; left: auto !important; top: auto !important; flex: 1 1 auto; min-width: 0; }
body #view-notes .notebooks-hero .notebook-identity-icon { width: 40px !important; height: 44px !important; min-width: 40px !important; }
body #view-notes .notebooks-hero .cuadernote-live-clock { position: static !important; left: auto !important; top: auto !important; flex: 0 0 auto; display: block; width: auto; margin: 2px 0 0 auto; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }

/* ---------- El reloj ---------- */
body .fc-wrap {
  --fc-hours: #C9C9C9;
  --fc-minutes: #C9C9C9;
  --fc-seconds: #C9C9C9;
  --fc-card: #26326A;
  display: grid;
  gap: .6em;
  justify-items: end;
  font-size: min(5.8px, 1.5vw);
  font-family: "Bebas Neue", Oswald, "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  color: var(--fc-hours);
}
body .fc-wrap *, body .fc-wrap *::before, body .fc-wrap *::after { box-sizing: border-box; }
body .fc-clock { display: flex; align-items: flex-end; gap: .4em; perspective: 60em; }

body .fc-card { position: relative; flex: none; border-radius: .5em; background: var(--fc-card); box-shadow: 0 .2em .6em rgba(0, 0, 0, .55); }
body .fc-card.fc-big { width: 5.2em; height: 5.2em; }
/* Separación entre los minutos y los segundos (o segundos y centésimas en el cronómetro) para no confundirlos */
body .fc-card.fc-small { width: 2.5em; height: 2.5em; border-radius: .36em; margin-left: .75em; }
body .fc-card[data-fc-unit="hours"] { color: var(--fc-hours); }
body .fc-card[data-fc-unit="minutes"] { color: var(--fc-minutes); }
body .fc-card[data-fc-unit="seconds"] { color: var(--fc-seconds); }

/* Mitades fijas y tapas que se voltean */
body .fc-half, body .fc-flap { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; }
body .fc-top, body .fc-flap-top { top: 0; border-radius: .5em .5em 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--fc-card) 84%, #fff), var(--fc-card)); }
body .fc-bottom, body .fc-flap-bottom { bottom: 0; border-radius: 0 0 .5em .5em; background: linear-gradient(180deg, var(--fc-card), color-mix(in srgb, var(--fc-card) 82%, #0b1233)); }
body .fc-small .fc-top, body .fc-small .fc-flap-top { border-radius: .36em .36em 0 0; }
body .fc-small .fc-bottom, body .fc-small .fc-flap-bottom { border-radius: 0 0 .36em .36em; }
body .fc-top, body .fc-bottom { z-index: 1; }
body .fc-flap { z-index: 3; visibility: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
body .fc-flap-top { transform-origin: 50% 100%; }
body .fc-flap-bottom { transform-origin: 50% 0; transform: rotateX(90deg); }
body .fc-flap::after { content: ""; position: absolute; inset: 0; background: #0b1233; opacity: 0; pointer-events: none; }

/* El número ocupa la tarjeta completa; cada mitad solo deja ver su parte */
body .fc-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200%;
  padding-bottom: .3em;
  font-size: 4.6em;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .02em;
  -webkit-text-stroke: .045em currentColor;
  paint-order: stroke fill;
  color: inherit;
  text-shadow: 0 .02em 0 rgba(255, 255, 255, .08);
  user-select: none;
}
/* La tipografía general de la app pisa a la del reloj: se fuerza la condensada */
body #view-notes .fc-wrap .fc-num, body #view-notes .fc-wrap .fc-ampm { font-family: "Bebas Neue", Oswald, "Arial Narrow", "Roboto Condensed", Impact, sans-serif !important; }
body .fc-small .fc-num { font-size: 2.2em; padding-bottom: .3em; -webkit-text-stroke-width: .035em; }
body .fc-bottom .fc-num, body .fc-flap-bottom .fc-num { top: -100%; }

/* Línea de la mitad */
body .fc-card::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; z-index: 6; height: .1em; margin-top: -.05em; background: #0B1233; box-shadow: 0 .06em .1em rgba(0, 0, 0, .7), 0 -.03em 0 rgba(255, 255, 255, .05); pointer-events: none; }
body .fc-ampm { position: absolute; left: .5em; bottom: .26em; z-index: 7; font-size: 1.2em; font-weight: 400; letter-spacing: .06em; color: color-mix(in srgb, var(--fc-hours) 88%, #0b1233); line-height: 1; }

/* Volteo: la tapa de arriba cae hasta la mitad y la de abajo termina de caer */
body .fc-card.is-flipping .fc-flap { visibility: visible; }
body .fc-card.is-flipping .fc-flap-top { animation: fc-flip-top .3s ease-in forwards; }
body .fc-card.is-flipping .fc-flap-top::after { animation: fc-shade-top .3s ease-in forwards; }
body .fc-card.is-flipping .fc-flap-bottom { animation: fc-flip-bottom .3s ease-out .3s forwards; }
body .fc-card.is-flipping .fc-flap-bottom::after { animation: fc-shade-bottom .3s ease-out .3s forwards; }
@keyframes fc-flip-top { from { transform: rotateX(0); } to { transform: rotateX(-90deg); } }
@keyframes fc-flip-bottom { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
@keyframes fc-shade-top { from { opacity: 0; } to { opacity: .6; } }
@keyframes fc-shade-bottom { from { opacity: .6; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body .fc-card.is-flipping .fc-flap { visibility: hidden; animation: none !important; } }

/* ---------- Botones: cada uno con su propio color ---------- */
body .fc-controls { display: flex; gap: .45em; justify-content: flex-end; }

/* Letrero pequeño con el día, el mes y el año; sale de la fecha del equipo o celular. */
body #view-notes .fc-wrap .fc-date {
  margin: -.1em 0 0;
  padding: 0;
  font-family: "Bebas Neue", Oswald, "Arial Narrow", "Roboto Condensed", Impact, sans-serif !important;
  font-size: 2.3em;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: right;
  color: color-mix(in srgb, var(--fc-hours) 88%, #0b1233);
  user-select: none;
}
body .fc-controls button {
  --bc: #9fb2a9;
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: grid;
  place-items: center;
  width: 3.3em;
  height: 3.1em;
  border: 1px solid color-mix(in srgb, var(--bc) 62%, transparent);
  border-radius: .8em;
  background: linear-gradient(155deg, color-mix(in srgb, var(--bc) 42%, #141D47) 0%, color-mix(in srgb, var(--bc) 16%, #0B1233) 100%);
  color: color-mix(in srgb, var(--bc) 58%, #ffffff);
  box-shadow: 0 .18em .6em color-mix(in srgb, var(--bc) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s, box-shadow .15s;
}
/* Área de toque más grande que el botón visible (el botón mide la mitad) */
body .fc-controls button::before { content: ""; position: absolute; inset: -7px -2px; }
body .fc-controls button svg { width: 1.95em; height: 1.95em; filter: drop-shadow(0 .05em .1em rgba(0, 0, 0, .45)); }
body .fc-controls button:active { transform: scale(.92); box-shadow: 0 .08em .3em color-mix(in srgb, var(--bc) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .1); }
body .fc-controls button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body .fc-controls button[data-tone="stopwatch"] { --bc: #FFB020; }
body .fc-controls button[data-tone="alarm"] { --bc: #4DA3FF; }
body .fc-controls button[data-tone="options"] { --bc: #B26BFF; }
body .fc-controls button[data-tone="clock"] { --bc: #2DD4BF; }
body .fc-controls button[data-tone="play"] { --bc: #4ADE80; }
body .fc-controls button[data-tone="pause"] { --bc: #FBBF24; }
body .fc-controls button[data-tone="reset"] { --bc: #FF6B8A; }
body .fc-controls button.has-alarm::after { content: ""; position: absolute; top: -.25em; right: -.25em; width: .9em; height: .9em; min-width: 4px; min-height: 4px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 .18em #141D47, 0 0 .6em #4ADE80; }

/* ---------- Ventanas: alarmas, opciones y alarma sonando ---------- */
body dialog.fc-dialog {
  width: min(100%, 460px);
  max-width: 100%;
  max-height: 88dvh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(0, 255, 102, .28);
  border-radius: 20px;
  overflow: hidden;
  background: #141D47;
  color: #eef6f2;
  color-scheme: dark;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 15px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
body dialog.fc-dialog:not([open]) { display: none; }
body dialog.fc-dialog[open] { display: flex; flex-direction: column; }
body dialog.fc-dialog::backdrop { background: rgba(2, 6, 4, .62); }
body dialog.fc-dialog.is-bottom { margin: auto auto 0; max-height: 82dvh; border-radius: 20px 20px 0 0; }
body dialog.fc-dialog.is-bottom::backdrop { background: rgba(2, 6, 4, .12); }
body dialog.fc-dialog *, body dialog.fc-dialog *::before, body dialog.fc-dialog *::after { box-sizing: border-box; }
body dialog.fc-dialog :is(h2, p, ul) { margin: 0; padding: 0; }
body dialog.fc-dialog ul { list-style: none; }
body dialog.fc-dialog :is(button, input, select) { font: inherit; color: inherit; }

body dialog.fc-dialog .fc-head { display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
body dialog.fc-dialog .fc-head h2 { font-size: 20px; font-weight: 800; }
body dialog.fc-dialog .fc-head p { margin-top: 2px; color: #9fb2a9; font-size: 13px; }
body dialog.fc-dialog .fc-close { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); font-size: 24px; line-height: 1; cursor: pointer; }
body dialog.fc-dialog .fc-body { display: grid; align-content: start; gap: 14px; padding: 8px 18px 20px; overflow-y: auto; }

body dialog.fc-dialog .fc-primary { min-height: 48px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #5cf597, #2fd870); color: #0B1233; font-weight: 800; font-size: 15px; cursor: pointer; }
body dialog.fc-dialog .fc-secondary { min-height: 44px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; background: rgba(255, 255, 255, .05); font-weight: 700; cursor: pointer; }
body dialog.fc-dialog .fc-empty { padding: 18px; border: 1px dashed rgba(255, 255, 255, .2); border-radius: 14px; color: #9fb2a9; text-align: center; }

/* Lista de alarmas */
body dialog.fc-dialog .fc-alarms { display: grid; gap: 8px; }
body dialog.fc-dialog .fc-alarm { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid rgba(0, 255, 102, .22); border-radius: 16px; background: rgba(255, 255, 255, .04); }
body dialog.fc-dialog .fc-alarm.is-off { opacity: .6; border-color: rgba(255, 255, 255, .12); }
body dialog.fc-dialog .fc-alarm-main { display: grid; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
body dialog.fc-dialog .fc-alarm-main strong { font-size: 26px; font-weight: 800; letter-spacing: .01em; }
body dialog.fc-dialog .fc-alarm-main span { overflow: hidden; color: #9fb2a9; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
body dialog.fc-dialog .fc-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: none; color: #ff7b7b; cursor: pointer; }
body dialog.fc-dialog .fc-switch { position: relative; display: block; width: 50px; height: 30px; cursor: pointer; }
body dialog.fc-dialog .fc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
body dialog.fc-dialog .fc-switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, .18); transition: background .15s; }
body dialog.fc-dialog .fc-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
body dialog.fc-dialog .fc-switch input:checked + i { background: #2fd870; }
body dialog.fc-dialog .fc-switch input:checked + i::after { transform: translateX(20px); }
body dialog.fc-dialog .fc-switch input:focus-visible + i { outline: 2px solid #7dffb0; outline-offset: 2px; }

/* Formularios */
body dialog.fc-dialog .fc-field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #c9dbd2; }
body dialog.fc-dialog .fc-field small { color: #9fb2a9; font-weight: 500; }
body dialog.fc-dialog input[type="time"], body dialog.fc-dialog input[type="text"], body dialog.fc-dialog select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; background: rgba(255, 255, 255, .06); color: #fff; font-size: 17px; font-weight: 600; }
body dialog.fc-dialog input[type="time"] { font-size: 28px; font-weight: 800; letter-spacing: .02em; }
body dialog.fc-dialog select option { background: #141D47; color: #fff; }
body dialog.fc-dialog .fc-sound { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
body dialog.fc-dialog .fc-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
body dialog.fc-dialog .fc-day { min-height: 44px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; background: rgba(255, 255, 255, .05); font-weight: 800; cursor: pointer; }
body dialog.fc-dialog .fc-day[aria-pressed="true"], body dialog.fc-dialog .fc-seg button[aria-pressed="true"], body dialog.fc-dialog .fc-chip[aria-pressed="true"] { border-color: #47f28a; background: rgba(71, 242, 138, .18); color: #7dffb0; }
body dialog.fc-dialog .fc-seg { display: grid; gap: 6px; }
body dialog.fc-dialog .fc-seg button { min-height: 46px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; background: rgba(255, 255, 255, .05); font-weight: 700; cursor: pointer; }
body dialog.fc-dialog .fc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body dialog.fc-dialog .fc-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 99px; background: rgba(255, 255, 255, .05); font-size: 13px; font-weight: 700; cursor: pointer; }
body dialog.fc-dialog .fc-chip i { width: 15px; height: 15px; border-radius: 50%; background: var(--cc); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
body dialog.fc-dialog .fc-honey { padding: 4px 0; text-align: center; }

/* Alarma sonando */
body dialog.fc-ring-dialog { width: min(92vw, 360px); border-color: rgba(0, 255, 102, .6); box-shadow: 0 0 0 4px rgba(0, 255, 102, .15), 0 24px 70px rgba(0, 0, 0, .7); }
body dialog.fc-ring-dialog .fc-ring { display: grid; gap: 10px; justify-items: center; padding: 26px 22px 22px; text-align: center; }
body dialog.fc-ring-dialog .fc-ring-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: rgba(0, 255, 102, .14); color: #7dffb0; animation: fc-ring-shake .7s ease-in-out infinite; }
body dialog.fc-ring-dialog .fc-ring-icon svg { width: 44px; height: 44px; }
body dialog.fc-ring-dialog h2 { font-size: 24px; font-weight: 800; }
body dialog.fc-ring-dialog p { color: #9fb2a9; font-size: 34px; font-weight: 800; letter-spacing: .02em; }
body dialog.fc-ring-dialog .fc-primary, body dialog.fc-ring-dialog .fc-secondary { width: 100%; }
@keyframes fc-ring-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { body dialog.fc-ring-dialog .fc-ring-icon { animation: none; } }
