/* Lantern — pink study hall (oklch design tokens) */
:root {
  --radius: 0.75rem;
  --background: oklch(0.97 0.01 15);
  --foreground: oklch(0.20 0.03 15);
  --card: oklch(0.99 0.02 15);
  --card-foreground: oklch(0.20 0.03 15);
  --primary: oklch(0.60 0.20 15);
  --primary-foreground: oklch(0.98 0.01 80);
  --secondary: oklch(0.95 0.02 15);
  --muted-foreground: oklch(0.55 0.04 10);
  --border: oklch(0.85 0.02 10 / 60%);
  --input: oklch(0.92 0.02 15);
  --ring: oklch(0.60 0.20 15);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "cv11";
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }
  45% {
    opacity: 0.92;
    filter: brightness(1.05);
  }
  55% {
    opacity: 0.85;
    filter: brightness(0.95);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(20px, -30px) scale(1.08);
  }
}

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

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 oklch(0.7 0.14 15 / 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px oklch(0.7 0.14 15 / 0);
  }
}

@keyframes timelinePulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes timelineShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.ambient {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  animation: drift 18s ease-in-out infinite;
}

.orb--1 {
  top: -10rem;
  left: -10rem;
  width: 30rem;
  height: 30rem;
  background: radial-gradient(circle, oklch(0.82 0.14 15 / 0.4), transparent 70%);
}

.orb--2 {
  top: 33%;
  right: -8rem;
  width: 32rem;
  height: 32rem;
  animation-delay: -6s;
  background: radial-gradient(circle, oklch(0.78 0.12 350 / 0.3), transparent 70%);
}

.orb--3 {
  bottom: -10rem;
  left: 33%;
  width: 26rem;
  height: 26rem;
  animation-delay: -12s;
  background: radial-gradient(circle, oklch(0.75 0.1 20 / 0.28), transparent 70%);
}

.ambient-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, transparent 40%, oklch(0.97 0.01 15 / 0.8));
}

/* [hidden] alone loses to flex layouts — hide signed-in shell when logged out */
.app-layout[hidden] {
  display: none !important;
}

.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.tag-nav {
  flex-shrink: 0;
  width: 5.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1.25rem 0.65rem;
  border-right: 1px solid oklch(0.85 0.02 10 / 55%);
  background: oklch(0.99 0.02 15 / 72%);
  backdrop-filter: blur(12px);
}

.tag-nav__brand {
  margin: 0 0 1.25rem;
  padding: 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  text-align: center;
  line-height: 1.2;
  color: oklch(0.6 0.2 15 / 0.95);
}

.tag-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.tag-nav__item {
  border: 1px solid oklch(0.85 0.02 10 / 50%);
  border-radius: var(--radius);
  padding: 0.7rem 0.35rem;
  background: oklch(0.97 0.01 15 / 50%);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.tag-nav__item:hover {
  color: var(--foreground);
  border-color: oklch(0.6 0.2 15 / 35%);
}

.tag-nav__item.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: transparent;
  box-shadow: 0 0 24px -6px oklch(0.6 0.14 15 / 0.55);
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem 2rem;
  max-width: 72rem;
}

@media (min-width: 1024px) {
  .app-main {
    padding: 2rem 2.5rem;
  }
}

