@import url("assets/fonts/AppleSDGothicNeo/AppleSDGothicNeo.css");

:root {
  color-scheme: light;
  --page: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f2f4f6;
  --ink: #191f28;
  --muted: #6b7684;
  --subtle: #8b95a1;
  --line: #e5e8eb;
  --line-strong: #d1d6db;
  --blue: #3182f6;
  --blue-soft: #e8f3ff;
  --profit: #f04452;
  --loss: #3182f6;
  --shadow: 0 18px 40px rgba(25, 31, 40, 0.045);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: rgba(49, 130, 246, 0.12);
}

button,
select,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
  translate: 0 -180%;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 14px;
  text-decoration: none;
}

.skip-link:focus-visible {
  translate: 0;
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: calc(30px + env(safe-area-inset-top)) clamp(20px, 4vw, 64px) 56px;
}

.top-nav {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.nav-link,
.hero-actions a.seg-button {
  color: var(--muted);
  text-decoration: none;
}

.nav-link {
  min-height: 36px;
  border-radius: 11px;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 800;
}

.nav-link.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 10px 0 28px;
  animation: rise 420ms ease-out both;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.16;
}

.summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
  text-wrap: pretty;
}

.hero-actions,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 4px;
}

.seg-button {
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.seg-button:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.seg-button:active {
  transform: scale(0.98);
}

.seg-button:focus-visible,
select:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid rgba(49, 130, 246, 0.35);
  outline-offset: 3px;
}

.seg-button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(25, 31, 40, 0.08);
}

.totals-grid {
  display: grid;
  grid-template-columns: 1.28fr 1fr 1fr;
  gap: clamp(16px, 2vw, 24px);
  margin: 0 0 clamp(20px, 2vw, 28px);
}

.metric-card {
  min-width: 0;
  border: 1px solid rgba(229, 232, 235, 0.9);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(20px, 2vw, 30px);
  animation: rise 460ms ease-out both;
}

button.metric-card {
  appearance: none;
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button.metric-card:hover {
  border-color: rgba(49, 130, 246, 0.32);
  box-shadow: 0 18px 42px rgba(25, 31, 40, 0.075);
}

button.metric-card:active {
  transform: translateY(1px);
}

button.metric-card:focus-visible {
  outline: 3px solid rgba(49, 130, 246, 0.35);
  outline-offset: 3px;
}

.metric-card:nth-child(2) {
  animation-delay: 70ms;
}

.metric-card:nth-child(3) {
  animation-delay: 140ms;
}

.metric-card--primary {
  background: linear-gradient(145deg, #1b64da, #3182f6);
  color: var(--surface);
  border-color: transparent;
}

button.metric-card.metric-card--primary {
  color: var(--surface);
}

.metric-card strong {
  display: block;
  margin: 9px 0 9px;
  font-size: clamp(1.65rem, 1.5vw, 2.55rem);
  font-weight: 650;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.metric-label,
.metric-card span:last-child {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.metric-card--primary .metric-label,
.metric-card--primary span:last-child {
  color: rgba(255, 255, 255, 0.68);
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.4vw, 32px);
}

.chart-panel,
.table-panel {
  min-width: 0;
  border: 1px solid rgba(229, 232, 235, 0.9);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 2.3vw, 34px);
  animation: rise 540ms ease-out both;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.chart-readout,
.table-time {
  color: var(--subtle);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: right;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toolbar-toggles {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-left: auto;
}

.stock-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.94rem;
  font-weight: 650;
}

.stock-picker select {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 10px 34px 10px 12px;
  font-weight: 700;
}

.chart-wrap {
  position: relative;
  height: clamp(320px, 38vh, 460px);
  min-height: 320px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  overflow: hidden;
}

#chart {
  display: block;
  width: 100%;
  height: 100%;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.96);
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 800;
}

th:first-child,
td:first-child {
  text-align: left;
}

td {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 650;
}

.stock-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.stock-name strong,
.stock-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-name strong {
  font-weight: 800;
}

.stock-name span {
  color: var(--subtle);
  font-size: 0.8rem;
  font-weight: 600;
}

.positive {
  color: var(--profit);
}

.negative {
  color: var(--loss);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 48px 12px;
}

.empty-state--compact {
  padding: 8px 0;
  text-align: left;
  font-weight: 750;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(460px, 100%);
  border: 1px solid rgba(229, 232, 235, 0.9);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 36px);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 13px 14px;
  font-weight: 750;
}

