:root {
  color-scheme: light;
  --page: #f4f7fb;
  --ink: #14161d;
  --muted: #6b717d;
  --panel: #fbfbfc;
  --panel-soft: #edf1f6;
  --line: #d9dde4;
  --line-dark: rgba(17, 22, 32, 0.16);
  --teal: #0f8b8d;
  --teal-dark: #0a6668;
  --coral: #e0523f;
  --amber: #f4b942;
  --violet: #6652a3;
  --green: #3b946e;
  --field: #ffffff;
  --field-muted: #e9edf2;
  --panel-alpha: rgba(255, 255, 255, 0.94);
  --card-bg: #ffffff;
  --tile-bg: rgba(255, 255, 255, 0.9);
  --login-card-bg: rgba(255, 255, 255, 0.96);
  --text-soft: #454b55;
  --active-tab-bg: #14161d;
  --active-tab-ink: #ffffff;
  --hero-ink: #11151d;
  --hero-muted: rgba(17, 22, 32, 0.7);
  --chrome-control-bg: rgba(255, 255, 255, 0.72);
  --chrome-control-border: rgba(17, 22, 32, 0.16);
  --chrome-control-hover: rgba(255, 255, 255, 0.94);
  --chrome-control-ink: #14161d;
  --body-glow: radial-gradient(circle at 78% 18%, rgba(15, 139, 141, 0.16), transparent 28%);
  --body-gradient: linear-gradient(180deg, rgba(244, 247, 251, 0.82), rgba(244, 247, 251, 0.94) 430px, #eef2f7 940px);
  --backdrop-image: url("assets/anime-rain-bg.jpg");
  --backdrop-opacity: 0.26;
  --backdrop-filter: saturate(0.82) contrast(0.95) brightness(1.08);
  --backdrop-position: top center;
  --backdrop-size: cover;
  --grid-line-a: rgba(17, 22, 32, 0.045);
  --grid-line-b: rgba(17, 22, 32, 0.035);
  --shadow: 0 24px 70px rgba(28, 37, 52, 0.14);
  --shadow-strong: 0 30px 90px rgba(28, 37, 52, 0.22);
  --focus-glow: 0 0 0 4px rgba(15, 139, 141, 0.14);
  --surface-shine: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  --display-font: "Showcard Gothic", "Bauhaus 93", "Cooper Black", "Arial Black", "Trebuchet MS", sans-serif;
  --body-font: "Trebuchet MS", "Yu Gothic", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1017;
  --ink: #f5f7fb;
  --muted: #a7b0bf;
  --panel: #171c26;
  --panel-soft: #222938;
  --line: #30394a;
  --line-dark: rgba(255, 255, 255, 0.18);
  --field: #101520;
  --field-muted: #252d3b;
  --panel-alpha: rgba(23, 28, 38, 0.94);
  --card-bg: #151a24;
  --tile-bg: rgba(23, 28, 38, 0.92);
  --login-card-bg: rgba(23, 28, 38, 0.94);
  --text-soft: #c5cbd7;
  --active-tab-bg: #f5f7fb;
  --active-tab-ink: #11151d;
  --hero-ink: #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.74);
  --chrome-control-bg: rgba(255, 255, 255, 0.12);
  --chrome-control-border: rgba(255, 255, 255, 0.24);
  --chrome-control-hover: rgba(255, 255, 255, 0.2);
  --chrome-control-ink: #ffffff;
  --body-glow: radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.18), transparent 28%);
  --body-gradient: linear-gradient(180deg, rgba(8, 10, 16, 0.34), rgba(8, 10, 16, 0.78) 430px, #111622 940px);
  --backdrop-opacity: 0.74;
  --backdrop-filter: saturate(0.95) contrast(1.04) brightness(0.78);
  --grid-line-a: rgba(255, 255, 255, 0.045);
  --grid-line-b: rgba(255, 255, 255, 0.035);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-strong: 0 34px 96px rgba(0, 0, 0, 0.46);
  --focus-glow: 0 0 0 4px rgba(15, 139, 141, 0.2);
  --surface-shine: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  background-color: var(--page);
  background-image:
    var(--body-glow),
    var(--body-gradient);
  background-position:
    top center,
    top center;
  background-repeat: no-repeat;
  background-size:
    100% 760px,
    100% 940px;
  background-attachment: fixed, fixed;
  color: var(--ink);
  font-family: var(--body-font);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--backdrop-image);
  background-position: var(--backdrop-position);
  background-repeat: no-repeat;
  background-size: var(--backdrop-size);
  opacity: var(--backdrop-opacity);
  filter: var(--backdrop-filter);
  transform: scale(1.02);
  transform-origin: center;
  will-change: transform;
  animation: backdropDrift 28s ease-in-out infinite alternate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line-a) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-b) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, #000, transparent 58%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.sprite {
  display: none;
}