.feature-panels {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.feature-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.feature-panel.is-active {
  display: flex;
}

.feature-panel[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .app-layout {
    flex-direction: column;
  }

  .tag-nav {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid oklch(0.85 0.02 10 / 55%);
  }

  .tag-nav__brand {
    margin: 0 0.75rem 0 0;
    font-size: 0.9rem;
  }

  .tag-nav__list {
    flex-direction: row;
    flex: 1;
    gap: 0.35rem;
  }

  .tag-nav__item {
    flex: 1;
    padding: 0.55rem 0.5rem;
  }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header__user {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: oklch(0.6 0.2 15 / 0.9);
}

.btn-logout {
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  border-radius: var(--radius);
  padding: 0.35rem 0.65rem;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  cursor: pointer;
}

.btn-logout:hover {
  color: var(--foreground);
  border-color: oklch(0.6 0.2 15 / 40%);
}

.login-shell[hidden] {
  display: none !important;
}

.login-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  pointer-events: auto;
}

.login-shell.is-active {
  z-index: 3;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  padding: 2rem 1.75rem;
  border-radius: 1rem;
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  background: oklch(0.99 0.02 15 / 55%);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -20px oklch(0 0 0 / 0.15);
  animation: rise 0.6s cubic-bezier(0.22, 0.9, 0.3, 1.2);
}

.login-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: oklch(0.6 0.2 15 / 0.85);
}

.login-card__title {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

.login-card__sub {
  margin: 0.75rem 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-field__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.login-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  background: oklch(0.92 0.02 15 / 40%);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--foreground);
}

.login-field input:focus {
  outline: none;
  border-color: oklch(0.6 0.2 15 / 60%);
  box-shadow: 0 0 0 1px oklch(0.6 0.2 15 / 40%);
}

.login-error {
  margin: 0;
  min-height: 1.2em;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted-foreground);
}

.login-error.is-error {
  color: oklch(0.55 0.22 25);
}

.btn-login {
  border: none;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-login:hover:not(:disabled) {
  box-shadow: 0 0 30px -4px oklch(0.6 0.14 15 / 0.5);
}

.btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-dot {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
}

.live-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--primary);
  animation: pulseGlow 3s ease-in-out infinite;
}

.header__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.clock {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.hero {
  margin-top: 3rem;
  margin-bottom: 2rem;
  max-width: 48rem;
  animation: rise 0.6s cubic-bezier(0.22, 0.9, 0.3, 1.2);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: oklch(0.6 0.2 15 / 0.8);
}

.hero__title {
  margin: 1.25rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.hero__title em {
  display: block;
  font-style: italic;
  color: var(--primary);
  animation: flicker 4s ease-in-out infinite;
}

.hero__sub {
  margin-top: 1.25rem;
  max-width: 32rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.panel {
  flex: 1;
  position: relative;
}

.chat-card {
  border-radius: 1rem;
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  background: oklch(0.99 0.02 15 / 40%);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -20px oklch(0 0 0 / 0.15);
}

.chat-card__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid oklch(0.85 0.02 10 / 50%);
}

.chat-card__title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flicker-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
  animation: flicker 4s ease-in-out infinite;
}

.chat-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
}

.chat-card__meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted-foreground);
}

.chat-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.chat-card__visitors {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: oklch(0.6 0.2 15 / 0.9);
  flex-shrink: 0;
}

.chat-card__hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

@media (max-width: 640px) {
  .chat-card__foot {
    justify-content: space-between;
  }

  .chat-card__hint {
    font-size: 0.58rem;
    letter-spacing: 0.15em;
  }
}

.hero--compact .hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hero--compact .hero__sub {
  margin-bottom: 0;
}

.hw-card__head {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.hw-card__toolbar {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.hw-card__toolbar[hidden] {
  display: none !important;
}

.hw-toolbar-btn {
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  background: oklch(0.95 0.02 15);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--foreground);
  cursor: pointer;
}

.hw-toolbar-btn:hover {
  border-color: oklch(0.6 0.2 15 / 45%);
}

.hw-toolbar-btn--delete.is-active {
  background: oklch(0.55 0.22 25 / 0.12);
  border-color: oklch(0.55 0.22 25 / 50%);
  color: oklch(0.5 0.22 25);
}

.hw-add-form {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid oklch(0.85 0.02 10 / 45%);
  background: oklch(0.97 0.01 15 / 50%);
}

.hw-add-form[hidden] {
  display: none !important;
}

.hw-add-form__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  font-family: var(--font-body);
  font-size: 0.94rem;
}

