@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4f4f0;
  --panel: #ffffff;
  --text: #171717;
  --muted: #515151;
  --border: #e1e1e1;
  --shadow: 0 14px 30px rgba(20, 20, 20, 0.08);
  --shadow2: 0 10px 24px rgba(20, 20, 20, 0.06);
  --blue: #1e4bd8;
  --red: #ff4b4b;
  --pause: #f4f4f4;

  --active_ring: rgba(34, 197, 94, 0.85);
  --active_bg: rgba(34, 197, 94, 0.10);
  --pause_splash: radial-gradient(120% 140% at 18% 18%, rgba(17, 5, 5, 0.22), rgba(255, 255, 255, 0.0) 62%), linear-gradient(180deg, rgba(255, 75, 75, 0.18), rgba(255, 75, 75, 0.10));
  --pause_text: rgba(92, 10, 10, 0.92);
  --pause_ring: rgba(255, 75, 75, 0.62);

  --glass_bg: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.44));
  --glass_bg_soft: rgba(255, 255, 255, 0.66);
  --glass_border: rgba(255, 255, 255, 0.22);
  --glass_border_soft: rgba(120, 120, 120, 0.16);
  --glass_shadow: 0 22px 58px rgba(15, 17, 20, 0.12);
  --glass_shadow2: 0 14px 36px rgba(15, 17, 20, 0.10);

  --card_glow: radial-gradient(520px 240px at 18% 18%, rgba(210, 235, 255, 0.22), transparent 62%), radial-gradient(480px 260px at 90% 42%, rgba(104, 5, 71, 0.16), transparent 64%), radial-gradient(560px 320px at 50% 120%, rgba(200, 255, 230, 0.12), transparent 64%);
  --card_glow_opacity: .4;
}
.cat-wrapper{
    width:170px;
    height:80px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    border-radius:12px;
    background:transparent; /* change to #222 if you want a placeholder */
}

.cat-wrapper img{
    width:100%;
    height:100%;
    object-fit:contain;      /* keeps the whole cat visible */
    display:block;
    opacity:0;
    transition:opacity .25s ease;
}

.cat-wrapper img.loaded{
    opacity:1;
}
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
   user-select: none; /* Standard syntax */
    -webkit-user-select: none; /* Safari and Chrome */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
}

html[data-theme="dark"] {
  --bg: #0f1114;
  --panel: #161a20;
  --text: #f3f3f4;
  --muted: #a7aab0;
  --border: #2b3038;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
  --shadow2: 0 12px 34px rgba(0, 0, 0, 0.35);
  --blue: #4d7cff;
  --red: #ff5a5a;
  --pause: #13171e;

  --active_ring: rgba(74, 222, 128, 0.78);
  --active_bg: rgba(74, 222, 128, 0.14);
  --pause_splash: radial-gradient(120% 140% at 18% 18%, rgba(255, 90, 90, 0.22), rgba(0, 0, 0, 0.0) 62%), linear-gradient(180deg, rgba(255, 90, 90, 0.18), rgba(255, 90, 90, 0.10));
  --pause_text: rgba(255, 235, 235, 0.92);
  --pause_ring: rgba(255, 120, 120, 0.70);

  --glass_bg: linear-gradient(180deg, rgba(22, 26, 32, 0.82), rgba(22, 26, 32, 0.46));
  --glass_bg_soft: rgba(12, 14, 16, 0.52);
  --glass_border: rgba(255, 255, 255, 0.14);
  --glass_border_soft: rgba(255, 255, 255, 0.12);
  --glass_shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
  --glass_shadow2: 0 16px 44px rgba(0, 0, 0, 0.40);

  --card_glow: radial-gradient(520px 240px at 18% 18%, rgba(120, 200, 255, 0.16), transparent 62%), radial-gradient(480px 260px at 90% 42%, rgba(255, 120, 190, 0.14), transparent 64%), radial-gradient(560px 320px at 50% 120%, rgba(120, 255, 200, 0.10), transparent 64%);
  --card_glow_opacity: 0.25;
}

