:root {
  --bg: #f4f5f7;
  --ink: #0b3554;
  --muted: #4a5568;
  --card: #ffffff;
  --accent: #1a6bb5;
  --canvas: #808080;
  --header-h: 64px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.header-nav {
  position: relative;
  flex-shrink: 0;
}

.nav-desktop {
  display: none !important;
}

.nav-desktop a {
  margin-left: 1.25rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-desktop a:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-mobile {
  display: block;
  position: relative;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:hover {
  background: #edf2f7;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 10.5rem;
  padding: 0.35rem 0;
  margin: 0;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(11, 53, 84, 0.14);
  z-index: 110;
}

.nav-dropdown[hidden] {
  display: none;
}

.nav-dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-dropdown a:hover {
  background: #f4f5f7;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.header-sign-in {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 0.45rem 0.65rem;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.header-sign-in:hover {
  background: #edf2f7;
  color: var(--accent);
}

.header-profile-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.profile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #718096;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.profile-toggle:hover,
.profile-toggle.is-open {
  background: #edf2f7;
  color: var(--ink);
}

.profile-icon {
  display: block;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 11.5rem;
  padding: 0.35rem 0;
  margin: 0;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(11, 53, 84, 0.14);
  z-index: 120;
}

.profile-dropdown[hidden] {
  display: none;
}

.profile-dropdown-email {
  margin: 0;
  padding: 0.5rem 1rem 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid #e2e8f0;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown a,
.profile-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
  background: #f4f5f7;
  text-decoration: none;
}

@media (max-width: 767px) {
  .logo {
    font-size: 1.15rem;
  }

  .logo-mark {
    width: 28px;
    height: 28px;
  }
}

.hero {
  padding: 3.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 36em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.download-section {
  scroll-margin-top: calc(var(--header-h) + 1rem);
  padding: 2.5rem 0 3rem;
  background: var(--card);
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.download-inner {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
}

.download-inner h2 {
  margin: 0 0 0.75rem;
}

.download-lead {
  margin: 0 auto 1.75rem;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.store-badge {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.store-badge:hover {
  opacity: 0.88;
  text-decoration: none;
}

.store-badge img {
  display: block;
  height: 52px;
  width: auto;
}

.hero-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 12px 40px rgba(11, 53, 84, 0.12);
}

.hero-carousel {
  position: relative;
}

.carousel-viewport {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.carousel-track {
  position: relative;
  aspect-ratio: 4 / 3;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.65s ease;
  pointer-events: none;
}

.carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #cbd5e0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.15);
}

.carousel-dot:hover {
  background: var(--ink);
}

.hero-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  aspect-ratio: 4 / 3;
}

.mock-canvas {
  background: var(--canvas);
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.mock-stroke {
  position: absolute;
  height: 4px;
  width: 45%;
  background: #111;
  border-radius: 4px;
  top: 38%;
  left: 18%;
  transform: rotate(-8deg);
}

.mock-stroke.s2 {
  width: 30%;
  top: 52%;
  left: 28%;
  transform: rotate(12deg);
}

.mock-hand {
  position: absolute;
  width: 38%;
  height: 50%;
  bottom: 8%;
  right: 12%;
  background: rgba(255, 220, 190, 0.85);
  border-radius: 40% 50% 20% 30%;
  transform: rotate(-18deg);
}

.mock-hand.pos-left {
  right: auto;
  left: 10%;
  bottom: 12%;
  transform: rotate(14deg);
}

.mock-hand.pos-center {
  right: 22%;
  bottom: 18%;
  width: 34%;
  height: 44%;
  transform: rotate(-6deg);
}

.mock-hand.pos-stream {
  right: 8%;
  bottom: 10%;
  transform: rotate(-22deg);
}

.mock-stroke.ink-blue {
  background: #1a6bb5;
  width: 50%;
  top: 42%;
  left: 22%;
}

.mock-stroke.ink-blue.s2 {
  width: 28%;
  top: 58%;
  left: 38%;
}

.mock-stroke.ink-green {
  background: #2f855a;
  width: 38%;
  top: 55%;
  left: 42%;
  transform: rotate(4deg);
}

.mock-stroke.ink-white {
  background: rgba(255, 255, 255, 0.92);
  width: 42%;
  top: 40%;
  left: 20%;
}

.mock-stroke.ink-white.s2 {
  width: 26%;
  top: 54%;
  left: 32%;
  transform: rotate(10deg);
}

.slide-ruled {
  background: #faf8f5;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    #c5d4e8 27px,
    #c5d4e8 28px
  );
}

.slide-tools {
  background: #f7fafc;
}

.mock-compass {
  position: absolute;
  width: 36%;
  aspect-ratio: 1;
  top: 18%;
  left: 14%;
  border: 3px solid #1a6bb5;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(26, 107, 181, 0.15);
}

.mock-ruler {
  position: absolute;
  width: 55%;
  height: 10px;
  top: 28%;
  right: 8%;
  background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e0 100%);
  border: 1px solid #a0aec0;
  border-radius: 2px;
  transform: rotate(-12deg);
}

.slide-stream {
  background: linear-gradient(145deg, #4a5568 0%, #2d3748 100%);
}

.mock-rec-badge {
  position: absolute;
  top: 10%;
  left: 10%;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mock-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53e3e;
  animation: rec-pulse 1.2s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide {
    transition: none;
  }

  .mock-rec-dot {
    animation: none;
  }
}

.features {
  padding: 2.5rem 0 3rem;
}

.features h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.feature-grid article {
  background: var(--card);
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.feature-grid h3 {
  margin-top: 0;
}

.coming {
  padding: 2rem 0 3.5rem;
}

.coming-inner {
  background: var(--ink);
  color: #e8f0f8;
  padding: 2rem 1.5rem;
  border-radius: 16px;
}

.coming-inner h2 {
  margin-top: 0;
}

.contact-section {
  scroll-margin-top: calc(var(--header-h) + 1rem);
  padding: 2.5rem 0 3rem;
}

.contact-inner {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto;
}

.contact-inner h2 {
  margin-top: 0;
}

.contact-email {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.5rem 0 0;
}

.footer-credit {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.footer-credit a {
  color: var(--ink);
  font-weight: 600;
}

.site-footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem 0 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--muted);
}

.legal {
  padding: 2rem 1.25rem 3rem;
  max-width: 720px;
}

.legal h1 {
  margin-top: 0;
}

.legal h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

.legal h3 {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.legal-meta {
  color: var(--muted);
}

.legal ul {
  padding-left: 1.25rem;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0;
}

.legal-table th,
.legal-table td {
  border: 1px solid #e2e8f0;
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.legal-table th {
  background: #edf2f7;
}

/* HandForge */
.handforge-main {
  padding: 2.5rem 0 4rem;
}

.handforge-page .handforge-main > .wrap {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.handforge-page .handforge-main > .wrap > .eyebrow,
.handforge-page .handforge-main > .wrap > h1,
.handforge-page .handforge-main > .wrap > .lead {
  text-align: center;
}

.handforge-page .handforge-card {
  margin-left: auto;
  margin-right: auto;
}

.handforge-card {
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 8px 24px rgba(11, 53, 84, 0.06);
}

.handforge-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: none;
}

.handforge-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.handforge-upload {
  display: block;
  cursor: pointer;
}

.handforge-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.handforge-upload-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.handforge-upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.75rem;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.handforge-upload:hover .handforge-upload-box {
  border-color: var(--accent);
  background: #f0f7ff;
}

.handforge-upload-box-has-file {
  border-style: solid;
  border-color: var(--accent);
}

.handforge-upload-placeholder {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0.5rem;
}

.handforge-upload-thumb {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
}

.handforge-optional {
  font-weight: 400;
  color: var(--muted);
}

.handforge-field span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.handforge-field input[type="file"],
.handforge-field input[type="text"] {
  width: 100%;
  font: inherit;
}

.handforge-status {
  margin-top: 1rem;
  color: var(--muted);
  min-height: 1.5em;
}

.handforge-status-error {
  color: #b91c1c;
}

.handforge-result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.handforge-result-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
}

.handforge-result img {
  max-width: 100%;
  max-height: 420px;
  display: block;
  margin-bottom: 1rem;
  background: repeating-conic-gradient(#ccc 0% 25%, #eee 0% 50%) 50% / 16px 16px;
  border-radius: 8px;
}

.handforge-import-steps {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.handforge-import-steps h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.handforge-import-steps ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

#handforge-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Classroom hub */
.classroom-page {
  background: linear-gradient(180deg, #eef4fa 0%, var(--bg) 28%);
}

.classroom-page .account-dashboard {
  max-width: 720px;
}

.classroom-hero {
  margin-bottom: 1.5rem;
}

.classroom-hero h1 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.03em;
}

.classroom-card {
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 28px rgba(11, 53, 84, 0.06);
}

.classroom-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.classroom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid #edf2f7;
}

.classroom-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.classroom-row-meta strong {
  font-size: 1.05rem;
}

.classroom-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent);
  background: #edf6ff;
  border-radius: 6px;
  word-break: break-all;
}

.classroom-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.classroom-live-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #0b3554 0%, #1a6bb5 100%);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(11, 53, 84, 0.22);
}

.classroom-live-banner p {
  margin: 0.25rem 0 0;
  opacity: 0.9;
  font-size: 0.92rem;
}

.classroom-live-banner .btn-primary {
  background: #fff;
  color: var(--ink);
  border: none;
}

.classroom-request,
.classroom-participant {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #edf2f7;
}

.classroom-participant-id {
  display: block;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  margin-top: 0.2rem;
  word-break: break-all;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(11, 53, 84, 0.06);
  text-decoration: none;
}

.btn-danger {
  background: #c53030;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #9b2c2c;
}

/* Live class page */
.live-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.live-page.live-in-board {
  height: 100vh;
  overflow: hidden;
}

.live-header .wrap {
  max-width: none;
}

.live-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: var(--header-h);
}

.live-header-meta {
  min-width: 0;
  text-align: center;
}

.live-header-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.live-role-pill {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: #e8f4fc;
  border-radius: 999px;
}

.live-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.live-flow-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0 3rem;
}

.live-flow-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 2rem 1.75rem;
  box-shadow: 0 16px 48px rgba(11, 53, 84, 0.08);
}

.live-eyebrow {
  margin-bottom: 0.25rem;
}

.live-wait-card {
  text-align: center;
}

.live-wait-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent);
  animation: live-spin 0.9s linear infinite;
}

