/* Zephdeck web demo: the Dynamic Island (demo/island.js). Black, like the app's default look, in both
   light and dark mode. Sizes are the app's points; the shape is clipped to the app's outline by JS. */

.island {
  position: absolute; top: 0; left: 50%; z-index: 15;
  width: 193px; height: 28px;
  transform: translateX(-50%);
  color: #fff; font-family: var(--font); font-size: 12px; line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  transition: filter 0.2s;
}
/* The app's shadow while it's open or under the pointer. */
.island.open, .island.hover { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }
.isl-body { position: absolute; inset: 0; overflow: hidden; background: #000; }
.island .ic { width: 100%; height: 100%; display: block; }
.island button { color: inherit; font: inherit; }
.island :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The closed island is one button (keyboard: Tab to it, Enter opens). */
.isl-toggle { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border-radius: 0 0 14px 14px; cursor: default; }
.isl-toggle:focus-visible { outline-offset: 2px; }

/* ---------- Closed: the live activity beside the notch ---------- */
.isl-acts { position: absolute; inset: 0; }
.isl-act {
  position: absolute; top: 0; left: 50%; height: 28px;
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 0 14px; transform: translateX(-50%); white-space: nowrap;
  opacity: 0; transition: opacity 0.18s ease-in;
}
.isl-act.show { opacity: 1; transition: opacity 0.2s ease-out; }
/* Coming back after the island closes: once the shape has mostly closed (0.4 × 0.40 s). */
.isl-act.show.after-close { transition-delay: 0.16s; }
.isl-notch { flex: none; height: 100%; }
.isl-act-music { gap: 8px; }

.isl-art {
  display: block; flex: none; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 72% 78%, color-mix(in srgb, var(--a0) 70%, transparent) 0 18%, transparent 19%),
    radial-gradient(circle at 26% 22%, var(--a0), transparent 58%),
    linear-gradient(140deg, var(--a1), var(--a2));
}
.isl-art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.12); }
.isl-art-sm { width: 16px; height: 16px; border-radius: 4px; }
.isl-art-md { width: 44px; height: 44px; border-radius: 8px; }