.hw-add-form__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.hw-add-form__save,
.hw-add-form__cancel {
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

.hw-add-form__save {
  background: var(--primary);
  color: var(--primary-foreground);
}

.hw-add-form__cancel {
  background: transparent;
  color: var(--muted-foreground);
}

.hw-list {
  list-style: none;
  margin: 0;
  padding: 1rem 1.1rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 10rem;
  max-height: min(380px, 48vh);
  overflow-y: auto;
  scrollbar-width: thin;
}

.hw-item {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0;
}

.hw-item__card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid oklch(0.82 0.03 15 / 55%);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(
    145deg,
    oklch(0.99 0.01 15 / 95%) 0%,
    oklch(0.96 0.02 12 / 90%) 100%
  );
  box-shadow:
    0 1px 0 oklch(1 0 0 / 80%) inset,
    0 2px 8px -4px oklch(0.4 0.04 15 / 12%);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.hw-item__card:hover {
  border-color: oklch(0.65 0.18 15 / 40%);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 85%) inset,
    0 4px 14px -6px oklch(0.55 0.2 15 / 18%);
}

.hw-item__card--view {
  cursor: default;
}

.hw-item__card--view:hover {
  border-color: oklch(0.82 0.03 15 / 55%);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 80%) inset,
    0 2px 8px -4px oklch(0.4 0.04 15 / 12%);
}

.hw-item__action {
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius);
  padding: 0.4rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  align-self: center;
  white-space: nowrap;
}

.hw-item__action--submit {
  background: linear-gradient(135deg, oklch(0.62 0.22 15), oklch(0.52 0.2 12));
  color: var(--primary-foreground);
  box-shadow: 0 2px 10px -4px oklch(0.5 0.22 15 / 45%);
}

.hw-item__action--submit:hover {
  filter: brightness(1.05);
}

.hw-item__submit-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  align-self: center;
}

.hw-item__submit-count {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.hw-item__grade {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 3.6rem;
  margin-left: 0.15rem;
  padding-left: 0.35rem;
  border-left: 1px solid oklch(0.82 0.03 15 / 40%);
}

.hw-grade {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.2;
}

.hw-grade--read {
  font-size: 0.62rem;
  font-weight: 600;
  color: oklch(0.42 0.12 15);
  white-space: nowrap;
}

.hw-grade--empty {
  color: var(--muted-foreground);
  font-style: italic;
}

.hw-grade-admin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  margin: 0;
  cursor: default;
}

.hw-grade-admin__who {
  font-family: var(--font-mono);
  font-size: 0.44rem;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  max-width: 4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hw-grade-admin__field {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1rem;
}

.hw-grade-input {
  width: 2.5rem;
  padding: 0.2rem 0.15rem;
  border: 1px solid oklch(0.75 0.06 15 / 55%);
  border-radius: calc(var(--radius) - 2px);
  background: oklch(0.99 0.01 15);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  text-align: center;
  color: inherit;
}

.hw-grade-input:focus {
  outline: none;
  border-color: oklch(0.58 0.2 15 / 65%);
  box-shadow: 0 0 0 2px oklch(0.58 0.2 15 / 15%);
}

.hw-grade-input:disabled {
  opacity: 0.6;
}

.hw-grade-admin__max {
  font-family: var(--font-mono);
  font-size: 0.44rem;
  color: var(--muted-foreground);
}

.hw-item__action--over {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, oklch(0.58 0.06 265), oklch(0.48 0.05 280));
  color: oklch(0.97 0.01 265);
  border: 1px solid oklch(0.65 0.08 270 / 55%);
  box-shadow: 0 1px 4px -2px oklch(0.35 0.06 280 / 35%);
  cursor: not-allowed;
  pointer-events: none;
  min-width: 3.2rem;
  font-weight: 600;
  opacity: 0.92;
}

.hw-item__action--unsub {
  display: inline-flex;
  align-items: center;
  background: oklch(0.94 0.02 15 / 80%);
  color: var(--muted-foreground);
  border: 1px dashed oklch(0.8 0.03 10 / 55%);
  cursor: default;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.52rem;
}