@keyframes live-spin {
  to {
    transform: rotate(360deg);
  }
}

.live-flow-actions {
  justify-content: center;
  margin-top: 1.25rem;
}

.live-board-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr min(320px, 36vw);
  min-height: 0;
  overflow: hidden;
}

.live-board-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.live-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--card);
  border-bottom: 1px solid #e2e8f0;
}

.live-connection {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.live-connection[data-state="ok"] {
  color: #276749;
}

.live-connection[data-state="error"] {
  color: #c53030;
}

.live-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 280px;
  height: calc(100vh - var(--header-h) - 44px);
  background-color: #faf9f6;
  background-image:
    linear-gradient(#e8e4dc 1px, transparent 1px),
    linear-gradient(90deg, #e8e4dc 1px, transparent 1px);
  background-size: 24px 24px;
  border-bottom: 1px solid #e2e8f0;
}

#live-canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

#live-canvas.live-canvas-readonly {
  cursor: default;
}

.live-canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  pointer-events: none;
}

.live-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border-left: 1px solid #e2e8f0;
  overflow: hidden;
}

.live-sidebar-inner {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 1.5rem;
}

.live-sidebar-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.live-sidebar-block {
  margin-top: 1.25rem;
}

.live-sidebar-block h3 {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.live-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  background: #edf2f7;
  border-radius: 999px;
  vertical-align: middle;
}

