:root { --ink:#1b1b1f; --muted:#8a8a93; --soft:#f6f6f8; --line:#ececf0; --pink:#f0699a; --pink-l:#ffc4da; --pink-bg:#fde8f4; --bad:#c2410c; }
* { box-sizing:border-box; }
html, body { height:100%; }
body { margin:0; color:var(--ink); background:linear-gradient(135deg,#fde3f4 0%,#fff0f9 45%,#fde5f5 100%) fixed; font:15.6px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust:100%; }
h1 { font-size:29.1px; margin:0 0 16.6px; font-weight:700; letter-spacing:-.01em; }
p { margin:0 0 12.5px; }
button, input, textarea { font:inherit; color:inherit; }
button { cursor:pointer; border:0; background:none; padding:0; }
[hidden] { display:none !important; }
svg { display:block; }

/* каркас */
.shell { display:flex; gap:16.6px; height:100vh; padding:15.6px 9.3px 15.6px 8.3px; }
.side { width:295.9px; flex:none; background:#fff; border-radius:27px; display:flex; flex-direction:column; padding:31.2px 0 22.8px; }
.panel { flex:1; min-width:0; background:#fff; border-radius:27px; display:flex; flex-direction:column; overflow:hidden; position:relative; }
.view { flex:1; min-height:0; overflow:auto; display:flex; flex-direction:column; }
.logo { padding:0 33.2px; font-size:23.9px; font-weight:800; letter-spacing:-.02em; line-height:1; height:66px; display:flex; align-items:center; color:var(--ink); text-decoration:none; }
.logo b { color:var(--pink); font-weight:800; margin-left:5.2px; }
.nav { margin-top:0; display:flex; flex-direction:column; gap:2px; }
.nav a { display:flex; align-items:center; gap:14.5px; height:54px; padding:0 23.9px; border-radius:20.8px; color:var(--ink); text-decoration:none; font-size:16.6px; }
.nav a svg { color:#555; flex:none; }
.nav a.on { background:var(--soft); color:var(--pink); }
.nav a.on svg { color:var(--pink); }
.side-bottom { margin-top:auto; padding:0 23.9px; }
.budget { color:var(--muted); font-size:12.5px; line-height:1.35; padding:0 0 12.5px 3px; }
.logout { display:flex; align-items:center; gap:14.5px; font-size:17.7px; height:45.7px; padding-left:2px; }
.logout:hover { color:var(--pink); }

/* меню, подсказки */
.toast { position:fixed; left:50%; bottom:29.1px; transform:translateX(-50%); background:#26262b; color:#fff; padding:12.5px 18.7px; border-radius:14.5px; z-index:60; max-width:90vw; font-size:14.5px; }
.toast.bad { background:var(--bad); }
.overlay { position:fixed; inset:0; z-index:50; background:rgba(40,20,40,.55); display:flex; align-items:center; justify-content:center; padding:20.8px; }
.x { position:absolute; top:14.5px; right:16.6px; width:35.3px; height:35.3px; display:grid; place-items:center; border-radius:50%; color:#777; font-size:24.9px; line-height:1; }
.x:hover { background:var(--soft); }
.lightbox { background:none; padding:0; }
.lightbox .box { position:relative; background:#fff; border-radius:6.2px; max-width:92vw; max-height:92vh; }
.lightbox img { display:block; max-width:92vw; max-height:92vh; }
.lightbox .x { position:fixed; top:14.5px; right:16.6px; color:#fff; font-size:31.2px; }
.modal { background:#fff; border-radius:27px; width:min(768.4px,100%); max-height:92vh; overflow:auto; padding:31.2px 35.3px 37.4px; position:relative; }
.memo h2 { text-align:center; font-size:28px; margin:14.5px 0 4px; font-weight:800; }
.memo .sub { text-align:center; color:var(--muted); margin:0 0 18.7px; padding-bottom:14.5px; border-bottom:1px solid var(--line); }
.memo .sub b { color:var(--pink); }
.memo .lead { color:#555; font-size:14.5px; }
.memo .note { background:#fff7fc; border:1px solid #fbe3f1; border-radius:12.5px; padding:12.5px 14.5px; font-size:14.5px; color:#444; margin:14.5px 0 18.7px; }
.memo h3 { font-size:17.7px; margin:20.8px 0 8.3px; padding-bottom:8.3px; border-bottom:1px solid #fbd9ea; font-weight:700; }
.memo h3 i { font-style:normal; color:var(--pink); margin-right:4px; }
.memo li { margin:5.2px 0; font-size:14.5px; color:#444; }
.memo ul { padding-left:18.7px; margin:0; }

/* новая генерация */
.newgen { flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; padding:20.8px 24.9px 31.2px; min-height:0; }
.head { text-align:center; position:relative; width:100%; max-width:746.6px; }
.head h1 { margin:0 0 10.4px; font-size:30.1px; }
.head .sub { color:var(--muted); margin:0 0 17.7px; font-size:16.6px; }
.tiles { display:flex; gap:15.6px; justify-content:center; margin:0 auto; width:100%; max-width:746.6px; }
.tile { position:relative; flex:1; min-width:0; height:243px; border-radius:22.8px; overflow:hidden; color:#fff; text-align:left; background:#444 center/cover no-repeat; }
.tile::before { content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,.1) 30%,rgba(0,0,0,.62) 100%); }
.tile.flat::before { background:linear-gradient(180deg,rgba(0,0,0,0) 62%,rgba(0,0,0,.55) 100%); }
.tile .tx { position:absolute; left:20.8px; right:14.5px; bottom:18.7px; }
.tile b { display:block; font-size:16.6px; font-weight:600; }
.tile b em { font-style:normal; opacity:.7; margin-left:6.2px; }
.tile small { display:block; font-size:14px; opacity:.85; line-height:1.35; margin-top:5.2px; }
.tile:hover { filter:brightness(1.06); }
.more { display:inline-block; color:#f48ab2; border-bottom:1px solid #f8bfd6; margin:22.8px 0 32.2px; font-size:15.6px; }
.more:hover { color:var(--pink); }
.back { position:absolute; left:0; top:60.2px; background:var(--soft); border-radius:9.3px; font-size:12.5px; padding:3px 9.3px; color:#555; }
.hints { text-align:center; color:var(--muted); font-size:13.5px; line-height:1.7; margin-top:20px; }

/* композер */
.composer { width:100%; max-width:920px; background:var(--soft); border-radius:22.8px; padding:12.5px; min-height:137.1px; display:flex; flex-direction:column; position:relative; }
.c-top { display:flex; gap:12.5px; flex:1; align-items:flex-start; }
.plus { width:39.5px; height:39.5px; border-radius:12.5px; background:#fff; display:grid; place-items:center; color:var(--pink); flex:none; }
.plus:hover { box-shadow:0 2px 8.3px rgba(240,105,154,.25); }
.c-main { flex:1; min-width:0; }
.atts { display:flex; gap:8.3px; flex-wrap:wrap; margin-bottom:8.3px; }
.att { position:relative; width:47.8px; height:47.8px; border-radius:11.4px; overflow:hidden; background:#e9e9ee; }
.att img { width:100%; height:100%; object-fit:cover; }
.att button { position:absolute; top:2px; right:2px; width:18.7px; height:18.7px; border-radius:50%; background:rgba(0,0,0,.55); color:#fff; font-size:13.5px; line-height:1; }
.att i { position:absolute; left:0; right:0; bottom:0; background:rgba(240,105,154,.85); color:#fff; font-size:9.3px; text-align:center; font-style:normal; }
.c-main textarea { width:100%; border:0; background:none; resize:none; outline:none; font-size:16.6px; line-height:1.4; padding:8.3px 0 0; min-height:43.6px; }
.c-main textarea::placeholder { color:#a9a9b3; }
.proj-composer .c-top { padding:6.2px 4px 0; }
.proj-composer .c-main textarea { min-height:54px; padding:4px 0 0; }
.c-bottom { display:flex; align-items:center; gap:2px; margin-top:8.3px; }
.dd { display:flex; align-items:center; gap:5.2px; font-size:14.5px; padding:6.2px 9.3px; border-radius:10.4px; color:var(--ink); }
.dd:hover, .dd.open { background:#ececf0; }
.dd.set { color:var(--pink); }
.dd svg { width:10.4px; height:10.4px; }
.sep { width:1px; height:16.6px; background:#e0e0e6; margin:0 4px; }
.reset { display:flex; align-items:center; gap:7.3px; font-size:14.5px; background:#fff; border-radius:16.6px; padding:6.2px 13.5px; margin-left:8.3px; }
.reset:hover { color:var(--pink); }
.sp { flex:1; }
.est { color:var(--muted); font-size:12.5px; margin-right:10.4px; }
.send { width:41.5px; height:41.5px; border-radius:12.5px; display:grid; place-items:center; color:#fff; background:linear-gradient(135deg,#ffc9de,#ffaacb); transition:background .15s; }
.send.ready { background:linear-gradient(135deg,#ff86b5,#ff5a97); }
.send:disabled { cursor:default; }
.dd-wrap, .plus-wrap, .chip-wrap { position:relative; }
.menu { position:absolute; bottom:calc(100% + 12.5px); left:0; background:#fff; border-radius:24.9px; box-shadow:0 6.2px 31.2px rgba(60,30,60,.16); padding:12.5px; z-index:20; min-width:145.4px; }
.menu::after { content:""; position:absolute; bottom:-6px; left:27px; width:14.5px; height:14.5px; background:#fff; transform:rotate(45deg); border-radius:3px; }
.menu button, .menu .li { display:flex; align-items:center; justify-content:space-between; gap:20.8px; width:100%; text-align:left; padding:12.5px 16.6px; border-radius:14.5px; font-size:14.5px; }
.menu button:hover, .menu .li:hover, .menu .li.open { background:var(--soft); }
.menu .on { background:var(--soft); }
.fmt-menu { min-width:197.3px; padding:10.4px 8.3px; }
.fmt-menu button { justify-content:flex-start; gap:14.5px; padding:11.4px 14.5px; }
.mode-menu { left:-92px; min-width:231.6px; padding:8.3px; }
.mode-menu .li { position:relative; cursor:pointer; }
.mode-menu .li svg { color:#999; }
.subm { display:none; position:absolute; left:100%; bottom:-30px; padding-left:6.2px; z-index:21; }
.li:hover > .subm, .li.open > .subm { display:block; }
.sub-card { background:#fff; border-radius:24.9px; box-shadow:0 6.2px 31.2px rgba(60,30,60,.16); padding:20.8px 16.6px 12.5px; width:363.4px; cursor:default; }
.sub-card .st { display:flex; gap:16.6px; padding:0 4px 18.7px; text-align:left; cursor:pointer; border-radius:12.5px; }
.sub-card .st:hover b { color:var(--pink); }
.sub-card .pv { width:81px; height:81px; flex:none; border-radius:14.5px; background:var(--pink-bg) center/cover; }
.sub-card b { display:block; font-weight:500; font-size:15.6px; margin-bottom:3px; }
.sub-card small { display:block; color:#a89fb4; font-size:11.9px; line-height:1.35; }
.nostyle { display:inline-flex !important; align-items:center; gap:8.3px; width:auto !important; border:1px solid var(--line); border-radius:18.7px !important; padding:6.2px 13.5px !important; font-size:14.5px; }
.plus-menu { min-width:238.8px; padding:8.3px; left:-6px; }
.plus-menu .li { position:relative; cursor:pointer; }
.plus-hint { display:none; position:absolute; left:calc(100% + 14.5px); top:50%; transform:translateY(-50%); background:#fff; width:259.6px; border-radius:18.7px; box-shadow:0 6.2px 31.2px rgba(60,30,60,.16); padding:16.6px 18.7px; font-size:13px; color:#444; text-align:left; line-height:1.45; cursor:default; }
.plus-hint b { display:block; font-size:14.5px; margin-bottom:6.2px; color:var(--ink); }
.li:hover .plus-hint { display:block; }

/* пресеты */
.presets { max-width:746.6px; }
.presets .tile { height:241.9px; }
.presets .tile b { font-size:15.1px; }
.view-presets .head h1 { font-size:30.1px; }

/* история */
.hist { padding:32.2px 32.2px 41.5px; }
.hist h1 { margin-bottom:29.1px; }
.grid3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16.6px; }
.sq { aspect-ratio:1; border-radius:22.8px; overflow:hidden; background:var(--soft); display:block; }
.sq img { width:100%; height:100%; object-fit:cover; display:block; }
.empty { color:var(--muted); padding:20.8px 0; }

/* проект */
.proj { flex:1; min-height:0; display:flex; flex-direction:column; position:relative; }
.dots { position:absolute; top:14.5px; right:20.8px; z-index:5; }
.dots > button { width:41.5px; height:29.1px; font-size:22.8px; letter-spacing:1px; line-height:1; border-radius:10.4px; color:#333; }
.dots > button:hover { background:var(--soft); }
.dots .pop { position:absolute; right:0; top:35.3px; background:#fff; box-shadow:0 6.2px 31.2px rgba(60,30,60,.18); border-radius:16.6px; padding:6.2px; min-width:197.3px; }
.dots .pop button { display:block; width:100%; text-align:left; padding:11.4px 14.5px; border-radius:10.4px; font-size:14.5px; color:var(--bad); }
.dots .pop button:hover { background:var(--soft); }
.feed { flex:1; min-height:0; overflow-y:auto; padding:51.9px 24.9px 12.5px; }
.col { max-width:920px; margin:0 auto; }
.bubble-row { display:flex; justify-content:flex-end; margin:0 0 20.8px; }
.bubble { background:var(--pink-bg); border-radius:24.9px; padding:12.5px 12.5px 12.5px 12.5px; max-width:436.1px; }
.bubble.photo { padding-right:49.8px; }
.bubble .ph { width:127.7px; background:#fff; border-radius:16.6px; overflow:hidden; display:grid; place-items:center; min-height:114.2px; }
.bubble .ph img { width:100%; display:block; }
.bubble .more-ph { display:flex; gap:5.2px; margin-top:7.3px; flex-wrap:wrap; }
.bubble .more-ph img { width:35.3px; height:35.3px; border-radius:8.3px; object-fit:cover; background:#fff; }
.bubble .tx { margin-top:10.4px; font-size:14.5px; color:#333; white-space:pre-wrap; padding:0 4px; }
.bubble.text { padding:11.4px 18.7px; font-size:14.5px; white-space:pre-wrap; }
.frame { margin:0 0 6.2px; width:301.1px; position:relative; }
.shot { position:relative; border-radius:22.8px; overflow:hidden; background:#f9f9fa; cursor:zoom-in; border:1px solid transparent; }
.shot img { width:301.1px; display:block; }
.shot:hover { border-color:#d9d9df; }
.shot .ck { position:absolute; top:10.4px; right:10.4px; width:29.1px; height:29.1px; border-radius:50%; background:rgba(255,255,255,.9); border:1.5px solid #c9c9d3; color:transparent; display:none; place-items:center; }
.shot .dl { position:absolute; right:10.4px; bottom:10.4px; width:45.7px; height:45.7px; border-radius:13.5px; background:#fff; border:1px solid #e3e3e8; display:none; place-items:center; color:#444; }
.shot:hover .ck, .shot:hover .dl, .shot.sel .ck { display:grid; }
.shot.sel .ck { background:#8f8fae; border-color:#8f8fae; color:#fff; }
.shot.sel { border-color:#d9d9df; }
.meta { display:flex; justify-content:space-between; color:#b9b9c1; font-size:13.5px; margin:8.3px 0 14.5px; width:301.1px; }
.wait, .fail { width:301.1px; border-radius:22.8px; background:var(--soft); padding:27px 20.8px; text-align:center; color:#666; font-size:14.5px; margin-bottom:14.5px; }
.fail { background:#fff3ef; color:var(--bad); }
.wait small { display:block; color:var(--muted); margin-top:8.3px; font-size:12.5px; }
.spin { width:27px; height:27px; margin:0 auto 12.5px; border-radius:50%; border:3px solid #f5cfe0; border-top-color:var(--pink); animation:sp 0.9s linear infinite; }
@keyframes sp { to { transform:rotate(360deg); } }
.chips { display:flex; gap:8.3px; margin:0 0 12.5px; }
.chip { display:flex; align-items:center; gap:8.3px; background:var(--soft); border-radius:18.7px; height:35.3px; padding:0 15.6px 0 13.5px; font-size:14.5px; }
.chip:hover, .chip.on { background:#ececf0; }
.chip svg { color:#333; }
.chip-pop { position:absolute; bottom:calc(100% + 10.4px); left:50%; transform:translateX(-50%); background:#fff; border-radius:22.8px; box-shadow:0 6.2px 31.2px rgba(60,30,60,.16); padding:12.5px 12.5px 10.4px; display:flex; gap:8.3px; z-index:15; }
.chip-pop.left { left:0; transform:none; }
.chip-pop .opt { width:81px; text-align:center; font-size:13.5px; padding:0; }
.chip-pop .opt .bx { width:78.9px; height:78.9px; border:1px solid #efeff3; border-radius:14.5px; display:grid; place-items:center; background:#fff; margin-bottom:6.2px; overflow:hidden; }
.chip-pop .opt .bx img { width:100%; height:100%; object-fit:cover; }
.chip-pop .opt:hover .bx { border-color:var(--pink-l); }
.chip-pop .opt span { font-size:12.5px; display:block; white-space:nowrap; }
.chip-pop.modes .opt { width:81px; }
.chip-pop.modes .opt .bx { border:0; border-radius:12.5px; }
.dock { padding:0 24.9px 24.9px; }
.dock .composer { margin:0 auto; }
.seg { display:flex; background:#ececf0; border-radius:12.5px; padding:3px; gap:2px; }
.seg button { display:flex; align-items:center; gap:7.3px; padding:7.3px 11.4px; border-radius:10.4px; font-size:14.5px; color:#999; }
.seg button.on { background:#fff; color:var(--ink); font-weight:500; }
.proj-composer { min-height:137.1px; }

/* вход */
.login-page { min-height:100vh; display:grid; place-items:center; padding:20.8px; }
.login-box { background:#fff; border-radius:27px; padding:35.3px 33.2px; width:min(394.6px,100%); }
.login-box h1 { font-size:27px; }
.login-box .hint { color:var(--muted); }
.field { display:block; margin-bottom:14.5px; }
.field span { display:block; font-size:13.5px; color:var(--muted); margin-bottom:5.2px; }
.field input { width:100%; height:47.8px; border:1px solid var(--line); border-radius:14.5px; padding:0 14.5px; background:var(--soft); outline:none; }
.field input:focus { border-color:var(--pink-l); }
.btn { width:100%; height:49.8px; border-radius:14.5px; background:linear-gradient(135deg,#ff86b5,#ff5a97); color:#fff; font-weight:600; }
.err { color:var(--bad); font-size:14.5px; min-height:20.8px; margin:10.4px 0 0; }

@media (max-width: 860px) {
  .shell { flex-direction:column; height:auto; min-height:100vh; padding:8px; gap:8px; }
  .side { width:auto; padding:12px 8px 10px; border-radius:22px; }
  .logo { height:40px; padding:0 16px; }
  .nav { flex-direction:row; flex-wrap:wrap; }
  .nav a { height:42px; padding:0 14px; font-size:14px; gap:8px; }
  .side-bottom { display:flex; align-items:center; justify-content:space-between; padding:6px 16px 0; }
  .budget { padding:0; }
  .panel { min-height:80vh; }
  .tiles { flex-direction:column; }
  .tile { height:150px; }
  .grid3 { grid-template-columns:repeat(2,1fr); }
  .subm { left:0; bottom:100%; padding:0 0 6px; }
  .sub-card { width:min(320px,86vw); }
  .feed { padding:44px 14px 12px; }
}