[hidden] {
  display: none !important;
}

@keyframes backdropDrift {
  from {
    transform: scale(1.02) translate3d(-10px, -6px, 0);
  }

  to {
    transform: scale(1.055) translate3d(12px, 8px, 0);
  }
}

@keyframes surfaceIn {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes itemIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes accentSweep {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 220px 0;
  }
}

@keyframes barBeat {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }

  50% {
    transform: translateY(-8px) scaleY(1.08);
  }
}

@keyframes softPulse {
  0%,
  100% {
    opacity: 0.48;
  }

  50% {
    opacity: 0.9;
  }
}

@keyframes updateAlert {
  0%,
  100% {
    border-color: rgba(224, 82, 63, 0.62);
    box-shadow: 0 0 0 0 rgba(224, 82, 63, 0.38);
    color: var(--coral);
  }

  50% {
    border-color: var(--coral);
    box-shadow: 0 0 0 7px rgba(224, 82, 63, 0);
    color: #fff;
  }
}

.access-screen,
.profile-screen {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
}

.access-screen {
  display: grid;
  place-items: center;
}

.access-card {
  position: relative;
  width: min(430px, 100%);
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--login-card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: surfaceIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.access-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--surface-shine);
  opacity: 0.55;
  transform: translateX(-110%) skewX(-16deg);
  transition: transform 700ms ease;
}

.access-card:hover::before {
  transform: translateX(110%) skewX(-16deg);
}

.access-heading {
  margin-bottom: 18px;
}

.access-heading h1,
.profile-stage h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1.1;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: var(--card-bg);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(17, 22, 32, 0.08);
}

.auth-form {
  margin-top: 4px;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--coral);
  font-size: 0.86rem;
  font-weight: 850;
}

.profile-screen {
  display: grid;
  align-content: start;
}

.profile-session-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 52px;
  color: var(--hero-muted);
  animation: itemIn 380ms ease both;
}

.profile-session-bar p {
  margin-bottom: 0;
  font-weight: 850;
}

.profile-stage {
  display: grid;
  justify-items: center;
  padding: 72px 0 38px;
  text-align: center;
  color: var(--hero-ink);
}

.profile-stage h1 {
  color: var(--hero-ink);
  font-size: clamp(2rem, 6vw, 4rem);
  animation: surfaceIn 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 176px));
  justify-content: center;
  gap: 24px;
  width: 100%;
  margin-top: 34px;
}

.profile-card {
  position: relative;
  min-width: 0;
  animation: itemIn 420ms ease both;
  animation-delay: calc(var(--item-index, 0) * 70ms);
}

.profile-select {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hero-muted);
  font-size: 1rem;
  font-weight: 900;
}

.profile-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--avatar-color), rgba(17, 21, 29, 0.88)),
    #11151d;
  color: #fff;
  font-family: var(--display-font);
  font-size: 2.4rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar.has-image span {
  opacity: 0;
}

.profile-select:hover,
.profile-select:focus-visible {
  color: var(--hero-ink);
  outline: none;
}

.profile-select:hover .profile-avatar,
.profile-select:focus-visible .profile-avatar {
  border-color: var(--hero-ink);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.34);
  transform: translateY(-2px);
}

.profile-card-name {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.58);
  color: #fff;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.profile-card:hover .profile-delete,