.live-roster-card {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 10px;
}

.live-roster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.live-roster-email {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.live-participant-id {
  display: block;
  margin: 0.35rem 0 0.5rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.68rem;
  word-break: break-all;
  background: #fff;
  border: 1px dashed #cbd5e0;
  border-radius: 6px;
  color: #4a5568;
}

.live-role-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.live-roster-actions {
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .live-board-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .live-sidebar {
    border-left: none;
    border-top: 1px solid #e2e8f0;
    max-height: 42vh;
  }

  .live-canvas-wrap {
    height: calc(55vh - var(--header-h));
    min-height: 220px;
  }

  .live-header-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .live-header-actions {
    justify-content: center;
  }
}

.handforge-hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.handforge-steps ol {
  padding-left: 1.25rem;
}

/* Account dashboard */
.account-main {
  padding: 2.5rem 0 4rem;
}

.account-dashboard {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.account-security {
  margin-bottom: 1.5rem;
}

.account-email-line {
  margin-bottom: 1.5rem;
}

.account-app-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.account-tile {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(11, 53, 84, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(26, 107, 181, 0.12);
  text-decoration: none;
}

.account-tile-muted {
  opacity: 0.85;
}

.account-tile-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
}

.account-tile-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.account-tile-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.4;
}

.account-profile h2 {
  margin-top: 0;
}

.account-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0 0 1rem;
}

.account-dl dt {
  font-weight: 600;
  color: var(--muted);
}

.account-dl dd {
  margin: 0;
}

.subscription-badge {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  margin: 0 0 1rem;
}

.subscription-badge-pending {
  background: #e2e8f0;
  color: var(--muted);
}

.subscription-badge-active {
  background: #d1fae5;
  color: #065f46;
}

.subscription-badge-inactive,
.subscription-badge-not_linked {
  background: #fee2e2;
  color: #991b1b;
}

.subscription-badge-not_configured,
.subscription-badge-unknown,
.subscription-badge-session_invalid {
  background: #fff3cd;
  color: #664d03;
}

.account-tile-pro-active {
  border-color: var(--accent);
  opacity: 1;
}

.account-id-line {
  font-size: 0.75rem;
  word-break: break-all;
}

.handforge-setup-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #664d03;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.handforge-auth-buttons {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.handforge-signed-in {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
}

.btn-header-auth {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.btn-header-auth:hover {
  background: #edf2f7;
}

.handforge-header-user {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