html.theme-anim body {
  transition: background 0.4s ease, color 0.4s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.tabs {
   padding: 16px clamp(12px, 2vw, 24px)
           calc(90px + env(safe-area-inset-bottom));
  display: grid;
  gap: 16px;
  min-height: 100dvh;
  align-content: center; /* Prevents grid items from stretching vertically */
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  #tabHome {
    width: min(100%, 1607px);
    justify-self: center;
  }

  #tabExplore,
  #tabProfile {
    width: min(100%, 540px);
    justify-self: center;
  }
}

@media (max-width: 700px) {
  .tabs {
    padding: 16px 16px calc(140px + env(safe-area-inset-bottom));
    gap: 20px;
  }

  input,
  select,
  button {
    font-size: 16px;
  }

  .tab-view.active {
    gap: 20px;
  }
}


.header {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 26px;
  background: var(--glass_bg);
  border: 1px solid var(--glass_border_soft);
  box-shadow: var(--glass_shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  animation: rise 0.6s ease;
  transition: transform 0.14s ease;
  transform-origin: center;
}

 .header:active {
  transform: scale(0.995);
 }

 .header::before {
  content: "";
  position: absolute;
  inset: -60px -80px;
  background:
    radial-gradient(520px 240px at 18% 18%, rgba(210, 235, 255, 0.22), transparent 60%),
    radial-gradient(480px 260px at 90% 40%, rgba(255, 210, 240, 0.18), transparent 62%),
    radial-gradient(560px 320px at 50% 120%, rgba(200, 255, 230, 0.12), transparent 62%);
  pointer-events: none;
  filter: blur(2px);
 }

 .header-dash {
  width: 100%;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 12px;
  align-items: stretch;
 }

 .dash-card {
  position: relative;
  border-radius: 22px;
  padding: 16px 18px 0px 18px;
  background: var(--glass_bg);
  border: 1px solid var(--glass_border);
  box-shadow: var(--glass_shadow2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transition: transform 0.14s ease;
  transform-origin: center;
 }

 .dash-card:active {
  transform: scale(0.97);
 }

 .dash-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
 }

 .dash-left {
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 15px;
 }

 .dash-left::before {
  content: "";
  position: absolute;
  inset: -120px -80px;
  background:
    radial-gradient(520px 240px at 20% 15%, rgba(140, 200, 255, 0.25), transparent 62%),
    radial-gradient(420px 220px at 50% 120%, rgba(255, 255, 255, 0.10), transparent 62%);
  pointer-events: none;
 }

 .dash-right {
  display: flex;
  
  gap: 8px;
  align-content: space-between;
  justify-content: space-between;
  justify-items: start;
  align-items: center;
  text-align: end;
 }

.header-stack {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.clock {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

#status {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.subline {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.settings-btn {
  position: absolute;
  left: 12px;
  top: 12px;
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.18s ease, background 0.25s ease;
}

.home-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.18s ease, background 0.25s ease;
}

.home-btn:hover {
  transform: translateY(-1px);
  background: rgba(120, 120, 120, 0.16);
}

.settings-btn:hover {
  transform: translateY(-1px);
  background: rgba(120, 120, 120, 0.16);
}

.current-card {
  display: none;
  width: min(520px, 92vw);
  background: rgba(120, 120, 120, 0.08);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}

.current-title {
  font-size: 34px;
  font-weight: 950;
  letter-spacing: 0.2px;
  line-height: 1.08;
  color: var(--text);
}

@supports (-webkit-background-clip: text) {
  html:not([data-theme="dark"]) .current-title {
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.96), rgba(58, 58, 58, 0.88));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  html[data-theme="dark"] .current-title {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(210, 235, 255, 0.86));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.current-sub {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text);
  font-weight: 800;
  opacity: 0.92;
}

/* Explore view */
.explore-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.explore-title {
  font-size: 28px;
  font-weight: 800;
}