.profile-card:focus-within .profile-delete {
  opacity: 1;
  transform: translateY(0);
}

.profile-delete:hover,
.profile-delete:focus-visible {
  border-color: var(--coral);
  background: rgba(224, 82, 63, 0.92);
  outline: none;
}

.profile-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.profile-add-form {
  display: flex;
  gap: 10px;
  width: min(390px, 100%);
  margin-top: 34px;
}

.profile-add-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--chrome-control-border);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

.profile-add-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.24);
}

.profile-add-form.is-disabled {
  opacity: 0.68;
}

.profile-add-form.is-disabled input,
.profile-add-form.is-disabled button {
  cursor: not-allowed;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 38px;
  animation: surfaceIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
}

.side-panel {
  position: sticky;
  top: 16px;
  align-self: start;
  min-width: 0;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alpha);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: itemIn 360ms ease 70ms both;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    padding 180ms ease,
    border-color 180ms ease;
}

.app-shell.sidebar-collapsed .side-panel {
  padding: 0;
  border-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
}

.side-panel-heading {
  padding: 18px 18px 12px;
}

.side-panel-heading h2 {
  color: var(--ink);
}

.side-nav {
  display: grid;
  gap: 8px;
  padding: 0 12px 14px;
}

.side-nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  text-align: left;
  overflow: hidden;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.side-nav button:hover {
  border-color: var(--line);
  background: var(--field-muted);
  color: var(--ink);
  transform: translateX(2px);
}

.side-nav button.active {
  border-color: rgba(15, 139, 141, 0.46);
  background: rgba(15, 139, 141, 0.14);
  color: var(--teal-dark);
}

.side-nav button.active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(15, 139, 141, 0.16), transparent);
  background-size: 220px 100%;
  animation: accentSweep 2.8s linear infinite;
}

.side-nav button span,
.side-nav button svg {
  position: relative;
  z-index: 1;
}

.side-nav-group {
  display: grid;
  gap: 6px;
}

.side-nav-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 900;
}

.side-nav-group:has(button.active) .side-nav-parent {
  color: var(--ink);
}

.side-nav-children {
  display: grid;
  gap: 6px;
  padding-left: 30px;
}

.side-nav-children button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.side-nav-children button::before {
  content: "";
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.56;
}

.side-nav svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-content {
  min-width: 0;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 16px;
  color: var(--chrome-control-ink);
  animation: itemIn 360ms ease 90ms both;
}

.topbar-actions,
.card-actions,
.panel-heading,
.toolbar,
.filter-tabs,
.card-title-row,
.meta-row {
  display: flex;
  align-items: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: var(--hero-muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #fff;
  font-family: var(--display-font);
  font-size: clamp(2.4rem, 8vw, 5.65rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow:
    3px 4px 0 rgba(224, 82, 63, 0.95),
    -2px 2px 0 rgba(15, 139, 141, 0.95),
    0 18px 46px rgba(0, 0, 0, 0.52);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.46);
}

h2 {
  margin-bottom: 0;
  font-family: var(--display-font);
  font-size: 1.18rem;
  line-height: 1.2;
}

.topbar-actions {
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.profile-widget {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--chrome-control-border);
  border-radius: 8px;
  background: var(--chrome-control-bg);
  backdrop-filter: blur(14px);
}

.profile-picker {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(244, 185, 66, 0.92), rgba(224, 82, 63, 0.88)),
    #101116;
  box-shadow:
    0 0 0 4px rgba(15, 139, 141, 0.28),
    0 14px 32px rgba(0, 0, 0, 0.28);
  color: #fff;
  font-family: var(--display-font);
  font-size: 1rem;
  font-weight: 950;
}

