:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --text: #16181d;
  --muted: #5d6470;
  --line: #d9dde3;
  --panel: #ffffff;
  --shadow: 0 18px 50px rgba(20, 26, 34, 0.08);
  --green: #1f8a70;
  --blue: #3267d6;
  --amber: #b46a00;
  --rose: #bd4565;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(31, 138, 112, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(189, 69, 101, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body.is-authed {
  overflow: hidden;
  background: var(--bg);
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 40px;
  align-items: end;
  min-height: 44vh;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-logo {
  display: block;
  width: 104px;
  height: auto;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 9vw, 6.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.55;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.status-label {
  margin-bottom: 6px;
  font-weight: 800;
}

.profile {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.profile-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--text);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 850;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.profile-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-details strong {
  overflow: hidden;
  font-size: 1.08rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-copy {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  min-height: 42px;
  padding: 11px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--text);
  color: #ffffff;
}

.button.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.button:disabled {
  color: #8d95a1;
  cursor: not-allowed;
}

.tools-section {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
}

h2 {
  margin-bottom: 0;
  font-size: 1.16rem;
  letter-spacing: 0;
}

.workspace-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.workspace-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 48px;
  border-radius: 8px;
}

.workspace-brand img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.workspace-user {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

.workspace-user .profile {
  grid-template-columns: 40px minmax(0, 160px);
  gap: 10px;
}

.workspace-user .profile-avatar {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.workspace-user .profile-details strong {
  font-size: 0.98rem;
}

.profile-button {
  display: block;
  max-width: 230px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: var(--line);
  background: #ffffff;
}

.profile-button:focus-visible {
  outline: 3px solid rgba(50, 103, 214, 0.25);
  outline-offset: 2px;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.profile-menu a {
  display: block;
  padding: 10px 11px;
  border-radius: 6px;
  font-weight: 760;
  text-decoration: none;
}

.profile-menu a:hover,
.profile-menu a:focus-visible {
  background: var(--bg);
}

.tool-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
}

.tool-tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.15;
  text-decoration: none;
}

.tool-tab[aria-current="page"] {
  border-color: var(--text);
  background: var(--text);
  color: #ffffff;
}

.tool-tab:focus-visible {
  outline: 3px solid rgba(50, 103, 214, 0.25);
  outline-offset: 2px;
}

.tool-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.workspace-home {
  overflow: auto;
  padding: 22px;
  background: var(--bg);
}

.home-panel {
  width: min(760px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(20, 26, 34, 0.05);
}

.home-panel h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.home-panel p {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-links a {
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 760;
  text-decoration: none;
}

.home-links a:hover,
.home-links a:focus-visible {
  border-color: var(--text);
}

@media (max-width: 900px) {
  .shell {
    padding-top: 48px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .workspace-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
  }

  .workspace-user {
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 34px;
  }

  h1 {
    font-size: clamp(2.55rem, 16vw, 4.25rem);
  }

  .lede {
    font-size: 1rem;
  }

  .auth-panel {
    padding: 18px;
  }

  .auth-panel .button {
    width: 100%;
    text-align: center;
  }

  .workspace-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .workspace-brand {
    width: 44px;
    height: 42px;
  }

  .workspace-brand img {
    width: 40px;
    height: 40px;
  }

  .tool-tabs {
    grid-column: 1 / -1;
    order: 3;
    padding: 2px 0;
  }

  .workspace-user {
    grid-column: 2;
    justify-self: end;
    justify-content: space-between;
  }

  .workspace-user .profile {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .workspace-user .profile-avatar {
    width: 36px;
    height: 36px;
  }

  .profile-button {
    max-width: min(230px, calc(100vw - 72px));
    padding-right: 4px;
  }

  .profile-menu {
    right: 0;
  }

  .tool-tab {
    min-height: 38px;
    padding: 9px 12px;
    font-size: 0.88rem;
  }

  .workspace-home {
    padding: 12px;
  }

  .home-panel {
    padding: 18px;
  }

  .home-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-links a {
    width: 100%;
  }
}
