:root {
  color-scheme: dark;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --text: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.62);
  --muted2: rgba(245, 245, 247, 0.38);
  --blue: #0071e3;
  --primary-btn-bg: #3478f6;
  --primary-btn-bg-hover: #4285ff;
  --primary-btn-shadow: 0 12px 34px rgba(52, 120, 246, 0.22);
  --primary-btn-shadow-hover: 0 14px 42px rgba(66, 133, 255, 0.28);
  background: #000;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background: #000;
  overflow: hidden;
}

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

.sr-only {
  width: 1px;
  height: 1px;
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

body.beta-locked .auth-shell,
body.beta-locked .workspace-shell {
  pointer-events: none;
  user-select: none;
  filter: blur(14px);
  transform: scale(0.992);
}

.beta-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}

.beta-card {
  width: min(100%, 460px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  padding: 24px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(22, 22, 24, 0.96), rgba(7, 7, 8, 0.98)),
    #050505;
  box-shadow:
    0 26px 90px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: betaCardIn 0.72s var(--ease-enter) both;
}

.beta-copy h2 {
  margin: 0 0 12px;
  color: rgba(245, 245, 247, 0.98);
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.08;
  font-weight: 620;
  letter-spacing: -0.046em;
}

.beta-copy p {
  max-width: 360px;
  margin: 0 0 18px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 15px;
  line-height: 1.38;
  letter-spacing: -0.024em;
}

.beta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 10px;
}

.beta-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  padding: 0 16px;
  color: rgba(245, 245, 247, 0.96);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
  font-size: 14px;
  font-weight: 520;
  letter-spacing: 0.105em;
  text-transform: uppercase;
  transition: border-color 0.24s var(--ease), background 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.beta-input:focus {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.055);
}

.beta-input::placeholder {
  color: rgba(245, 245, 247, 0.44);
}

.beta-submit {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  color: #050505;
  background: rgba(245, 245, 247, 0.94);
  box-shadow: 0 12px 34px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.024em;
  transition: background 0.24s var(--ease), box-shadow 0.24s var(--ease), opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

.beta-submit:hover {
  background: #fff;
  box-shadow: 0 14px 38px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.beta-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.beta-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: rgba(255, 188, 191, 0.95);
  font-size: 13px;
  line-height: 1.4;
}

.auth-shell {
  z-index: 0;
  isolation: isolate;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding: 22px 20px 120px;
  display: flex;
  position: relative;
  overflow: hidden;
}

.auth-shell::before {
  content: "";
  z-index: -2;
  pointer-events: none;
  filter: none;
  opacity: 1;
  will-change: transform, opacity;
  animation: blackBreath 18s var(--ease-enter) infinite alternate;
  background:
    radial-gradient(980px 520px at 50% 44%, rgba(255, 255, 255, 0.026), transparent 66%),
    radial-gradient(1200px 740px at 50% 120%, rgba(255, 255, 255, 0.035), transparent 72%),
    #000;
  position: fixed;
  inset: -30%;
  transform: translateZ(0);
}

.container {
  text-align: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

.auth-content {
  will-change: opacity, transform;
  width: 100%;
  animation: authContentReveal 1.02s var(--ease-enter) both;
  justify-content: center;
  display: flex;
}

.logo {
  letter-spacing: -0.04em;
  opacity: 0;
  text-shadow: 0 14px 42px rgba(6, 14, 34, 0.34);
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  animation: authLogoReveal 1.12s var(--ease-enter) forwards;
  user-select: none;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 80px;
  font-size: clamp(50px, 6.25vw, 76px);
  font-weight: 700;
  line-height: 0.92;
  color: var(--text);
  transform: translateZ(0);
}

.logo-initial {
  font-size: 1.06em;
  letter-spacing: -0.075em;
}

.initial-buttons {
  will-change: transform, opacity;
  animation: authClusterReveal 0.96s var(--ease-enter) 0.12s both;
  flex-direction: column;
  gap: 16px;
  display: flex;
  width: min(100%, 440px);
  margin: 0 auto;
  transform: translateZ(0);
}

.btn,
.btn-submit {
  cursor: pointer;
  isolation: isolate;
  backface-visibility: hidden;
  text-wrap: balance;
  white-space: normal;
  width: 100%;
  min-height: 64px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  border: none;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  padding: 18px 32px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  display: flex;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.btn::after,
.btn-submit::after {
  content: "";
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.1;
  will-change: opacity, transform;
  position: absolute;
  inset: -18%;
  transform: scale(0.992) translateZ(0);
}

.btn-login,
.btn-submit {
  background: var(--primary-btn-bg);
  color: #fff;
  box-shadow: var(--primary-btn-shadow);
}

.btn-login::after,
.btn-submit::after {
  background: radial-gradient(circle, rgba(120, 183, 255, 0.42), transparent 68%);
  animation: authGlowPulse 14s ease-in-out 1.2s infinite;
}

.btn-login:hover,
.btn-submit:hover {
  background: var(--primary-btn-bg-hover);
  box-shadow: var(--primary-btn-shadow-hover);
}

.btn-register {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 28px rgba(7, 14, 30, 0.16);
}

.btn-register::after {
  opacity: 0.08;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
  animation: authGlowPulseSoft 15s ease-in-out 1.35s infinite;
}

.btn-register:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.10);
}

.auth-form {
  opacity: 0;
  max-height: 0;
  display: none;
  overflow: hidden;
}

.auth-form:not([hidden]) {
  will-change: transform, opacity;
  backface-visibility: hidden;
  max-height: none;
  animation: authSheetReveal 0.74s var(--ease-enter) both;
  display: block;
  overflow: visible;
  transform: translateZ(0);
  opacity: 1;
}

.form-header {
  margin-bottom: 32px;
}

.form-title {
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
}

.form-subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 15px;
}