.profile-picker input {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.profile-picker img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.profile-picker.has-image img {
  opacity: 1;
}

.profile-widget .mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.active-profile-name {
  max-width: 150px;
  color: var(--chrome-control-ink);
  font-size: 0.9rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-widget .mini svg {
  width: 15px;
  height: 15px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(16, 17, 22, 0.06);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.icon-button svg {
  transition: transform 180ms ease;
}

.icon-button:hover svg,
.icon-button:focus-visible svg {
  transform: scale(1.08) rotate(-4deg);
}

.theme-toggle {
  position: relative;
}

.theme-toggle .theme-icon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun,
:root[data-theme="light"] .theme-icon-moon {
  display: block;
}

.floating-theme-toggle {
  position: absolute;
  top: 24px;
  right: 0;
  z-index: 2;
  border-color: var(--chrome-control-border);
  background: var(--chrome-control-bg);
  color: var(--chrome-control-ink);
}

.floating-theme-toggle:hover {
  border-color: var(--teal);
  background: var(--chrome-control-hover);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .icon-button {
  border-color: var(--chrome-control-border);
  background: var(--chrome-control-bg);
  color: var(--chrome-control-ink);
  box-shadow: none;
}

.profile-session-bar .icon-button,
.profile-add-form .icon-button {
  border-color: var(--chrome-control-border);
  background: var(--chrome-control-bg);
  color: var(--chrome-control-ink);
  box-shadow: none;
}

.icon-button:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

.topbar .icon-button:hover {
  border-color: var(--teal);
  background: var(--chrome-control-hover);
}

.profile-session-bar .icon-button:hover,
.profile-add-form .icon-button:hover {
  border-color: var(--teal);
  background: var(--chrome-control-hover);
}

.icon-button svg,
.primary-button svg,
.search-field svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button.subtle {
  box-shadow: none;
}

.icon-button.danger:hover {
  border-color: var(--coral);
  color: var(--coral);
}

body.settings-open {
  overflow: hidden;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 10, 16, 0.62);
  backdrop-filter: blur(12px);
}

.settings-panel {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--panel-alpha);
  box-shadow: var(--shadow);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-header h2 {
  color: var(--ink);
}

.settings-nav {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-nav button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: rgba(15, 139, 141, 0.12);
  color: var(--ink);
  font-weight: 900;
}

.settings-nav button.active {
  background: var(--teal);
  color: #fff;
}

.settings-nav button.update-available,
.settings-open.update-available {
  animation: updateAlert 1.15s ease-in-out infinite;
}

.account-summary {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.account-summary strong {
  color: var(--ink);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.settings-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-form .field,
.settings-form .primary-button {
  margin-top: 0;
}

.settings-form-title {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.settings-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.settings-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--coral);
  font-size: 0.86rem;
  font-weight: 850;
}

.settings-message[data-tone="success"] {
  color: var(--green);
}

.version-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-muted);
}

.version-summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.version-summary strong {
  font-family: var(--display-font);
  font-size: 1.25rem;
}

.update-state-card {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.update-state-card strong {
  display: block;
  color: var(--ink);
}

.update-state-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.45;
}

.update-state-card[data-status="available"],
.update-state-card[data-status="error"] {
  border-color: rgba(224, 82, 63, 0.52);
}

.update-state-card[data-status="available"] strong,
.update-state-card[data-status="error"] strong {
  color: var(--coral);
}

.update-state-card[data-status="current"] {
  border-color: rgba(59, 148, 110, 0.52);
}

.update-state-card[data-status="current"] strong {
  color: var(--green);
}

.update-progress {
  height: 7px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field-muted);
}

.update-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 180ms ease;
}

.update-install-button {
  background: linear-gradient(90deg, #9e3027, #e0523f) !important;
  animation: updateAlert 1.15s ease-in-out infinite;
}

.file-action {
  position: relative;
  overflow: hidden;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.stats-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.stat-tile {
  position: relative;
  min-height: 96px;
  padding: 17px 16px 15px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--tile-bg);
  box-shadow: 0 16px 34px rgba(7, 9, 15, 0.14);
  animation: itemIn 420ms ease both;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.stat-tile:hover {
  border-color: rgba(15, 139, 141, 0.36);
  box-shadow: 0 22px 48px rgba(7, 9, 15, 0.2);
  transform: translateY(-2px);
}

.stat-tile:nth-child(1) {
  animation-delay: 40ms;
}

.stat-tile:nth-child(2) {
  animation-delay: 80ms;
}

.stat-tile:nth-child(3) {
  animation-delay: 120ms;
}

.stat-tile:nth-child(4) {
  animation-delay: 160ms;
}

.stat-tile:nth-child(5) {
  animation-delay: 200ms;
}

.stat-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--teal);
}

