*{box-sizing:border-box}
:root{color-scheme:dark;--bg:#17191e;--line:#2d323d;--text:#e1e5ee;--muted:#9aa3b2;--dim:#707a89;--accent:#aaa2ff;--green:#62c58a;font-family:Inter,system-ui,sans-serif}
body{margin:0;min-height:100vh;padding:26px;background:radial-gradient(ellipse at 50% 40%,#20232b 0%,var(--bg) 62%);color:var(--text);display:grid;place-items:center}
button{font:inherit}

/* ===== DESKTOP (Главная страница) ===== */
.app-frame{width:min(1080px,100%);min-height:650px;height:min(730px,calc(100vh - 52px));display:grid;grid-template-columns:210px 1fr;overflow:hidden;border:1px solid #303641;border-radius:18px;background:#191c22;box-shadow:0 24px 80px #0005}
.sidebar{padding:26px 15px 15px;background:#1c1f25;border-right:1px solid var(--line);display:flex;flex-direction:column}
.wordmark,.mobile-brand{font:600 17px 'IBM Plex Mono',monospace;letter-spacing:.12em;color:#e5e8f1;padding:2px 8px 23px}
.side-rule{height:1px;background:var(--line);margin:0 8px 26px}
.navigation{display:grid;gap:6px}
.nav-item{border:0;background:transparent;color:var(--muted);border-radius:11px;padding:11px 12px;display:flex;align-items:center;gap:12px;text-align:left;font-size:13px;cursor:pointer;transition:.18s}
.nav-item:hover{background:#ffffff08;color:var(--text)}
.nav-item.active{background:#343344;color:#c6c1ff;box-shadow:inset 0 0 0 1px #514d70}
.nav-icon{width:20px;text-align:center;font-size:18px}
.sidebar-bottom{margin-top:auto}
.system-card{padding:14px 12px;border:1px solid var(--line);border-radius:11px;background:#ffffff04;cursor:default;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.online-line{display:flex;align-items:center;gap:9px;color:#75c991;font-size:11px;font-weight:600}
.online-dot{width:8px;height:8px;display:inline-block;flex:none;border-radius:50%;background:var(--green);box-shadow:0 0 10px #62c58a55}

.main-area{min-width:0;display:flex;flex-direction:column}
.topbar{height:60px;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 26px}
.top-spacer{flex:1}
.mobile-brand{display:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.network-pill{display:flex;align-items:center;gap:9px;padding:8px 13px;border:1px solid var(--line);border-radius:30px;color:var(--muted);font:11px 'IBM Plex Mono',monospace}

.content{flex:1;min-height:0;overflow:auto;padding:30px 40px;display:flex;justify-content:center}
.page{display:none;width:min(100%,700px);margin:auto}
.page.active{display:block;animation:appear .2s ease}
.page-home{max-width:630px}

.hero{text-align:center;margin:0 auto 32px}
.eyebrow{margin:0 0 15px;color:#888ba9;font:10px 'IBM Plex Mono',monospace;letter-spacing:.16em}
.hero h1,.section-heading h1{margin:0;color:#e2e6ef;font:500 clamp(36px,5vw,50px) 'IBM Plex Mono',monospace;letter-spacing:.13em}
.subtitle{margin:12px 0 0;color:var(--muted);font:13px 'IBM Plex Mono',monospace}

.invite-card{display:flex;align-items:center;gap:17px;padding:19px;border:1px solid var(--line);border-radius:15px;background:linear-gradient(135deg,#22252d,#1e2128);box-shadow:inset 0 1px #ffffff08}
.lock-tile{width:62px;height:62px;flex:none;display:grid;place-items:center;border:1px solid #343747;border-radius:13px;background:#292a3a;color:var(--accent)}
.lock-tile svg{width:30px;height:30px}
.invite-copy h2,.feature-card h2,.text-panel h2{font-size:14px;font-weight:600;margin:0 0 8px}
.invite-copy p,.feature-card p,.text-panel p{margin:0;color:var(--muted);font-size:12px;line-height:1.8}
.invite-copy{flex:1}

.login-btn {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #2a2d37; color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 16px; font: 500 12px 'IBM Plex Mono', monospace;
  letter-spacing: .05em; cursor: pointer; transition: .18s;
}
.login-btn span { font-size: 14px; transition: transform .18s; }
.login-btn:hover { background: #343846; border-color: #4a505e; }
.login-btn:hover span { transform: translateX(2px); }
.login-btn:active { transform: scale(.97); }

.bottom-caption{display:flex;align-items:center;justify-content:center;gap:15px;margin:34px 0 0;color:var(--dim);font:11px 'IBM Plex Mono',monospace}
.bottom-caption span{width:34px;height:1px;background:#3b404b}

.section-heading{margin:0 0 27px}
.section-heading h1{font-size:32px;letter-spacing:.04em}
.section-subtitle{color:var(--muted);font-size:13px;line-height:1.7;max-width:520px}
.feature-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.feature-card,.text-panel{position:relative;padding:18px;border:1px solid var(--line);border-radius:13px;background:#20232a}
.feature-symbol{display:block;margin-bottom:17px;color:#8e88d6;font:11px 'IBM Plex Mono',monospace}
.feature-card h2{margin-bottom:7px}
.feature-card p{min-height:42px}
.feature-state{display:inline-block;margin-top:13px;color:#8580bf;font:9px 'IBM Plex Mono',monospace;letter-spacing:.08em}
.text-panel{padding:22px}
.text-panel h2{margin-bottom:12px}
.info-row{display:flex;justify-content:space-between;gap:15px;padding:13px 0;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}
.info-row:first-of-type{margin-top:16px}
.info-row strong{color:#d6dae5;text-align:right;font-weight:500}
.contact-panel{text-align:center;padding:32px}
.contact-mark{color:var(--accent);font:22px 'IBM Plex Mono',monospace;margin-bottom:15px}
.small-note{display:inline-block;margin-top:20px;color:#8883c4;font:10px 'IBM Plex Mono',monospace;letter-spacing:.1em}

.main-footer{height:45px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 26px;color:var(--dim);font:9px 'IBM Plex Mono',monospace;letter-spacing:.06em}
.footer-center{color:#858b99}

@keyframes appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}

/* ===== OWNER MODAL ===== */
.owner-modal{
  position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:20px;
  background:rgba(10,11,14,.72);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  animation:fadeIn .18s ease;
}
.owner-modal[hidden]{display:none}

.owner-dialog{
  width:min(380px,100%);padding:26px 24px 22px;border:1px solid #3a3f4d;border-radius:14px;
  background:linear-gradient(160deg,#20232b,#1a1d23);box-shadow:0 30px 80px #0009, inset 0 1px #ffffff0a;
  position:relative;
}

.owner-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.owner-badge{
  font:10px 'IBM Plex Mono',monospace;letter-spacing:.14em;color:#aaa2ff;
  padding:4px 8px;border:1px solid #4a4568;border-radius:6px;background:#2a283a;
}
.owner-close{
  border:0;background:transparent;color:var(--dim);font-size:22px;line-height:1;cursor:pointer;
  width:28px;height:28px;border-radius:8px;transition:.15s;
}
.owner-close:hover{background:#ffffff08;color:var(--text)}

.owner-dialog h2{margin:0 0 6px;font-size:17px;font-weight:600;letter-spacing:.02em}
.owner-dialog p{margin:0 0 16px;color:var(--muted);font-size:12px;line-height:1.6}

#ownerForm{display:grid;gap:10px}
#ownerKey{
  width:100%;padding:11px 13px;border:1px solid var(--line);border-radius:9px;
  background:#14161b;color:var(--text);font:13px 'IBM Plex Mono',monospace;
  letter-spacing:.08em;outline:none;transition:.18s;
}
#ownerKey:focus{border-color:#6a63a8;box-shadow:0 0 0 3px #6a63a822}

.owner-submit{
  width:100%;padding:11px 14px;border:1px solid #8279db;border-radius:9px;
  background:#514c83;color:#e2dfff;font:500 12px 'IBM Plex Mono',monospace;
  letter-spacing:.06em;cursor:pointer;transition:.18s;
}
.owner-submit:hover{background:#5b5592;box-shadow:0 5px 20px #6c63c522}

.owner-error{margin:12px 0 0!important;color:#e88989;font-size:11px;text-align:center}
.owner-error[hidden]{display:none}

@keyframes fadeIn{from{opacity:0}to{opacity:1}}

/* маркер владельца рядом с логотипом */
body.is-owner .wordmark::after,
body.is-owner .mobile-brand::after{
  content:" ●"; color:#62c58a; font-size:.7em; vertical-align:middle; margin-left:2px;
}

/* ===== DASHBOARD REDESIGN V2 (ФИНАЛЬНЫЙ) ===== */
.owner-dashboard {
  position: fixed; inset: 0; z-index: 200;
  background: #14161b;
  display: grid; grid-template-columns: 260px 1fr;
  animation: fadeIn .3s ease; font-family: var(--font);
}
.owner-dashboard[hidden] { display: none; }

/* Сайдбар */
.dashboard-sidebar {
  background: #17191e; border-right: 1px solid rgba(255,255,255,0.04);
  padding: 30px 20px; display: flex; flex-direction: column;
}

.dashboard-sidebar .wordmark {
  font-size: 18px; font-weight: 600; letter-spacing: 0.1em;
  padding-bottom: 30px; margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04); padding-left: 10px;
  color: #fff;
}

.dashboard-nav { display: grid; gap: 6px; }
.dash-nav-item {
  border: 0; background: transparent; color: #8e95a5; border-radius: 10px;
  padding: 12px 16px; display: flex; align-items: center; gap: 14px;
  text-align: left; font-size: 14px; cursor: pointer; transition: all .2s; font-family: inherit;
}
.dash-nav-item:hover { background: rgba(255,255,255,0.03); color: #e1e5ee; }
.dash-nav-item.active { background: rgba(170,162,255,0.1); color: #c6c1ff; font-weight: 500; }
.dash-icon { font-size: 18px; width: 22px; text-align: center; opacity: 0.7; }
.dash-nav-item.active .dash-icon { opacity: 1; }

.dash-bottom { margin-top: auto; padding-top: 20px; }
.logout-btn {
  width: 100%; padding: 12px; background: transparent; border: 1px solid rgba(255,255,255,0.08);
  color: #e88989; border-radius: 10px; cursor: pointer; font-size: 13px; transition: all .2s; font-family: inherit;
}
.logout-btn:hover { background: rgba(232, 137, 137, 0.08); border-color: rgba(232, 137, 137, 0.2); }

/* Основная часть */
.dashboard-main { display: flex; flex-direction: column; overflow: hidden; background: #14161b; }
.dash-header {
  height: 72px; border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: space-between; padding: 0 40px;
  background: #17191e;
}
.dash-title { font-size: 18px; font-weight: 600; color: #fff; }
.dash-status { font-size: 12px; color: #62c58a; display: flex; align-items: center; gap: 8px; font-weight: 500; letter-spacing: 0.02em; }
.status-dot { width: 6px; height: 6px; background: #62c58a; border-radius: 50%; box-shadow: 0 0 10px rgba(98,197,138,0.4); }

.dash-content { padding: 40px; overflow-y: auto; flex: 1; }

/* Карточки */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }
.dash-card {
  background: #1c1f25; border: 1px solid rgba(255,255,255,0.03); border-radius: 16px;
  padding: 28px; box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.dash-card-title { font-size: 12px; color: #8e95a5; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.dash-card-value { font-size: 38px; font-weight: 600; margin-bottom: 8px; font-family: 'IBM Plex Mono', monospace; color: #fff; line-height: 1; }
.dash-card-sub { font-size: 12px; color: #5a6070; }

/* Панели */
.dash-page { display: none; animation: fadeIn .2s ease; }
.dash-page.active { display: block; }
.dash-panel {
  background: #1c1f25; border: 1px solid rgba(255,255,255,0.03); border-radius: 16px;
  padding: 32px; margin-bottom: 24px; box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.dash-panel h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; color: #fff; }
.panel-desc { color: #8e95a5; font-size: 13px; margin-bottom: 24px; line-height: 1.6; }

/* Формы */
.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.input-group label { font-size: 12px; color: #8e95a5; font-weight: 500; }
.input-group input {
  background: #14161b; border: 1px solid rgba(255,255,255,0.08); color: #fff;
  padding: 14px 16px; border-radius: 10px; font-family: inherit; outline: none; transition: border .2s;
}
.input-group input:focus { border-color: #aaa2ff; box-shadow: 0 0 0 3px rgba(170,162,255,0.1); }

.primary-btn {
  background: #514c83; color: #e2dfff; border: 1px solid #8279db;
  padding: 14px 24px; border-radius: 10px; cursor: pointer; font-size: 13px;
  font-family: inherit; transition: all .2s; font-weight: 500;
}
.primary-btn:hover { background: #5b5592; box-shadow: 0 0 20px rgba(108,99,197,0.2); }
.mt-10 { margin-top: 10px; }

/* Генератор ссылок */
.invite-generator { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.generated-link-box { margin-top: 24px; display: flex; gap: 12px; }
.generated-link-box input {
  flex: 1; background: #14161b; border: 1px solid rgba(255,255,255,0.08);
  color: #62c58a; padding: 14px 16px; border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; outline: none;
}
.copy-btn {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: #fff; padding: 0 24px; border-radius: 10px; cursor: pointer;
  transition: all .2s; font-family: inherit; font-size: 13px;
}
.copy-btn:hover { background: rgba(255,255,255,0.08); }

/* Профиль */
.profile-info { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.avatar-placeholder {
  width: 72px; height: 72px; border-radius: 50%; background: #2a2d37;
  border: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center;
  justify-content: center; font-size: 28px; font-weight: 600; color: #c6c1ff;
}
.profile-info h4 { margin: 0 0 8px; font-size: 18px; font-weight: 500; color: #fff; }
.profile-info p { margin: 0; font-size: 13px; color: #8e95a5; }

/* Поля ввода */
.wall-textarea {
  width: 100%; min-height: 160px; background: #14161b; border: 1px solid rgba(255,255,255,0.08);
  color: #fff; padding: 18px; border-radius: 10px; font-family: inherit;
  margin-bottom: 24px; resize: vertical; outline: none; transition: border .2s;
  line-height: 1.6;
}
.wall-textarea:focus { border-color: #aaa2ff; box-shadow: 0 0 0 3px rgba(170,162,255,0.1); }
.empty-state { text-align: center; color: #5a6070; font-size: 14px; padding: 50px 0; }

/* Настройки */
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 14px; color: #e1e5ee;
}
.settings-row:last-child { border-bottom: none; }

/* ===== MOBILE ===== */
@media(max-width:700px){
  body{padding:0;display:block;min-height:100svh;background:var(--bg)}
  .app-frame{width:100%;height:100svh;min-height:0;grid-template-columns:1fr;grid-template-rows:auto 1fr auto;border:0;border-radius:0;box-shadow:none;background:#191c22}
  
  .sidebar{grid-row:3;padding:0;border-right:0;border-top:1px solid var(--line);background:rgba(28,31,37,.95);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);z-index:10}
  .wordmark,.side-rule,.sidebar-bottom{display:none}
  .navigation{display:grid;grid-template-columns:repeat(4,1fr);gap:2px;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px))}
  .nav-item{flex-direction:column;justify-content:center;align-items:center;gap:3px;padding:7px 4px 8px;border-radius:10px;font-size:9.5px;font-weight:500;letter-spacing:.03em;color:var(--dim);text-align:center;transition:color .18s, background .18s;position:relative}
  .nav-item.active{background:transparent;box-shadow:none;color:#c6c1ff}
  .nav-item.active::before{content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);width:22px;height:2px;border-radius:2px;background:var(--accent);box-shadow:0 0 10px rgba(170,162,255,.5)}
  .nav-icon{width:auto;font-size:19px;line-height:1;transition:transform .18s}
  .nav-item.active .nav-icon{transform:translateY(-1px)}
  .nav-item:hover{background:transparent;color:var(--muted)}

  .main-area{grid-row:1 / 3;min-height:0;display:flex;flex-direction:column}
  .topbar{height:50px;padding:0 16px;border-bottom:1px solid var(--line);background:rgba(28,31,37,.95);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);flex:none;z-index:10}
  .mobile-brand{display:block;padding:0;font-size:13px}
  .network-pill{font-size:9px;padding:5px 10px}

  .content{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:22px 16px 24px;display:flex;flex-direction:column;justify-content:center}

  .page{width:100%;margin:0}
  .page-home{max-width:none}

  .hero{margin:4px 0 20px;text-align:center}
  .hero h1{font-size:32px;letter-spacing:.1em}
  .eyebrow{font-size:9px;margin-bottom:8px}
  .subtitle{font-size:11px;margin-top:6px}

  .invite-card{flex-direction:column;align-items:center;text-align:center;gap:12px;padding:20px 16px;border-radius:12px}
  .lock-tile{width:48px;height:48px;border-radius:12px;margin-bottom:4px}
  .lock-tile svg{width:24px;height:24px}
  .invite-copy h2{font-size:13px;margin-bottom:6px;line-height:1.35}
  .invite-copy p{font-size:11px;line-height:1.6;margin-bottom:8px}
  .login-btn{width:100%;margin-top:8px;padding:12px 14px;font-size:12px;justify-content:center}
  .bottom-caption{font-size:9px;gap:8px;margin-top:32px}
  .bottom-caption span{width:18px}

  .section-heading{margin-bottom:18px;text-align:center}
  .section-heading h1{font-size:25px}
  .section-subtitle{font-size:11.5px;margin-top:6px;line-height:1.6;margin-left:auto;margin-right:auto}

  .feature-grid{grid-template-columns:1fr;gap:9px}
  .feature-card{padding:14px}
  .feature-symbol{margin-bottom:10px;font-size:10px}
  .feature-card h2{font-size:13px;margin-bottom:5px}
  .feature-card p{min-height:0;font-size:10.5px;line-height:1.6}
  .feature-state{margin-top:9px;font-size:8.5px}

  .text-panel{padding:16px}
  .text-panel h2{font-size:13px}
  .text-panel p{font-size:10.5px}

  .info-row{font-size:10px;flex-direction:column;gap:3px;padding:10px 0}
  .info-row strong{text-align:left}

  .contact-panel{padding:22px 16px}
  .contact-mark{font-size:18px;margin-bottom:10px}
  .small-note{font-size:9px;margin-top:16px}

  .main-footer{display:none}

  /* Мобильный дашборд V2 */
  .owner-dashboard { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .dashboard-sidebar {
    grid-row: 2; border-right: none; border-top: 1px solid rgba(255,255,255,0.04);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom,0px)); display: block; background: #17191e;
  }
  .dashboard-sidebar .wordmark, .dash-bottom { display: none; }
  .dashboard-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .dash-nav-item { flex-direction: column; padding: 10px 14px; font-size: 10px; gap: 6px; white-space: nowrap; border-radius: 8px; }
  .dash-icon { font-size: 20px; }
  
  .dashboard-main { grid-row: 1; }
  .dash-header { height: 60px; padding: 0 20px; }
  .dash-title { font-size: 16px; }
  .dash-content { padding: 20px; }
  .dash-grid { grid-template-columns: 1fr; gap: 16px; }
  .invite-generator { flex-direction: column; align-items: stretch; }
  .generated-link-box { flex-direction: column; }
  .copy-btn { padding: 12px; }
}

@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}