:root {
  color-scheme: light;
  --bg: #eef3fb;
  --bg-secondary: #f7f8fc;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: rgba(15, 23, 42, 0.08);
  --accent: #2f6df6;
  --accent-soft: rgba(47, 109, 246, 0.12);
  --success: #129366;
  --warning: #d97706;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  font-family: "SF Pro Text", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(95, 143, 255, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-secondary) 100%);
  color: var(--text);
}

button {
  font: inherit;
}

.mobile-frame {
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: transparent;
}

.app-shell {
  padding: calc(env(safe-area-inset-top) + 20px) 18px calc(env(safe-area-inset-bottom) + 92px);
}

#banner-root,
#modal-root {
  display: contents;
}

.nav-hero {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -6px -4px 28px;
  padding: 10px 6px 18px;
  border-radius: 0 0 30px 30px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.44) 0%, rgba(247, 250, 255, 0.22) 100%);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: 0 10px 26px rgba(148, 163, 184, 0.06);
  backdrop-filter: blur(16px) saturate(120%);
  overflow: hidden;
}

.brand-lockup {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.brand-lockup__logo {
  display: block;
  width: min(184px, 48vw);
  height: auto;
}

.hero-copy {
  display: grid;
  gap: 4px;
}

.workspace-chip {
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  padding: 10px 14px;
}

.workspace-code {
  border: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(47, 109, 246, 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.workspace-code:focus,
.workspace-code:focus-visible {
  outline: none;
  box-shadow: none;
}

@media (max-width: 1023px) {
  .app-shell {
    padding-top: calc(env(safe-area-inset-top) + 10px);
  }

  .tabbar {
    grid-template-columns: repeat(var(--tab-count, 4), minmax(0, 1fr));
    gap: 2px;
    padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
    align-items: stretch;
  }

  .tabbar__item {
    min-width: 0;
    padding: 11px 2px;
    font-size: 13px;
    line-height: 1;
    border-radius: 14px;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  .nav-hero {
    margin: -4px -2px 16px;
    padding: 8px 4px 12px;
    border-radius: 0 0 24px 24px;
  }

  .brand-lockup {
    margin-bottom: 8px;
  }

  .brand-lockup__logo {
    width: min(156px, 42vw);
  }

  .eyebrow {
    display: none;
  }

  .hero-title {
    display: none;
  }

  .hero-subtitle {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .icon-btn {
    flex-shrink: 0;
  }

  .media-play {
    padding: 8px 12px;
    font-size: 12px;
  }
}

.auth-shell {
  min-height: 100vh;
  padding: 24px 18px;
  display: flex;
  align-items: center;
}

.auth-card {
  width: 100%;
  padding: 24px 20px;
}

.auth-switch {
  margin: 20px 0 10px;
}

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

.auth-toggle {
  margin: 8px 0 2px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-toggle__text {
  display: grid;
  gap: 4px;
}

.auth-toggle__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.auth-toggle__hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.auth-toggle__switch {
  position: relative;
  width: 52px;
  height: 32px;
  flex-shrink: 0;
}

.auth-toggle__switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}

.auth-toggle__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  transition: background 0.2s ease;
}

.auth-toggle__slider::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.auth-toggle__switch input:checked + .auth-toggle__slider {
  background: rgba(47, 109, 246, 0.82);
}

.auth-toggle__switch input:checked + .auth-toggle__slider::after {
  transform: translateX(20px);
}

.auth-toggle__switch input:focus-visible + .auth-toggle__slider {
  outline: 2px solid rgba(47, 109, 246, 0.28);
  outline-offset: 2px;
}

.workspace-empty {
  padding: 22px;
}

.workspace-empty__title {
  font-size: 22px;
  font-weight: 750;
}

.workspace-empty__body {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.workspace-empty__actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hero-title {
  margin-top: 8px;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 750;
}

.hero-subtitle {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

.card,
.glass {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.glass {
  backdrop-filter: blur(18px);
}

.section {
  margin-top: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-head--stacked {
  display: grid;
  gap: 12px;
  align-items: start;
}

.section-head__group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-head__actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
}

.section-meta {
  font-size: 13px;
  color: var(--muted);
}

.search-card {
  padding: 14px 16px;
  margin-top: 6px;
}

.search-card__form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-card__input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 15px;
  outline: none;
  color: var(--text);
}

.search-card__button {
  flex-shrink: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 18px;
}

.metric[data-action] {
  cursor: pointer;
}

.metric--accent {
  background:
    linear-gradient(180deg, rgba(47, 109, 246, 0.12) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.metric__label {
  color: var(--muted);
  font-size: 13px;
}

.metric__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric__value {
  margin-top: 12px;
  font-size: 38px;
  line-height: 1;
  font-weight: 760;
}

.metric__value--compact {
  font-size: 24px;
  line-height: 1.2;
}

.metric__value--status {
  font-size: 22px;
  line-height: 1.2;
  text-transform: uppercase;
  word-break: break-word;
}

.metric__hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.admin-overview-grid {
  align-items: stretch;
}

.asset-card {
  overflow: hidden;
}

.asset-card__cover {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  overflow: hidden;
}

.asset-card__cover--video {
  background: linear-gradient(135deg, #0f172a 0%, #384860 100%);
}

.asset-card__cover--image {
  background: linear-gradient(135deg, #dbeafe 0%, #f9d7ba 100%);
  color: #173256;
}

.asset-card__title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
}

.asset-card__cover-inner {
  display: flex;
  min-height: 100px;
  flex-direction: column;
  justify-content: space-between;
}

.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--media-ratio, 3 / 4);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.16) 0%, rgba(226, 232, 240, 0.4) 100%);
}

.asset-card__media,
.list-card__media,
.sheet__preview-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20px;
  background: #e5e7eb;
}

.list-card__media {
  margin-bottom: 14px;
}

.media-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.media-duration,
.media-play {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.media-duration {
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.media-play {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.asset-card__body,
.list-card {
  padding: 18px;
}

.asset-card__topic,
.list-card__subtitle,
.idea-card__hook,
.account-card__persona,
.workspace-card__meta {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.chips,
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip,
.filter {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  border: 0;
}

.chip {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.chip--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.filter {
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.filter.is-active {
  background: var(--text);
  color: #fff;
}

.list-card__title,
.idea-card__title,
.account-card__title,
.workspace-card__title {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.list-card__toolbar {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.list-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.list-card__footer,
.workspace-card__footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.idea-card {
  padding: 18px;
}

.idea-card__topline,
.account-card__topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.idea-card__status-control {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
}

.idea-card__status-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  min-width: 132px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.idea-card__header {
  margin-top: 14px;
}

.idea-card__field-head {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.idea-card__actions {
  margin-top: 14px;
  flex-wrap: wrap;
}

.idea-card__ai {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.idea-card__ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.idea-card__ai-group {
  margin-top: 12px;
}

.idea-card__ai-summary {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.idea-card__ai-option,
.idea-card__feedback {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.icon-btn--copy {
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.idea-card__ai-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.idea-card__ai-option-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.idea-card__feedback-action {
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.idea-card__materials-wrap {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.idea-card__materials {
  display: grid;
  gap: 12px;
}

.idea-card__asset {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.idea-card__asset-preview {
  overflow: hidden;
  border-radius: 16px;
  background: #f8fafc;
}

.idea-card__asset-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idea-card__asset-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.idea-card__asset-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.idea-card__materials-empty {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.96);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.preview-card {
  overflow: hidden;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.preview-card__media {
  overflow: hidden;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.96);
}

.preview-card__media-asset {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card__body {
  min-width: 0;
}

.preview-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-word;
}

.preview-card__empty {
  padding: 28px 16px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.96);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.idea-list-grid {
  display: grid;
  gap: 12px;
}

.idea-list-card {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.idea-list-card__topline,
.idea-list-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.idea-list-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.idea-list-card__hook {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.icon-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.kanban-group + .kanban-group {
  margin-top: 26px;
}

.account-card {
  padding: 18px;
}

.member-card {
  padding: 18px;
}

.member-card__note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.activity-card {
  padding: 18px;
}

.account-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.account-strip::-webkit-scrollbar {
  display: none;
}

.account-pill {
  min-width: 170px;
  border: 0;
  text-align: left;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.account-pill.is-active {
  color: #fff;
  background: linear-gradient(135deg, #111827 0%, #344256 100%);
}

.workspace-card {
  padding: 18px;
}

.workspace-card__avatar {
  display: block;
  width: 72px;
  height: 72px;
  margin-top: 14px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.workspace-card__details {
  margin-top: 14px;
}

.workspace-card__link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
}

.workspace-card__stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workspace-card__value {
  font-size: 28px;
  font-weight: 760;
}

.workspace-card__label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sheet__action-btn {
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
}

.sheet__field--multiselect {
  border: 0;
  margin: 0;
  padding: 0;
}

.multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.multi-select__legend {
  margin-bottom: 10px;
}

.multi-select__chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.multi-select__chip:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 109, 246, 0.28);
}

.multi-select__chip.is-selected,
.multi-select__chip:has(input:checked) {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.multi-select__chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.multi-select__label {
  width: 100%;
  min-width: 0;
  font-size: clamp(12px, 2.9vw, 15px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress {
  margin-top: 12px;
}

.upload-progress__meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.upload-progress__track {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6df6 0%, #7fb0ff 100%);
}

.cta {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(env(safe-area-inset-bottom) + 86px);
  z-index: 30;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  color: #fff;
  box-shadow: 0 22px 42px rgba(37, 99, 235, 0.28);
  font-size: 34px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(460px, 100vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 4), minmax(0, 1fr));
  gap: 4px;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.tabbar__item {
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  padding: 12px 6px;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.tabbar__item.is-active {
  background: rgba(17, 24, 39, 0.08);
  color: var(--text);
  font-weight: 700;
}

.empty {
  padding: 24px 18px;
  text-align: center;
  color: var(--muted);
}

.assets-more {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(47, 109, 246, 0.12);
  color: var(--accent);
  font-size: 14px;
}

.banner--floating {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 50%;
  z-index: 140;
  width: min(420px, calc(100vw - 24px));
  transform: translateX(-50%);
  margin-bottom: 0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
}

.banner--error {
  background: rgba(220, 38, 38, 0.12);
  color: #b42318;
}

.primary-btn,
.icon-btn {
  border: 0;
  border-radius: 14px;
}

.primary-btn {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
}

.primary-btn:disabled {
  background: rgba(148, 163, 184, 0.48);
  color: rgba(255, 255, 255, 0.92);
}

.primary-btn.small {
  padding: 9px 12px;
  font-size: 13px;
}

.icon-btn {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
}

.section-help-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
}

.icon-btn.danger {
  color: #b42318;
  background: rgba(220, 38, 38, 0.1);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.32);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding:
    calc(env(safe-area-inset-top) + 16px)
    max(16px, env(safe-area-inset-right))
    calc(env(safe-area-inset-bottom) + 120px)
    max(16px, env(safe-area-inset-left));
}

.sheet {
  width: min(460px, 100%);
  margin: 0 auto;
  max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 136px);
  overflow: auto;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
  padding: 18px 18px calc(env(safe-area-inset-bottom) + 24px);
}

.sheet__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sheet__title {
  font-size: 20px;
  font-weight: 700;
}

.sheet__form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.sheet__field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.sheet__field.is-hidden {
  display: none;
}

.sheet__field input,
.sheet__field select,
.sheet__field textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: #f8fafc;
  color: var(--text);
}

.sheet__field textarea {
  min-height: 96px;
  resize: vertical;
}

.sheet__field input[type="file"] {
  padding: 10px 12px;
}

.sheet__file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.sheet__file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 18px;
  background: #f7f9fd;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.sheet__file-picker-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.sheet__file-picker-name {
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet__preview-wrap {
  overflow: hidden;
  border-radius: 18px;
  background: #f8fafc;
}

.sheet__preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.sheet__preview-item {
  display: grid;
  gap: 10px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
}

.sheet__preview-media {
  max-height: none;
}

.sheet__preview-empty {
  padding: 18px 14px;
  color: var(--muted);
}

.sheet__hint {
  font-size: 12px;
  color: var(--muted);
}

.sheet__mention-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.sheet__mention-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sheet__mention-item:hover {
  background: #eef4ff;
}

.sheet__preview-action {
  margin-top: 10px;
}

.sheet__preview-delete {
  justify-self: end;
  margin-top: 2px;
}

.comment-thread {
  display: grid;
  gap: 10px;
}

.help-sheet {
  display: grid;
  gap: 12px;
}

.help-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
}

.help-item__title {
  font-size: 15px;
  font-weight: 700;
}

.help-item__body {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.comment-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.comment-item__topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 768px) {
  .auth-shell {
    padding: 48px 28px;
    justify-content: center;
  }

  .auth-card {
    max-width: 560px;
    padding: 32px 30px;
  }

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

@media (min-width: 1024px) {
  body {
    overflow-y: auto;
  }

  .mobile-frame {
    width: min(1360px, calc(100vw - 48px));
    max-width: none;
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    align-items: start;
  }

  .app-shell {
    padding: 0 0 0 8px;
  }

  .nav-hero {
    margin: 0 0 26px;
    padding: 22px 22px 22px;
    border-radius: 32px;
  }

  .brand-lockup {
    margin-bottom: 12px;
  }

  .brand-lockup__logo {
    width: 208px;
  }

  .hero-subtitle {
    max-width: 620px;
  }

  .search-card {
    margin-top: 0;
    padding: 16px 18px;
  }

  .search-card__button {
    min-width: 72px;
    justify-content: center;
  }

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

  .stack {
    gap: 16px;
  }

  .asset-card__body,
  .list-card,
  .idea-card,
  .account-card,
  .member-card,
  .activity-card,
  .workspace-card {
    padding: 20px;
  }

  .list-card__toolbar,
  .idea-card__topline,
  .account-card__topline,
  .workspace-card__footer,
  .list-card__footer {
    gap: 14px;
  }

  .list-card__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .idea-card__asset {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .account-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }

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

  .account-pill {
    min-width: 0;
  }

  .workspace-card__stats {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .cta {
    right: max(calc((100vw - min(1360px, calc(100vw - 48px))) / 2 + 248px), 32px);
    bottom: 34px;
  }

  .tabbar {
    position: fixed;
    top: 28px;
    right: max(calc((100vw - min(1360px, calc(100vw - 48px))) / 2), 24px);
    left: auto;
    bottom: auto;
    transform: none;
    width: 220px;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(120%);
    pointer-events: auto;
  }

  .tabbar__item {
    min-height: 52px;
    padding: 14px 16px;
    text-align: left;
    font-size: 15px;
  }

  .banner--floating {
    top: 20px;
    width: min(520px, calc(100vw - 80px));
  }

  .sheet-backdrop {
    align-items: flex-start;
    padding: max(28px, calc(env(safe-area-inset-top) + 20px)) 28px 28px;
  }

  .sheet {
    width: min(680px, calc(100vw - 340px));
    max-height: calc(100vh - 56px);
    padding: 24px 24px 28px;
  }
}

@media (min-width: 1280px) {
  .grid-2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack {
    gap: 18px;
  }
}
