:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  color: #1c2940;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #1c2940;
  --muted: #6c7b91;
  --edge: rgba(255,255,255,.80);
  --glass: rgba(255,255,255,.56);
  --row: rgba(255,255,255,.62);
  --shadow: 0 15px 38px rgba(37,58,90,.10), 0 2px 8px rgba(27,46,77,.06);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 42% at 8% 10%, rgba(185,211,245,.54), transparent 78%),
    radial-gradient(ellipse 50% 44% at 96% 92%, rgba(223,207,236,.34), transparent 81%),
    linear-gradient(140deg, #f0f4f9, #e8edf5 53%, #f4f5f8);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 24px; height: 24px; flex-shrink: 0; }
.hide { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #7392c6; outline-offset: 3px; }

.shell { width: min(calc(100% - 36px), 690px); min-height: 100dvh; margin: auto; padding: 18px 0 max(30px,env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.topbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; letter-spacing: -.5px; font-weight: 690; }
.brand-sign { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg,#273c58,#445d83); color: white; box-shadow: inset 0 1px 1px #ffffff70,0 3px 10px #21355028; }
.brand-sign svg { width: 16px; height: 16px; }

.icon-button, .link-form, .mark-button {
  border: 1px solid var(--edge);
  background: var(--glass);
  box-shadow: inset 0 1px 1px #ffffffb8, var(--shadow);
}
.icon-button { display: grid; place-items: center; flex: none; }
.icon-button { width: 44px; height: 44px; border-radius: 16px; color: var(--ink); }
.icon-button svg { width: 18px; height: 18px; }
.home { position: relative; isolation: isolate; flex: 1; display: flex; flex-direction: column; align-items: stretch; padding: clamp(80px,24dvh,210px) 0 14px; }
.home::before, .home::after { content: ''; position: absolute; z-index: -1; width: min(62%,350px); aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: .72; will-change: transform; }
.home::before { left: 0; top: clamp(30px,12dvh,110px); background: radial-gradient(circle,rgba(142,185,239,.32),rgba(142,185,239,0) 71%); animation: ambient-one 17s ease-in-out infinite alternate; }
.home::after { right: 0; top: clamp(95px,22dvh,210px); background: radial-gradient(circle,rgba(203,177,232,.26),rgba(203,177,232,0) 72%); animation: ambient-two 21s ease-in-out infinite alternate; }
@keyframes ambient-one { from { transform: translate3d(-7px,-9px,0) scale(.96); } to { transform: translate3d(17px,11px,0) scale(1.06); } }
@keyframes ambient-two { from { transform: translate3d(9px,7px,0) scale(1.04); } to { transform: translate3d(-15px,-12px,0) scale(.96); } }
.link-form { position: relative; height: 62px; display: flex; align-items: center; border-radius: 23px; padding: 5px 20px; transition: border-color .22s, box-shadow .22s, background-color .22s; }
.link-form::after { content: ''; position: absolute; pointer-events: none; top: 1px; left: 15%; width: 34%; height: 1px; background: linear-gradient(90deg,transparent,rgba(255,255,255,.97),transparent); opacity: .65; transform: translateX(-20%); transition: transform .6s ease, opacity .25s ease; }
.link-form:focus-within { border-color: #a6bddc; box-shadow: inset 0 1px 1px #ffffffb8,0 0 0 3px rgba(117,153,202,.13),var(--shadow); }
.link-form:focus-within::after { opacity: 1; transform: translateX(120%); }
.link-form input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.link-form input::placeholder { color: #7c8da4; }
.input-error { min-height: 17px; margin: 7px 7px 0; color: #a13f51; font-size: 12px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.section-head h2 { margin: 0; color: #56677f; font-size: 12px; font-weight: 640; letter-spacing: .02em; }
.recent { margin-top: clamp(25px,7dvh,55px); }
.recent-list, .marks-list { display: flex; flex-direction: column; gap: 9px; }
.recent-item, .mark-row { background: var(--row); border: 1px solid var(--edge); box-shadow: inset 0 1px 1px #ffffffad,0 3px 16px #28415e0b; }
.recent-item { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 13px; padding: 8px 13px; border-radius: 19px; text-align: left; color: var(--ink); }
.recent-item:hover, .mark-row:hover { border-color: #ffffff; background: rgba(255,255,255,.75); }
@media (hover: hover) and (pointer: fine) {
  .recent-item { transition: transform .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
  .recent-item:hover { transform: translateY(-2px); box-shadow: inset 0 1px 1px #ffffffd0,0 8px 22px #28415e15; }
}
.recent-icon { width: 38px; height: 38px; border-radius: 13px; flex: none; display: grid; place-items: center; background: #e7edf5b8; color: #526b8c; }
.recent-icon svg { width: 18px; height: 18px; }
.recent-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.recent-title strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 590; font-size: 13px; }
.recent-title small { color: var(--muted); font-size: 11px; }
.recent-arrow svg { width: 17px; height: 17px; color: #8596ac; }

.watch { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 18px 0 0; }
.watch:not(.hide) { animation: watch-enter .32s cubic-bezier(.16,1,.3,1) both; }
@keyframes watch-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.player-shell { position: relative; overflow: hidden; aspect-ratio: 16/9; flex: none; border-radius: 22px; background: #131924; border: 1px solid #ffffffb0; box-shadow: 0 16px 38px #1a2c4630,0 1px 1px #ffffffa0; }
.player-mount, .player-mount iframe { display: block; width: 100%; height: 100%; border: 0; }
.player-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 20px; color: #d9e1ee; background: #161d27; font-size: 13px; text-align: center; }
.retry-button { margin-top: 12px; background: #fff; color: #1d2a40; border: 0; border-radius: 9px; padding: 11px 18px; }
.clipboard-fallback { position: fixed; opacity: 0; top: 0; left: 0; pointer-events: none; }
.small-spinner { width: 22px; height: 22px; border: 2px solid #697c91; border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.video-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 2px 0; font-size: 12px; }
.video-name { min-width: 0; max-width: 85%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #536783; font-weight: 540; }
.direct-link { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 12px; color: #546d90; background: #ffffff6b; border: 1px solid #ffffffa8; }
.direct-link svg { width: 17px; height: 17px; }
.mark-area { margin: 23px 0 28px; display: flex; align-items: center; gap: 14px; }
.mark-button { height: 61px; display: flex; flex: 1; align-items: center; justify-content: center; gap: 9px; border-radius: 20px; color: #fff; background: linear-gradient(138deg,rgba(29,46,73,.97),rgba(57,81,116,.92)); font-size: 16px; letter-spacing: -.3px; font-weight: 630; box-shadow: inset 0 1px 1px #ffffff75,0 9px 22px #233c6130; transition: transform .16s,background .16s; }
.mark-button svg { width: 21px; height: 21px; }
.mark-button:active:not(:disabled) { transform: scale(.985); }
.mark-button:disabled { opacity: .58; }
.time-display { width: 74px; flex: none; color: var(--ink); font-weight: 630; font-size: 17px; letter-spacing: -.6px; text-align: right; font-variant-numeric: tabular-nums; }
.marks-section { min-height: 0; }
.mark-row { min-height: 61px; display: flex; align-items: center; gap: 5px; padding: 6px 8px 6px 7px; border-radius: 19px; }
.mark-row.fresh { animation: moment-enter .32s cubic-bezier(.16,1,.3,1) both; }
@keyframes moment-enter { from { opacity: .3; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.jump-button { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 7px; background: transparent; border: 0; text-align: left; color: var(--ink); font-size: 15px; font-weight: 630; font-variant-numeric: tabular-nums; }
.moment-play { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 13px; color: #446286; background: #e4ebf4c0; }
.moment-play svg { width: 16px; height: 16px; margin-left: 2px; }
.mini-button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 13px; background: transparent; color: #607795; }
.mini-button:hover { background: rgba(255,255,255,.64); }
.mini-button svg { width: 18px; height: 18px; }
.mini-button.delete { color: #9ba9bb; }
.toast { position: fixed; left: 50%; bottom: max(22px,env(safe-area-inset-bottom)); z-index: 10; max-width: min(90vw,480px); padding: 12px 17px; border: 1px solid #ffffff8f; border-radius: 16px; background: rgba(33,49,74,.88); color: #fff; box-shadow: 0 12px 30px #182d4d36; font-size: 13px; text-align: center; transform: translate(-50%,12px); opacity: 0; pointer-events: none; transition: transform .2s,opacity .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .link-form, .icon-button, .toast { backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }
}
@media (max-width: 420px) {
  .shell { width: calc(100% - 28px); padding-top: 12px; }
  .home { padding-top: clamp(64px,22dvh,150px); }
  .watch { padding-top: 13px; }
  .player-shell { border-radius: 17px; }
  .mark-area { margin: 17px 0 22px; }
  .mark-button { height: 56px; }
}
@media (max-height: 650px) {
  .home { padding-top: 22px; }
  .recent { margin-top: 18px; }
  .watch { padding-top: 8px; }
  .mark-area { margin: 13px 0 18px; }
  .mark-button { height: 54px; }
}
/* Mobile GPUs should not composite animated gradients behind blurred glass. */
@media (max-width: 680px), (pointer: coarse) {
  .home::before, .home::after { animation: none; transform: none; will-change: auto; opacity: .42; }
  .link-form, .icon-button, .toast { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .link-form, .icon-button { background: rgba(255,255,255,.78); }
  .link-form { box-shadow: inset 0 1px 1px #ffffffc2, 0 7px 22px rgba(37,58,90,.09); }
  .link-form:focus-within { box-shadow: inset 0 1px 1px #ffffffc2, 0 0 0 3px rgba(117,153,202,.18), 0 7px 22px rgba(37,58,90,.09); }
  .watch:not(.hide), .mark-row.fresh { animation: none; }
}
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  :root { --glass: #fff; --row: #fff; --edge: #afbac8; }
  .link-form, .icon-button { background: #fff; }
  .link-form, .icon-button, .toast { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .home::before, .home::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .home::before, .home::after { will-change: auto; }
}