.hw-item__action--check-pending {
  background: oklch(0.55 0.24 25);
  color: oklch(0.99 0.02 15);
  box-shadow: 0 0 14px -4px oklch(0.5 0.26 25 / 55%);
}

.hw-item__action--check-pending:hover {
  background: oklch(0.48 0.26 25);
}

.hw-item__action--check-done {
  background: oklch(0.52 0.16 145);
  color: oklch(0.98 0.02 15);
  box-shadow: 0 0 12px -4px oklch(0.45 0.18 145 / 50%);
}

.hw-item__action--check-done:hover {
  background: oklch(0.45 0.18 145);
}

.hw-submit-task-label {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.hw-view-meta {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

.hw-view-entries {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.hw-view-entry {
  padding-bottom: 1rem;
  border-bottom: 1px solid oklch(0.55 0.02 260 / 18%);
}

.hw-view-entry:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.hw-view-entry--checked .hw-view-entry__meta {
  opacity: 0.75;
}

.hw-view-entry__meta {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.hw-view-entry__err {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.hw-view-entry__mark {
  margin-top: 0.65rem;
  width: 100%;
}

.hw-view-body img,
.hw-view-entry img {
  width: 100%;
  max-height: 42vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.hw-item.is-selected .hw-item__card {
  border-color: oklch(0.58 0.2 15 / 55%);
  box-shadow:
    0 0 0 2px oklch(0.58 0.2 15 / 12%),
    0 4px 16px -6px oklch(0.55 0.22 15 / 22%);
}

.hw-item__text {
  flex: 1;
  min-width: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  word-break: break-word;
}

/* Task deadline badge — candle / study-hall drama */
.hw-item__timeline {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 6.25rem;
  max-width: 44%;
  padding: 0.45rem 0.6rem 0.45rem 0.5rem;
  border-radius: calc(var(--radius) + 1px);
  border: 1px solid oklch(0.72 0.14 15 / 35%);
  background: linear-gradient(
    135deg,
    oklch(0.98 0.03 18 / 95%) 0%,
    oklch(0.92 0.08 12 / 90%) 100%
  );
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 50%) inset,
    0 4px 18px -8px oklch(0.55 0.2 15 / 35%);
  position: relative;
  overflow: hidden;
}

.hw-item__timeline::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    oklch(0.99 0.04 80 / 25%) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: timelineShimmer 6s ease-in-out infinite;
  pointer-events: none;
}

.hw-item__timeline--lit {
  border-color: oklch(0.58 0.2 15 / 50%);
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 55%) inset,
    0 0 20px -4px oklch(0.6 0.22 15 / 45%),
    0 6px 20px -10px oklch(0.5 0.2 15 / 30%);
}

.hw-item__timeline--overdue {
  border-color: oklch(0.55 0.24 25 / 55%);
  background: linear-gradient(
    135deg,
    oklch(0.97 0.04 25 / 95%) 0%,
    oklch(0.9 0.1 25 / 88%) 100%
  );
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 40%) inset,
    0 0 22px -4px oklch(0.52 0.26 25 / 50%);
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.hw-item__timeline--empty {
  border-style: dashed;
  border-color: oklch(0.82 0.03 10 / 45%);
  background: oklch(0.97 0.01 15 / 60%);
  box-shadow: none;
}

.hw-item__timeline--empty::before {
  display: none;
}

.hw-item__timeline-orb {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: oklch(0.75 0.06 15 / 50%);
  flex-shrink: 0;
  animation: timelinePulse 3s ease-in-out infinite;
}

.hw-item__timeline-day {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  color: oklch(0.45 0.18 15);
  min-width: 1.6rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hw-item__timeline--overdue .hw-item__timeline-day {
  color: oklch(0.48 0.24 25);
}

.hw-item__timeline-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hw-item__timeline-week {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.5 0.16 15);
  font-weight: 600;
}

.hw-item__timeline-month {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-style: italic;
  color: var(--foreground);
  line-height: 1.1;
}

.hw-item__timeline-time {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.hw-item__timeline--overdue .hw-item__timeline-week {
  color: oklch(0.5 0.22 25);
}

.hw-item__timeline-empty {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.hw-item__timeline-empty-sub {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-style: italic;
  color: oklch(0.7 0.04 10);
}

.hw-item__delete {
  display: none;
  align-self: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 50%;
  background: oklch(0.55 0.24 25);
  color: oklch(0.99 0.02 15);
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hw-list.is-delete-mode .hw-item__delete {
  display: inline-flex;
}

.hw-list.is-delete-mode .hw-item__card {
  pointer-events: none;
  opacity: 0.92;
}

.hw-item__delete:hover {
  background: oklch(0.48 0.26 25);
  box-shadow: 0 0 12px -2px oklch(0.5 0.24 25 / 0.6);
}

.hw-empty-wrap {
  list-style: none;
}

.hw-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  border: 1px dashed oklch(0.85 0.02 10 / 50%);
  border-radius: var(--radius);
}

/* Deadline composer — dramatic study-hall panel */
.hw-timeline-panel {
  position: relative;
  margin: 0 1.1rem 0.85rem;
  padding: 1.1rem 1.15rem 1rem;
  border-radius: 1rem;
  border: 1px solid oklch(0.65 0.18 15 / 35%);
  background: linear-gradient(
    160deg,
    oklch(0.99 0.03 18 / 92%) 0%,
    oklch(0.94 0.06 12 / 88%) 55%,
    oklch(0.97 0.04 25 / 85%) 100%
  );
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 45%) inset,
    0 20px 50px -28px oklch(0.45 0.12 15 / 40%),
    0 0 40px -12px oklch(0.6 0.2 15 / 25%);
  overflow: hidden;
}

.hw-timeline-panel__glow {
  pointer-events: none;
  position: absolute;
  top: -3rem;
  right: -2rem;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(0.7 0.2 15 / 0.35), transparent 68%);
  animation: drift 14s ease-in-out infinite;
}

.hw-timeline-panel.is-ready .hw-timeline-panel__glow {
  background: radial-gradient(circle, oklch(0.65 0.22 15 / 0.5), transparent 65%);
}

.hw-timeline-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  position: relative;
  z-index: 1;
}

.hw-timeline-panel__orb {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
}

.hw-timeline-panel__titles {
  min-width: 0;
}

.hw-timeline-panel__label {
  margin: 0 0 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: oklch(0.5 0.16 15);
}

.hw-timeline-panel__hint {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.hw-timeline-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid oklch(0.78 0.08 15 / 40%);
  background: oklch(0.99 0.02 15 / 55%);
  position: relative;
  z-index: 1;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.hw-timeline-preview.is-lit {
  border-color: oklch(0.58 0.2 15 / 55%);
  background: linear-gradient(
    120deg,
    oklch(0.99 0.03 18 / 90%) 0%,
    oklch(0.93 0.1 12 / 85%) 100%
  );
  box-shadow: 0 0 28px -8px oklch(0.6 0.22 15 / 45%);
}

.hw-timeline-preview.is-lit.is-overdue {
  border-color: oklch(0.52 0.24 25 / 60%);
  box-shadow: 0 0 30px -6px oklch(0.5 0.26 25 / 55%);
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.hw-timeline-preview__day {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 3.25rem);
  font-weight: 600;
  font-style: italic;
  line-height: 0.9;
  color: oklch(0.72 0.06 15 / 70%);
  min-width: 2.5rem;
  transition: color 0.2s ease;
}

.hw-timeline-preview.is-lit .hw-timeline-preview__day {
  color: oklch(0.42 0.2 15);
}

.hw-timeline-preview.is-lit.is-overdue .hw-timeline-preview__day {
  color: oklch(0.45 0.24 25);
}

.hw-timeline-preview__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hw-timeline-preview__week {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.hw-timeline-preview.is-lit .hw-timeline-preview__week {
  color: oklch(0.48 0.18 15);
  font-weight: 600;
}

.hw-timeline-preview__time {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--foreground);
}

.hw-timeline-panel__picker {
  display: block;
  position: relative;
  z-index: 1;
  margin-bottom: 0.75rem;
}

.hw-timeline-panel__picker-label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: oklch(0.55 0.12 15);
}

.hw-timeline-panel__input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid oklch(0.62 0.18 15 / 40%);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--foreground);
  background: oklch(0.99 0.02 15 / 90%);
  box-shadow: 0 0 0 1px oklch(1 0 0 / 60%) inset;
  color-scheme: light;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.hw-timeline-panel__input:hover,
.hw-timeline-panel__input:focus {
  outline: none;
  border-color: oklch(0.55 0.22 15 / 65%);
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 70%) inset,
    0 0 0 3px oklch(0.6 0.2 15 / 18%);
}

