﻿/* ДРЕВО Mobile · Design system 0.3.1 · clean rebuild, not layered patches */
:root{
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-synthesis:none;font-weight:400;color-scheme:light;
  --bg:#F8F9FB;--surface:#FFFFFF;--surface-soft:#F2F4F6;
  --text:#1C2733;--sub:#52616F;--hairline:#DDE2E7;
  --brand:#8F1D38;--brand-deep:#71132B;--brand-soft:#F7EEF1;
  --danger:#B72E49;--danger-soft:#FCF1F3;
  --nav:#FFFFFF;--shadow:0 3px 12px rgba(30,46,64,.065);
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#151A21;--surface:#232B35;--surface-soft:#2B3440;
  --text:#F1F3F6;--sub:#B8C4CE;--hairline:#46515D;
  --brand:#D58899;--brand-deep:#9E3952;--brand-soft:#3A2C36;
  --danger:#F0A0B1;--danger-soft:#462D38;
  --nav:#1D252E;--shadow:0 3px 14px rgba(0,0,0,.16);
}
*{box-sizing:border-box}
html,body{width:100%;min-width:0;max-width:none;min-height:100%;margin:0;overflow-x:hidden}
html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--text);font-size:17px;line-height:1.4}
button,input,select,textarea{font:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{opacity:.5;cursor:not-allowed}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible{
  outline:3px solid var(--brand);outline-offset:3px
}
a{color:var(--brand)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.app-shell{
  display:flex;flex-direction:column;width:100%;min-width:0;max-width:none;
  min-height:100vh;min-height:100dvh;margin:0;background:var(--bg)
}
.main{flex:1 0 auto;min-width:0;width:100%;padding:20px 18px calc(112px + env(safe-area-inset-bottom))}
.ico{width:24px;height:24px;flex:none;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round}
.small-ico{width:20px;height:20px}
.head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 0 16px}
.brand{min-width:0}
.brand img{display:block;width:clamp(148px,39vw,187px);height:auto;max-width:100%}
.mobile{display:block;margin-top:1px;font-size:16px;line-height:1.1;color:var(--sub);font-weight:450}
.voice-switch{
  display:flex;align-items:center;justify-content:center;gap:8px;min-height:49px;
  max-width:58%;white-space:nowrap;color:var(--text);
  border:1px solid var(--hairline);border-radius:999px;
  background:var(--surface);padding:8px 10px;box-shadow:none
}
.voice-switch span.label{font-size:13px;font-weight:550}
.voice-switch .small-ico{width:18px;height:18px}
.switch-track{display:flex;align-items:center;width:37px;height:23px;padding:3px;border-radius:99px;background:#ADB5BD;transition:background .15s;flex:none}
.switch-knob{width:17px;height:17px;border-radius:50%;background:#FFFFFF;transition:transform .15s}
.voice-switch[aria-pressed="true"] .switch-track{background:var(--brand)}
.voice-switch[aria-pressed="true"] .switch-knob{transform:translateX(14px)}
.identity-line{
  display:flex;align-items:center;gap:12px;min-height:73px;padding:11px 14px;
  margin:0 0 19px;border:1px solid var(--hairline);border-radius:17px;
  background:var(--surface);box-shadow:var(--shadow);text-decoration:none;color:var(--text)
}
.identity-avatar{
  display:grid;place-items:center;position:relative;overflow:hidden;flex:none;
  width:46px;height:46px;border-radius:50%;background:var(--brand);
  color:white;font-size:17px;font-weight:650
}
.identity-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.identity-content{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}
.identity-name{font-size:18px;font-weight:680;line-height:1.24;overflow-wrap:anywhere}
.identity-hint{font-size:14px;color:var(--sub)}
.identity-line>.ico{width:20px;height:20px;color:var(--sub)}
.demo-ribbon{display:none}
/* A compact asymmetric Bento: creation remains prominent, not oversized. */
.home-hero{
  display:grid;grid-template-columns:minmax(0,.87fr) minmax(0,1.13fr);
  gap:11px;height:clamp(208px,53vw,240px);min-width:0
}
.bento-create{
  min-width:0;min-height:0;display:flex;flex-direction:column;
  align-items:flex-start;justify-content:space-between;
  padding:17px;border:1px solid var(--brand-deep);border-radius:19px;
  background:var(--brand-deep);color:white;box-shadow:var(--shadow);
  transition:transform .13s
}
.bento-create:active,.bento-action:active,.folder-card:active,.focus-card:active,.list-card:active{transform:scale(.987)}
.bento-create .plus{font-size:50px;font-weight:300;line-height:.8}
.bento-create strong{font-size:22px;font-weight:720;line-height:1.1}
:root[data-theme="dark"] .bento-create{background:#A14A60;border-color:#A14A60}
.action-stack{display:grid;grid-template-rows:1fr 1fr!important;gap:11px;min-width:0;min-height:0}
.action-row{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:11px;height:101px;margin-top:11px;min-width:0
}
.bento-action{
  display:flex;flex-direction:column;align-items:stretch;justify-content:space-between;
  min-width:0;min-height:0;padding:13px 14px;text-align:left;
  background:var(--surface);color:var(--text);
  border:1px solid var(--hairline);border-radius:18px;
  box-shadow:var(--shadow);transition:transform .13s
}
.action-top{display:flex;align-items:start;justify-content:space-between;gap:7px}
.bento-action .ico{width:23px;height:23px;color:var(--brand)}
.action-count,.action-count.strong{
  font-size:29px;font-weight:680;line-height:1;letter-spacing:-.035em;
  font-variant-numeric:tabular-nums;color:var(--text)
}
.action-label{font-size:17px;font-weight:660;line-height:1.16;overflow-wrap:anywhere;letter-spacing:-.015em}
.minor-heading{
  display:flex;align-items:center;gap:15px;margin:26px 0 13px;
  color:var(--text);font-size:19px;font-weight:690;line-height:1.3
}
.minor-heading:after{content:"";height:1px;background:var(--hairline);flex:1}
.focus-grid,.folders{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px
}
.focus-card{
  display:flex;flex-direction:column;justify-content:space-between;
  min-width:0;min-height:96px;padding:13px 14px;text-align:left;
  background:var(--surface);color:var(--text);
  border:1px solid var(--hairline);border-radius:18px;box-shadow:var(--shadow);
  transition:transform .13s
}
.focus-card:first-child{background:var(--danger-soft);border-color:#E8C5CC;color:var(--danger)}
:root[data-theme="dark"] .focus-card:first-child{border-color:#754655}
.focus-card:nth-child(2){border-left:3px solid var(--brand);padding-left:12px}
.focus-top{display:flex;align-items:start;gap:6px;font-size:16px;font-weight:580;line-height:1.2}
.focus-top .small-ico{width:18px;height:18px}
.focus-card .num{font-size:28px;font-weight:730;line-height:1.1;align-self:flex-end}
.folders{margin-top:20px}
.folder-card{
  display:flex;flex-direction:column;justify-content:space-between;
  min-width:0;min-height:106px;padding:13px 14px;
  text-align:left;color:var(--text);background:var(--surface);
  border:1px solid var(--hairline);border-radius:18px;box-shadow:var(--shadow)
}
.folder-head{display:flex;align-items:start;justify-content:space-between;gap:7px}
.folder-head .ico{width:23px;height:23px;color:var(--brand)}
.folder-head small{font-size:19px;font-weight:670;color:var(--text);font-variant-numeric:tabular-nums}
.folder-card .folder-label{font-size:16px;font-weight:620;line-height:1.23}
.bottom-nav{
  position:fixed;left:0;right:0;bottom:0;z-index:5;flex-shrink:0;
  display:flex;align-items:stretch;justify-content:space-around;gap:2px;
  width:100%;padding:8px 7px max(11px,env(safe-area-inset-bottom));
  background:var(--nav);border-top:1px solid var(--hairline);
  box-shadow:0 -3px 12px rgba(20,35,50,.05)
}
.nav-item{
  display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;
  gap:5px;min-width:0;min-height:60px;padding:4px 3px;
  border:0;background:transparent;color:var(--sub);
  font-size:14px;font-weight:580;line-height:1.2;text-align:center
}
.nav-item .ico{width:26px;height:26px}
.nav-item.active{font-weight:760;color:var(--brand)}
/* Lists and drill-downs keep the same material and hierarchy. */
.page-top{display:flex;align-items:center;gap:13px;margin:6px 0 18px}
.page-top h1{margin:0;min-width:0;flex:1;font-size:clamp(26px,4vw,35px);font-weight:720;line-height:1.16;letter-spacing:-.025em;overflow-wrap:anywhere}
.icon-button{
  display:grid;place-items:center;flex:none;width:49px;height:49px;
  background:var(--surface);color:var(--brand);
  border:1px solid var(--hairline);border-radius:15px;box-shadow:var(--shadow)
}
.subhead{margin:-3px 0 18px;color:var(--sub);font-size:15px;line-height:1.5}
.section-label{margin:26px 0 11px;color:var(--text);font-size:18px;font-weight:680}
.item-list{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.list-card{
  display:flex;align-items:center;gap:13px;min-width:0;min-height:88px;
  padding:15px;text-align:left;color:var(--text);
  background:var(--surface);border:1px solid var(--hairline);
  border-radius:18px;box-shadow:var(--shadow)
}
.list-card>.ico{
  display:block;flex:none;width:45px;height:45px;padding:11px;
  border-radius:13px;background:var(--brand-soft);color:var(--brand)
}
.list-card>.ico:last-child{
  width:25px;height:27px;padding:2px;border-radius:0;
  background:transparent;color:var(--sub)
}
.list-card .entry{min-width:0;flex:1}
.item-title{font-size:17px;font-weight:690;line-height:1.3;overflow-wrap:anywhere}
.item-sub{margin-top:5px;font-size:14px;color:var(--sub);line-height:1.45;overflow-wrap:anywhere}
.count-chip{
  padding:5px 10px;border-radius:10px;background:var(--surface-soft);
  border:1px solid var(--hairline);color:var(--text);font-size:14px
}
.status-chip{
  padding:6px 10px;border-radius:10px;background:var(--danger-soft);
  color:var(--danger);font-size:14px;font-weight:600
}
.searchbox,.control-wrap{
  display:flex;align-items:center;gap:8px;min-height:55px;
  padding:7px 13px;margin:12px 0 18px;
  border:1px solid var(--hairline);border-radius:15px;
  background:var(--surface);color:var(--text)
}
.searchbox input,.control-wrap input,.control-wrap select,.control-wrap textarea{
  min-width:0;width:100%;flex:1;padding:8px 2px;
  border:0;outline:0;background:transparent;color:var(--text);font-size:17px
}
.searchbox input{width:100%}
.searchbox button{
  display:grid;place-items:center;min-width:44px;min-height:44px;
  background:transparent;color:var(--brand);border:0
}
.field{margin-top:16px}
.field label{display:block;margin-bottom:8px;color:var(--text);font-size:16px;font-weight:650}
.control-wrap{margin:0;min-height:58px;padding:8px 12px}
.control-wrap textarea{min-height:114px;resize:vertical}
.control-wrap select option{background:var(--surface);color:var(--text)}
.field-mic{
  display:grid;place-items:center;flex:none;width:44px;height:44px;
  border:1px solid var(--hairline);border-radius:12px;
  background:var(--surface-soft);color:var(--brand)
}
.action-primary,.action-secondary{
  display:block;width:100%;min-height:56px;padding:12px 16px;
  border-radius:15px;font-size:17px;font-weight:680;line-height:1.25
}
.action-primary{margin-top:18px;background:var(--brand-deep);color:#FFF;border:1px solid var(--brand-deep)}
:root[data-theme="dark"] .action-primary{background:#A14A60;border-color:#A14A60}
.action-secondary{margin-top:11px;background:var(--surface);border:1px solid var(--hairline);color:var(--text)}
.helper{font-size:14px;color:var(--sub);line-height:1.5}
.empty,.doc-preview{
  padding:25px 19px;border:1px solid var(--hairline);border-radius:17px;
  background:var(--surface);color:var(--text);font-size:16px;line-height:1.5
}
.doc-preview{margin:16px 0;text-align:center}
.doc-preview .ico{width:45px;height:45px;color:var(--brand)}
.demo-alert{
  padding:14px 16px;margin-bottom:20px;
  background:var(--brand-soft);border-left:4px solid var(--brand);
  color:var(--text);font-size:15px;line-height:1.4;border-radius:10px
}
.radio-row{display:flex;flex-wrap:wrap;gap:9px}
.pill{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-height:48px;padding:10px 15px;border:1px solid var(--hairline);
  border-radius:13px;background:var(--surface);color:var(--text);font-size:16px
}
.pill.selected{color:var(--brand);border-color:var(--brand);background:var(--brand-soft);font-weight:690}
.settings{display:grid;gap:14px}
.setting{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--hairline)}
.setting button{min-width:85px}
.sliders .range-row{display:grid;grid-template-columns:minmax(0,1fr) 100px 36px;align-items:center;gap:10px;padding:10px 0}
.sliders input{max-width:100%;accent-color:var(--brand)}
.screen-reader-title{font-size:14px;color:var(--sub);text-transform:uppercase;letter-spacing:.04em}
.sheet-shade{position:fixed;inset:0;z-index:15;display:flex;align-items:flex-end;justify-content:center;background:rgba(10,15,25,.58)}
.sheet{
  width:100%;max-width:760px;max-height:90dvh;overflow-y:auto;
  padding:23px 20px max(24px,env(safe-area-inset-bottom));
  border-radius:24px 24px 0 0;background:var(--surface);color:var(--text)
}
.sheet h3{margin:0 0 11px;font-size:23px;font-weight:690}
.sheet p{font-size:16px;line-height:1.5;color:var(--sub)}
.sheet-actions{display:flex;gap:10px}
.sheet-actions button{flex:1}
.toast{
  position:fixed;bottom:93px;left:50%;transform:translateX(-50%);z-index:30;
  max-width:min(92vw,540px);padding:12px 17px;border-radius:12px;
  background:var(--text);color:var(--bg);font-size:15px;box-shadow:var(--shadow)
}
.install-help{font-size:15px;color:var(--sub);line-height:1.5}
.kbd{font-family:monospace}
@media(max-width:359px){
  .main{padding:15px 12px calc(108px + env(safe-area-inset-bottom))}
  .brand img{width:129px}
  .voice-switch{gap:5px;padding:7px}
  .voice-switch span.label{font-size:12px}
  .home-hero{height:206px;gap:9px}
  .action-stack,.action-row,.focus-grid,.folders{gap:9px}
  .action-row{margin-top:9px;height:98px}
  .bento-create,.bento-action{padding:12px}
  .bento-create strong{font-size:21px}
  .action-label{font-size:16px}
  .action-count,.action-count.strong{font-size:26px}
  .focus-card,.folder-card{padding:12px}
  .focus-top{font-size:15px}
  .folder-card .folder-label{font-size:15px}
  .nav-item{font-size:13px}
}
@media(min-width:600px){
  .main{padding:26px clamp(24px,4vw,48px) calc(115px + env(safe-area-inset-bottom))}
  .head{margin-bottom:20px}
  .home-hero{height:clamp(252px,31vw,320px);gap:16px}
  .action-stack,.action-row,.focus-grid,.folders{gap:16px}
  .action-row{height:115px;margin-top:16px}
  .bento-create,.bento-action{padding:20px}
  .bento-create strong{font-size:26px}
  .action-label{font-size:19px}
  .focus-card,.folder-card{min-height:117px}
  .item-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bottom-nav{padding-left:clamp(20px,4vw,50px);padding-right:clamp(20px,4vw,50px)}
}
@media(min-width:1000px){
  .main.page-home{
    display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);
    grid-template-rows:auto auto auto auto minmax(0,1fr);
    gap:0 clamp(20px,3vw,44px);align-content:start
  }
  .main.page-home>.head,.main.page-home>.identity-line{grid-column:1/-1}
  .main.page-home>section[aria-label="Быстрые действия"]{grid-column:1;grid-row:3/span 3;min-width:0}
  .main.page-home>.minor-heading{grid-column:2;grid-row:3;margin:0 0 15px}
  .main.page-home>.focus-grid{grid-column:2;grid-row:4}
  .main.page-home>.folders{grid-column:2;grid-row:5;margin-top:18px;align-self:start}
  .home-hero{height:clamp(278px,25vw,360px)}
  .action-row{height:130px}
  .bottom-nav{justify-content:center;gap:clamp(12px,2vw,42px)}
  .nav-item{flex:0 1 250px}
}
@media(min-width:1500px){.item-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(hover:hover){
  .list-card:hover,.bento-action:hover,.bento-create:hover,.folder-card:hover,.focus-card:hover{
    border-color:var(--brand);transform:translateY(-1px)
  }
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*:before,*:after{transition:none!important;animation:none!important}
}