.form-group {
  text-align: left;
  margin-bottom: 20px;
  display: block;
}

.form-label {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 400;
  display: block;
}

.input {
  width: 100%;
  color: var(--text);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 16px;
  font-family: inherit;
  font-size: 17px;
  outline: none;
}

.input:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.input:focus {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
}

.input::placeholder {
  color: var(--muted2);
}

.feedback {
  min-height: 20px;
  text-align: left;
  border-radius: 12px;
  margin: 0 0 16px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.feedback.is-error {
  color: rgba(255, 188, 191, 0.95);
  background: rgba(255, 109, 118, 0.13);
  border: 1px solid rgba(255, 109, 118, 0.45);
  padding: 12px 14px;
}

.feedback.is-success {
  color: rgba(179, 214, 255, 0.95);
  background: rgba(45, 111, 245, 0.18);
  border: 1px solid rgba(97, 161, 255, 0.50);
  padding: 12px 14px;
}

.btn-submit {
  margin-bottom: 12px;
  padding: 16px;
}

.btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-back {
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
}

.btn-back:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(-4px);
}

.footer {
  text-align: center;
  color: var(--muted2);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease) 1s forwards;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  display: flex;
  position: fixed;
  bottom: 34px;
  left: 0;
  right: 0;
}

.version {
  opacity: 0.7;
  font-size: 12px;
}

body.mode-form .initial-buttons {
  display: none !important;
}

