/* Lewar client portal and studio panel */

.app-html { height: 100%; }
.app-body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
}
.app-body .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.boot[hidden] { display: none; }

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 300;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  font-size: 13px;
}

/* Auth */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  background: var(--ink);
}
.auth__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: clamp(28px, 4vw, 56px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 80% 18%, rgba(226, 104, 60, .16), transparent 40%),
    linear-gradient(150deg, var(--ink-2), var(--ink));
  overflow: hidden;
}
.auth__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 88px, 88px 100%;
  mask-image: radial-gradient(ellipse 80% 70% at 40% 40%, #000 10%, transparent 80%);
  pointer-events: none;
}
.auth__brand > * { position: relative; z-index: 1; }
.auth__pitch { margin-block: auto; max-width: 620px; }
.auth__pitch .mono { color: var(--accent-2); margin-bottom: 18px; }
.auth__pitch h1 { font-size: clamp(38px, 4.9vw, 72px); max-width: 620px; }
.auth__lead { margin-top: 22px; max-width: 480px; color: var(--dim); font-size: 15px; line-height: 1.65; }
.auth__list { display: grid; gap: 10px; margin-top: 28px; }
.auth__list li { display: flex; align-items: center; gap: 9px; color: var(--dim); font-size: 13px; }
.auth__list .icon { width: 14px; height: 14px; color: var(--ok); }
.auth__foot { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.auth__foot a { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .05em; color: var(--muted); }
.auth__foot a:hover { color: var(--text); }
.auth__foot .icon { width: 14px; height: 14px; }
.auth__main { display: grid; place-items: center; padding: 32px 24px; overflow-y: auto; }
.auth__panel { width: min(440px, 100%); }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.auth__tabs button {
  padding: 13px 6px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.auth__tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.auth__form h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 10px; }
.auth__form > p { color: var(--dim); font-size: 13px; line-height: 1.55; margin-bottom: 24px; }
.auth__form form { display: flex; flex-direction: column; gap: 14px; }
.auth__switch { margin-top: 20px; font-size: 12px; color: var(--muted); }
.auth__switch button { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.auth__forgot { display: inline-block; margin-top: 16px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .04em; color: var(--muted); }
.auth__forgot:hover { color: var(--text); }
.auth__secure { display: flex; align-items: center; gap: 7px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 8.5px; line-height: 1.5; color: var(--muted); }
.auth__secure .icon { width: 13px; height: 13px; color: var(--ok); }
.password { position: relative; }
.password input { padding-right: 46px; }
.password__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; }
.password__toggle:hover { color: var(--text); }
.password__toggle .icon { width: 16px; height: 16px; }

/* App shell */
.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  background: var(--ink);
}
.side {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--ink-2);
  min-height: 0;
}
.side__top { display: flex; flex-direction: column; gap: 14px; padding-inline: 8px; }
.side__badge {
  align-self: flex-start;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--dim);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.side__link .icon { width: 16px; height: 16px; color: var(--muted); }
.side__link:hover { color: var(--text); background: rgba(233, 226, 214, .04); }
.side__link.is-active { color: var(--text); background: rgba(226, 104, 60, .1); box-shadow: inset 2px 0 0 var(--accent); }
.side__link.is-active .icon { color: var(--accent); }
.side__link--muted { font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; padding-block: 8px; }
.side__count { margin-left: auto; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--ink); font-family: var(--font-mono); font-size: 8px; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.side__user { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 12px 8px 0; border-top: 1px solid var(--line-soft); }
.side__user-info { min-width: 0; display: flex; flex-direction: column; }
.side__user-info strong { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__user-info span { font-family: var(--font-mono); font-size: 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink-3);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
}
.avatar--sm { width: 26px; height: 26px; font-size: 9px; }
.icon-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 2px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line); background: rgba(233, 226, 214, .04); }
.icon-btn .icon { width: 16px; height: 16px; }
.side__user .icon-btn { margin-left: auto; }
.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: 70px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: clamp(18px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 10, 9, .65);
  backdrop-filter: blur(10px);
}
.topbar__back { margin-right: 2px; }
.topbar__title { min-width: 0; }
.topbar__title .mono { color: var(--muted); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar__user { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.topbar__logout { display: none; }
.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 48px) clamp(18px, 4vw, 52px) 60px;
  scroll-behavior: smooth;
}
.view { width: 100%; max-width: 1240px; margin-inline: auto; }
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.view-head h1 { font-size: clamp(28px, 3.4vw, 44px); }
.view-head__lead { margin-top: 10px; max-width: 560px; color: var(--dim); font-size: 13.5px; line-height: 1.55; }
.view-head .mono { color: var(--accent-2); margin-bottom: 10px; }
.view-head .btn { flex: 0 0 auto; }

/* Cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
}
.stat__label { font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat strong { font-family: var(--font-display); font-size: clamp(26px, 3vw, 38px); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.stat__note { font-family: var(--font-mono); font-size: 8px; letter-spacing: .04em; color: var(--muted); }
.panel {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
  padding: 22px;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel__head h2, .panel__head h3 { font-size: 18px; letter-spacing: -.02em; }
.panel__head .text-link { font-size: 9px; border-bottom: 0; padding-bottom: 0; color: var(--muted); white-space: nowrap; }
.panel__head .text-link:hover { color: var(--accent); }
.admin-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin-bottom: 12px; }
.admin-grid .panel { min-width: 0; }
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  text-align: center;
  color: var(--muted);
}
.empty .icon { width: 26px; height: 26px; color: var(--muted); }
.empty p { max-width: 360px; font-size: 13px; line-height: 1.55; }
.empty--small { min-height: 120px; }
.empty .btn { margin-top: 6px; }
.security-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(184, 217, 107, .18);
  border-radius: 3px;
  background: rgba(184, 217, 107, .035);
}
.security-strip > .icon { width: 20px; height: 20px; color: var(--ok); flex: 0 0 auto; }
.security-strip div { flex: 1 1 auto; }
.security-strip strong { display: block; font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.security-strip p { font-size: 11px; color: var(--muted); line-height: 1.5; }
.security-strip a { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-2); white-space: nowrap; }
.security-strip--admin { border-color: var(--line); background: var(--ink-2); }
.security-strip--admin > .icon { color: var(--accent); }

/* Project cards */
.project-list { display: flex; flex-direction: column; }
.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 15px 4px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  cursor: pointer;
  transition: padding .25s, background .25s;
}
.project-card:first-child { border-top: 0; }
.project-card:hover { padding-inline: 10px; background: rgba(233, 226, 214, .03); }
.project-card__main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.project-card__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-card__title { font-family: var(--font-display); font-size: 16px; font-weight: 500; letter-spacing: -.02em; }
.project-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .04em; color: var(--muted); }
.project-card__last { margin-top: 2px; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card__right { display: flex; align-items: center; gap: 10px; }
.unread { min-width: 20px; height: 20px; display: grid; place-items: center; padding-inline: 5px; border-radius: 10px; background: var(--accent); color: var(--ink); font-family: var(--font-mono); font-size: 8px; }
.project-card__arrow { color: var(--muted); }
.project-card__arrow .icon { width: 15px; height: 15px; }
.project-card:hover .project-card__arrow { color: var(--accent); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status--new { color: var(--accent-2); border-color: rgba(208, 138, 74, .3); }
.status--in_progress { color: var(--ok); border-color: rgba(184, 217, 107, .25); }
.status--review { color: #c9b3ff; border-color: rgba(201, 179, 255, .25); }
.status--done { color: var(--dim); }
.status--archived { color: var(--muted); }

.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.project-tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
  cursor: pointer;
  text-align: left;
  transition: border-color .25s, transform .25s, background .25s;
}
.project-tile:hover { border-color: rgba(226, 104, 60, .45); transform: translateY(-2px); background: var(--ink-3); }
.project-tile__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-tile__title { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.project-tile__meta { display: flex; flex-wrap: wrap; gap: 5px 12px; font-family: var(--font-mono); font-size: 8.5px; color: var(--muted); }
.project-tile__last { min-height: 34px; color: var(--dim); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-tile__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 8px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; }
.filters button {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: none;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.filters button:hover { color: var(--text); }
.filters button.is-active { border-color: var(--line); background: var(--ink-2); color: var(--text); }

/* Project view */
.view--project { max-width: 1040px; }
.project-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.project-head__back { margin-top: 4px; }
.project-head__title { min-width: 0; flex: 1 1 auto; }
.project-head__title .mono { color: var(--accent-2); margin-bottom: 6px; }
.project-head__title h1 { font-size: clamp(24px, 3vw, 38px); }
.project-head__title > p:last-child { margin-top: 7px; color: var(--dim); font-size: 12px; }
.project-head__meta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding-top: 4px; }
.status-select {
  min-height: 32px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background-color: var(--ink-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.project-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.project-tabs button {
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.project-tabs button.is-active { color: var(--text); border-color: var(--accent); }
.project-panel { display: block; }
.project-panel[data-project-panel="chat"] { display: flex; flex-direction: column; }
.chat {
  height: min(52vh, 560px);
  min-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 4px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.chat-empty { display: none; }
.chat-empty[hidden] { display: none; }
.chat-empty:not([hidden]) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 240px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 3px; }
.chat-empty .icon { width: 26px; height: 26px; }
.chat-empty p { max-width: 380px; font-size: 13px; line-height: 1.55; }
.msg { display: flex; gap: 9px; max-width: 82%; align-self: flex-start; }
.msg--client { align-self: flex-end; flex-direction: row-reverse; }
.msg__avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink-3);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 8px;
}
.msg__body { min-width: 0; }
.msg__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .04em; color: var(--muted); }
.msg--client .msg__head { justify-content: flex-end; }
.msg__head strong { color: var(--dim); font-weight: 400; text-transform: uppercase; }
.msg__bubble {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.msg--client .msg__bubble { background: rgba(226, 104, 60, .08); border-color: rgba(226, 104, 60, .25); }
.msg__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__attachments { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.msg__image { display: block; width: min(260px, 100%); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: var(--ink); }
.msg__image img { width: 100%; height: auto; max-height: 220px; object-fit: cover; }
.msg__file {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--ink);
  font-size: 11px;
  color: var(--dim);
}
.msg__file .icon { width: 15px; height: 15px; color: var(--accent-2); flex: 0 0 auto; }
.msg__file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg__file small { font-family: var(--font-mono); font-size: 8px; color: var(--muted); }
.msg--system { align-self: center; max-width: 100%; }
.msg--system .msg__bubble { background: transparent; border-style: dashed; color: var(--muted); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.composer { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.composer textarea {
  width: 100%;
  min-height: 62px;
  max-height: 200px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--ink-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer__foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.attach-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--dim);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.attach-btn:hover { color: var(--accent); border-color: rgba(226, 104, 60, .4); }
.attach-btn .icon { width: 16px; height: 16px; }
.composer__hint { font-family: var(--font-mono); font-size: 8px; letter-spacing: .04em; color: var(--muted); }
.composer__foot .btn { margin-left: auto; min-height: 38px; padding: 9px 14px; font-size: 9px; }
.composer__attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.file-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--ink-2);
  font-size: 10px;
  color: var(--dim);
}
.file-chip .icon { width: 13px; height: 13px; color: var(--accent-2); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; }
.file-chip.is-loading { opacity: .55; }

/* Safe */
.safe-intro { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 3px; background: var(--ink-2); margin-bottom: 14px; }
.safe-intro__icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(226, 104, 60, .35); border-radius: 2px; color: var(--accent); background: var(--accent-soft); }
.safe-intro h2 { font-size: 24px; margin-bottom: 6px; }
.safe-intro p:not(.mono) { max-width: 620px; color: var(--dim); font-size: 12px; line-height: 1.55; }
.safe-intro .mono { color: var(--accent-2); margin-bottom: 5px; }
.safe-intro .text-link { margin-left: auto; flex: 0 0 auto; font-size: 8.5px; }
.safe-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 12px; }
.safe-form h3, .safe-list-panel h3 { font-size: 17px; margin-bottom: 10px; }
.safe-note { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 16px; padding: 10px; border: 1px dashed rgba(226, 104, 60, .3); border-radius: 2px; font-family: var(--font-mono); font-size: 8px; line-height: 1.55; color: var(--muted); }
.safe-note .icon { width: 13px; height: 13px; color: var(--accent-2); flex: 0 0 auto; margin-top: 1px; }
.safe-form .field { margin-bottom: 10px; }
.safe-form .form-grid { margin-bottom: 10px; }
.safe-form .check { margin-block: 12px; }
.safe-form .btn { margin-top: 4px; }
.safe-list { display: flex; flex-direction: column; }
.safe-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.safe-item:first-child { border-top: 0; }
.safe-item__icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 2px; color: var(--accent); flex: 0 0 auto; }
.safe-item__icon .icon { width: 14px; height: 14px; }
.safe-item__main { min-width: 0; flex: 1 1 auto; }
.safe-item__main strong { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.safe-item__main span { font-family: var(--font-mono); font-size: 8px; color: var(--muted); }
.safe-item .tag { flex: 0 0 auto; }
.safe-item__revoke { border: 0; background: none; color: var(--muted); font-family: var(--font-mono); font-size: 7.5px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; padding: 4px; }
.safe-item__revoke:hover { color: var(--deny); }
.safe-item.is-revoked { opacity: .5; }
.safe-how { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 3px; }
.safe-how h3 { font-size: 16px; margin-bottom: 12px; }
.safe-how ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.safe-how li { display: flex; gap: 8px; }
.safe-how li span { font-family: var(--font-mono); font-size: 8px; color: var(--accent); flex: 0 0 auto; }
.safe-how li p { font-size: 10.5px; line-height: 1.5; color: var(--muted); }

/* Details */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.details-list { display: flex; flex-direction: column; }
.details-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.details-list > div:first-child { border-top: 0; }
.details-list dt { font-family: var(--font-mono); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.details-list dd { font-size: 12px; text-align: right; color: var(--dim); overflow-wrap: anywhere; }
.details-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
.details-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.details-actions .btn { min-height: 36px; padding: 8px 12px; font-size: 8.5px; }

/* New project */
.new-project { max-width: 960px; }
.service-picker { border: 0; margin-bottom: 24px; }
.service-picker legend { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.service-picker__hint { color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.service-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.service-option { cursor: pointer; }
.service-option input { position: absolute; opacity: 0; pointer-events: none; }
.service-option > span {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 100%;
  min-height: 110px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
  transition: border-color .2s, background .2s, transform .2s;
}
.service-option > span:hover { border-color: rgba(226, 104, 60, .4); transform: translateY(-1px); }
.service-option input:checked + span { border-color: var(--accent); background: rgba(226, 104, 60, .08); }
.service-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.service-option .icon { width: 18px; height: 18px; color: var(--accent-2); }
.service-option strong { font-family: var(--font-display); font-size: 13px; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.service-option em { font-style: normal; font-size: 10.5px; line-height: 1.4; color: var(--muted); }
.new-project .form-grid { margin-bottom: 14px; }
.new-project__foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.new-project__foot p { display: flex; align-items: center; gap: 7px; max-width: 420px; font-family: var(--font-mono); font-size: 8px; line-height: 1.5; color: var(--muted); }
.new-project__foot .icon { width: 13px; height: 13px; color: var(--ok); flex: 0 0 auto; }

/* Profile */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-grid .panel { display: flex; flex-direction: column; gap: 10px; }
.profile-grid .panel .field { margin-bottom: 2px; }
.profile-grid .panel .btn { align-self: flex-start; margin-top: 6px; }
.field-note { font-family: var(--font-mono); font-size: 8.5px; line-height: 1.55; color: var(--muted); }
.language-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 2px; margin-top: 4px; }
.language-switch button { padding: 9px; border: 0; border-radius: 2px; background: none; font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.language-switch button.is-active { background: var(--accent); color: var(--ink); }

/* Leads */
.leads-list { display: flex; flex-direction: column; gap: 8px; }
.lead-card { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 3px; background: var(--ink-2); }
.lead-card__main { min-width: 0; }
.lead-card__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.lead-card__name { font-family: var(--font-display); font-size: 16px; font-weight: 500; }
.lead-card__meta { display: flex; flex-wrap: wrap; gap: 5px 12px; font-family: var(--font-mono); font-size: 8px; color: var(--muted); margin-bottom: 8px; }
.lead-card__message { color: var(--dim); font-size: 12px; line-height: 1.55; white-space: pre-wrap; max-height: 120px; overflow: auto; }
.lead-card__side { display: flex; flex-direction: column; gap: 8px; }
.lead-card__contact { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); overflow-wrap: anywhere; }
.lead-card__contact .icon { width: 13px; height: 13px; color: var(--accent-2); }
.lead-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lead-card__actions .btn { min-height: 30px; padding: 6px 9px; font-size: 7.5px; }
.lead-card select { min-height: 32px; }
.lead-mini { display: flex; flex-direction: column; }
.lead-mini__item { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.lead-mini__item:first-child { border-top: 0; }
.lead-mini__item strong { font-size: 12px; font-weight: 500; }
.lead-mini__item span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bottom nav and dialogs */
.bottom-nav { display: none; }
.app-dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--ink-2);
  color: var(--text);
}
.app-dialog::backdrop { background: rgba(5, 4, 3, .72); backdrop-filter: blur(4px); }
.app-dialog__inner { padding: 24px; }
.app-dialog h2 { font-size: 22px; margin-bottom: 10px; }
.app-dialog p { color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.app-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 300;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  max-width: min(460px, calc(100vw - 32px));
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-3);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
  transition: opacity .25s, transform .25s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Dark form overrides (styles.css carries the marketing light forms) */
.app-body .field label { color: var(--muted); }
.app-body .field input,
.app-body .field select,
.app-body .field textarea {
  background-color: rgba(233, 226, 214, .035);
  border-color: var(--line);
  color: var(--text);
}
.app-body .field input:focus,
.app-body .field select:focus,
.app-body .field textarea:focus {
  background-color: rgba(233, 226, 214, .06);
  border-color: var(--accent);
}
.app-body .field input::placeholder,
.app-body .field textarea::placeholder { color: var(--muted); }
.app-body .field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.app-body .check { color: var(--muted); }
.app-body .form-error { color: #f0a08f; }
.app-body .btn--ghost { color: var(--text); }
.app-body .btn--ghost:hover { background: var(--text); color: var(--ink); }
body[data-mode="admin"] .project-head__meta .status { display: none; }

/* Responsive */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .safe-grid, .details-grid, .profile-grid { grid-template-columns: 1fr; }
  .service-options { grid-template-columns: 1fr 1fr; }
  .safe-how ol { grid-template-columns: 1fr 1fr; }
  .lead-card { grid-template-columns: 1fr; }
  .lead-card__side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .lead-card__side select { width: auto; }
}

@media (max-width: 900px) {
  .app-body { overflow: auto; }
  .auth { grid-template-columns: 1fr; min-height: 100dvh; }
  .auth__brand { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 20px; gap: 24px; }
  .auth__pitch { margin-block: 0; }
  .auth__pitch h1 { font-size: clamp(30px, 8vw, 44px); }
  .auth__lead, .auth__list { display: none; }
  .auth__foot { display: none; }
  .auth__main { padding: 26px 18px 40px; place-items: start center; }
  .auth__panel { width: min(440px, 100%); }
  .app { display: block; height: auto; min-height: 100dvh; }
  .side { display: none; }
  .app-main { min-height: calc(100dvh - 0px); padding-bottom: 72px; }
  .topbar { height: 60px; padding-inline: 14px; position: sticky; top: 0; z-index: 20; background: rgba(11, 10, 9, .9); }
  .topbar__user { display: none; }
  .topbar__logout { display: grid; }
  .content { overflow: visible; padding: 18px 14px 30px; }
  .bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(62px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(11, 10, 9, .96);
    backdrop-filter: blur(14px);
  }
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: none;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 7px;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .bottom-nav button .icon { width: 17px; height: 17px; }
  .bottom-nav button.is-active { color: var(--accent); }
  .view-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .view-head .btn { align-self: flex-start; }
  .security-strip { align-items: flex-start; flex-wrap: wrap; }
  .security-strip a { margin-left: 32px; }
  .project-head { flex-wrap: wrap; }
  .project-head__meta { width: 100%; padding-left: 44px; }
  .chat { height: calc(100dvh - 360px); min-height: 220px; }
  .msg { max-width: 94%; }
  .composer { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); background: var(--ink); padding-bottom: 8px; }
  .safe-intro { flex-wrap: wrap; }
  .safe-intro .text-link { margin-left: 56px; }
  .safe-how ol { grid-template-columns: 1fr; }
  .new-project__foot { flex-direction: column; align-items: flex-start; }
  .service-options { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .auth__brand { padding: 20px 16px; }
  .auth__pitch .mono { margin-bottom: 10px; }
  .auth__pitch h1 { font-size: 28px; }
  .auth__main { padding: 22px 14px 40px; }
  .stat-grid { gap: 7px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 28px; }
  .panel { padding: 16px; }
  .view-head h1 { font-size: 27px; }
  .service-options { grid-template-columns: 1fr; }
  .service-option > span { min-height: 84px; }
  .project-tabs button { flex: 1 1 auto; padding-inline: 8px; font-size: 8px; }
  .project-head__meta { padding-left: 0; flex-wrap: wrap; }
  .project-head__title h1 { font-size: 24px; }
  .chat { height: calc(100dvh - 330px); }
  .composer__hint { display: none; }
  .composer textarea { min-height: 54px; font-size: 16px; }
  .safe-grid { gap: 8px; }
  .safe-intro { padding: 14px; }
  .safe-intro h2 { font-size: 20px; }
  .safe-how { padding: 14px; }
  .details-list dd { max-width: 60%; }
  .lead-card { padding: 13px; }
  .lead-card__side { flex-direction: column; align-items: flex-start; }
  .filters { gap: 2px; }
  .filters button { padding: 6px 8px; font-size: 7.5px; }
  .profile-grid .panel .btn { width: 100%; }
  .toast { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .app-dialog__actions { flex-direction: column-reverse; }
  .app-dialog__actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .app-body * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

button.text-link { background: none; border: 0; padding: 0; cursor: pointer; }
.msg__video { width: min(320px, 100%); max-height: 220px; border: 1px solid var(--line); border-radius: 2px; background: #000; }

.topbar__brand { display: none; }
@media (max-width: 900px) {
  .topbar__brand { display: block; }
  .topbar__brand .brand__type { display: none; }
  .topbar__brand .brand__mark { width: 24px; height: 24px; }
}