.explore-refresh {
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.explore-controls {
  display: flex;
  flex-direction: column;
  /* grid-template-columns: 0.4fr minmax(140px, 220px); */
  gap: 16px;
}

.explore-search,
.explore-sort {
  padding: 6px 14px;
  line-height: 1.2;
  min-height: 44px;
  border-radius: 18px;
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  font-weight: 700;
  color: var(--text);
}

.explore-search:focus,
.explore-sort:focus {
  outline: none;
}

.explore-meta {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.explore-list {
  display: grid;
  gap: 9px;
}

.explore-group {
  background: var(--glass_bg);
  border-radius: 12px;
  box-shadow: var(--glass_shadow2);
  overflow: hidden;
  border: 1px solid var(--glass_border_soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  isolation: isolate;
}

 .explore-group::before {
  content: "";
  position: absolute;
  inset: -80px -120px;
  background: var(--card_glow);
  opacity: var(--card_glow_opacity);
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
 }

 .explore-group > * {
  position: relative;
  z-index: 1;
 }

.explore-group-head {
  padding: 12px 13px 11px;
  color: black;
  border-bottom: 1px solid rgba(222, 222, 222, 0.18);
  background-color: rgba(120, 120, 120, 0.11);
}

.explore-group-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.explore-group-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.explore-items {
  display: grid;
}

.explore-item {
  border: none;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.14s ease;
  transform-origin: center;
}

 .explore-item:active {
  transform: scale(0.985);
 }

.explore-item + .explore-item {
  border-top: 1px solid rgba(120, 120, 120, 0.18);
}

.explore-item-main {
  display: grid;
  gap: 4px;
}

.explore-item-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

.explore-item-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.explore-item-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.14);
  color: var(--text);
}

@media (max-width: 700px) {
  .explore-head {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .explore-title {
    font-size: 34px;
  }

  .explore-refresh {
    padding: 16px;
    font-size: 18px;
  }

  .explore-controls {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .explore-search,
  .explore-sort {
    font-size: 18px;
    padding: 18px;
  }

  .explore-meta {
    font-size: 18px;
  }

  .explore-group-title {
    font-size: 22px;
  }

  .explore-group-sub {
    font-size: 16px;
  }

  .explore-item {
    padding: 14px 14px;
  }

  .explore-item-title {
    font-size: 18px;
  }

  .explore-item-sub {
    font-size: 16px;
  }

  .explore-item-chip {
    font-size: 14px;
    padding: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header,
  .dash-card,
  .explore-item {
    transition: none;
  }

  .header:active,
  .dash-card:active,
  .explore-item:active {
    transform: none;
  }
}

.home-topbar {
  padding: 14px 14px 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.home-title {
  text-align: center;
  font-weight: 900;
  font-size: 16px;
}

.home-search,
.home-sort {
  padding: 4px 6px;
  border-radius: 16px;
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  font-weight: 700;
  color: var(--text);
  outline: none;
}

.home-search:focus,
.home-sort:focus {
  outline: none;
}

@media (max-width: 700px) {
  .home-title {
    font-size: 30px;
  }

  .home-topbar {
    padding: 22px 16px 16px;
  }

  .home-search,
  .home-sort {
    font-size: 22px;
    padding: 20px 18px;
    border-radius: 20px;
  }

  .home-back,
  .home-refresh {
    padding: 16px 18px;
    border-radius: 18px;
    font-size: 18px;
  }

  .home-item {
    padding: 22px 18px;
  }

  .home-item-title {
    font-size: 26px;
  }

  .home-item-sub {
    font-size: 18px;
  }

  .home-item-chip {
    font-size: 17px;
    padding: 12px 14px;
  }
}

.home-back,
.home-refresh {
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  color: var(--text);
}

/* Profile view */
.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 20px;
  background: var(--glass_bg);
  border-radius: 26px;
  box-shadow: var(--glass_shadow);
  border: 1px solid var(--glass_border_soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

 .profile-hero::before {
  content: "";
  position: absolute;
  inset: -80px -120px;
  background: var(--card_glow);
  opacity: var(--card_glow_opacity);
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
 }

 .profile-hero > * {
  position: relative;
  z-index: 1;
 }

.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: linear-gradient(140deg, rgba(120, 120, 120, 0.18), rgba(120, 120, 120, 0.06));
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1px;
}

.profile-hero-text {
  display: grid;
  gap: 6px;
}

.profile-hero-name {
  font-size: 26px;
  font-weight: 900;
}

.profile-hero-email {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.profile-card {
  background: var(--glass_bg);
  border-radius: 22px;
  box-shadow: var(--glass_shadow2);
  padding: 20px 22px;
  display: grid;
  gap: 18px;
  border: 1px solid var(--glass_border_soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

 .profile-card::before {
  /* content: ""; */
  position: absolute;
  inset: -80px -120px;
  background: var(--card_glow);
  opacity: var(--card_glow_opacity);
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
 }

 .profile-card > * {
  position: relative;
  z-index: 1;
 }

.profile-card-title {
  font-size: 18px;
  font-weight: 800;
}

.auth-status {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.auth-form,
.profile-form {
  display: grid;
  gap: 14px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-wide {
  grid-column: 1 / -1;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  color: var(--text);
  font-weight: 700;
  outline: none;
}

.auth-input:focus {
  border-color: var(--border);
  box-shadow: none;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-btn {
  border: 1px solid var(--glass_border_soft);
  background: rgba(120, 120, 120, 0.10);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
}

#saveProfileBtn.is-unsaved {
  border-color: rgba(255, 75, 75, 0.45);
  background: rgba(255, 75, 75, 0.12);
}

#saveProfileBtn.is-saved {
  border-color: rgba(30, 180, 90, 0.45);
  background: rgba(30, 180, 90, 0.14);
}

.auth-btn.secondary {
  border-color: var(--glass_border_soft);
  background: rgba(120, 120, 120, 0.10);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

 .setting-row::before {
  content: "";
  position: absolute;
  inset: -80px -120px;
  background: var(--card_glow);
  opacity: var(--card_glow_opacity);
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
 }

 .setting-row > * {
  position: relative;
  z-index: 1;
 }

.setting-name {
  font-weight: 800;
  font-size: 16px;
}

.setting-desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.toggle {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.toggle-track {
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.26);
  border: 1px solid rgba(120, 120, 120, 0.22);
  display: flex;
  align-items: center;
  padding: 4px;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.toggle-thumb {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--glass_bg_soft);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  transform: translateX(0);
  transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.toggle.on .toggle-track {
  background: rgba(120, 120, 120, 0.26);
  border-color: rgba(120, 120, 120, 0.28);
}

.toggle.on .toggle-thumb {
  transform: translateX(24px);
}

.settings-hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 700px) {
  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 18px;
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
  }

  .profile-hero-name {
    font-size: 32px;
  }

  .profile-hero-email {
    font-size: 18px;
  }

  .profile-card {
    padding: 22px 24px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .auth-input,
  .auth-btn {
    padding: 18px 20px;
    font-size: 18px;
  }

  .setting-row {
    padding: 18px;
  }

  .setting-name {
    font-size: 20px;
  }

  .setting-desc {
    font-size: 16px;
  }
}

@media (max-width: 700px) {
  .home-title {
    font-size: 30px;
  }

  .home-topbar {
    padding: 22px 16px 16px;
  }

  .home-back,
  .home-refresh {
    padding: 16px 18px;
    border-radius: 18px;
    font-size: 18px;
  }

  .home-controls {
    padding: 0 16px 16px;
    gap: 14px;
  }

  .home-search,
  .home-sort {
    font-size: 22px;
    padding: 20px 18px;
    border-radius: 20px;
  }

  .home-meta {
    padding: 0 16px 16px;
    font-size: 18px;
  }

  .home-list {
    padding: 0 16px 24px;
    gap: 16px;
  }

  .home-group {
    border-radius: 22px;
  }

  .home-group-head {
    padding: 18px 18px 14px;
  }

  .home-group-title {
    font-size: 22px;
  }

  .home-group-sub {
    font-size: 16px;
  }

  .home-item {
    padding: 22px 18px;
    gap: 14px;
  }

  .home-item-title {
    font-size: 26px;
  }

  .home-item-sub {
    font-size: 18px;
  }

  .home-item-chip {
    font-size: 17px;
    padding: 12px 14px;
  }
}

/* Tab bar */
.tabbar {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: var(--glass_bg_soft);
  border-top: 1px solid var(--glass_border_soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  justify-content: space-around;
  padding: 12px clamp(16px, 5vw, 32px) calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 28px rgba(15, 17, 20, 0.10);
  gap: clamp(18px, 6vw, 48px);
}

.tab-btn {
  appearance: none;
  border: none;
  background: none;
  flex: 1;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.4px;
}
/*  */

.tab-btn:focus,
.tab-btn:active,
.tab-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

button:focus,
button:focus-visible,
button:active {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

/*  */
.tab-btn svg {
  width: 26px;
  height: 26px;
  transition: transform 0.24s ease, color 0.24s ease;
}

.tab-btn.active {
  color: var(--text);
}

.tab-btn.active svg {
  transform: translateY(-2px);
}

@media (max-width: 700px) {
  .tabbar {
    padding: 16px clamp(20px, 12vw, 40px) calc(18px + env(safe-area-inset-bottom));
    gap: 26px;
  }

  .tab-btn {
    font-size: 14px;
    gap: 8px;
  }

  .tab-btn svg {
    width: 32px;
    height: 32px;
  }
}


.settings-hint.toast {
  color: var(--text);
  background: transparent;
  border: none;
  padding: 12px 16px;
  border-radius: 18px;
  
  animation: hintPop 0.38s ease;
}

.home-empty-hint {
  margin: 10px 12px 6px;
  font-size: 13px;
  line-height: 1.35;
  
  color: var(--muted);
  font-weight: 600;
}

.home-empty-hint.is-clickable {
  color: var(--text);
  cursor: pointer;
}

@keyframes hintPop {
  from {
    transform: translateY(6px);
    opacity: 0.55;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Students sheet */
.students-sheet {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 20, 0.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: none 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: clamp(16px, 5vw, 32px);
  z-index: 40;
  overflow-x: hidden;
}

 html[data-theme="dark"] .students-sheet {
  background: rgba(0, 0, 0, 0.45);
 }

.students-sheet.show {
  opacity: 1;
  pointer-events: auto;
}

.students-sheet > * {
  width: min(520px, 100%);
  background: var(--glass_bg);
  border: 1px solid var(--glass_border_soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

 .students-sheet > *::before {
  content: "";
  position: absolute;
  inset: -80px -120px;
  background: var(--card_glow);
  opacity: var(--card_glow_opacity);
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
 }

 .students-sheet > * > * {
  position: relative;
  z-index: 1;
 }

.students-sheet > *:first-child {
  border-radius: 26px 26px 0 0;
  box-shadow: 0 28px 60px rgba(15, 17, 20, 0.38);
}

.students-sheet > *:last-child {
  border-radius: 0 0 18px 18px;
  box-shadow: 0 28px 60px rgba(15, 17, 20, 0.38);
}

.students-sheet > * + * {
  border-top: 1px solid rgba(120, 120, 120, 0.18);
}

.students-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.students-back,
.students-refresh {
  border: 1px solid var(--glass_border_soft);
  background: rgba(120, 120, 120, 0.10);
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.students-title {
  text-align: center;
  font-weight: 900;
  font-size: 18px;
}

.students-controls {
  padding: 18px 20px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.students-search,
.students-sort {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg_soft);
  color: var(--text);
  font-weight: 700;
  outline: none;
}

.students-search:focus,
.students-sort:focus {
  outline: none;
}

.students-meta {
  padding: 0 20px 12px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.students-list {
  padding: 0 20px 24px;
  overflow: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 12px;
}

.students-list::-webkit-scrollbar {
  width: 10px;
}

.students-list::-webkit-scrollbar-track {
  background: rgba(120, 120, 120, 0.14);
  border-radius: 999px;
}

.students-list::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.40);
  border-radius: 999px;
  border: 2px solid rgba(120, 120, 120, 0.14);
}

html[data-theme="dark"] .students-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .students-list::-webkit-scrollbar-thumb {
  background: rgba(90, 90, 90, 0.85);
  border-color: rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .students-list {
  scrollbar-color: rgba(90, 90, 90, 0.85) rgba(0, 0, 0, 0.45);
}

.students-group {
  border: 1px solid var(--glass_border_soft);
  background: var(--glass_bg);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.students-group-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(120, 120, 120, 0.18);
}

.students-group-title {
  font-weight: 800;
  font-size: 16px;
}

.students-group-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.students-items {
  display: grid;
}

.students-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px 18px;
  background: var(--glass_bg_soft);
  min-width: 0;
}

.students-item + .students-item {
  border-top: 1px solid rgba(120, 120, 120, 0.18);
}

.students-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.students-item-title {
  font-weight: 800;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.students-item-sub {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.students-item-chip {
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.12);
}

@media (max-width: 700px) {
  .students-sheet > * {
    width: 100%;
  }

  .students-sheet > *:first-child {
    border-radius: 30px 30px 0 0;
  }

  .students-sheet > *:last-child {
    border-radius: 0 0 24px 24px;
  }

  .students-topbar {
    grid-template-columns: auto 1fr auto;
    justify-items: stretch;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .students-back {
    justify-self: start;
  }

  .students-refresh {
    justify-self: end;
  }

  .students-controls {
    grid-template-columns: 1fr;
  }

  .students-search,
  .students-sort {
    font-size: 18px;
    padding: 16px;
  }

  .students-meta {
    font-size: 16px;
  }

  .students-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .students-item-title {
    font-size: 20px;
  }

  .students-item-sub {
    font-size: 16px;
  }
}

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: min(300px, calc(100% - 32px));
  height: 60px;
  background: var(--glass_bg_soft);
  border: 1px solid var(--glass_border_soft);
  border-radius: 999px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 8px;
  box-shadow: var(--glass_shadow2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 50;
  -webkit-tap-highlight-color: transparent;
}

html[data-theme="dark"] .tabbar {
  background: var(--glass_bg_soft);
  border: 1px solid var(--glass_border_soft);
  box-shadow: var(--glass_shadow2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tab-btn {
  appearance: none;
  border: none;
  background: none;
  height: 48px;
  width: 100%;
  display: grid;
  place-items: center;
  color: rgba(23, 23, 23, 0.55);
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

html[data-theme="dark"] .tab-btn {
  color: rgba(243, 243, 244, 0.55);
}

.tab-btn svg {
  width: 24px;
  height: 24px;
}

.tab-btn.active {
  color: var(--text);
}

.tab-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

@media (max-width: 700px) {
  .tabbar {
    bottom: 14px;
    width: min(300px, calc(100% - 28px));
    height: 66px;
    padding: 10px;
  }

  .tab-btn {
    height: 54px;
  }

  .tab-btn svg {
    width: 28px;
    height: 28px;
  }
}

.progress-wrap {
  background: linear-gradient(180deg, rgba(120, 120, 120, 0.08), rgba(120, 120, 120, 0.03));
  border: 1px solid rgba(120, 120, 120, 0.16);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow2);
  text-align: center;
}

.progress-track {
  position: relative;
  margin: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.22);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(18, 18, 18, 0.86);
  transition: width 0.3s ease;
}

html[data-theme="dark"] .progress-fill {
  background: rgba(243, 243, 244, 0.92);
}

.progress-meta {
  /* margin-top: 8px; */
  /* font-size: 13px; */
  /* z-index: -40; */
  /* color: var(--text); */
  /* opacity: 0.74; */
  /* font-weight: 700; */
}


.table-wrapper {
  --table-zoom: 1;
  overflow: hidden;
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.7s ease;
  position: relative;
  padding: 64px 12px 14px;
}

 .table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
 }

 .table-scroll::-webkit-scrollbar {
  height: 12px;
 }

 .table-scroll::-webkit-scrollbar-track {
  background: rgba(120, 120, 120, 0.16);
  border-radius: 999px;
 }

 .table-scroll::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.40);
  border-radius: 999px;
  border: 3px solid rgba(120, 120, 120, 0.16);
 }

 html[data-theme="dark"] .table-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.10);
 }

 html[data-theme="dark"] .table-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.10);
 }

 html[data-theme="dark"] .table-scroll {
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.10);
 }

table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  margin: 0;
  zoom: var(--table-zoom);
}

.table-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 12;
}

.table-tools-btn {
  display: grid;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.table-control-btn {
  width: 38px;
  height: 38px;
  border-radius: 18px;
  border: 1px solid rgba(120, 120, 120, 0.32);
  background: rgba(24, 24, 24, 0.82);
  display: grid;
  place-items: center;
  color: #f6f6f6;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(15, 17, 20, 0.25);
  transition: transform 0.18s ease;
}

.table-control-btn.table-tools-btn {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--text);
}

.table-control-btn svg {
  width: 19px;
  height: 19px;
}

.table-control-btn:active {
  transform: scale(0.94);
}

.table-actions:not(.is-open) .table-tool {
  display: none;
}

.table-actions.is-open .table-tool {
  animation: tableToolIn 0.22s ease both;
}

.table-actions.is-open .table-tool:nth-of-type(1) {
  animation-delay: 0.02s;
}

.table-actions.is-open .table-tool:nth-of-type(2) {
  animation-delay: 0.04s;
}

.table-actions.is-open .table-tool:nth-of-type(3) {
  animation-delay: 0.06s;
}

.table-actions.is-open .table-tool:nth-of-type(4) {
  animation-delay: 0.08s;
}

.table-actions.is-open .table-tool:nth-of-type(5) {
  animation-delay: 0.10s;
}

.table-actions.is-open .table-tool:nth-of-type(6) {
  animation-delay: 0.12s;
}

.table-actions.is-open {
  left: 12px;
  justify-content: flex-end;
}

.table-clear-btn {
  color: #ff6969;
}

.table-edit-btn.on {
  border-color: rgba(120, 120, 120, 0.46);
}

.table-edit-btn.on svg {
  transform: rotate(-1deg);
}

.table-wrapper.table-fullscreen {
  display: grid;
  grid-template-rows: 1fr;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  padding: 64px 14px 18px;
  background: var(--panel);
}

.table-wrapper.table-fullscreen .table-scroll {
  align-self: center;
  max-height: calc(100vh - 82px);
  max-height: calc(100dvh - 82px);
  overflow: auto;
}

.table-wrapper.table-fullscreen table {
  min-width: max-content;
}

.table-wrapper.table-fullscreen .table-fullscreen-btn {
  border-color: rgba(120, 120, 120, 0.46);
}

body.table-lock-scroll {
  overflow: hidden;
}

@keyframes tableToolIn {
  from {
    opacity: 0;
    transform: translateX(8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (max-width: 700px) {
  .table-wrapper {
    padding: 76px 14px 18px;
  }

  .table-actions {
    top: 14px;
    right: 14px;
    left: auto;
    justify-content: flex-end;
    gap: 7px;
  }

  .table-actions.is-open {
    left: 14px;
    justify-content: space-between;
  }

  .table-tools-btn {
    width: 36px;
    height: 36px;
    border-radius: 16px;
  }

  .table-control-btn {
    width: clamp(36px, 10vw, 44px);
    height: clamp(36px, 10vw, 44px);
    border-radius: 18px;
  }

  .table-control-btn svg {
    width: 22px;
    height: 22px;
  }

  .table-tools-btn svg {
    width: 28px;
    height: 28px;
  }

  .table-scroll {
    overscroll-behavior-x: contain;
  }

  .table-wrapper.table-fullscreen {
    padding: 82px 12px 14px;
  }

  .table-wrapper.table-fullscreen .table-scroll {
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  .table-wrapper.table-fullscreen.landscape-fallback {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    height: 100dvw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center;
    z-index: 100;
  }

  .table-wrapper.table-fullscreen.landscape-fallback .table-scroll {
    max-height: calc(100vw - 96px);
    max-height: calc(100dvw - 96px);
  }
}

th, td {
  border: 1px solid var(--border);
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
  font-size: 14px;
  transition: background 0.3s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

th {
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 2;
}

tr th:first-child {
  position: sticky;
  left: 0;
  z-index: 3; width: 120px;
  background: var(--panel);

}
tr th:first-child,
td:first-child {
  left: -0.9rem;
}

.th-top {
  font-weight: 700;
  font-size: 13px;
}

tr.today th:first-child {
  background: var(--bg);position: sticky;
  color: var(--text);
  font-weight: 700;
}

tr.today td {
  background: rgba(255, 255, 255, 0.04);
}

td.pause {
  background: var(--pause);
  font-weight: 600;
  color: var(--text);
}

td.active {
  font-weight: 700;
  color: var(--text);
}

 td.active:not(.break) {
  background: var(--active_bg);
  box-shadow: inset 0 0 0 2px var(--active_ring);
 }

td.active.break {
  background: var(--pause_splash);
  box-shadow: inset 0 0 0 2px var(--pause_ring);
  color: var(--pause_text);
}
/* ----------------------------------------------------- */
tr.today td.active {
  position: relative;
  overflow: hidden;
}

/* Ripple layer */
tr.today td.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border: inset 2px rgba(0, 0, 0, 0.979);
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.18);
  transform: scale(0.85);
  opacity: 0;
  animation: ActiveRipple 4s ease-in-out infinite;
}

 tr.today td.active.break::after {
  background: rgba(255, 75, 75, 0.20);
 }

/* Keyframes */
@keyframes ActiveRipple {
  0% {
    transform: scale(1.85);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* ----------------------------------------------------- */
td.active::after {
  content: none;
}

.selected {
  box-shadow: inset 0 0 0 1px rgba(120, 120, 120, 0.35);
}

td.editing {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(120, 120, 120, 0.45);
  background: rgba(120, 120, 120, 0.10);
}

td.editing::after {
  opacity: 0;
}

.ripple {
  position: absolute;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.25);
  transform: scale(0);
  animation: ripple 0.55s ease-out;
  pointer-events: none;
}

@keyframes activeRing {
  0%, 100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.22;
    transform: scale(0.985);
  }
}

@keyframes ripple {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes splash {
  0% {
    transform: scale(0.75);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.1);
    opacity: 0.15;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@media (max-width: 700px) {
  .header {
    padding: 12px;
  }
  .header-dash {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dash-card {
    padding: 18px 18px;
    border-radius: 24px;
  }
  .settings-btn,
  .home-btn {
    padding: 16px;
    border-radius: 16px;
  }
  .clock {
    font-size: 22px;
  }
  .current-title {
    font-size: 36px;
  }
  .current-sub {
    font-size: 16px;
  }
  .subline {
    font-size: 14px;
  }
  th, td {
    padding: 8px;
    font-size: 13px;
  }
  .progress-wrap {
    padding: 10px 12px 12px;
  }
  .progress-meta {
    font-size: 20px;
  }
}
.github-button {
  background: var(--panel);
  border-radius: 20px;


}