body.mode-form .logo {
  margin-bottom: 40px;
  font-size: clamp(36px, 4.6vw, 48px);
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes authContentReveal {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes authSpringIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.986); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes authLogoReveal {
  0% { opacity: 0; filter: blur(8px); transform: translateY(14px) scale(0.982); }
  60% { filter: blur(0); }
  100% { opacity: 1; filter: blur(0); transform: translate(0, 0) scale(1); }
}

@keyframes authClusterReveal {
  0% { opacity: 0; transform: translateY(12px) scale(0.992); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes authSheetReveal {
  0% { opacity: 0; filter: blur(7px); transform: translateY(12px) scale(0.992); }
  65% { filter: blur(0); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes blackBreath {
  0% { opacity: 0.94; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.012); }
}

@keyframes betaCardIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.986); filter: blur(8px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes authGlowPulse {
  0%, 100% { opacity: 0.05; transform: scale(0.996) translateZ(0); }
  50% { opacity: 0.11; transform: scale(1.006) translateZ(0); }
}

@keyframes authGlowPulseSoft {
  0%, 100% { opacity: 0.04; transform: scale(0.997) translateZ(0); }
  50% { opacity: 0.07; transform: scale(1.004) translateZ(0); }
}

@media (max-width: 1024px) {
  .auth-shell { padding-bottom: 110px; }
  .container { max-width: 520px; }
}

@media (max-width: 768px) {
  body { overflow: auto; }
  body.beta-locked { overflow: hidden; }
  .beta-gate { padding: 16px; }
  .beta-card {
    width: min(100%, 390px);
    border-radius: 20px;
    padding: 22px;
  }
  .beta-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .beta-input,
  .beta-submit {
    min-height: 52px;
  }
  .beta-copy h2 {
    margin-bottom: 10px;
    font-size: clamp(25px, 7vw, 31px);
  }
  .beta-copy p {
    margin-bottom: 16px;
    font-size: 14.5px;
  }
  .auth-shell {
    min-height: 100svh;
    padding: 20px 18px 112px;
  }
  .container {
    max-width: 440px;
    padding: 0 10px;
  }
  .logo {
    margin-bottom: 56px;
    font-size: clamp(38px, 9.8vw, 58px);
    letter-spacing: -0.045em;
  }
  body.mode-form .logo { margin-bottom: 32px; font-size: 42px; }
  .form-title { font-size: 24px; }
  .initial-buttons {
    width: min(100%, 390px);
    gap: 14px;
  }
  .footer {
    bottom: 22px;
    padding: 0 18px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .logo {
    margin-bottom: 48px;
    font-size: clamp(32px, 9.2vw, 44px);
    letter-spacing: -0.044em;
  }

  .btn,
  .btn-submit {
    min-height: 56px;
    padding: 15px 24px;
    font-size: 16px;
  }

  .auth-form:not([hidden]) {
    width: min(100%, 390px);
    margin: 0 auto;
  }

  .input {
    padding: 14px;
    font-size: 16px;
  }

  .footer {
    gap: 5px;
    bottom: 18px;
    font-size: 11.5px;
  }

  .version {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .auth-shell {
    padding-inline: 14px;
  }

  .beta-card {
    padding: 20px;
  }

  .beta-input {
    padding-inline: 14px;
    font-size: 13px;
  }

  .logo {
    font-size: clamp(29px, 8.8vw, 36px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell *,
  .auth-shell::before,
  .workspace-shell *,
  .workspace-shell::before,
  .tool-workbench,
  .tool-workbench::before,
  .beta-card {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

[hidden] {
  display: none !important;
}

body.is-workspace {
  overflow: auto;
  background: #000;
}

body.is-tool-open {
  overflow: hidden;
}

.workspace-shell {
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(920px 540px at 50% 22%, rgba(255, 255, 255, 0.028), transparent 68%),
    radial-gradient(1200px 760px at 50% 116%, rgba(255, 255, 255, 0.026), transparent 72%),
    #000;
  padding: clamp(82px, 14vh, 128px) 24px 136px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.workspace-shell::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(900px 600px at 50% 48%, rgba(255, 255, 255, 0.018), transparent 70%);
  animation: blackBreath 20s var(--ease-enter) infinite alternate;
}

.workspace-hero,
.workspace-grid,
.workspace-nav {
  position: relative;
  z-index: 1;
  will-change: opacity, transform, filter;
}

.workspace-hero {
  text-align: center;
  margin: 0 auto 58px;
  max-width: 860px;
  animation: workspaceRise 0.9s var(--ease-enter) both;
}

.workspace-kicker {
  margin: 0 0 16px;
  color: rgba(245, 245, 247, 0.42);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.workspace-hero h2 {
  margin: 0;
  color: rgba(245, 245, 247, 0.96);
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.workspace-subtitle {
  margin: 18px 0 0;
  color: rgba(245, 245, 247, 0.72);
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: -0.036em;
}

.workspace-grid {
  width: min(100%, 1080px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.workspace-card {
  appearance: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  min-height: 178px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.026));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 60px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(18px) scale(0.992);
  animation: cardIn 0.76s var(--ease-enter) var(--delay) forwards;
}

.workspace-card:hover {
  border-color: rgba(255, 255, 255, 0.17);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.066), rgba(255, 255, 255, 0.032));
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: rgba(245, 245, 247, 0.82);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-icon svg,
.workspace-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-card h3 {
  margin: 0 0 8px;
  color: rgba(245, 245, 247, 0.92);
  font-size: 17px;
  line-height: 1.12;
  font-weight: 520;
  letter-spacing: -0.028em;
}

.workspace-card p {
  margin: 0 0 18px;
  color: rgba(245, 245, 247, 0.58);
  font-size: 14px;
  line-height: 1.38;
  letter-spacing: -0.018em;
}

.workspace-card span {
  color: rgba(245, 245, 247, 0.72);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.workspace-nav {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: min(calc(100vw - 32px), 720px);
  min-height: 70px;
  border-radius: 999px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(24, 24, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  animation: navIn 0.9s var(--ease-enter) 0.35s both;
}

.nav-pill {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: rgba(245, 245, 247, 0.67);
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 520;
  letter-spacing: -0.026em;
  transition: color 0.24s var(--ease), background 0.24s var(--ease), transform 0.24s var(--ease);
}

.nav-pill:hover {
  color: rgba(245, 245, 247, 0.92);
  background: rgba(255, 255, 255, 0.055);
}

.nav-pill.active {
  color: rgba(245, 245, 247, 0.95);
  background: rgba(255, 255, 255, 0.14);
}

@keyframes workspaceRise {
  0% { opacity: 0; transform: translateY(20px); filter: blur(10px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes cardIn {
  0% { opacity: 0; transform: translateY(18px) scale(0.992); filter: blur(8px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes navIn {
  0% { opacity: 0; transform: translate(-50%, 18px) scale(0.985); filter: blur(8px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); filter: blur(0); }
}

@keyframes sectorHeroOut {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-26px) scale(0.985); filter: blur(12px); visibility: hidden; }
}

@keyframes sectorCardsOut {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(24px) scale(0.986); filter: blur(12px); visibility: hidden; }
}

@keyframes sectorNavOut {
  0% { opacity: 1; transform: translate(-50%, 0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, 28px) scale(0.98); filter: blur(10px); visibility: hidden; }
}

@keyframes toolSectorIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.992); filter: blur(12px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes toolBlockIn {
  0% { opacity: 0; transform: translateY(18px); filter: blur(8px); }
  70% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 680px;
  }

  .workspace-nav {
    width: min(calc(100vw - 28px), 620px);
  }

  .nav-pill {
    padding: 0 14px;
  }
}

@media (max-width: 720px) {
  .workspace-shell {
    min-height: 100svh;
    padding: 74px 18px 118px;
  }

  .workspace-hero {
    margin-bottom: 34px;
  }

  .workspace-kicker {
    margin-bottom: 12px;
    font-size: 12px;
  }

  .workspace-hero h2 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .workspace-subtitle {
    margin-top: 14px;
    font-size: clamp(16px, 4.4vw, 20px);
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    gap: 14px;
  }

  .workspace-card {
    min-height: 148px;
    padding: 18px;
    border-radius: 15px;
  }

  .card-icon {
    margin-bottom: 15px;
  }

  .workspace-nav {
    bottom: 18px;
    width: min(calc(100vw - 20px), 420px);
    min-height: 62px;
    padding: 8px;
    gap: 4px;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .workspace-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-pill {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 0 14px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .workspace-shell {
    padding-inline: 14px;
  }

  .workspace-hero h2 {
    font-size: clamp(30px, 9.4vw, 38px);
  }

  .workspace-subtitle {
    font-size: 15px;
  }

  .workspace-card h3 {
    font-size: 16px;
  }

  .workspace-card p {
    font-size: 13px;
  }
}

body.is-tool-open .workspace-hero {
  pointer-events: none;
  animation: sectorHeroOut 0.46s var(--ease-enter) both;
}

body.is-tool-open .workspace-grid {
  pointer-events: none;
  animation: sectorCardsOut 0.48s var(--ease-enter) 0.03s both;
}

body.is-tool-open .workspace-nav {
  pointer-events: none;
  animation: sectorNavOut 0.42s var(--ease-enter) both;
}

.tool-workbench {
  position: fixed;
  inset: 0;
  z-index: 4;
  width: 100%;
  min-height: 100dvh;
  padding: clamp(34px, 5vh, 58px) 22px 34px;
  overflow-y: auto;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 50% 18%, rgba(255, 255, 255, 0.035), transparent 70%),
    radial-gradient(1100px 720px at 50% 118%, rgba(255, 255, 255, 0.025), transparent 72%),
    #000;
  animation: toolSectorIn 0.62s var(--ease-enter) 0.08s both;
}

.tool-workbench::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(820px 520px at 50% 44%, rgba(255, 255, 255, 0.018), transparent 70%);
  animation: blackBreath 20s var(--ease-enter) infinite alternate;
}

.tool-back {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 42px;
  margin: 0 0 clamp(34px, 6vh, 62px);
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  color: rgba(245, 245, 247, 0.76);
  background: rgba(18, 18, 20, 0.72);
  cursor: pointer;
  font-size: 14px;
  font-weight: 520;
  letter-spacing: -0.018em;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: color 0.22s var(--ease), background 0.22s var(--ease), transform 0.22s var(--ease);
}

.tool-back:hover {
  color: rgba(245, 245, 247, 0.95);
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(-2px);
}

.tool-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(26px, 5vh, 42px);
  animation: toolBlockIn 0.62s var(--ease-enter) 0.16s both;
}

.tool-mode {
  margin: 0 0 10px;
  color: rgba(245, 245, 247, 0.42);
  font-size: 13px;
  font-weight: 520;
  letter-spacing: -0.012em;
}

.tool-head h2 {
  margin: 0;
  color: rgba(245, 245, 247, 0.96);
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 520;
  letter-spacing: -0.055em;
}

.tool-head p:last-child {
  margin: 14px 0 0;
  color: rgba(245, 245, 247, 0.62);
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.38;
  letter-spacing: -0.03em;
}

.tool-form {
  width: min(100%, 860px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
  animation: toolBlockIn 0.62s var(--ease-enter) 0.22s both;
}

.tool-target {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  justify-content: end;
  gap: 12px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 14px;
  letter-spacing: -0.018em;
}

.tool-target select {
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  padding: 0 14px;
  color: rgba(245, 245, 247, 0.92);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

#toolInput {
  width: 100%;
  min-height: clamp(180px, 28vh, 280px);
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 26px;
  padding: 24px;
  color: rgba(245, 245, 247, 0.94);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.030));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 30px 90px rgba(0, 0, 0, 0.36);
  outline: none;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.02em;
}

#toolInput:focus {
  border-color: rgba(255, 255, 255, 0.19);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.064), rgba(255, 255, 255, 0.034));
}

#toolInput::placeholder {
  color: rgba(245, 245, 247, 0.32);
}

.tool-submit {
  justify-self: center;
  min-width: min(100%, 320px);
  min-height: 58px;
  border: none;
  border-radius: 999px;
  color: #050505;
  background: rgba(245, 245, 247, 0.94);
  box-shadow: 0 18px 48px rgba(255, 255, 255, 0.09);
  cursor: pointer;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.026em;
  transition: background 0.22s var(--ease), box-shadow 0.22s var(--ease), opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.tool-submit:hover {
  background: #fff;
  box-shadow: 0 22px 58px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.tool-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.tool-output {
  width: min(100%, 860px);
  margin: 22px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.030));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 24px 80px rgba(0, 0, 0, 0.30);
  overflow: hidden;
  animation: toolBlockIn 0.55s var(--ease-enter) both;
}

.tool-output-head {
  min-height: 58px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 14px;
  font-weight: 540;
  letter-spacing: -0.018em;
}

.tool-output-head button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  color: rgba(245, 245, 247, 0.86);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

#outputText {
  margin: 0;
  padding: 22px;
  white-space: pre-wrap;
  color: rgba(245, 245, 247, 0.92);
  font: inherit;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.02em;
}

@media (max-width: 720px) {
  body.is-tool-open .workspace-shell {
    padding-bottom: 104px;
  }

  .tool-workbench {
    padding: 24px 16px 28px;
  }

  .tool-back {
    margin-bottom: 28px;
  }

  .tool-head {
    margin-bottom: 22px;
  }

  .tool-head h2 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .tool-head p:last-child {
    font-size: 16px;
  }

  .tool-target {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .tool-target select {
    width: 100%;
  }

  #toolInput {
    min-height: 240px;
    border-radius: 18px;
    padding: 18px;
    font-size: 16px;
  }

  .tool-submit {
    width: 100%;
  }

  .tool-output {
    border-radius: 18px;
  }

  #outputText {
    padding: 18px;
    font-size: 16px;
  }
}
