/*
 * Loading-screen styles — extracted from docs/tile-ui/tile-ui.css.
 *
 * Just the rules needed by <LoadingScreen> and its <Logo>:
 *   - the variables those rules reference (4 colors + 1 radius)
 *   - .skeleton / .sk-logo / .sk-text / .sk-bar / .sk-bar-fill
 *   - the @keyframes (sk-pulse, sk-load)
 *   - .logo / .logo-light / .logo-dark dark-mode toggle
 *
 * Scoped to descendants of `.tile-loading-host` so the rules can't bleed
 * into the rest of the editor (`.skeleton` and `.logo` are common-enough
 * names that we don't want them at the global level). The host class is
 * applied by <App> at the loading-screen wrapper.
 *
 * Why a separate file (vs Aphrodite or styled-components):
 *   <LoadingScreen> ships in the design system using plain class names
 *   (`.skeleton`, `.sk-*`). Reproducing those rules in Aphrodite would
 *   fork the design system. This file IS the porting layer — the smallest
 *   possible CSS subset to make the design-system component render.
 */

.tile-loading-host {
  --tlh-white: #fefefe;
  --tlh-gray-100: #f3f3f3;
  --tlh-gray-500: #777;
  --tlh-tile-blue: #2068a8;
  --tlh-radius-xl: 14px;
}

.tile-loading-host .skeleton {
  position: absolute;
  inset: 0;
  background: var(--tlh-white);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--tlh-radius-xl);
  transition: opacity 0.3s;
}

.tile-loading-host .skeleton.hide {
  opacity: 0;
  pointer-events: none;
}

.tile-loading-host .sk-logo {
  animation: tlh-sk-pulse 1.5s ease-in-out infinite;
}

@keyframes tlh-sk-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.tile-loading-host .sk-text {
  font-size: 13px;
  color: var(--tlh-gray-500);
  font-weight: 500;
}

.tile-loading-host .sk-bar {
  width: 200px;
  height: 4px;
  background: var(--tlh-gray-100);
  border-radius: 2px;
  overflow: hidden;
}

.tile-loading-host .sk-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--tlh-tile-blue);
  border-radius: 2px;
  animation: tlh-sk-load 2s ease-out forwards;
}

@keyframes tlh-sk-load {
  0% {
    width: 0;
  }
  60% {
    width: 80%;
  }
  100% {
    width: 100%;
  }
}

/* Mono sub-caption under the progress bar, e.g.
 * "Hydrating VFS · Indexing AST · Connecting session". */
.tile-loading-host .sk-status {
  font-size: 11px;
  color: var(--tlh-gray-500);
  font-family: 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;
  opacity: 0.6;
}

/* Logo: design-system variant rendering. The component emits both
 * `.logo-light` and `.logo-dark` SVGs and toggles them via the `.dark`
 * class on an ancestor. Default = light visible, dark hidden. */
.tile-loading-host .logo {
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.tile-loading-host .logo svg {
  height: 20px;
  width: auto;
}
.tile-loading-host .logo .logo-dark {
  display: none;
}
.tile-loading-host.dark .logo .logo-light {
  display: none;
}
.tile-loading-host.dark .logo .logo-dark {
  display: block;
}

/*
 * Auth pages styles — Login / Register / ForgotPassword / ResetPassword.
 *
 * Follows DESIGN.md:
 *   - pure white card (#fefefe) on a neutral canvas (#f6f6f6) for figure/ground
 *   - Tile Blue (#2068a8) as the sole chromatic accent — primary button, link,
 *     focus ring; nothing else carries chroma
 *   - Inter font (already loaded by public/index.html)
 *   - shadow-as-border (box-shadow: 0 0 0 1px) instead of CSS borders
 *   - 6px control radius, 10px card radius
 *
 * Scoped under `.tile-auth-host` to keep these rules off the rest of the
 * editor — `.auth-card`, `.btn`, `.input` are common-enough names that
 * leaking them globally would collide.
 *
 * Variables are duplicated from dashboard.css with an `--ta-*` prefix
 * (tile-auth) to stay self-contained — each file is ~10 vars; not worth
 * abstracting into a shared layer yet.
 */

.tile-auth-host {
  --ta-white: #fefefe;
  --ta-canvas: #f6f6f6;
  --ta-gray-50: #f9f9f9;
  --ta-gray-200: #e8e8e8;
  --ta-gray-400: #a8a8a8;
  --ta-gray-500: #777;
  --ta-gray-700: #484848;
  --ta-gray-900: #1a1a1a;
  --ta-tile-blue: #2068a8;
  --ta-tile-blue-hover: #185490;
  --ta-tile-blue-tint: rgba(32, 104, 168, 0.07);
  --ta-err: #dc2626;
  --ta-err-tint: rgba(220, 38, 38, 0.06);
  --ta-ok: #16a34a;
  --ta-ok-tint: rgba(22, 163, 74, 0.06);
  --ta-border: rgba(0, 0, 0, 0.08);
  --ta-border-em: rgba(0, 0, 0, 0.14);
  --ta-focus: rgba(32, 104, 168, 0.35);
  --ta-r: 6px;
  --ta-r-lg: 10px;
  --ta-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  --ta-sh1: 0 0 0 1px var(--ta-border);
  --ta-sh-lift: 0 0 0 1px var(--ta-border), 0 12px 32px rgba(0, 0, 0, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.04);

  /* Page = full viewport, centered card on canvas. */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--ta-canvas);
  font-family: var(--ta-sans);
  color: var(--ta-gray-900);
  overflow: auto;
}