.auth-form input:focus-visible {
  outline: 3px solid rgba(49, 130, 246, 0.35);
  outline-offset: 3px;
}

.auth-error {
  margin: 0;
  color: var(--profit);
  font-size: 0.9rem;
  font-weight: 750;
}

.current-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  align-items: center;
  border: 1px solid rgba(49, 130, 246, 0.16);
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow);
  padding: clamp(20px, 2.2vw, 30px);
}

.current-panel[hidden] {
  display: none;
}

.current-anime {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.current-anime strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 850;
  line-height: 1.16;
}

.current-anime span {
  color: var(--muted);
  font-weight: 750;
}

.edit-current {
  min-width: 0;
}

.edit-fields--current {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr);
}

.edit-row--current {
  align-items: stretch;
}

.current-editor {
  width: 100%;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr) auto;
  align-items: end;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.maple-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(20px, 2.4vw, 32px);
  align-items: start;
}

.maple-detail {
  display: grid;
  gap: clamp(18px, 2vw, 26px);
  min-width: 0;
}

.maple-sidebar {
  position: sticky;
  top: 24px;
  min-width: 0;
  border: 1px solid rgba(229, 232, 235, 0.9);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(20px, 2vw, 28px);
}

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

.character-button {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.character-button__portrait {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.character-button__portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.character-button__portrait img {
  transform: translateY(-6%) scale(1.85);
}

.character-button__content {
  min-width: 0;
}

.character-button__content strong,
.character-button__content span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-button__content strong {
  font-weight: 850;
}

.character-button__content span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.character-button.is-active {
  border-color: rgba(49, 130, 246, 0.24);
  background: var(--blue-soft);
  color: var(--blue);
}

.maple-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 2vw, 28px);
  align-items: center;
  border: 1px solid rgba(49, 130, 246, 0.16);
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow);
  padding: clamp(20px, 2.2vw, 32px);
}

.maple-avatar {
  display: grid;
  place-items: center;
  width: clamp(140px, 15vw, 220px);
  aspect-ratio: 1;
  border-radius: 22px;
  background: var(--surface-soft);
  overflow: hidden;
}

.maple-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translateY(-6%) scale(1.75);
}

.maple-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.maple-stat-grid .metric-card {
  padding: clamp(18px, 1.8vw, 24px);
}

.metric-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.metric-card--estimate {
  border-color: rgba(49, 130, 246, 0.24);
  background: var(--blue-soft);
}

.maple-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.maple-card-grid--skills {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.maple-skill-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.maple-skill-tabs::-webkit-scrollbar {
  display: none;
}

.maple-equipment-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.maple-equipment-tabs::-webkit-scrollbar {
  display: none;
}

.maple-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.maple-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-soft);
}

.maple-hover-source {
  cursor: help;
}

.maple-item strong,
.maple-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maple-item strong {
  font-size: 0.92rem;
  font-weight: 850;
}

.maple-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.maple-tooltip {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 1000;
  width: min(360px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.maple-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.maple-tooltip__content {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: #282828;
  color: #f7f7f7;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  padding: 14px;
}

.maple-tooltip__stars {
  color: #ffd733;
  font-size: 1.0rem;
  letter-spacing: 1px;
  line-height: 1;
  text-align: center;
}

.maple-tooltip__title {
  font-size: 1rem;
  font-weight: 850;
  text-align: center;
}

.maple-tooltip__subtitle {
  color: #f7f7f7;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.maple-tooltip__body {
  display: grid;
  gap: 10px;
}

.maple-tooltip__iconline {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-top: 1px dashed rgba(255, 255, 255, 0.28);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.28);
  padding: 10px 0;
}

.maple-tooltip__iconline img {
  width: 54px;
  height: 54px;
  border-radius: 4px;
  background: #efefef;
}

.maple-tooltip__iconline strong,
.maple-tooltip__iconline span {
  display: block;
  color: #f7f7f7;
  font-size: 0.82rem;
  white-space: normal;
}

.maple-tooltip__section {
  display: grid;
  gap: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.22);
  padding-top: 10px;
}

.maple-tooltip__iconline + .maple-tooltip__section {
  border-top: 0;
  padding-top: 0;
}

.maple-tooltip__section strong {
  color: #f7f7f7;
  font-size: 0.84rem;
}