/* Four bars in the artwork's color, still while paused, with Reduce Motion, and while scrolled away. */
.isl-bars { flex: none; width: 16px; height: 12px; display: flex; align-items: center; justify-content: space-between; padding: 0 1px; }
.isl-bars i {
  width: 2px; height: 12px; border-radius: 1px;
  background: linear-gradient(var(--bar), color-mix(in srgb, var(--bar) 55%, #000));
  transform: scaleY(0.35);
}
.isl-bars.playing i { animation: isl-bar 0.6s ease-in-out infinite alternate; }
.isl-bars.playing i:nth-child(2) { animation-duration: 0.9s; animation-delay: -0.3s; }
.isl-bars.playing i:nth-child(3) { animation-duration: 0.75s; animation-delay: -0.5s; }
.isl-bars.playing i:nth-child(4) { animation-duration: 1.05s; animation-delay: -0.2s; }
@keyframes isl-bar { 0% { transform: scaleY(0.35); } 40% { transform: scaleY(0.9); } 70% { transform: scaleY(0.55); } 100% { transform: scaleY(1); } }
.island.offscreen .isl-bars i, .island.open .isl-bars i { animation-play-state: paused; }

/* A running timer: an orange icon and its name left of the notch, the time right of it. */
.isl-side { flex: none; height: 100%; display: flex; align-items: center; }
.isl-side-l { justify-content: flex-end; }
.isl-side-r { justify-content: flex-start; }
.isl-wing { display: inline-flex; align-items: center; gap: 5px; }
.isl-t-ic { width: 13px; height: 13px; color: #FF9F0A; }
.isl-t-ic .ic { stroke-width: 2.4; }
.isl-t-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; }
.isl-t-time { font-size: 13px; font-weight: 600; color: #FF9F0A; font-variant-numeric: tabular-nums; }
.isl-t-time.paused { color: #999; }

/* The next event, ten minutes before it starts. */
.isl-ev-l { gap: 6px; padding-left: 6px; }
.isl-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.isl-ev-name { overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; }
.isl-ev-r { justify-content: flex-end; padding-right: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; filter: brightness(1.15); }

/* A timer ended: the island widens for 3 s. */
.isl-act-done { padding: 0 20px; justify-content: space-between; }
.isl-done-text { flex: 1; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.isl-done-ic { flex: 1; display: flex; justify-content: flex-end; color: #FF9F0A; }
.isl-done-ic .ic { width: 16px; height: 16px; }

/* ---------- Open: the header and the page ---------- */
/* Laid out at its final size from the start, so nothing re-wraps while the shape grows. It follows the
   shape 0.04 s later, coming into focus and growing from the top, and leaves the way it came. */
.isl-page {
  position: absolute; top: 0; left: 50%; height: 178px;
  display: flex; flex-direction: column;
  transform-origin: 50% 0;
  opacity: 0; filter: blur(8px); transform: translateX(-50%) scale(0.92);
  transition: opacity 0.18s ease-in, filter 0.18s ease-in, transform 0.18s ease-in;
}
.island.open .isl-page {
  opacity: 1; filter: blur(0); transform: translateX(-50%) scale(1);
  transition: opacity 0.18s ease-out 0.04s, filter 0.18s ease-out 0.04s, transform 0.18s ease-out 0.04s;
}

.isl-head { position: relative; z-index: 2; flex: none; height: 28px; display: flex; align-items: center; gap: 8px; }
.isl-head-l { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.isl-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.isl-head-r { display: flex; align-items: center; gap: 6px; }
.isl-ibtn {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.18);
  transition: background 0.15s, opacity 0.15s;
}
.isl-ibtn:hover { background: rgba(255, 255, 255, 0.2); }
.isl-ibtn:active { background: rgba(255, 255, 255, 0.26); }
.isl-ibtn .ic { width: 14px; height: 14px; }
/* Settings and … wait for the pointer, so the header reads as a title. */
.isl-later { opacity: 0; }
.isl-head:hover .isl-later, .isl-head:focus-within .isl-later, .isl-head-r.keep .isl-later { opacity: 1; }

.isl-menu {
  position: absolute; top: 32px; right: 0; z-index: 3; min-width: 210px; padding: 5px;
  border-radius: 9px; background: rgba(38, 38, 40, 0.98);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.14), 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: isl-fade 0.12s ease-out;
}
.isl-menu button { width: 100%; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 5px; font-size: 13px; text-align: left; }
.isl-menu button:hover, .isl-menu button:focus-visible { background: var(--accent); outline: none; }
.isl-menu-check { width: 16px; flex: none; font-size: 12px; }
.isl-menu hr { margin: 4px 8px; border: 0; border-top: 0.5px solid rgba(255, 255, 255, 0.15); }

.isl-main { position: relative; flex: none; height: 142px; margin-top: 8px; }
.isl-view { height: 100%; }
.isl-view.fade { animation: isl-fade 0.25s ease; }
@keyframes isl-fade { from { opacity: 0; } }

/* Round buttons that brighten under the pointer (the player's and the timers'). */
.isl-hover {
  flex: none; width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center; transition: background 0.3s;
}
.isl-hover:hover { background: rgba(142, 142, 147, 0.22); }
.isl-hover:active { background: rgba(142, 142, 147, 0.32); }
.isl-hover .ic { width: 15px; height: 15px; }
.isl-hover.large { width: 40px; height: 40px; }
.isl-hover.large .ic { width: 25px; height: 25px; }
.isl-hover:disabled { opacity: 0.35; }

/* ---------- Music ---------- */
.isl-player { height: 100%; display: flex; gap: 8px; }
.isl-cover { position: relative; flex: none; height: calc(100% - 10px); aspect-ratio: 1; margin: 5px; }
.isl-cover > * { position: absolute; inset: 0; border-radius: 13px; }
.isl-glow, .isl-cover-dim { pointer-events: none; }
.isl-glow {
  background: radial-gradient(circle at 26% 22%, var(--a0), transparent 58%), linear-gradient(140deg, var(--a1), var(--a2));
  filter: blur(40px); transform: scale(1.3, 1.4) rotate(92deg); opacity: 0; transition: opacity 0.4s;
}
.isl-player.playing .isl-glow { opacity: 0.5; }
.isl-art-lg { transform: scale(0.85); transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1); }
.isl-player.playing .isl-art-lg { transform: none; }
.isl-cover-dim { background: rgba(0, 0, 0, 0.45); transform: scale(0.85); transition: opacity 0.35s, transform 0.35s; }
.isl-player.playing .isl-cover-dim { opacity: 0; }
.isl-player-r { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px 0 0 5px; }
.isl-song, .isl-csong { min-width: 0; display: flex; flex-direction: column; }
.isl-song b, .isl-song span, .isl-csong b, .isl-csong span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isl-song b { font-size: 13px; font-weight: 700; }
.isl-song span { font-size: 13px; font-weight: 600; filter: brightness(1.15); }
.isl-slider { position: relative; height: 10px; margin-top: 9px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.isl-track { position: relative; width: 100%; height: 5px; border-radius: 5px; overflow: hidden; background: rgba(142, 142, 147, 0.3); transition: height 0.2s; }
.isl-slider.dragging .isl-track { height: 9px; }
.isl-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--bar) 85%, #fff); }
.isl-times { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; filter: brightness(1.15); }
.isl-controls { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; }
.isl-controls.compact { gap: 2px; margin-top: 0; }

.isl-cplayer { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.isl-crow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.isl-csong b { font-size: 11px; font-weight: 600; }
.isl-csong span { font-size: 11px; filter: brightness(1.15); }
.isl-cplayer .isl-slider { margin-top: 0; }

/* ---------- Home: up to three outlined widgets ---------- */
.isl-home { height: 100%; display: flex; }
.isl-widget {
  flex: none; height: 100%; padding: 8px; overflow: hidden;
  border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ---------- Calendar: like the iPhone's Up Next widget ---------- */
.isl-cal { height: 126px; display: flex; gap: 10px; }
.isl-cal-arrow { flex: none; width: 22px; display: grid; place-items: center; color: #999; border-radius: 6px; transition: filter 0.12s, transform 0.12s; }
.isl-cal-arrow:hover { color: #bbb; }
.isl-cal-arrow:active { transform: scale(0.96); }
.isl-cal-arrow .ic { width: 14px; height: 14px; }
.isl-date { flex: none; width: 84px; padding-top: 4px; display: flex; flex-direction: column; }
.isl-date span { font-size: 11px; font-weight: 600; color: #FF453A; letter-spacing: 0.01em; }
.isl-date b { font-size: 40px; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.isl-cal-list { flex: 1; min-width: 0; padding-top: 4px; overflow: hidden; }
.isl-evs { list-style: none; margin: 0; padding: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.isl-evs::-webkit-scrollbar { display: none; }
.isl-ev { display: flex; align-items: flex-start; gap: 7px; padding: 3px 0; }
.isl-ev > i { flex: none; width: 3px; height: 26px; border-radius: 1.5px; }
.isl-ev > span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.isl-ev b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.isl-ev small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #a6a6a6; }
.isl-cal-none { margin: 0; font-size: 11px; color: #a6a6a6; }
.isl-cal-free { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.isl-cal-free-ic { width: 20px; height: 20px; color: #a6a6a6; }
.isl-cal-free b { font-size: 11px; font-weight: 400; }
.isl-cal-free small { font-size: 10px; color: #a6a6a6; }
/* A third of Home: the arrows and a smaller date on top, the events below. */
.isl-cal.small { height: 100%; flex-direction: column; gap: 4px; }
.isl-cal-top { flex: none; height: 44px; display: flex; align-items: stretch; }
.isl-date.sm { flex: 1; width: auto; padding: 0; align-items: center; justify-content: center; }
.isl-date.sm span { font-size: 10px; }
.isl-date.sm b { font-size: 24px; line-height: 1.05; }
.isl-cal.small .isl-evs { height: auto; flex: 1; min-height: 0; }
.isl-cal.small .isl-cal-none { text-align: center; font-size: 10px; }

/* ---------- Timers ---------- */
.isl-ring { flex: none; transform: rotate(-90deg); }
.isl-ring circle { fill: none; }
.isl-ring .bg { stroke: rgba(255, 159, 10, 0.25); }
.isl-ring .fg { stroke: #FF9F0A; stroke-linecap: round; transition: stroke-dasharray 0.9s linear; }
.isl-thome { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.isl-thome-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: #FF9F0A; }
.isl-thome-label .ic { width: 13px; height: 13px; }
.isl-thome-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.isl-thome-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.isl-thome-time { font-size: 30px; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.isl-thome-time.paused, .isl-trow-time.paused { color: #999; }
.isl-thome-btns { display: flex; gap: 4px; }
.isl-quick { display: grid; gap: 6px; width: 100%; }
.isl-quick button {
  height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.08);
  font-size: 12px; font-weight: 600; transition: filter 0.12s, transform 0.12s, background 0.15s;
}
.isl-quick button:hover { background: rgba(255, 255, 255, 0.14); }
.isl-quick button:active { transform: scale(0.96); }
.isl-timers { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.isl-tempty { flex: 1; margin: 0; display: grid; place-items: center; font-size: 13px; font-weight: 500; color: #a6a6a6; }
.isl-trows { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; display: flex; flex-direction: column; gap: 6px; }
.isl-trows::-webkit-scrollbar { display: none; }
.isl-trow { flex: none; display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.isl-trow b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.isl-trow-time { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Shelf ---------- */
.isl-shelf {
  height: 100%; border-radius: 16px; display: flex; overflow: hidden;
  border: 3px dashed rgba(255, 255, 255, 0.1); transition: border-color 0.15s;
}
.island.drop-target .isl-shelf { border-color: color-mix(in srgb, var(--accent) 90%, transparent); }
.isl-shelf-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; text-align: center; color: #8e8e93; }
.isl-shelf-big { width: 26px; height: 26px; color: #fff; }
.isl-shelf-empty b { font: 500 15px var(--font-rounded); }
.isl-shelf-empty small { font-size: 11px; max-width: 320px; color: #8e8e93; }
.isl-shelf-items { flex: 1; display: flex; gap: 8px; padding: 10px; overflow-x: auto; scrollbar-width: none; }
.isl-shelf-item { position: relative; flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 10px; font-size: 10px; text-align: center; }
.isl-shelf-item:hover { background: rgba(255, 255, 255, 0.08); }
.isl-shelf-item > span:nth-child(2) { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isl-shelf-ic { width: 34px; height: 34px; color: #d1d1d6; }
.isl-shelf-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(60, 60, 64, 0.95); opacity: 0; }
.isl-shelf-x .ic { width: 10px; height: 10px; }
.isl-shelf-item:hover .isl-shelf-x, .isl-shelf-x:focus-visible { opacity: 1; }

/* ---------- The grid of tabs ---------- */
.isl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.isl-tile {
  position: relative; height: 64px; padding: 0 6px; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 255, 255, 0.045); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  font-size: 11px; font-weight: 500; transition: filter 0.12s, transform 0.12s;
}
.isl-tile.on { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.isl-tile:hover { filter: brightness(1.25); }
.isl-tile:active { transform: scale(0.96); }
.isl-tile-ic { width: 24px; height: 24px; }
.isl-tile > span:nth-child(2) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isl-tile-check { position: absolute; top: 7px; right: 7px; width: 11px; height: 11px; color: rgba(255, 255, 255, 0.7); }

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .isl-page, .island.open .isl-page { filter: none; transform: translateX(-50%); transition: opacity 0.2s ease-in-out; }
  .isl-act, .isl-act.show { transition: opacity 0.2s ease-in-out; transition-delay: 0s !important; }
  .isl-bars.playing i { animation: none; transform: scaleY(0.6); }
  .isl-view.fade, .isl-menu { animation: none; }
  .isl-art-lg, .isl-cover-dim, .isl-ring .fg, .isl-tile, .isl-quick button { transition: none; }
  .isl-tile:active, .isl-quick button:active, .isl-cal-arrow:active { transform: none; }
}
@media (prefers-contrast: more) {
  .isl-widget { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
  .isl-tile { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
  .isl-ev small, .isl-cal-none, .isl-tempty { color: #ccc; }
}
/* Browsers without clip-path: path(): a plain rounded bottom. */
.island.no-clip-path .isl-body { border-radius: 0 0 14px 14px; }
