:root {
  --text: #26233a;
  --muted: #6f6a88;
  --white: rgba(255, 255, 255, 0.72);
  --white-strong: rgba(255, 255, 255, 0.88);
  --pink: #ff86d0;
  --violet: #9c6cff;
  --blue: #bcdfff;
  --green: #98dc44;
  --orange: #ff9838;
  --red: #ff5b69;
  --shadow: 0 18px 38px rgba(129, 105, 169, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(188, 223, 255, 0.75),
      transparent 28%
    ),
    radial-gradient(
      circle at top right,
      rgba(255, 134, 208, 0.35),
      transparent 24%
    ),
    linear-gradient(180deg, #eef6ff 0%, #f7f2ff 48%, #fff5fb 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  width: min(1320px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.app-frame {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(111, 106, 136, 0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, var(--blue), var(--pink));
  box-shadow: 0 12px 24px rgba(156, 108, 255, 0.18);
}

.brand strong {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 600;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(12px);
}

.coins-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.25),
    rgba(251, 191, 36, 0.25)
  );
  font-size: 0.8rem;
  font-weight: 600;
  color: #78350f;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  background: radial-gradient(
    circle at 35% 30%,
    #ffbf8e,
    #8a112b 60%,
    #291228 100%
  );
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.user-copy strong {
  display: block;
  font-size: 0.96rem;
  font-weight: 600;
}

.user-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.35rem;
}

.nav-main,
.nav-auth {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.nav-auth {
  margin-left: auto;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: auto;
  padding: 10px 16px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  background: white;
  color: #8b5cf6;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.nav a.primary,
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: auto;
  padding: 10px 16px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  background: white;
  color: #8b5cf6;
  cursor: pointer;
  box-shadow: none;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  box-shadow: none;
}

.button.danger,
button.danger {
  background: linear-gradient(90deg, #ff7979 0%, #ff4f90 100%);
  color: white;
}

.messages {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.message {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: var(--white-strong);
  box-shadow: var(--shadow);
}

.screen-pill,
.window,
.form-card,
.empty-state,
.task-card,
.mini-task,
.aside-card,
.detail-block,
.mini-stat {
  background: var(--white);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.screen-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1.2rem;
  padding: 1.15rem 1.35rem;
  border-radius: 1.5rem;
}

.screen-pill strong {
  display: block;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 600;
}

.screen-pill span,
.helper,
.muted {
  color: var(--muted);
}

.helper {
  font-size: 0.92rem;
  line-height: 1.55;
}

.window,
.form-card,
.empty-state {
  padding: 1.35rem;
  border-radius: 1.5rem;
}

.window-header,
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--violet);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metrics-row,
.panel-grid,
.task-board,
.detail-layout {
  display: grid;
  gap: 1rem;
}

.metrics-row {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1rem;
}

.mini-stat {
  padding: 1rem;
  border-radius: 1.1rem;
}

.mini-stat strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

.panel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list-stack {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;

  overflow-y: auto;
  max-height: 300px;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  border-radius: 5px;
  box-shadow: inset 0 0 6px rgba(74, 88, 99, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  box-shadow: inset 0 0 6px rgba(74, 88, 99, 0.7);
}

a {
  transition-duration: 0.1s;
}

a:hover {
  transform: scale(103%);
}

.mini-task,
.task-card,
.aside-card,
.detail-block {
  padding: 1rem;
  border-radius: 1.15rem;
}

.mini-task {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.mini-task-copy {
  display: grid;
  gap: 0.35rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.95rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.7);
}

.chip.status-todo {
  color: #c84768;
}

.chip.status-in_progress {
  color: #cc7a1f;
}

.chip.status-done {
  color: #5d9c13;
}

.chip.overdue,
.chip.priority-high {
  color: #c84768;
}

.chip.priority-medium {
  color: #c67d1b;
}

.chip.priority-low {
  color: #418d56;
}

.task-board {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 1rem;
}

.task-card {
  display: grid;
  gap: 0.85rem;
}

.task-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.task-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.task-copy,
.detail-copy {
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
}

.task-actions,
.detail-actions,
.card-actions,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.detail-layout {
  grid-template-columns: 320px minmax(0, 1fr);
  margin-top: 1rem;
}

.meta-grid,
.action-stack {
  display: grid;
  gap: 0.75rem;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.meta-item {
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.58);
}

.meta-item span {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.editor-shell {
  width: min(720px, 100%);
  margin: 0 auto;
}

.field {
  display: grid;
  gap: 0.45rem;
}

label {
  font-size: 0.94rem;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
  border: none;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.76);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 3.7rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  width: 2.15rem;
  min-height: 2.15rem;
  padding: 0;
  border-radius: 0.75rem;
  transform: translateY(-50%);
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
}

.password-toggle:hover {
  transform: translateY(-50%);
}

.password-icon {
  display: block;
}

.password-icon-hide,
.password-toggle[aria-pressed="true"] .password-icon-show {
  display: none;
}

.password-toggle[aria-pressed="true"] .password-icon-hide {
  display: block;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

.filter-row select {
  max-width: 220px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  background: white;
  color: #8b5cf6;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.errorlist {
  margin: 0;
  padding-left: 1rem;
  color: #c84768;
  font-size: 0.88rem;
}

.empty-state {
  text-align: center;
}

@media (max-width: 920px) {
  .panel-grid,
  .account-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 0.8rem;
  }

  .topbar,
  .screen-pill,
  .window-header,
  .detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    gap: 0.75rem;
  }

  .nav-main,
  .nav-auth {
    width: 100%;
  }

  .nav-auth {
    margin-left: 0;
  }

  .nav a.primary,
  .button,
  button {
    width: 100%;
  }

  .meta-row {
    grid-template-columns: 1fr;
  }

  .filter-row select {
    max-width: none;
  }
}

.account-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1rem;
}

.profile-hero {
  text-align: center;
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6.2rem;
  height: 6.2rem;
  margin-bottom: 1rem;
  border-radius: 2rem;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(145deg, var(--violet), var(--pink));
  box-shadow: 0 16px 28px rgba(156, 108, 255, 0.24);
}

.profile-hero h1,
.window h2,
.timeline-item h3 {
  margin: 0;
}

.profile-hero p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.meta-grid {
  margin-top: 1rem;
}

.meta-card span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta-card strong,
.meta-card a {
  word-break: break-word;
}

.spac {
  margin: 0.8rem 0;
}