.maple-tooltip__section span {
  color: #f7f7f7;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: normal;
}

.maple-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.maple-option-total {
  color: #48f5ff;
}

.maple-option-total.option-total-base {
  color: #ffffff;
}

.maple-option-row em {
  color: #ffffff;
  font-style: normal;
}

.maple-option-row i {
  font-style: normal;
}

.option-base {
  color: #ffffff;
}

.option-add {
  color: #a7f255;
}

.option-etc {
  color: #b481ff;
}

.option-starforce {
  color: #ffd733;
}

.maple-tooltip__potential {
  padding-top: 8px;
}

.maple-tooltip__potential strong {
  font-weight: 900;
}

.maple-tooltip__potential .potential-rare {
  color: #72d9ff;
}

.maple-tooltip__potential .potential-epic {
  color: #7c3cff;
}

.maple-tooltip__potential .potential-unique {
  color: #ffb72e;
}

.maple-tooltip__potential .potential-legendary {
  color: #a7f255;
}

.maple-tooltip__description span {
  color: #d8dde6;
}

.maple-tooltip__soul strong {
  color: #ffdf4d;
}

.maple-tooltip__soul span {
  color: #f7f7f7;
}

.maple-tooltip__symbol-stats b {
  color: #ffdf4d;
}

.maple-tooltip__hexa-stat .hexa-stat-main {
  color: #ff6b6b;
  font-weight: 850;
}

.maple-tooltip__hexa-stat .hexa-stat-sub {
  color: #f7f7f7;
  font-weight: 750;
}

.maple-footer {
  margin-top: clamp(28px, 4vw, 52px);
  border-top: 1px solid var(--line);
  padding: 18px 0 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.anime-workspace {
  gap: 20px;
}

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

.blog-search {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.blog-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(18px, 2vw, 28px);
  align-items: start;
}

.blog-grid {
  display: grid;
  gap: 10px;
}

.blog-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.blog-card:hover {
  border-color: rgba(49, 130, 246, 0.26);
}

.blog-card.is-active {
  border-color: rgba(49, 130, 246, 0.34);
  background: var(--blue-soft);
}

.blog-card strong {
  font-size: 1.02rem;
  font-weight: 850;
}

.blog-card__date {
  justify-self: end;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-card__tags span {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--blue);
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 850;
}

.blog-reader {
  min-height: 420px;
}

@media (min-width: 1181px) {
  .blog-reader {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.blog-reader__head {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.blog-reader__head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.blog-content {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.78;
}

.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content p,
.blog-content ul,
.blog-content pre {
  margin: 0;
}

.blog-content a,
.blog-source {
  color: var(--blue);
  font-weight: 800;
}

.blog-content code {
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 2px 5px;
}

.blog-content pre {
  overflow-x: auto;
  border-radius: 14px;
  background: #191f28;
  color: #f7f7f7;
  padding: 14px;
}

.blog-source {
  display: inline-flex;
  width: fit-content;
  margin-top: 18px;
  text-decoration: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding-top: 18px;
}

.anime-card,
.anime-row,
.edit-row,
.edit-form {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.anime-card {
  padding: 16px;
}

.anime-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.anime-card__head > :first-child {
  min-width: 0;
}

.anime-card__head strong,
.anime-row strong,
.edit-row strong,
.edit-form strong {
  font-weight: 850;
}

.anime-card__head span,
.anime-row span,
.edit-row span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.anime-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.anime-chip {
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.anime-chip.is-watched {
  background: var(--blue-soft);
  color: var(--blue);
}

.anime-chip--waiting {
  border: 1px dashed rgba(49, 130, 246, 0.42);
  background: #fff;
  color: var(--muted);
}

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

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

#editWatched.edit-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.anime-row,
.edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.anime-row > div,
.edit-row > div:first-child {
  display: grid;
  gap: 4px;
}

.anime-row--dated {
  display: block;
}

.anime-row--stacked {
  display: block;
}

.anime-row--stacked > div {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
  height: 100%;
  width: 100%;
}

.anime-row--stacked strong {
  grid-row: 1;
}

.anime-row--stacked span {
  grid-row: 3;
  align-self: end;
}

.anime-row--dated > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  gap: 4px 12px;
  height: 100%;
  width: 100%;
}

.anime-row--dated strong {
  grid-column: 1 / -1;
  grid-row: 1;
}

.anime-row--dated span {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
}

.anime-row--dated time {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.anime-row time {
  color: var(--blue);
  font-weight: 850;
  white-space: nowrap;
}

.edit-forms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.edit-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr) auto;
  align-items: end;
  gap: 10px;
  padding: 16px;
}

.edit-form strong {
  grid-column: 1 / -1;
}

.edit-form input,
.edit-fields input,
.title-field input,
.season-editor input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
  font-weight: 650;
}

.edit-form[data-add="waiting"] {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr) minmax(160px, 0.35fr) auto;
}

.primary-button,
.row-actions button,
.edit-row--stack button[data-action="delete-anime"] {
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
  cursor: pointer;
}

.icon-text-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--blue);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.icon-text-button {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1.1rem;
  line-height: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.34);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 22px;
}