.stat-tile:nth-child(2)::before {
  background: var(--violet);
}

.stat-tile:nth-child(3)::before {
  background: var(--green);
}

.stat-tile:nth-child(4)::before {
  background: var(--coral);
}

.stat-tile:nth-child(5)::before {
  background: var(--amber);
}

.stat-number {
  display: block;
  font-family: var(--display-font);
  font-size: 2.28rem;
  font-weight: 900;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(294px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.editor-panel,
.library-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alpha);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: itemIn 420ms ease both;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.editor-panel:hover,
.library-panel:hover {
  border-color: rgba(15, 139, 141, 0.28);
  box-shadow: var(--shadow-strong);
}

.editor-panel {
  position: sticky;
  top: 16px;
  overflow: hidden;
  animation-delay: 120ms;
}

.library-panel {
  animation-delay: 170ms;
}

.editor-panel::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--coral), var(--violet), var(--teal));
  background-size: 220% 100%;
  animation: accentSweep 5s linear infinite;
}

.anime-form {
  padding: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.cover-picker {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid #b8c0ca;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.28), transparent 40%),
    linear-gradient(315deg, rgba(244, 185, 66, 0.42), transparent 44%),
    var(--panel-soft);
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 1.9rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.34);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.cover-picker::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(35, 43, 54, 0.24);
  border-radius: 8px;
}

.cover-picker::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--surface-shine);
  opacity: 0.45;
  transform: translateX(-120%) skewX(-14deg);
  transition: transform 700ms ease;
}

.cover-picker:hover {
  border-color: var(--teal);
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.34),
    0 18px 42px rgba(7, 9, 15, 0.12);
  transform: translateY(-1px);
}

.cover-picker:hover::after {
  transform: translateX(120%) skewX(-14deg);
}

.cover-picker.has-image::after {
  display: none;
}

.cover-picker input {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.cover-picker img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.cover-picker.has-image::before {
  display: none;
}

.cover-picker.has-image img {
  opacity: 1;
}

.cover-picker.has-image span {
  opacity: 0;
}

.text-button {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 850;
}

.text-button.ghost {
  background: var(--field-muted);
  color: var(--muted);
}

.text-button.ghost:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.field,
.status-group {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span,
.status-group legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.field input,
.field textarea,
.toolbar select,
.search-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.field input,
.field textarea,
.toolbar select {
  padding: 11px 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.toolbar select:focus,
.search-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.12);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 0;
  padding: 0;
}

.status-group legend {
  grid-column: 1 / -1;
  padding: 0;
}

.status-group label {
  position: relative;
}

.status-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-group span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.status-group input:checked + span {
  border-color: var(--teal);
  background: rgba(15, 139, 141, 0.12);
  color: var(--teal-dark);
  box-shadow: inset 0 -3px 0 rgba(15, 139, 141, 0.2);
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, #11151d, #172831 58%, #0a6668),
    var(--ink);
  color: #fff;
  font-weight: 900;
  overflow: hidden;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--surface-shine);
  transform: translateX(-120%) skewX(-12deg);
  transition: transform 680ms ease;
}

.primary-button:hover::after,
.primary-button:focus-visible::after {
  transform: translateX(120%) skewX(-12deg);
}

.primary-button span,
.primary-button svg {
  position: relative;
  z-index: 1;
}

.library-panel {
  min-height: 590px;
  padding: 18px;
}