.hw-timeline-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.hw-timeline-panel__apply,
.hw-timeline-panel__clear {
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.hw-timeline-panel__apply {
  flex: 1;
  min-width: 10rem;
  background: linear-gradient(
    135deg,
    oklch(0.62 0.22 15) 0%,
    oklch(0.52 0.2 12) 100%
  );
  color: var(--primary-foreground);
  box-shadow: 0 4px 18px -6px oklch(0.5 0.22 15 / 50%);
}

.hw-timeline-panel__apply:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px -6px oklch(0.5 0.24 15 / 55%);
}

.hw-timeline-panel__apply:disabled,
.hw-timeline-panel__clear:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hw-timeline-panel__clear {
  background: transparent;
  border: 1px solid oklch(0.7 0.1 15 / 45%);
  color: var(--muted-foreground);
}

.hw-timeline-panel__clear:hover:not(:disabled) {
  border-color: oklch(0.55 0.2 25 / 50%);
  color: oklch(0.5 0.2 25);
}

.hw-timeline-readonly {
  margin: 0 1.1rem 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px dashed oklch(0.78 0.06 15 / 45%);
  background: oklch(0.97 0.02 15 / 70%);
  font-size: 0.82rem;
  color: var(--muted-foreground);
  line-height: 1.45;
  text-align: center;
}