.maple-add-form {
  margin-top: 16px;
  grid-template-columns: 1fr;
}

.form-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.row-actions button:last-child,
.edit-row--stack button[data-action="delete-anime"] {
  background: var(--surface-soft);
  color: var(--muted);
}

.edit-row--stack {
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: stretch;
  gap: 14px;
  padding: 18px;
}

.edit-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.45fr) minmax(140px, 0.32fr);
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.edit-fields label,
.title-field,
.season-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.title-field {
  flex: 1 1 auto;
  min-width: 0;
}

.edit-row.edit-row--stack > .anime-card__head {
  display: flex;
  align-items: end;
  gap: 12px;
}

.season-editor {
  display: grid;
  align-self: end;
  gap: 10px;
  margin-top: 0;
  padding-top: 2px;
}

.season-editor__row {
  display: grid;
  grid-template-columns: minmax(180px, 420px) auto auto;
  gap: 8px;
  align-items: end;
  justify-content: start;
}

.season-editor__row .anime-chip,
.compact-danger {
  justify-self: end;
  white-space: nowrap;
}

.compact-danger {
  flex: 0 0 auto;
  width: auto;
  min-width: 56px;
}

#editWatched .title-field,
#editWatched .season-editor label {
  font-size: 0.84rem;
}

#editWatched .title-field input,
#editWatched .season-editor input {
  font-size: 0.98rem;
}

#editWatched .anime-chip,
#editWatched .compact-danger {
  font-size: 0.88rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@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: 1180px) {
  .totals-grid {
    grid-template-columns: 1fr;
  }

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

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

  .maple-sidebar {
    position: static;
    order: -1;
  }

  .chart-wrap {
    height: 340px;
    min-height: 340px;
  }
}

@media (max-width: 720px) {
  .shell {
    padding-inline: 16px;
    padding-bottom: 32px;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .top-nav {
    display: flex;
    width: 100%;
  }

  .nav-link {
    flex: 1;
    text-align: center;
  }

  .panel-heading,
  .toolbar,
  .toolbar-toggles {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .toolbar .segmented,
  .maple-skill-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .toolbar .segmented::-webkit-scrollbar,
  .maple-skill-tabs::-webkit-scrollbar {
    display: none;
  }

  .seg-button {
    flex: 1 0 auto;
    min-width: 0;
    width: auto;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .toolbar .seg-button {
    flex-basis: 0;
    font-size: 0.86rem;
  }

  .stock-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-picker select {
    width: 100%;
  }

  .chart-wrap {
    height: 300px;
    min-height: 300px;
    margin-inline: -4px;
  }

  .metric-card,
  .current-panel,
  .maple-hero-card,
  .maple-sidebar,
  .chart-panel,
  .table-panel {
    border-radius: 18px;
    padding: 20px;
  }

  .maple-hero-card,
  .maple-stat-grid {
    grid-template-columns: 1fr;
  }

  .edit-forms {
    grid-template-columns: 1fr;
  }

  .edit-form,
  .edit-form[data-add="waiting"],
  .edit-fields,
  .current-panel,
  .season-editor__row {
    grid-template-columns: 1fr;
  }

  .anime-row,
  .edit-row:not(.edit-row--stack) {
    align-items: stretch;
    flex-direction: column;
  }

  #editWatched.edit-list {
    grid-template-columns: 1fr;
  }

  .anime-card__head,
  .edit-row.edit-row--stack > .anime-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button {
    flex: 1;
  }

  .season-editor__row .anime-chip,
  .compact-danger {
    justify-self: stretch;
  }
}