.tile-auth-host *,
.tile-auth-host *::before,
.tile-auth-host *::after {
  box-sizing: border-box;
}

/* ─── Card ────────────────────────────────────────────────────────────── */

.tile-auth-host .auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--ta-white);
  border-radius: var(--ta-r-lg);
  padding: 32px;
  box-shadow: var(--ta-sh-lift);
}

.tile-auth-host .auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  height: 32px;
  cursor: default;
}
.tile-auth-host .auth-logo svg {
  height: 32px;
  width: auto;
}
.tile-auth-host .auth-logo .logo-dark {
  display: none;
}

.tile-auth-host .auth-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--ta-gray-900);
  margin: 0 0 6px;
  text-align: center;
}

.tile-auth-host .auth-subtitle {
  font-size: 13px;
  color: var(--ta-gray-500);
  margin: 0 0 24px;
  text-align: center;
  line-height: 1.4;
}

/* ─── Form fields ─────────────────────────────────────────────────────── */

.tile-auth-host .auth-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ta-gray-700);
  margin: 14px 0 6px;
}

.tile-auth-host .auth-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--ta-white);
  border: none;
  outline: none;
  border-radius: var(--ta-r);
  font-family: var(--ta-sans);
  font-size: 13px;
  color: var(--ta-gray-900);
  box-shadow: var(--ta-sh1);
  transition: box-shadow 0.15s;
}
.tile-auth-host .auth-input::placeholder {
  color: var(--ta-gray-400);
}
.tile-auth-host .auth-input:hover {
  box-shadow: 0 0 0 1px var(--ta-border-em);
}
.tile-auth-host .auth-input:focus {
  box-shadow: 0 0 0 1px var(--ta-tile-blue), 0 0 0 3px var(--ta-focus);
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.tile-auth-host .auth-btn {
  width: 100%;
  height: 38px;
  margin-top: 22px;
  border: none;
  border-radius: var(--ta-r);
  font-family: var(--ta-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.tile-auth-host .auth-btn-primary {
  background: var(--ta-tile-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.tile-auth-host .auth-btn-primary:hover {
  background: var(--ta-tile-blue-hover);
}
.tile-auth-host .auth-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ─── Banners (error / success) ───────────────────────────────────────── */

.tile-auth-host .auth-banner {
  padding: 10px 12px;
  border-radius: var(--ta-r);
  font-size: 12px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.tile-auth-host .auth-banner-error {
  background: var(--ta-err-tint);
  color: var(--ta-err);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}
.tile-auth-host .auth-banner-success {
  background: var(--ta-ok-tint);
  color: var(--ta-ok);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15);
}

/* ─── Footer links ────────────────────────────────────────────────────── */

.tile-auth-host .auth-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--ta-gray-500);
}
.tile-auth-host .auth-foot + .auth-foot {
  margin-top: 8px;
}

.tile-auth-host .auth-link {
  color: var(--ta-tile-blue);
  text-decoration: none;
  font-weight: 500;
}
.tile-auth-host .auth-link:hover {
  text-decoration: underline;
}

/* ─── Field-level error caption ───────────────────────────────────────── */

.tile-auth-host .auth-field-error {
  font-size: 11px;
  color: var(--ta-err);
  margin-top: 4px;
}

/*
 * Dashboard styles — extracted subset of docs/tile-ui/tile-ui.css.
 *
 * Just the rules used by /apps and /dashboard:
 *   - top bar (.dash-top, .dash-search, .dash-search:focus)
 *   - card grid (.dash-grid, .dash-card, .dash-card-preview, .dash-card-info,
 *     .dash-card-name, .dash-card-meta)
 *   - "Create new app" placeholder card (.dash-card-empty)
 *   - buttons (.btn, .btn-p, .btn-s, .btn-d, .btn-g)
 *   - user chip + divider (.chip, .vd)
 *   - logo dark/light toggle (.logo, .logo-light, .logo-dark)
 *
 * Scoped under `.tile-dash-host` so the rules can't bleed into the editor —
 * `.dash`, `.btn`, `.chip` are common-enough names that we don't want them
 * at the global level.
 *
 * Why a separate file (vs Aphrodite or styled-components):
 *   The mockup in docs/newdesign.html uses these exact class names. By
 *   keeping the same selectors we can paste future design tweaks straight
 *   from the prototype instead of translating to CSS-in-JS each time.
 */

.tile-dash-host {
  /* Variables — same values as tile-ui.css's :root, prefixed to dodge
   * collisions with anything else in the page. */
  --td-white: #fefefe;
  --td-canvas: #f6f6f6;
  --td-gray-50: #f9f9f9;
  --td-gray-100: #f3f3f3;
  --td-gray-400: #a8a8a8;
  --td-gray-500: #777;
  --td-gray-700: #484848;
  --td-gray-900: #1a1a1a;
  --td-tile-blue: #2068a8;
  --td-tile-blue-hover: #185490;
  --td-err: #dc2626;
  --td-err-tint: rgba(220, 38, 38, 0.06);
  --td-border: rgba(0, 0, 0, 0.06);
  --td-border-em: rgba(0, 0, 0, 0.1);
  --td-focus: rgba(32, 104, 168, 0.35);
  --td-r: 8px;
  --td-r-sm: 6px;
  --td-r-lg: 10px;
  --td-r-xl: 14px;
  --td-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  --td-sh1: 0 0 0 1px var(--td-border);
  --td-sh2: 0 0 0 1px var(--td-border), 0 2px 6px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.03);
  --td-sh3: 0 0 0 1px var(--td-border), 0 8px 24px rgba(0, 0, 0, 0.07),
    0 4px 10px rgba(0, 0, 0, 0.04);

  /* Host fills the page and acts as the layout root. */
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--td-white);
  font-family: var(--td-sans);
  color: var(--td-gray-900);
  overflow: hidden;
}

.tile-dash-host *,
.tile-dash-host *::before,
.tile-dash-host *::after {
  box-sizing: border-box;
}

/* ─── Top bar ─────────────────────────────────────────────────────────── */

.tile-dash-host .dash-top {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: inset 0 -1px 0 var(--td-border);
}

.tile-dash-host .dash-search {
  flex: 1;
  max-width: 320px;
  height: 34px;
  background: var(--td-gray-50);
  border-radius: var(--td-r);
  padding: 0 12px;
  font-size: 13px;
  color: var(--td-gray-900);
  border: none;
  outline: none;
  font-family: var(--td-sans);
  box-shadow: var(--td-sh1);
}
.tile-dash-host .dash-search:focus {
  box-shadow: 0 0 0 2px var(--td-focus);
}
.tile-dash-host .dash-search::placeholder {
  color: var(--td-gray-500);
}

/* User block aligned to the right of the top bar */
.tile-dash-host .dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.tile-dash-host .chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--td-r);
  box-shadow: var(--td-sh1);
  font-size: 12px;
  font-weight: 500;
  color: var(--td-gray-700);
  background: var(--td-white);
}