.hw-timeline-readonly[hidden] {
  display: none !important;
}

.restrict-card .restrict-list {
  list-style: none;
  margin: 0;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.restrict-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.restrict-row__nav-mock {
  flex: 1;
  pointer-events: none;
  text-align: center;
}

.restrict-row__toggle {
  flex-shrink: 0;
  min-width: 5.5rem;
  border: 1px solid oklch(0.75 0.1 15 / 50%);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
  background: oklch(0.98 0.02 15);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  cursor: pointer;
}

.restrict-row__toggle.is-active {
  background: linear-gradient(135deg, oklch(0.58 0.22 15), oklch(0.5 0.2 12));
  color: var(--primary-foreground);
  border-color: transparent;
}

.restrict-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.restrict-status {
  padding: 0 1.25rem 1rem;
}

/* Check — admin usage dashboard */
.check-panel {
  max-width: 100%;
}

.check-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.check-stat {
  flex: 1;
  min-width: 5.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid oklch(0.82 0.03 15 / 50%);
  background: oklch(0.99 0.02 15 / 80%);
  text-align: center;
}

.check-stat--wide {
  min-width: 12rem;
  flex: 2;
}

.check-stat__n {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-style: italic;
  color: oklch(0.45 0.18 15);
  line-height: 1.1;
}

.check-stat__n--sm {
  font-size: 0.95rem;
  font-family: var(--font-mono);
  font-style: normal;
  letter-spacing: 0.04em;
}

.check-stat__l {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.check-card {
  padding: 0;
  overflow: hidden;
}

.check-card__title {
  margin: 0;
  padding: 0.85rem 1rem 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
}

.check-card__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--muted-foreground);
  margin-top: 0.2rem;
}