.toolbar {
  gap: 10px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 12px;
  background: var(--field);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.toolbar select {
  flex: 0 0 190px;
  min-height: 46px;
}

.filter-tabs {
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.filter-tabs button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.filter-tabs button:hover {
  border-color: #aeb6c2;
  transform: translateY(-1px);
}

.filter-tabs button.active {
  border-color: var(--active-tab-bg);
  background: var(--active-tab-bg);
  color: var(--active-tab-ink);
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 15px;
}

.anime-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 10px 24px rgba(17, 22, 32, 0.08);
  animation: itemIn 440ms ease both;
  animation-delay: calc(var(--item-index, 0) * 42ms);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.anime-card:hover {
  border-color: rgba(15, 139, 141, 0.46);
  box-shadow: 0 20px 42px rgba(17, 22, 32, 0.14);
  transform: translateY(-2px);
}

.anime-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  z-index: 3;
  background: var(--green);
}

.anime-card[data-status="completed"]::before {
  background: var(--violet);
}

.anime-card[data-status="planned"]::before {
  background: var(--coral);
}

.anime-card[data-status="waiting"]::before {
  background: var(--amber);
}

.poster-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(102, 82, 163, 0.34), transparent 42%),
    linear-gradient(315deg, rgba(224, 82, 63, 0.26), transparent 42%),
    #e7ebf0;
}

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.22)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 26%, transparent 76%, rgba(0, 0, 0, 0.1));
}

.poster-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: var(--surface-shine);
  opacity: 0.5;
  transform: translateX(-120%) skewX(-12deg);
  transition: transform 720ms ease;
}

.anime-card:hover .poster-frame::before {
  transform: translateX(120%) skewX(-12deg);
}

.poster,
.poster-fallback {
  position: absolute;
  inset: 0;
}

.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.anime-card:hover .poster {
  transform: scale(1.045);
}

.poster-fallback {
  display: grid;
  place-items: center;
  color: rgba(21, 22, 26, 0.58);
  font-family: var(--display-font);
  font-size: 2.1rem;
  font-weight: 950;
  letter-spacing: 0;
}

.poster-fallback::before,
.poster-fallback::after {
  content: "";
  position: absolute;
  width: 64%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.poster-fallback::before {
  top: 20%;
}

.poster-fallback::after {
  bottom: 19%;
  width: 44%;
  background: rgba(20, 22, 29, 0.16);
}

.card-body {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  min-width: 0;
  padding: 13px;
}

.card-title-row {
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-title-row h3 {
  min-width: 0;
  margin-bottom: 0;
  font-family: var(--display-font);
  font-size: 1.02rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.status-pill {
  flex: 0 0 auto;
  max-width: 112px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(59, 148, 110, 0.13);
  color: #2f7659;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.completed {
  background: rgba(102, 82, 163, 0.13);
  color: var(--violet);
}

.status-pill.planned {
  background: rgba(224, 82, 63, 0.12);
  color: var(--coral);
}

.status-pill.waiting {
  background: rgba(244, 185, 66, 0.22);
  color: #8a640b;
}

.meta-row {
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.meta-row span {
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--panel-soft);
}

.rating-label {
  color: #8a640b;
  background: rgba(244, 185, 66, 0.2) !important;
}

.notes {
  display: -webkit-box;
  min-height: 38px;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-actions {
  justify-content: flex-end;
  gap: 7px;
}

.card-actions .icon-button {
  width: 35px;
  height: 35px;
  box-shadow: none;
}

.card-actions .icon-button svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  display: none;
  place-items: center;
  min-height: 380px;
  text-align: center;
}

.empty-state.visible {
  display: grid;
}

.empty-visual {
  position: relative;
  width: min(320px, 72vw);
  height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13, 16, 23, 0.7), rgba(13, 16, 23, 0.15)),
    url("assets/anime-rain-bg.jpg");
  background-position: 62% center;
  background-size: 620px auto;
  box-shadow: 0 18px 38px rgba(17, 22, 32, 0.12);
}

.empty-visual span {
  position: absolute;
  bottom: 24px;
  width: 50px;
  height: 82px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--teal);
  transform-origin: bottom;
  animation: barBeat 1.8s ease-in-out infinite;
}

.empty-visual span:nth-child(1) {
  left: 76px;
  height: 104px;
  background: var(--coral);
  animation-delay: 0ms;
}

.empty-visual span:nth-child(2) {
  left: 132px;
  bottom: 36px;
  background: var(--amber);
  animation-delay: 140ms;
}