.tile-dash-host .vd {
  width: 1px;
  height: 18px;
  background: var(--td-border);
  flex-shrink: 0;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.tile-dash-host .btn {
  padding: 6px 14px;
  border-radius: var(--td-r);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--td-sans);
  transition: 0.15s;
}
.tile-dash-host .btn-s {
  background: var(--td-white);
  color: var(--td-gray-900);
  box-shadow: var(--td-sh1);
}
.tile-dash-host .btn-s:hover {
  box-shadow: var(--td-sh2);
}
.tile-dash-host .btn-p {
  background: var(--td-tile-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.tile-dash-host .btn-p:hover {
  background: var(--td-tile-blue-hover);
}
.tile-dash-host .btn-p:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tile-dash-host .btn-g {
  background: transparent;
  color: var(--td-gray-500);
  padding: 6px 8px;
}
.tile-dash-host .btn-g:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--td-gray-700);
}
.tile-dash-host .btn-d {
  background: var(--td-white);
  color: var(--td-err);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}
.tile-dash-host .btn-d:hover {
  background: var(--td-err-tint);
}

/* ─── Card grid ───────────────────────────────────────────────────────── */

.tile-dash-host .dash-grid {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-content: start;
  background: var(--td-canvas);
}

.tile-dash-host .dash-card {
  background: var(--td-white);
  border-radius: var(--td-r-lg);
  box-shadow: var(--td-sh2);
  cursor: pointer;
  overflow: hidden;
  transition: 0.2s;
  position: relative;
}
.tile-dash-host .dash-card:hover {
  box-shadow: var(--td-sh3);
  transform: translateY(-2px);
}