.check-card__canvas {
  position: relative;
  height: 220px;
  padding: 0.5rem 0.75rem 1rem;
}

.check-card__canvas--tall {
  height: 280px;
}

.check-recent-card {
  padding-bottom: 0.5rem;
}

.check-recent {
  list-style: none;
  margin: 0;
  padding: 0 1rem 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.check-recent li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid oklch(0.88 0.02 10 / 40%);
  font-size: 0.82rem;
}

.check-recent__who {
  font-weight: 600;
  color: var(--foreground);
}

.check-recent__what {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: oklch(0.5 0.16 15);
}

.check-recent time {
  margin-left: auto;
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.check-status {
  margin-top: 0.5rem;
}

.check-raw-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: oklch(0.2 0.03 15 / 0.45);
  backdrop-filter: blur(6px);
}

.check-raw-modal[hidden] {
  display: none !important;
}

.check-raw-sheet {
  width: min(32rem, 100%);
  max-height: 80vh;
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid oklch(0.75 0.1 15 / 45%);
  background: var(--card);
  box-shadow: 0 24px 60px -20px oklch(0.3 0.05 15 / 50%);
  padding: 1.25rem;
}

.check-raw-sheet__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
}

.check-raw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.check-raw-table th,
.check-raw-table td {
  padding: 0.45rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid oklch(0.88 0.02 10 / 45%);
}