.empty-visual span:nth-child(3) {
  left: 188px;
  height: 112px;
  background: var(--violet);
  animation-delay: 280ms;
}

.empty-state h2 {
  margin-top: 15px;
  color: var(--muted);
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 900px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    max-height: none;
  }

  .app-shell.sidebar-collapsed .side-panel {
    display: none;
  }

  .side-panel-heading {
    padding-bottom: 8px;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
  }

  .side-nav-group {
    flex: 1 1 260px;
  }

  .side-nav-parent {
    justify-content: center;
  }

  .side-nav-children {
    grid-template-columns: 1fr 1fr;
    padding-left: 0;
  }

  .side-nav button {
    flex: 1 1 150px;
    justify-content: center;
  }

  .side-nav button:hover {
    transform: translateY(-1px);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  .cover-picker {
    max-height: 520px;
  }
}

@media (max-width: 640px) {
  body {
    background-size:
      100% 660px,
      100% 820px;
  }

  body::after {
    background-size: 1200px auto;
  }

  .app-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 12px;
  }

  .access-screen,
  .profile-screen {
    width: min(100% - 20px, 1200px);
    padding: 18px 0;
  }

  .access-card {
    padding: 18px;
  }

  .settings-modal {
    align-items: start;
    padding: 12px;
  }

  .settings-panel {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .profile-stage {
    padding-top: 44px;
  }

  .profile-grid {
    grid-template-columns: repeat(2, minmax(118px, 150px));
    gap: 18px;
  }

  .topbar {
    align-items: flex-start;
    padding-bottom: 12px;
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
  }

  .toolbar {
    display: grid;
  }

  .toolbar select {
    flex-basis: auto;
  }

  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 12px;
  }

  .anime-card {
    min-height: 360px;
  }
}

@media (max-width: 430px) {
  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-self: end;
  }

  .profile-widget {
    order: -1;
    width: 100%;
    justify-content: space-between;
  }

  .active-profile-name {
    max-width: calc(100vw - 180px);
  }

  .profile-session-bar {
    justify-content: space-between;
  }

  .profile-add-form {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .field-grid,
  .status-group {
    grid-template-columns: 1fr;
  }

  .anime-grid {
    grid-template-columns: 1fr;
  }
}

/* Tacendax platform views */
.view-nav {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.view-nav button {
  min-height: 42px;
}

.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  margin-bottom: 16px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--panel-alpha);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  backdrop-filter: blur(14px);
}

.sync-banner[data-tone="success"] {
  border-color: rgba(59, 148, 110, 0.48);
  color: var(--green);
}

.sync-banner[data-tone="error"] {
  border-color: rgba(224, 82, 63, 0.48);
  color: var(--coral);
}

.sync-banner[data-tone="pending"] {
  border-color: rgba(244, 185, 66, 0.58);
  color: #a0730b;
}

.sync-banner .text-button {
  width: auto;
  min-width: 116px;
  margin: 0;
  padding: 0 12px;
}

.product-view {
  animation: surfaceIn 320ms ease both;
}

.product-view > .view-heading,
.hero-panel,
.dashboard-section,
.insight-panel,
.calendar-list {
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--panel-alpha);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 260px;
  padding: clamp(24px, 5vw, 54px);
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--panel-alpha) 12%, transparent 100%),
    linear-gradient(120deg, rgba(15, 139, 141, 0.18), rgba(102, 82, 163, 0.18)),
    var(--panel-alpha);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border: 70px solid rgba(15, 139, 141, 0.12);
  border-radius: 50%;
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.hero-panel h1,
.view-heading h1 {
  max-width: 780px;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

.hero-panel p:not(.eyebrow) {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.6;
}

.hero-actions {
  display: grid;
  flex: 0 0 min(260px, 100%);
  gap: 9px;
}

.compact {
  width: auto;
  min-height: 42px;
  margin-top: 0;
  padding: 0 14px;
}

.dashboard-section {
  margin-top: 18px;
  padding: 18px;
}

.section-heading,
.view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading button {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 900;
}

.rail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  min-height: 80px;
}