.tile-dash-host .dash-card-preview {
  height: 140px;
  background: linear-gradient(135deg, var(--td-gray-50), var(--td-gray-100));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  opacity: 0.5;
}

.tile-dash-host .dash-card-info {
  padding: 12px;
}

.tile-dash-host .dash-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--td-gray-900);
  margin: 0 0 4px;
}

.tile-dash-host .dash-card-meta {
  font-size: 11px;
  color: var(--td-gray-500);
}

/* "Create new app" placeholder card — matches the dashed style in the
 * mockup (docs/newdesign.html line 1618). */
.tile-dash-host .dash-card-empty {
  border: 2px dashed var(--td-border-em);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--td-gray-400);
  text-align: center;
}
.tile-dash-host .dash-card-empty:hover {
  box-shadow: none;
  border-color: var(--td-tile-blue);
  color: var(--td-tile-blue);
  transform: translateY(-2px);
}
.tile-dash-host .dash-card-empty-plus {
  font-size: 24px;
  margin-bottom: 6px;
  line-height: 1;
}
.tile-dash-host .dash-card-empty-label {
  font-size: 12px;
  font-weight: 500;
}

/* ─── Card kebab menu (revealed on hover) ─────────────────────────────── */

.tile-dash-host .dash-card-kebab {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: var(--td-r-sm);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--td-sh1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--td-gray-700);
  opacity: 0;
  transition: opacity 0.15s, box-shadow 0.15s;
  font-size: 16px;
  font-weight: 700;
}
.tile-dash-host .dash-card:hover .dash-card-kebab,
.tile-dash-host .dash-card-kebab.open {
  opacity: 1;
}
.tile-dash-host .dash-card-kebab:hover {
  box-shadow: var(--td-sh2);
}

.tile-dash-host .dash-card-menu {
  position: absolute;
  top: 40px;
  right: 8px;
  background: var(--td-white);
  box-shadow: var(--td-sh3);
  border-radius: var(--td-r-sm);
  padding: 4px;
  z-index: 10;
  min-width: 140px;
}
.tile-dash-host .dash-card-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--td-gray-900);
  cursor: pointer;
  border-radius: var(--td-r-sm);
  font-family: var(--td-sans);
}
.tile-dash-host .dash-card-menu button:hover {
  background: var(--td-gray-50);
}
.tile-dash-host .dash-card-menu button.danger {
  color: var(--td-err);
}
.tile-dash-host .dash-card-menu button.danger:hover {
  background: var(--td-err-tint);
}

/* ─── Empty state ─────────────────────────────────────────────────────── */

.tile-dash-host .dash-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--td-gray-500);
}
.tile-dash-host .dash-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--td-gray-900);
  margin: 0 0 8px;
}
.tile-dash-host .dash-empty-sub {
  font-size: 13px;
  margin: 0 0 16px;
  max-width: 360px;
}

.tile-dash-host .dash-error {
  margin: 0 24px 8px;
  background: var(--td-err-tint);
  color: var(--td-err);
  border-radius: var(--td-r-sm);
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

/* ─── Logo dark/light toggle ──────────────────────────────────────────── */

.tile-dash-host .logo {
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.tile-dash-host .logo svg {
  height: 24px;
  width: auto;
}
.tile-dash-host .logo .logo-dark {
  display: none;
}
.tile-dash-host.dark .logo .logo-light {
  display: none;
}
.tile-dash-host.dark .logo .logo-dark {
  display: block;
}

/* ─── Modal (Create / Rename / Delete) ────────────────────────────────── */

.tile-dash-host .dlg-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.tile-dash-host .dlg {
  background: var(--td-white);
  border-radius: var(--td-r-lg);
  box-shadow: var(--td-sh3);
  padding: 24px;
  min-width: 360px;
  max-width: 480px;
}
.tile-dash-host .dlg-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--td-gray-900);
  margin: 0 0 14px;
}
.tile-dash-host .dlg-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--td-gray-50);
  border-radius: var(--td-r);
  border: none;
  outline: none;
  font-family: var(--td-sans);
  font-size: 13px;
  color: var(--td-gray-900);
  box-shadow: var(--td-sh1);
  margin-bottom: 16px;
}
.tile-dash-host .dlg-input:focus {
  box-shadow: 0 0 0 2px var(--td-focus);
}
.tile-dash-host .dlg-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tile-dash-host .dlg-text {
  font-size: 13px;
  color: var(--td-gray-700);
  margin: 0 0 16px;
}
.tile-dash-host .dlg-text strong {
  color: var(--td-gray-900);
  font-weight: 600;
}


/*# sourceMappingURL=app.css.map*/