.check-raw-table th {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.check-raw-empty {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.check-raw-sheet__close {
  margin-top: 1rem;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

.hw-status {
  padding: 0 1.25rem 1rem;
}

.messages {
  height: min(460px, 55vh);
  overflow-y: auto;
  padding: 2rem 1.5rem;
  scrollbar-width: thin;
}

.msg {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.msg--new {
  animation: rise 0.45s cubic-bezier(0.22, 0.9, 0.3, 1.2) both;
}

.msg__avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  box-shadow: 0 0 24px -4px var(--avatar-glow, oklch(0.7 0.2 350));
  border: 1px solid oklch(1 0 0 / 10%);
}

.msg__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.msg__name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
}

.msg__time {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
}

.msg__text {
  margin: 0.35rem 0 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: oklch(0.2 0.03 15 / 0.9);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg__text:empty {
  display: none;
}

.msg__attachment {
  margin-top: 0.5rem;
}

.msg__img {
  display: block;
  max-width: min(100%, 20rem);
  max-height: 16rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid oklch(0.85 0.02 10 / 55%);
  object-fit: contain;
  background: oklch(0.99 0.01 15);
  cursor: pointer;
}

.msg__pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(0.55 0.18 15);
  text-decoration: none;
}

.msg__pdf-link:hover {
  text-decoration: underline;
}

.msg__pdf-frame {
  display: block;
  width: min(100%, 20rem);
  height: 14rem;
  margin-top: 0.5rem;
  border: 1px solid oklch(0.85 0.02 10 / 55%);
  border-radius: calc(var(--radius) - 2px);
  background: oklch(0.99 0.01 15);
}

.msg--pending .msg__text {
  opacity: 0.72;
}

.msg--pending .msg__avatar {
  animation: pulseGlow 1.2s ease-in-out infinite;
}

.composer {
  border-top: 1px solid oklch(0.85 0.02 10 / 50%);
  padding: 1.25rem 1.5rem;
  background: oklch(0.97 0.01 15 / 30%);
}

.composer__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.composer__signed-as {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--foreground);
  white-space: nowrap;
}

.composer__signed-as::before {
  content: "signed, ";
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.palettes {
  display: flex;
  gap: 0.35rem;
}

.palette-btn {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  opacity: 0.65;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.palette-btn:hover {
  opacity: 1;
}

.palette-btn.is-active {
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--primary), 0 0 0 4px var(--card);
}

.composer__input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.composer__textarea {
  flex: 1;
  resize: none;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  background: oklch(0.92 0.02 15 / 40%);
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--foreground);
}

.composer__textarea:focus {
  outline: none;
  border-color: oklch(0.6 0.2 15 / 60%);
  box-shadow: 0 0 0 1px oklch(0.6 0.2 15 / 40%);
}

.composer__textarea::placeholder {
  color: var(--muted-foreground);
}

.composer__actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-add,
.btn-send {
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: box-shadow 0.2s, opacity 0.2s;
}

.btn-add {
  background: oklch(0.95 0.02 15);
  color: var(--foreground);
  border: 1px solid oklch(0.85 0.02 10 / 60%);
}

.btn-add:hover:not(:disabled) {
  border-color: oklch(0.6 0.2 15 / 45%);
  box-shadow: 0 0 20px -6px oklch(0.6 0.14 15 / 0.35);
}

.btn-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-send {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-send:hover:not(:disabled) {
  box-shadow: 0 0 30px -4px oklch(0.6 0.14 15 / 0.5);
}

.btn-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.attach-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: oklch(0.15 0.02 15 / 0.45);
  backdrop-filter: blur(6px);
}

.attach-overlay[hidden]:not(.is-open) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.attach-overlay.is-open {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

body.hw-overlay-lock {
  overflow: hidden;
}

.attach-sheet {
  width: 100%;
  max-width: 22rem;
  padding: 1.35rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  background: oklch(0.99 0.02 15 / 96%);
  box-shadow: 0 24px 60px -16px oklch(0 0 0 / 0.25);
  animation: rise 0.35s cubic-bezier(0.22, 0.9, 0.3, 1.2);
}

.attach-sheet--preview,
.attach-sheet--camera {
  max-width: 26rem;
}

.attach-sheet__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.attach-sheet__btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  border-radius: var(--radius);
  background: oklch(0.95 0.02 15);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.attach-sheet__btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: transparent;
}

.attach-sheet__btn--ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.attach-sheet__btn:hover:not(:disabled) {
  box-shadow: 0 0 20px -6px oklch(0.6 0.14 15 / 0.35);
}

.attach-preview__body {
  min-height: 6rem;
  max-height: 50vh;
  overflow: auto;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid oklch(0.85 0.02 10 / 55%);
  background: oklch(0.97 0.01 15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.attach-preview__img {
  display: block;
  max-width: 100%;
  max-height: 48vh;
  object-fit: contain;
}

.attach-preview__pdf {
  padding: 2rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  text-align: center;
}

.attach-preview__caption {
  display: block;
  margin: 0.85rem 0 0.25rem;
}

.attach-preview__caption-label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.attach-preview__caption input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid oklch(0.85 0.02 10 / 60%);
  background: oklch(0.99 0.01 15);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.camera-wrap {
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  border: 1px solid oklch(0.85 0.02 10 / 55%);
  background: oklch(0.2 0.02 15);
  aspect-ratio: 3 / 4;
  max-height: 55vh;
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Front/selfie preview only — back camera (homework) stays unmirrored */
.camera-video--mirror {
  transform: scaleX(-1);
}

.footer {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.footer__dots {
  animation: flicker 4s ease-in-out infinite;
}

.status-bar {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted-foreground);
  min-height: 1.2em;
}

.status-bar.is-error {
  color: oklch(0.55 0.22 25);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted-foreground);
  font-style: italic;
}

/* Avatar gradient presets */
.grad-blush {
  background: linear-gradient(135deg, #f9a8d4, #fb7185);
}
.grad-coral {
  background: linear-gradient(135deg, #fecdd3, #fdba74);
}
.grad-rose {
  background: linear-gradient(135deg, #fda4af, #e11d48);
}
.grad-magenta {
  background: linear-gradient(135deg, #f0abfc, #ec4899);
}
.grad-mauve {
  background: linear-gradient(135deg, #d8b4fe, #f472b6);
}