.mini-media-card {
  display: grid;
  grid-template-rows: 160px auto auto;
  gap: 7px;
  min-width: 0;
  padding: 0 0 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--ink);
  text-align: left;
}

.mini-media-card img,
.mini-fallback {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.mini-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.32), rgba(102, 82, 163, 0.38));
  font-family: var(--display-font);
  font-size: 1.8rem;
}

.mini-media-card strong,
.mini-media-card small {
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-media-card small {
  color: var(--muted);
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-row,
.calendar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.activity-row div,
.calendar-row div {
  display: grid;
  gap: 3px;
}

.activity-row span,
.activity-row time,
.calendar-row span,
.calendar-row time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.muted-empty,
.view-message {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.view-heading {
  padding: 22px;
}

.discover-search {
  display: flex;
  gap: 8px;
  flex: 0 1 520px;
}

.discover-search input,
.discover-media-tabs button,
.advanced-filters select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
}

.discover-search input {
  width: 100%;
}

.discover-media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.discover-media-tabs button {
  font-weight: 900;
}

.discover-media-tabs button.active {
  border-color: var(--active-tab-bg);
  background: var(--active-tab-bg);
  color: var(--active-tab-ink);
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.discover-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.discover-poster {
  min-height: 190px;
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.32), rgba(102, 82, 163, 0.38));
}

.discover-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discover-card > div:last-child {
  display: grid;
  align-content: start;
  padding: 13px;
}

.discover-card h3 {
  margin: 6px 0;
}

.discover-card span,
.discover-card p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.discover-card p {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.calendar-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding: 18px;
}

.calendar-row time {
  flex: 0 0 110px;
  color: var(--teal-dark);
}

.calendar-row div {
  flex: 1;
}

.calendar-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-muted);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 900;
}

#statsView > .stats-strip {
  margin-top: 16px;
}

.stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.insight-panel {
  padding: 18px;
}

.insight-panel h2 {
  margin-bottom: 14px;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(120px, 2fr) 28px;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.bar-row div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--field-muted);
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--violet));
}

.catalog-assist {
  position: relative;
  margin-bottom: 12px;
}

.catalog-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 8;
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.catalog-results button {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 9px;
  width: 100%;
  min-height: 62px;
  padding: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.catalog-results button:hover {
  background: var(--field-muted);
}

.catalog-results img {
  width: 46px;
  height: 58px;
  object-fit: cover;
  border-radius: 5px;
}

.catalog-results span {
  display: grid;
  align-content: center;
  gap: 4px;
}

.catalog-results small {
  color: var(--muted);
}

.favorite-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.favorite-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto auto;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.advanced-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.favorite-action.active {
  border-color: var(--amber);
  background: rgba(244, 185, 66, 0.18);
  color: #a0730b;
}

.progress-action {
  width: 42px !important;
  color: var(--teal-dark);
  font-weight: 950;
}

.preferences-settings-page .settings-form,
.data-settings-page .settings-form {
  border-top: 0;
}

.settings-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
}

:root[data-font-scale="large"] {
  font-size: 112.5%;
}

:root[data-font-scale="xlarge"] {
  font-size: 125%;
}

:root[data-contrast="high"] {
  --muted: var(--ink);
  --line: currentColor;
  --line-dark: currentColor;
  --text-soft: var(--ink);
}

:root[data-reduce-motion="true"] *,
:root[data-reduce-motion="true"] *::before,
:root[data-reduce-motion="true"] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 1ms !important;
}

@media (max-width: 1100px) {
  .advanced-filters {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 900px) {
  .view-nav {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    width: 100%;
    overflow-x: auto;
  }

  .hero-panel,
  .view-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions,
  .discover-search {
    flex-basis: auto;
    width: 100%;
  }

  .stats-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sync-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-banner .text-button {
    width: 100%;
  }

  .hero-panel {
    min-height: 230px;
    align-items: stretch;
    flex-direction: column;
  }

  .advanced-filters {
    grid-template-columns: 1fr 1fr;
  }

  .discover-grid {
    grid-template-columns: 1fr;
  }

  .calendar-row {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-row time {
    flex-basis: auto;
  }
}
