@font-face {
  font-family: 'Geist';
  src: url('/vendor/geist/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/vendor/geist-mono/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0b0b0d;
  --panel-2: #101013;
  --field: #131316;
  --field-2: #18181c;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.22);
  --text: #f5f5f7;
  --text-2: #c4c4cb;
  --mist: #a1a1a6;
  --muted: #85858e;
  --faint: #5c5c64;
  --accent: #ececf0;
  --accent-ink: #0a0a0b;
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, 0.1);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.1);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, 0.1);
  --info: #93b8ff;
  --info-bg: rgba(147, 184, 255, 0.1);
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --chrome: linear-gradient(#fff 0%, #ececf0 30%, #8e8e96 52%, #f3f3f6 66%, #b4b4bb 84%, #fff 100%);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' 1;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% -12%, rgba(255, 255, 255, 0.07), transparent 62%),
    radial-gradient(700px 400px at 10% 110%, rgba(255, 255, 255, 0.035), transparent 60%);
  z-index: 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: rgba(255, 255, 255, 0.22); }
:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.5); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1; }
.tnum { font-feature-settings: 'tnum' 1; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.spacer { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ */
/* Shell                                                               */
/* ------------------------------------------------------------------ */

.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 16px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 14, 17, 0.9), rgba(6, 6, 8, 0.9));
  backdrop-filter: blur(20px);
}
.sidebar .brand { display: flex; align-items: center; height: 40px; padding: 0 8px; margin-bottom: 14px; text-decoration: none; }
.sidebar .compose-btn { width: 100%; justify-content: center; margin-bottom: 14px; height: 46px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; font-weight: 500; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 450;
  transition: background 0.15s, color 0.15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav a:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.nav a.on { background: rgba(255, 255, 255, 0.085); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.nav a .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 650; display: inline-grid; place-items: center; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.conn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s;
}
.conn:hover { border-color: var(--line-2); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); flex: none; }
.conn.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.conn .meta { min-width: 0; }
.conn .meta b { display: block; font-weight: 550; font-size: 13px; }
.conn .meta span { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-switch { position: relative; }
.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
}
.profile-btn:hover { background: rgba(255, 255, 255, 0.04); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, #3a3a40, #121215);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  flex: none;
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.main { position: relative; min-width: 0; padding: 28px 36px 64px; }
.view { max-width: 1520px; margin: 0 auto; animation: viewIn 0.35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mobile-bar { display: none; }

/* ------------------------------------------------------------------ */
/* Page header                                                         */
/* ------------------------------------------------------------------ */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 6px 0 26px; flex-wrap: wrap; }
.title {
  margin: 0;
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: transparent;
  background-image: var(--chrome);
  background-size: 100% 1lh;
  -webkit-background-clip: text;
  background-clip: text;
  padding-bottom: 0.06em;
}
.subtitle { margin: 10px 0 0; color: var(--mist); font-size: 16px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s, opacity 0.15s;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 8px 24px -10px rgba(255, 255, 255, 0.35); }
.btn-primary:hover:not([disabled]) { background: #fff; }
.btn-secondary { background: rgba(255, 255, 255, 0.02); border-color: var(--line-2); color: var(--text); }
.btn-secondary:hover:not([disabled]) { background: rgba(255, 255, 255, 0.06); border-color: var(--line-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not([disabled]) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(248, 113, 113, 0.35); color: var(--bad); }
.btn-danger:hover:not([disabled]) { background: var(--bad-bg); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.12); margin-left: 4px; font-weight: 500; }
.btn-secondary .kbd, .btn-ghost .kbd { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Cards, forms                                                        */
/* ------------------------------------------------------------------ */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 18, 21, 0.92), rgba(10, 10, 12, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 30px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.card + .card { margin-top: 18px; }
.card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 4px; }
.card-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.section-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin: 28px 0 14px; display: flex; align-items: center; gap: 12px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-label:first-child { margin-top: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 18px; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label, .label {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.field > label .hint, .label .hint { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; font-size: 12.5px; }
.field > label .right { margin-left: auto; }
.input, .select, .textarea {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .select:focus, .textarea:focus, .chips:focus-within { border-color: rgba(255, 255, 255, 0.3); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06); background: var(--field-2); }
.input[readonly] { color: var(--text-2); }
.input.sm, .select.sm { height: 40px; font-size: 14px; padding: 0 12px; border-radius: 11px; }
.textarea { height: auto; min-height: 170px; padding: 14px 16px; line-height: 1.65; resize: vertical; }
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2385858e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
.select option { background: #141417; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .suffix { position: absolute; right: 8px; }
.input-wrap .prefix-icon { position: absolute; left: 14px; color: var(--faint); pointer-events: none; display: flex; }
.input-wrap .prefix-icon svg { width: 17px; height: 17px; }
.input-wrap.has-prefix .input { padding-left: 42px; }
.help { color: var(--faint); font-size: 13px; margin-top: -2px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); font-size: 14px; user-select: none; }
.check input { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-3); background: var(--field); display: grid; place-items: center; cursor: pointer; margin: 0; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border-left: 2px solid #000; border-bottom: 2px solid #000; transform: rotate(-45deg) translate(1px, -1px); }
.switch { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(16px); }

/* Segmented control */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); position: relative; flex-wrap: wrap; }
.seg button {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--mist);
  font-weight: 550;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s var(--ease), color 0.2s;
  white-space: nowrap;
}
.seg button svg { width: 16px; height: 16px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px rgba(255, 255, 255, 0.45); }
.seg.sm button { height: 30px; padding: 0 12px; font-size: 13px; }
.seg.lg button { height: 46px; padding: 0 22px; font-size: 15px; }

/* Chips input */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 50px;
  padding: 7px 8px 7px 10px;
  border-radius: var(--r-md);
  background: var(--field);
  border: 1px solid var(--line);
  cursor: text;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chips:hover { border-color: var(--line-2); }
.chips input { flex: 1; min-width: 160px; height: 34px; border: 0; background: transparent; outline: none; font-size: 15.5px; padding: 0 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font-size: 13.5px;
  max-width: 100%;
}
.chip .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .chip-sub { color: var(--muted); font-size: 12.5px; }
.chip.bad { background: var(--bad-bg); border-color: rgba(248, 113, 113, 0.4); color: #ffd1d1; }
.chip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.chip button:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.chip button svg { width: 13px; height: 13px; }
.chip.static { padding-right: 12px; }
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #141417;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8);
  padding: 6px;
  max-height: 280px;
  overflow: auto;
}
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; cursor: pointer; }
.suggest-item.on, .suggest-item:hover { background: rgba(255, 255, 255, 0.07); }
.suggest-item .avatar { width: 30px; height: 30px; font-size: 11px; }
.suggest-item b { font-weight: 550; font-size: 14px; display: block; }
.suggest-item span { color: var(--muted); font-size: 13px; }
.suggest-item .tag { margin-left: auto; font-size: 11px; color: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 550; background: rgba(255, 255, 255, 0.07); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill.success { background: var(--ok-bg); color: var(--ok); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.danger { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.strong { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.pill.muted { color: var(--faint); }
.pill.plain::before { display: none; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font-size: 14px; color: var(--text-2); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.warn { border-color: rgba(251, 191, 36, 0.25); background: var(--warn-bg); color: #fde7b0; }
.notice.warn svg { color: var(--warn); }
.notice.bad { border-color: rgba(248, 113, 113, 0.3); background: var(--bad-bg); color: #ffd4d4; }
.notice.ok { border-color: rgba(74, 222, 128, 0.25); background: var(--ok-bg); color: #c9f7d9; }
.notice.info { border-color: rgba(147, 184, 255, 0.22); background: var(--info-bg); color: #d6e4ff; }
.notice b { color: var(--text); font-weight: 600; }
.notice a { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Compose                                                             */
/* ------------------------------------------------------------------ */

.compose { display: grid; grid-template-columns: minmax(0, 1fr) 452px; gap: 28px; align-items: start; }
.compose-form .card { padding: 30px 32px; }
.compose-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.compose-top .seg button .avatar { width: 22px; height: 22px; font-size: 9.5px; box-shadow: none; }
.compose-top .seg button.on .avatar { background: #0a0a0b; color: #fff; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.toolbar button { height: 30px; min-width: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 550; }
.toolbar button:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.toolbar button svg { width: 15px; height: 15px; }
.toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.toolbar .tag-btn { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.body-field .textarea { min-height: 220px; }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0; display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.link-btn:hover { color: var(--text); }
.link-btn svg { width: 14px; height: 14px; }
.link-btn.on { color: var(--text); }
.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 14px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--line-3); background: rgba(255, 255, 255, 0.025); color: var(--text-2); }
.dropzone .dz-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.05); color: var(--text-2); flex: none; }
.dropzone .dz-icon svg { width: 20px; height: 20px; }
.dropzone b { color: var(--text); font-weight: 550; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.att { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-size: 13.5px; max-width: 100%; }
.att svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.att .att-size { color: var(--muted); font-size: 12.5px; }
.att button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.att button:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.att button svg { width: 13px; height: 13px; }
.att.pdf svg { color: #ff8a80; }
.quote-box { margin-top: 18px; border-radius: 16px; border: 1px solid var(--line); padding: 14px 16px; background: rgba(255, 255, 255, 0.02); }
.quote-box .q-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.quote-box .q-body { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--line-2); color: var(--muted); font-size: 13.5px; max-height: 140px; overflow: auto; white-space: pre-wrap; }
.compose-actions {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 999px;
  background: rgba(16, 16, 19, 0.82);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
}
.compose-actions .status-text { color: var(--muted); font-size: 13px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--warn); margin-top: 10px; }
.warn-tags code { font-family: var(--mono); background: var(--warn-bg); padding: 2px 7px; border-radius: 6px; font-size: 12px; }

/* Preview */
.preview-col { position: sticky; top: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.preview-bar { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between; }
.phone-wrap { width: 100%; display: flex; justify-content: center; }
.phone {
  width: 400px;
  height: min(820px, calc(100vh - 120px));
  min-height: 600px;
  border-radius: 64px;
  padding: 11px;
  background: linear-gradient(150deg, #5d5d64 0%, #1b1b1e 18%, #3d3d43 45%, #8b8b93 58%, #1d1d20 78%, #57575e 100%);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 0 0 1px #000;
  position: relative;
}
.phone::before { content: ''; position: absolute; inset: 4px; border-radius: 60px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.85); pointer-events: none; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 54px; overflow: hidden; background: #000; display: flex; flex-direction: column; isolation: isolate; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 18px 34px 0; height: 50px; font-size: 15px; font-weight: 600; color: #fff; flex: none; }
.phone-status .island { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 118px; height: 34px; border-radius: 20px; background: #000; box-shadow: 0 0 0 1px #0d0d0f; }
.phone-status .icons { display: flex; gap: 6px; align-items: center; }
.phone-status .icons svg { width: 17px; height: 17px; }
.mail-head { padding: 16px 24px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); flex: none; background: #000; }
.mail-head .from { font-weight: 650; font-size: 15px; color: #fff; display: flex; justify-content: space-between; gap: 8px; }
.mail-head .from small { color: #8a8a92; font-weight: 450; font-size: 13px; }
.mail-head .subj { font-size: 14px; color: #e8e8ec; margin-top: 2px; }
.mail-head .pre { font-size: 13.5px; color: #8a8a92; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.phone iframe { flex: 1; width: 100%; border: 0; background: #000; display: block; }
.phone.light-mail iframe { background: #f2f2f4; }
.home-indicator { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.85); z-index: 3; mix-blend-mode: difference; }

.desk {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: #0c0c0e;
  overflow: hidden;
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9);
}
.desk-bar { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #121215; }
.desk-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a40; display: block; }
.desk-bar i:nth-child(1) { background: #ff5f57; }
.desk-bar i:nth-child(2) { background: #febc2e; }
.desk-bar i:nth-child(3) { background: #28c840; }
.desk-meta { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.desk-meta b { color: var(--text); font-weight: 600; }
.desk-meta .subj { grid-column: 1 / -1; color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.desk-body { overflow: auto; max-height: calc(100vh - 260px); }
.desk-body .zoomer { width: 720px; transform-origin: 0 0; }
.desk-body iframe { width: 720px; border: 0; display: block; }

.fullscreen-preview { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(10px); display: grid; grid-template-rows: auto 1fr; animation: fade 0.2s; }
.fullscreen-preview .fs-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; }
.fullscreen-preview iframe { width: 100%; height: 100%; border: 0; background: #000; }
@keyframes fade { from { opacity: 0; } }

/* ------------------------------------------------------------------ */
/* Popover / menu / modal / toast                                      */
/* ------------------------------------------------------------------ */

.pop {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: 360px;
  background: #141417;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
  padding: 6px;
  animation: popIn 0.16s var(--ease);
  max-height: 70vh;
  overflow: auto;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.pop .menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; text-align: left; color: var(--text-2); font-size: 14px; }
.pop .menu-item:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.pop .menu-item svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.pop .menu-item.danger { color: var(--bad); }
.pop .menu-item.danger svg { color: var(--bad); }
.pop .menu-item .mi-sub { display: block; color: var(--faint); font-size: 12.5px; margin-top: 1px; }
.pop .menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop .menu-title { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); padding: 8px 12px 4px; font-weight: 600; }
.tpl-item { display: flex; align-items: center; gap: 12px; }
.tpl-item .grow b { font-weight: 550; color: var(--text); display: block; font-size: 14px; }
.tpl-item .tpl-del { opacity: 0; }
.menu-item:hover .tpl-del { opacity: 1; }

.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px; animation: fade 0.18s; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: linear-gradient(180deg, #141417, #0c0c0e);
  border: 1px solid var(--line-2);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.95);
  animation: modalIn 0.24s var(--ease);
}
.modal.wide { width: min(760px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -0.025em; }
.modal .modal-sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

#toasts { position: fixed; z-index: 120; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: rgba(24, 24, 28, 0.94);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(16px);
  font-size: 14.5px;
  animation: toastIn 0.28s var(--ease);
  max-width: min(640px, calc(100vw - 32px));
}
.toast.out { animation: toastOut 0.2s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
.toast .t-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, 0.1); }
.toast .t-icon svg { width: 14px; height: 14px; }
.toast.ok .t-icon { background: var(--ok); color: #03140a; }
.toast.bad .t-icon { background: var(--bad); color: #1f0505; }
.toast.warn .t-icon { background: var(--warn); color: #1a1202; }
.toast .t-msg { padding-right: 8px; }
.toast .btn { height: 34px; }
.toast:not(:has(.btn)) { padding-right: 20px; }

/* ------------------------------------------------------------------ */
/* Mailbox                                                             */
/* ------------------------------------------------------------------ */

.mailbox { display: grid; grid-template-columns: 210px 400px minmax(0, 1fr); gap: 0; height: calc(100vh - 150px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: rgba(10, 10, 12, 0.85); }
.folders { border-right: 1px solid var(--line); padding: 14px 10px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.folders a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 11px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.folders a svg { width: 17px; height: 17px; opacity: 0.8; flex: none; }
.folders a:hover { background: rgba(255, 255, 255, 0.045); }
.folders a.on { background: rgba(255, 255, 255, 0.085); color: var(--text); }
.folders a .n { margin-left: auto; font-size: 12px; color: var(--muted); font-feature-settings: 'tnum' 1; }
.folders a .n.unseen { color: var(--text); font-weight: 650; }
.msg-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.msg-list-head { padding: 14px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.msg-list-head .input-wrap { flex: 1; }
.msg-list-head .input { height: 42px; font-size: 14px; border-radius: 12px; }
.msg-scroll { overflow: auto; flex: 1; }
.msg {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 2px 10px;
  padding: 14px 16px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.msg:hover { background: rgba(255, 255, 255, 0.03); }
.msg.on { background: rgba(255, 255, 255, 0.07); }
.msg .udot { width: 7px; height: 7px; border-radius: 50%; background: transparent; margin-top: 8px; grid-row: 1 / span 3; }
.msg.unseen .udot { background: var(--accent); box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.msg .m-from { font-weight: 500; font-size: 14.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.unseen .m-from { color: var(--text); font-weight: 650; }
.msg .m-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.msg .m-date svg { width: 13px; height: 13px; }
.msg .m-subj { grid-column: 2 / span 2; font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.unseen .m-subj { color: var(--text); font-weight: 500; }
.msg .m-snip { grid-column: 2 / span 2; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.load-more { padding: 14px; display: flex; justify-content: center; }
.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.reader-head { padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.reader-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.reader-subj { font-size: 23px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 14px; line-height: 1.25; }
.reader-from { display: flex; gap: 12px; align-items: center; }
.reader-from .who b { font-weight: 600; }
.reader-from .who span { color: var(--muted); font-size: 13.5px; }
.reader-from .when { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.reader-to { color: var(--muted); font-size: 13px; margin-top: 4px; }
.reader-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 26px; border-bottom: 1px solid var(--line); }
.reader-atts a { text-decoration: none; }
.reader-body { flex: 1; min-height: 0; background: #fff; position: relative; }
.reader-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.img-banner { display: flex; align-items: center; gap: 10px; padding: 10px 26px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; color: var(--muted); gap: 10px; height: 100%; }
.empty-state .es-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--text-2); margin-bottom: 8px; }
.empty-state .es-icon svg { width: 26px; height: 26px; }
.empty-state h3 { margin: 0; color: var(--text); font-weight: 600; font-size: 18px; letter-spacing: -0.015em; }
.empty-state p { margin: 0; max-width: 380px; font-size: 14.5px; }
.empty-state .btn { margin-top: 12px; }
.skeleton { background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.connect-hero { max-width: 720px; margin: 40px auto; text-align: center; }
.connect-hero .es-icon { margin: 0 auto 20px; }

/* ------------------------------------------------------------------ */
/* Invoices                                                            */
/* ------------------------------------------------------------------ */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 20px 22px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(18, 18, 21, 0.9), rgba(10, 10, 12, 0.9)); }
.stat .s-label { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.stat .s-value { font-size: 27px; font-weight: 600; letter-spacing: -0.035em; margin-top: 8px; font-feature-settings: 'tnum' 1; }
.stat .s-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.bad .s-value { color: var(--bad); }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.table-card { padding: 6px; border-radius: var(--r-xl); border: 1px solid var(--line); background: rgba(10, 10, 12, 0.85); overflow: auto; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.list th { text-align: left; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 14px 16px 12px; white-space: nowrap; }
table.list td { padding: 14px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
table.list tbody tr { cursor: pointer; transition: background 0.12s; }
table.list tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
table.list tbody tr td:first-child { border-top-left-radius: 0; }
table.list .num { text-align: right; font-feature-settings: 'tnum' 1; }
table.list .doc-no { font-weight: 600; font-family: var(--mono); font-size: 13px; letter-spacing: -0.01em; }
table.list .doc-type { color: var(--muted); font-size: 12.5px; }
table.list .client { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
table.list .actions { text-align: right; width: 1%; }
table.list .actions .btn { opacity: 0.7; }
table.list tr:hover .actions .btn { opacity: 1; }

.inv-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 46%); gap: 26px; align-items: start; }
.inv-preview { position: sticky; top: 20px; }
.paper-wrap { border-radius: 22px; border: 1px solid var(--line); background: #1a1a1d; padding: 18px; overflow: hidden; }
.paper-zoom { transform-origin: 0 0; }
.paper-zoom iframe { width: 794px; border: 0; display: block; background: #fff; border-radius: 4px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); }
.items-head, .item-row { display: grid; grid-template-columns: 22px minmax(0, .8fr) minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, 1fr) 34px; gap: 8px; align-items: start; }
.item-row .desc { grid-column: 2 / -1; }
.item-row .qty { grid-column: 2; }
.item-row .idx { grid-row: 1; grid-column: 1; }
.items-head { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 0 8px; }
.items-head .r { text-align: right; }
.item-row { padding: 10px 0; border-top: 1px solid var(--line); }
.item-row .idx { color: var(--faint); font-size: 13px; padding-top: 11px; text-align: center; font-feature-settings: 'tnum' 1; }
.item-row .textarea { min-height: 40px; height: 40px; padding: 9px 12px; font-size: 14px; border-radius: 11px; resize: none; overflow: hidden; line-height: 1.5; }
.item-row .input.num { text-align: right; font-feature-settings: 'tnum' 1; }
.item-row .line-total { grid-column: 2 / -1; display: flex; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 12.5px; font-feature-settings: 'tnum' 1; padding-right: 42px; margin-top: -2px; }
.item-row .line-total b { color: var(--text-2); font-weight: 600; }
.item-row .rm { margin-top: 3px; }
.item-row { padding: 14px 0 10px; }
.items-head { padding-left: 0; }
.totals-box { margin-top: 14px; display: flex; justify-content: flex-end; }
.totals-box .tb { min-width: 300px; border-radius: 18px; padding: 16px 18px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font-feature-settings: 'tnum' 1; }
.totals-box .tb-row { display: flex; justify-content: space-between; gap: 20px; color: var(--text-2); font-size: 14px; padding: 3px 0; }
.totals-box .tb-grand { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.totals-box .tb-grand span { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.totals-box .tb-grand b { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.quick-days { display: flex; gap: 6px; margin-top: 2px; }
.quick-days button { height: 26px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.quick-days button:hover { color: var(--text); border-color: var(--line-2); }
.locked-banner { margin-bottom: 18px; }
.inv-head-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.client-pick { position: relative; }

/* ------------------------------------------------------------------ */
/* Clients                                                             */
/* ------------------------------------------------------------------ */

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.client-card { padding: 22px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(18, 18, 21, 0.9), rgba(10, 10, 12, 0.9)); display: flex; flex-direction: column; gap: 14px; transition: border-color 0.15s, transform 0.15s; }
.client-card:hover { border-color: var(--line-2); }
.client-card .cc-head { display: flex; gap: 12px; align-items: center; }
.client-card .cc-head b { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; display: block; }
.client-card .cc-head span { color: var(--muted); font-size: 13.5px; }
.client-card .cc-lines { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.client-card .cc-lines div { display: flex; gap: 10px; align-items: center; min-width: 0; }
.client-card .cc-lines svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.client-card .cc-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }

/* ------------------------------------------------------------------ */
/* Settings                                                            */
/* ------------------------------------------------------------------ */

.settings { display: grid; grid-template-columns: 220px minmax(0, 860px); gap: 30px; align-items: start; }
.settings-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--text-2); font-size: 14.5px; }
.settings-nav a svg { width: 17px; height: 17px; }
.settings-nav a:hover { background: rgba(255, 255, 255, 0.045); }
.settings-nav a.on { background: rgba(255, 255, 255, 0.085); color: var(--text); }
.conn-status { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 22px; }
.conn-tile { border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, 0.02); }
.conn-tile .ct-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.05); flex: none; }
.conn-tile .ct-icon svg { width: 18px; height: 18px; }
.conn-tile.ok .ct-icon { background: var(--ok-bg); color: var(--ok); }
.conn-tile.bad .ct-icon { background: var(--bad-bg); color: var(--bad); }
.conn-tile b { display: block; font-weight: 600; font-size: 14.5px; }
.conn-tile span { color: var(--muted); font-size: 13px; }
.profile-card { border: 1px solid var(--line); border-radius: 22px; padding: 20px; background: rgba(255, 255, 255, 0.015); }
.profile-card + .profile-card { margin-top: 14px; }
.profile-card .pc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.logo-slot { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); }
.logo-slot .ls-prev { width: 220px; height: 70px; border-radius: 12px; display: grid; place-items: center; flex: none; overflow: hidden; }
.logo-slot .ls-prev.dark { background: #0b0b0c; border: 1px solid #1e1e22; }
.logo-slot .ls-prev.light { background: #fff; }
.logo-slot .ls-prev img { max-width: 190px; max-height: 44px; }
.counter-row { display: grid; grid-template-columns: 1fr 120px 150px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.counter-row:first-of-type { border-top: 0; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1380px) {
  .compose { grid-template-columns: minmax(0, 1fr) 420px; }
  .phone { width: 380px; }
  .mailbox { grid-template-columns: 190px 340px minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .compose { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .inv-editor { grid-template-columns: 1fr; }
  .inv-preview { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mailbox { grid-template-columns: 300px minmax(0, 1fr); }
  .folders { display: none; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform 0.25s var(--ease); }
  .app.nav-open .sidebar { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, 0.8); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(14px); }
  .main { padding: 18px 16px 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card { padding: 22px 18px; }
  .compose-form .card { padding: 22px 18px; }
  .mailbox { grid-template-columns: 1fr; height: auto; }
  .mailbox.reading .msg-list { display: none; }
  .mailbox:not(.reading) .reader { display: none; }
  .reader-body { height: 70vh; }
  .phone { width: 100%; max-width: 380px; }
  .items-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row .idx { display: none; }
  .item-row .desc { grid-column: 1 / -1; }
  .item-row .qty { grid-column: 1; }
  .item-row .line-total { grid-column: 1 / -1; padding-right: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .conn-status { grid-template-columns: 1fr; }
  .counter-row { grid-template-columns: 1fr 1fr; }
  .compose-actions { border-radius: 22px; flex-wrap: wrap; }
}

.main-col { min-width: 0; }
details > summary::-webkit-details-marker { display: none; }
code { font-family: var(--mono); font-size: .9em; background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; }
.profile-btn > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.btn > .avatar { width: 22px; height: 22px; }

/* Mobil finomhangolás */
@media (max-width: 1180px) {
  .compose, .inv-editor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 16px; border-radius: 18px; }
  .stat .s-value { font-size: 20px; }
  .stat .s-label { font-size: 10.5px; }
  .compose-actions { flex-wrap: nowrap; border-radius: 999px; padding: 8px; gap: 6px; bottom: 10px; }
  .compose-actions .btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
  .compose-actions .btn-ghost, .compose-actions .status-text, .compose-actions .kbd { display: none; }
  .compose-top { gap: 10px; }
  .filters .input { width: 100% !important; }
  .seg { max-width: 100%; }
  .page-head { margin-bottom: 18px; }
  .desk-body .zoomer { transform-origin: 0 0; }
}
@media (max-width: 860px) {
  .compose-top .seg { flex-wrap: nowrap; }
  .compose-top .seg button { padding: 0 10px; font-size: 13px; }
}

/* ------------------------------------------------------------------ */
/* Belépés                                                             */
/* ------------------------------------------------------------------ */
body.is-login { overflow: hidden; }
.login { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; overflow: auto; }
.login-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(700px 420px at 50% 26%, rgba(255, 255, 255, 0.09), transparent 65%); }
.login-mark { position: relative; width: min(280px, 62vw); height: auto; filter: drop-shadow(0 30px 60px rgba(255, 255, 255, 0.08)); animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.login-title { margin-top: 18px; font-size: clamp(36px, 6vw, 56px); }
.login .subtitle { margin: 10px 0 28px; }
.login-card { position: relative; width: min(420px, 100%); text-align: left; background: linear-gradient(180deg, rgba(20, 20, 23, 0.92), rgba(10, 10, 12, 0.92)); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 26px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9); backdrop-filter: blur(16px); }
.login-card .btn-lg { width: 100%; }
.code-input { font-family: var(--mono); font-size: 26px; letter-spacing: 0.3em; text-align: center; height: 62px; }
.login-foot { position: relative; color: var(--faint); font-size: 13px; margin-top: 22px; }

/* ------------------------------------------------------------------ */
/* Leadek                                                              */
/* ------------------------------------------------------------------ */
.lead-stats .stat.good .s-value { color: var(--ok); }
.leads-table td { vertical-align: middle; }
.leads-table .chk { width: 34px; padding-right: 0; }
.leads-table tr.sel td { background: rgba(255, 255, 255, 0.045); }
.leads-table .site-link { color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.leads-table .site-link:hover { color: var(--text); text-decoration: underline; }
.signals { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.sig { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--warn-bg); color: #f6d98a; white-space: nowrap; }
.mx-ok { color: var(--ok); display: inline-flex; }
.mx-ok svg { width: 15px; height: 15px; }
select.lead-status { appearance: none; border: 0; border-radius: 99px; height: 28px; padding: 0 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: rgba(255, 255, 255, 0.08); color: var(--text-2); }
select.lead-status.tone-strong { background: rgba(255, 255, 255, 0.12); color: var(--text); }
select.lead-status.tone-info { background: var(--info-bg); color: var(--info); }
select.lead-status.tone-warn { background: var(--warn-bg); color: var(--warn); }
select.lead-status.tone-success { background: var(--ok-bg); color: var(--ok); }
select.lead-status.tone-danger { background: var(--bad-bg); color: var(--bad); }
select.lead-status.tone-muted { color: var(--faint); }
select.lead-status option { background: #141417; color: var(--text); }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); position: sticky; top: 10px; z-index: 4; backdrop-filter: blur(14px); }
.lead-legal { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 14px; }
.lead-legal svg { width: 16px; height: 16px; flex: none; }
.lead-meta { display: grid; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.notice.campaign { border-color: rgba(147, 184, 255, 0.28); background: var(--info-bg); color: #d6e4ff; align-items: center; }

/* ------------------------------------------------------------------ */
/* Csomag összeállító                                                  */
/* ------------------------------------------------------------------ */
.pkg-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pkg-type { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.02); color: var(--text); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.pkg-type:hover { border-color: var(--line-3); }
.pkg-type.on { border-color: var(--accent); background: rgba(255, 255, 255, 0.07); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.pkg-type b { font-size: 14.5px; font-weight: 600; }
.pkg-type span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.pkg-type em { font-style: normal; font-size: 12.5px; color: var(--text-2); margin-top: auto; padding-top: 6px; font-feature-settings: 'tnum' 1; }
.pkg-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pkg-extra { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; }
.pkg-extra.on { border-color: var(--line-3); background: rgba(255, 255, 255, 0.05); }
.pkg-extra input { accent-color: #ececf0; width: 16px; height: 16px; }
.pkg-extra b { display: block; font-size: 13.5px; font-weight: 550; }
.pkg-extra span span, .pkg-extra .grow span { display: block; font-size: 12px; color: var(--muted); }
.pkg-extra em { font-style: normal; font-size: 12.5px; color: var(--text-2); white-space: nowrap; font-feature-settings: 'tnum' 1; }
.pkg-summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.pkg-range { font-size: 18px; font-weight: 600; margin-top: 4px; font-feature-settings: 'tnum' 1; }
.pkg-total { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-feature-settings: 'tnum' 1; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); }
@media (max-width: 860px) {
  .pkg-types, .pkg-extras { grid-template-columns: 1fr 1fr; }
  .user-row { flex-wrap: wrap; }
}
.leads-table .site-link { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.leads-table .client { max-width: 250px; }
.leads-table th, .leads-table td { padding-left: 12px; padding-right: 12px; }
.leads-table .actions { white-space: nowrap; }
