:root{font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:#111545;background:#e6e9fb;font-synthesis:none;font-size:16px;--ink:#111545;--muted:#56648c;--panel:rgba(255,255,255,.76);--line:rgba(114,108,191,.18);--purple:#6437eb;--shadow:0 9px 24px #2e2a7110;--good:#168647;--bad:#b5394f}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.5;cursor:default}a{color:#4a27c4;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #a077ff;outline-offset:3px}button{border:0}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(1.6rem,2.6vw,2.2rem);line-height:1.18}h2{font-size:1.3rem;letter-spacing:-.025em}h3{font-size:1.05rem}small{font-size:.875rem}svg{width:1.5rem;height:1.5rem;flex-shrink:0;vertical-align:middle;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}[hidden]{display:none!important}
.auth-view{min-height:100svh;display:grid;grid-template-columns:1fr 1fr;gap:3vw;padding:6.5vh 5vw 5vh;background:radial-gradient(ellipse at 38% 80%,#9689f8,transparent 56%),linear-gradient(120deg,#192b88,#7462cc 54%,#344baf);position:relative;overflow:hidden}.auth-view:after{content:"";position:absolute;bottom:-10%;left:-10%;width:130%;height:20%;border-radius:50%;border-top:2px solid #a6cfff;box-shadow:0 -5px 28px #edbafa;transform:rotate(-4deg);pointer-events:none}.language{position:absolute;right:3.1vw;top:1.5rem;display:flex;border:1px solid white;border-radius:30px;padding:3px;background:#eef1ff99;z-index:2}.language button{padding:.4rem .8rem;color:#172058;background:none;border-radius:24px;font-weight:700}.language .selected{background:#30216c;color:#fff}.auth-story{display:flex;flex-direction:column;justify-content:flex-end;position:relative;min-height:650px;isolation:isolate}.story-art{position:absolute;inset:0;width:100%;height:76%;object-fit:cover;object-position:47% 35%;border-radius:30px;z-index:-2;mask-image:linear-gradient(#000 85%,transparent)}.auth-story:after{content:"";position:absolute;inset:50% -12% -5%;background:linear-gradient(transparent,#26215ebb);z-index:-1;border-radius:45% 45% 0 0}.story-copy{color:white;text-align:center;padding:2rem 0 1rem}.story-copy h2{font-size:clamp(1.5rem,2.6vw,2.4rem);text-shadow:0 2px 10px #171758b0;line-height:1.2;letter-spacing:-.025em;margin-bottom:2rem}.story-benefits{display:grid;grid-template-columns:repeat(4,1fr);font-size:clamp(.85rem,1.2vw,1.1rem);gap:8px}.story-benefits>div{border-right:1px solid #b4baff44;line-height:1.4}.story-benefits>div:last-child{border:0}.story-benefits span{display:flex;justify-content:center;margin:auto auto .6rem;width:50px;height:50px;align-items:center;border:1px solid #c9ccff;border-radius:14px;background:linear-gradient(140deg,#a79cfd66,#4f48b477);box-shadow:inset 0 0 12px #fff6}.story-benefits svg{width:30px;height:30px}
.glass{border:1px solid #fffffff0;background:linear-gradient(130deg,#fefbffd9,#edf0ffd4);backdrop-filter:blur(18px);box-shadow:inset 0 0 25px #fff8,0 18px 55px #13184a35}.auth-card{align-self:center;max-width:690px;width:100%;border-radius:38px;padding:2.3rem clamp(1.3rem,3.2vw,3.8rem);z-index:1}.brand{display:flex;align-items:center;gap:.7rem}.brand img{width:68px;height:76px;object-fit:contain}.brand strong{display:block;font-size:2rem;letter-spacing:-.04em;line-height:1.08}.brand small{display:block;font-size:.95rem;line-height:1.3}.auth-brand{justify-content:center;color:#080d37;margin-bottom:1.5rem}.auth-brand img{width:95px;height:115px}.auth-brand strong{font-size:clamp(2rem,3.1vw,3.3rem)}.auth-brand small{font-size:clamp(.9rem,1.4vw,1.3rem);font-weight:550}.auth-heading{text-align:center;font-size:clamp(1.7rem,2.4vw,2.5rem);margin:0 0 .4rem}.auth-lead{text-align:center;color:#35416a;margin-bottom:1.4rem;line-height:1.4}.form-field{display:grid;gap:.4rem;margin-bottom:1rem;color:var(--ink);font-weight:550}.form-field input,.form-field select,.form-field textarea{width:100%;min-width:0;border:1px solid #b7b4d9;background:#ffffffb8;color:var(--ink);border-radius:12px;padding:.85rem 1rem;box-shadow:0 2px 7px #625a9b0a;min-height:48px}.form-field textarea{resize:vertical;min-height:90px}.input-icon{position:relative}.input-icon>svg{position:absolute;left:1rem;top:50%;transform:translateY(-50%);color:#484171}.input-icon input{padding-left:3rem;font-weight:400}.input-icon .reveal{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);background:none;color:#4d4777;padding:.35rem}.input-icon .reveal+input{padding-right:3rem}.auth-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:.5rem 0 1.4rem;font-size:.92rem}.check{display:inline-flex;gap:.55rem;align-items:center;font-weight:450}.check input{accent-color:#6b32e8;width:20px;height:20px}.text-button{background:none;padding:0;color:#5420df;text-decoration:underline}.primary,.secondary,.danger,.subtle{display:inline-flex;justify-content:center;align-items:center;gap:.55rem;border-radius:12px;min-height:44px;padding:.7rem 1rem;font-weight:650;line-height:1.3}.primary{background:linear-gradient(130deg,#a05cff,#6534dd 50%,#302175);color:white;box-shadow:0 5px 15px #6d44c933}.secondary{background:#f9f8ff;border:1px solid #a79be2;color:#39227d}.danger{background:#fae6e9;color:#9c233b}.subtle{background:#e9e9f8;color:#3d4580}.wide{width:100%}.auth-card .wide{min-height:52px;font-size:1.1rem}.divider{display:flex;align-items:center;gap:1rem;margin:1.2rem 0;color:#67728d}.divider:before,.divider:after{content:"";height:1px;flex:1;background:#bdb4e5}.message{min-height:1.3em;font-size:.95rem;line-height:1.5;color:#a0213e;overflow-wrap:anywhere;margin:.8rem 0 0}.auth-qr{display:block;width:200px;max-width:100%;margin:1rem auto;background:white;padding:8px;border-radius:10px}.secret{display:block;word-break:break-all;font-size:1rem;background:#ffffffa0;padding:.8rem;border-radius:9px;text-align:center}.auth-code{text-align:center;letter-spacing:.18em;font-size:1.4rem}.hint{color:var(--muted);font-size:.9rem;line-height:1.5}.backup-codes{display:grid;grid-template-columns:1fr 1fr;gap:.4rem;padding:1rem;background:#fff;border-radius:12px;list-style:none}.backup-codes code{font-size:.85rem;overflow-wrap:anywhere}
.app-view{display:grid;grid-template-columns:245px minmax(0,1fr);min-height:100svh;background:radial-gradient(at 40% 20%,#f6f4ff,#e4e8fd 65%,#e9ebfa)}.sidebar{background:linear-gradient(175deg,#0c193c,#202555 64%,#604582);color:white;padding:1.2rem 1.1rem;display:flex;flex-direction:column;min-height:100svh;position:sticky;top:0;height:100svh;overflow:auto;z-index:10}.sidebar:after{content:"";pointer-events:none;position:absolute;bottom:0;left:0;right:0;height:180px;background:linear-gradient(transparent,#f0a89544),url('/assets/assets/family-sunset.png') center bottom/cover;mask-image:linear-gradient(to bottom,transparent,#000 68%);opacity:.25;z-index:-1}.sidebar .brand{color:white;flex-direction:column;text-align:center;margin-bottom:2rem}.sidebar .brand img{width:96px;height:105px}.sidebar .brand strong{font-size:2.2rem}.sidebar .brand small{font-size:.95rem;margin-top:.35rem}.sidebar nav{display:grid;gap:.4rem}.nav-link{display:flex;align-items:center;gap:.8rem;color:#f1f2ff;border-radius:14px;padding:.8rem .85rem;font-weight:550;font-size:1rem;min-height:48px}.nav-link svg{width:24px;height:24px}.nav-link.active{background:linear-gradient(110deg,#7760bc,#6e3dec);box-shadow:0 5px 14px #15153b44}.nav-link:hover{background-color:#ffffff14}.sidebar-logout{margin-top:auto;display:flex;gap:.8rem;align-items:center;padding:1rem;background:transparent;color:#d5d6ed;font-size:.95rem}.workspace{min-width:0}/* Keep the family foreground at a fixed scale independently of the landscape. */
.hero {
  --hero-height: 192px;
  --hero-scene-height: calc(var(--hero-height) * 1.42);
  --hero-scene-start: clamp(0px, 18%, 290px);
  --hero-overlay: linear-gradient(90deg, #d2d7f8 0%, #e4d9f4bd 18%, #e4d9f430 36%, #c6cdf01a 62%);
  box-sizing: border-box;
  block-size: var(--hero-height);
  padding: 1.55rem 2rem 1.65rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  isolation: isolate;
  background: #6b63a8 url('/assets/assets/family-sunset-wide.png') right 53% / max(185%, 900px) auto no-repeat;
}
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.hero::before {
  left: var(--hero-scene-start);
  width: min(calc(100% - var(--hero-scene-start)), calc(var(--hero-scene-height) * 1.777));
  background: url('/assets/assets/family-sunset-wide.png') left 50% / auto var(--hero-scene-height) no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 65%, transparent);
}
.hero::after { background: var(--hero-overlay); }
body[data-theme=dark] .hero {
  --hero-overlay: linear-gradient(90deg, #1c2046 0%, #262b507d 33%, #23234522 68%);
}
@media (max-width: 760px) {
  .hero {
    --hero-height: 168px;
    --hero-scene-start: clamp(36px, 24%, 125px);
  }
  .hero::before { mask-image: linear-gradient(90deg, transparent, #000 4%, #000 82%, transparent); }
}.hero-copy{max-width:660px;z-index:1}.hero h1{margin:1rem 0 .4rem;letter-spacing:-.04em}.hero p{font-size:1.1rem;font-weight:550}.top-actions{display:flex;align-items:center;gap:.8rem;flex-shrink:0}.icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border-radius:50%;background:#ffffffbb;color:#18174b;font-size:1.6rem;position:relative}.icon-button i{position:absolute;right:9px;top:7px;background:#e24555;width:8px;height:8px;border-radius:50%;border:1px solid white}.family-switch{display:flex;align-items:center;gap:.6rem;border-radius:30px;background:#ffffffbb;color:#18174b;padding:.7rem 1rem;font-weight:650;max-width:220px}.family-switch span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.main-content{padding:0 1.5rem 1.2rem;margin-top:-18px;position:relative}.connection{color:var(--muted);font-size:.875rem;padding:0 1.6rem 1rem;margin:0}.mobile-menu{display:none}.grid{display:grid;gap:1rem}.summary-grid{grid-template-columns:minmax(260px,2.5fr) repeat(4,minmax(110px,1fr));margin-bottom:1rem}.card{border:1px solid #fff;border-radius:23px;background:var(--panel);box-shadow:var(--shadow);padding:1.25rem;min-width:0;backdrop-filter:blur(12px)}.card-head{display:flex;justify-content:space-between;align-items:center;gap:.7rem;margin-bottom:1rem}.card-head h2{margin:0;display:flex;align-items:center;gap:.6rem}.card-head h2 svg{color:#6735e7}.device-summary{display:flex;gap:1rem;align-items:center}.phone-shape{width:60px;height:108px;border:4px solid #151a3f;border-radius:13px;background:linear-gradient(155deg,#b4d4ff,#9655c8 40%,#e89fd2 58%,#ffd9a1);box-shadow:2px 4px 6px #15153b30;flex-shrink:0;position:relative}.phone-shape:before{content:"";position:absolute;width:22px;height:5px;top:0;left:15px;background:#151a3f;border-radius:0 0 5px 5px}.device-summary h2{font-size:1.15rem;line-height:1.4;margin:0 0 .6rem}.device-picker{border:0;background:transparent;color:var(--ink);inline-size:fit-content;max-inline-size:min(100%,19rem);min-width:0;min-block-size:44px;font-weight:700;font-size:1rem;padding:.25rem .55rem .25rem 0}.member-line{display:flex;align-items:center;gap:.55rem;margin:.4rem 0;color:#202653}.avatar{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;background:#dfd7fb;color:#472e85;font-weight:700;flex-shrink:0;overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}.metric{display:flex;flex-direction:column;gap:.45rem;font-size:.9rem}.metric>svg{color:#7744ec;width:29px;height:29px}.metric strong{display:block;font-size:1.65rem;line-height:1.15;letter-spacing:-.04em}.metric .unavailable{font-size:1rem;font-weight:500;color:var(--muted)}.metric small{line-height:1.35;color:var(--muted)}.dashboard-grid{grid-template-columns:minmax(205px,.8fr) minmax(300px,1.35fr) minmax(265px,1.1fr);align-items:start}.quick-actions{display:grid;gap:.6rem}.quick-actions button{display:flex;align-items:center;text-align:left;gap:.8rem;padding:.8rem;border-radius:18px;background:#f5faffb8;color:var(--ink);font-weight:650;box-shadow:0 3px 9px #25255008;min-height:52px}.quick-actions svg{color:#7952ee;width:28px;height:28px}.protection-list{display:grid;gap:.5rem}.protection-item{border-radius:14px;padding:.75rem;display:flex;gap:.7rem;align-items:flex-start;font-size:.9rem;background:#edf0f9}.protection-item strong{display:block}.protection-item small{display:block;margin-top:.2rem;line-height:1.4}.protection-item.good{background:#e0f4e6;color:#146f39}.protection-item.bad{background:#ffede9;color:#a63737}.protection-item.pending{background:#fff0dc;color:#8d5915}.apps-preview{list-style:none;padding:0;margin:0}.apps-preview li{display:flex;gap:.65rem;align-items:center;padding:.7rem 0;border-top:1px solid var(--line)}.app-icon{width:38px;height:38px;background:#e9e2fd;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#6741b8;font-weight:650;flex-shrink:0}.app-meta{min-width:0;flex:1}.app-meta strong{display:block;overflow-wrap:anywhere}.app-meta small{display:block;color:var(--muted);font-size:.8rem;overflow-wrap:anywhere;margin-top:.2rem}.pill{display:inline-block;border-radius:20px;background:#ede9fb;color:#6845a5;padding:.3rem .6rem;font-size:.8rem;white-space:normal}.pill.good{background:#def3e3;color:#18733d}.pill.bad{background:#fde3e7;color:#9c2c46}.pill.pending{background:#fff0da;color:#875816}.mini-switch{width:40px;height:25px;border-radius:20px;background:#b6b9ce;padding:3px;flex-shrink:0;position:relative}.mini-switch:after{content:"";position:absolute;top:3px;left:3px;width:19px;height:19px;background:white;border-radius:50%;box-shadow:0 1px 3px #3333}.mini-switch.allowed{background:#477dff}.mini-switch.allowed:after{left:18px}.bottom-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:1rem}.empty{padding:1rem;color:var(--muted);font-size:.95rem;line-height:1.6}.empty.large{padding:2rem}.empty-icon{display:block;color:#927ae1;margin-bottom:.6rem}.empty-icon svg{width:40px;height:40px}.muted{color:var(--muted)}.section-toolbar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:1rem;margin-bottom:1rem}.section-toolbar h2{margin:0}.actions{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}.stack{display:grid;gap:1rem}.two-columns{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.member-grid,.device-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}.profile-heading{display:flex;align-items:center;gap:.8rem;margin-bottom:1rem}.profile-heading .avatar{width:55px;height:55px;font-size:1.3rem}.profile-heading h2{margin:0 0 .2rem}.details{display:grid;grid-template-columns:minmax(110px,1fr) 1.4fr;gap:.65rem;font-size:.9rem;margin:1rem 0}.details dt{color:var(--muted)}.details dd{margin:0;overflow-wrap:anywhere}.tabs{display:flex;gap:.4rem;flex-wrap:wrap;padding:.2rem 0 .9rem}.tab{border-radius:30px;padding:.5rem .8rem;border:1px solid #cbc6e7;background:#f9f8ff;color:#4b4771;font-size:.9rem;min-height:40px}.tab.active{background:#6941df;color:white;border-color:#6941df}.apps-controls{display:grid;grid-template-columns:1fr 1fr 1.4fr;gap:.8rem}.apps-controls .form-field{margin-bottom:.5rem}.table-wrap{overflow:auto}.app-table{width:100%;border-collapse:collapse;text-align:left}.app-table th{font-size:.85rem;font-weight:550;color:var(--muted);padding:.6rem;border-bottom:1px solid var(--line)}.app-table td{padding:.85rem .6rem;border-bottom:1px solid var(--line);font-size:.9rem;vertical-align:middle}.app-table td .app-meta{min-width:150px}.app-table input[type=checkbox]{width:20px;height:20px;accent-color:#693be4}.app-table .primary,.app-table .secondary{min-height:38px;padding:.5rem .7rem;font-size:.85rem}.table-app{display:flex;gap:.65rem;align-items:center}.batch-actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;padding:.8rem;background:#eee9fc;border-radius:12px;margin:.5rem 0}.settings-grid{display:grid;grid-template-columns:220px minmax(0,1fr);gap:1rem}.settings-nav{display:flex;flex-direction:column;gap:.35rem;align-self:start}.settings-nav button{text-align:left;padding:.7rem;border-radius:10px;background:transparent;color:var(--ink);min-height:44px}.settings-nav button.active{background:#e7defd;color:#5425c7;font-weight:650}.event-list{list-style:none;margin:0;padding:0}.event-list li{padding:.7rem 0;border-bottom:1px solid var(--line)}.event-list p{font-size:.95rem;margin:0 0 .25rem}.event-list time{font-size:.85rem;color:var(--muted)}.session-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0;border-bottom:1px solid var(--line)}.session-row small{display:block;max-width:460px;overflow-wrap:anywhere;color:var(--muted);margin-top:.3rem}.notice{padding:.9rem 1rem;border-radius:12px;background:#f0ecfc;color:#51436e;font-size:.9rem;line-height:1.5}.notice.warning{background:#fff0dc;color:#875816}.toast{position:fixed;left:50%;bottom:max(20px,env(safe-area-inset-bottom));transform:translateX(-50%);max-width:min(92vw,600px);background:#282251;color:#fff;padding:.9rem 1.2rem;border-radius:14px;box-shadow:0 5px 30px #2225;z-index:60;line-height:1.5}.drawer-backdrop{position:fixed;inset:0;background:#10193588;z-index:9}.empty-card{min-height:160px}
dialog{border:1px solid #fff;border-radius:24px;background:#f8f7ff;color:var(--ink);padding:1.5rem;width:min(92vw,600px);max-height:calc(100svh - 40px);overflow:auto;box-shadow:0 20px 80px #10173f55;overscroll-behavior:contain}dialog::backdrop{background:#121a4f88;backdrop-filter:blur(4px)}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}.modal-head h2{margin:0}.modal-head .icon-button{flex-shrink:0}.modal-head+.hint{margin-top:0}.invite-qr{display:block;margin:1rem auto;width:230px;max-width:100%;background:#fff;padding:8px;border-radius:14px}.invite-secret{font-size:.85rem;word-break:break-all;padding:.7rem;background:#fff;border-radius:8px}.invite-timer{text-align:center;color:#5b4d87}.modal-wide{width:min(94vw,820px)}.proof-fields{border:1px solid var(--line);padding:1rem;border-radius:12px;margin:1rem 0}.link-button{display:inline-flex;align-items:center;color:#5930cb;font-size:.9rem;gap:.2rem}.connection.bad{color:var(--bad)}body[data-theme=dark]{--ink:#e8eafd;--muted:#a8b2d1;--panel:rgba(30,31,65,.94);--line:#8487aa33;background:#15152f;color:var(--ink)}body[data-theme=dark] .app-view{background:#16172f}body[data-theme=dark] .card{border-color:#5c5d7c55}body[data-theme=dark] .form-field input,body[data-theme=dark] .form-field select,body[data-theme=dark] .form-field textarea,body[data-theme=dark] dialog{background:#292942;color:#eff0ff}body[data-theme=dark] .secondary,body[data-theme=dark] .tab{background:#343051;color:#eee9ff}body[data-theme=dark] .quick-actions button,body[data-theme=dark] .notice,body[data-theme=dark] .batch-actions{background:#30294d;color:#dad7f4}body[data-theme=dark] .settings-nav button.active{background:#4e3681;color:#fff}
@media(min-width:1600px){.app-view{grid-template-columns:275px minmax(0,1fr)}.main-content{padding-left:2rem;padding-right:2rem}.dashboard-grid{grid-template-columns:1fr 1.5fr 1.2fr}.card{padding:1.5rem}}
@media(max-width:1250px){.app-view{grid-template-columns:210px minmax(0,1fr)}.sidebar .brand strong{font-size:1.9rem}.sidebar{padding:1rem .7rem}.summary-grid{grid-template-columns:minmax(250px,2fr) repeat(2,1fr)}.summary-grid .metric:nth-last-child(-n+2){display:none}.dashboard-grid{grid-template-columns:1fr 1.5fr}.dashboard-grid>.card:last-child{grid-column:1/-1}.protection-list{grid-template-columns:1fr 1fr}.hero{padding:1.5rem 1.4rem 2rem}.hero-copy{max-width:500px}.hero h1{font-size:1.75rem}.top-actions{gap:.4rem}.family-switch{max-width:160px}.bottom-grid{grid-template-columns:repeat(3,1fr)}.auth-view{padding:7vh 3vw 3vh;gap:2vw}.auth-card{padding:2rem 1.8rem}}
@media(max-width:980px){.auth-story{min-height:600px}.story-benefits{grid-template-columns:1fr 1fr;gap:1rem}.story-benefits>div:nth-child(2){border:0}.story-copy h2{font-size:1.7rem}.story-art{height:65%}.auth-brand{gap:.4rem}.auth-brand img{width:65px;height:85px}.auth-brand strong{font-size:2rem}.auth-brand small{font-size:1rem}.main-content{padding:0 1rem 1rem}.hero-copy p{max-width:310px}.top-actions .family-switch{display:none}.bottom-grid{grid-template-columns:1fr}.settings-grid{grid-template-columns:1fr}.settings-nav{flex-direction:row;overflow-x:auto;padding:.5rem;max-width:100%}.settings-nav button{white-space:nowrap}.apps-controls{grid-template-columns:1fr 1fr}.apps-controls>.form-field:last-child{grid-column:1/-1}}
@media(max-width:760px){.auth-view{grid-template-columns:1fr;padding:5.5rem 1rem 2rem;gap:0;min-height:100svh}.auth-story{display:none}.auth-card{margin:auto;max-width:520px;border-radius:28px;padding:1.8rem 1.5rem}.auth-view{background:linear-gradient(140deg,#203399bb,#6553b4bb),url('/assets/assets/family-sunset.png') center/cover}.language{top:1rem;right:1rem}.auth-brand{margin-bottom:1.4rem}.app-view{display:block}.sidebar{position:fixed;left:0;top:0;width:250px;transform:translateX(-105%);transition:transform .2s;height:100dvh;min-height:0}.sidebar.open{transform:translateX(0)}.mobile-menu{display:inline-flex;align-self:flex-start;flex-shrink:0}.hero{padding:1.1rem 1rem 1.4rem;gap:.7rem}.hero-copy{flex:1}.hero h1{font-size:1.45rem;margin:.3rem 0}.hero p{font-size:.9rem;line-height:1.4;margin-bottom:0}.top-actions .icon-button{width:40px;min-width:40px;min-height:40px}.hero .top-actions{margin-top:0}.main-content{margin-top:-18px;padding:0 .8rem 1rem}.summary-grid{grid-template-columns:1.5fr 1fr;gap:.7rem}.summary-grid .device-summary{grid-column:1/-1}.summary-grid .metric:nth-last-child(-n+2){display:flex}.summary-grid .metric{padding:1rem}.summary-grid .metric strong{font-size:1.4rem}.summary-grid .metric:nth-child(3){display:none}.summary-grid .metric:nth-child(4){display:none}.dashboard-grid{grid-template-columns:1fr}.dashboard-grid>.card:last-child{grid-column:auto}.protection-list{grid-template-columns:1fr}.card{border-radius:20px;padding:1.1rem}.card-head h2{font-size:1.2rem}.bottom-grid{gap:.8rem}.quick-actions{grid-template-columns:1fr 1fr}.quick-actions button{font-size:.875rem;padding:.75rem}.quick-actions svg{width:23px;height:23px}.apps-controls{grid-template-columns:1fr}.apps-controls>.form-field:last-child{grid-column:auto}.two-columns{grid-template-columns:1fr}.app-table th:nth-child(3),.app-table td:nth-child(3){display:none}.app-table th,.app-table td{padding:.65rem .4rem}.app-table td .app-meta{min-width:100px}.app-table .app-icon{display:none}.app-table .app-meta small{font-size:.72rem}.app-table .primary,.app-table .secondary{font-size:.8rem;padding:.5rem}.session-row{align-items:flex-start;flex-wrap:wrap}.backup-codes{grid-template-columns:1fr}.auth-row{flex-wrap:wrap}dialog{padding:1.1rem;border-radius:20px;max-height:calc(100svh - 24px)}.modal-head h2{font-size:1.2rem}}
@media(max-width:380px){.auth-card{padding:1.4rem 1rem}.auth-brand img{width:58px;height:70px}.auth-brand strong{font-size:1.85rem}.auth-brand small{font-size:.9rem}.hero h1{font-size:1.3rem}.quick-actions{grid-template-columns:1fr}.app-table .app-meta{max-width:105px}.app-table .pill{font-size:.72rem}.app-table td{padding:.55rem .2rem}.family-switch{padding:.5rem}.details{grid-template-columns:1fr;gap:.2rem}.details dd{margin-bottom:.5rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

.input-icon input{padding-right:3rem}

.metric strong{overflow-wrap:anywhere}
@media(max-width:760px){
 .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .summary-grid .metric:nth-child(3),.summary-grid .metric:nth-child(4){display:flex}
}
.auth-story .story-art{object-position:25% 35%}

.confirm-dialog{width:min(92vw,480px);padding:1.5rem;background:linear-gradient(130deg,#fdfbff,#edf0ff)}
.confirm-dialog #confirmDescription{line-height:1.65;color:var(--muted);overflow-wrap:anywhere}
.confirm-actions{display:flex;justify-content:flex-end;gap:.75rem;margin-top:1.4rem;flex-wrap:wrap}
.confirm-actions button{min-height:46px}
@media(max-width:480px){.confirm-actions{display:grid;grid-template-columns:1fr}.confirm-actions button{width:100%}}
body[data-theme=dark] .confirm-dialog{background:#292942}

/* FG-AUTH-COMPOSITION */
.auth-view {
  isolation: isolate;
  background: linear-gradient(90deg,#19265710,#30326f22 65%,#2a246533),
    url('/assets/assets/family-sunset-wide.png') no-repeat;
  grid-template-columns: repeat(2,minmax(0,1fr));
}
.auth-view::after {
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  background: url('/assets/assets/auth-light-trails.svg') center / 100% 100% no-repeat;
  z-index: -1;
}
.auth-story .story-art { display: none; }
.auth-story .story-copy { padding-top: 0; }
.auth-story::after {
  inset: 60% -10% -5%;
  mask-image: linear-gradient(90deg,transparent,#000 13% 87%,transparent);
  background: linear-gradient(transparent,#221e6388);
}
.auth-card { background: linear-gradient(130deg,#fefbffdd,#edf0ffd9); }

@media (min-width: 1100px) {
  .auth-view {
    min-height: 100svh;
    background-size: 100% 100%,cover;
    background-position: center,25% 69%;
  }
  .auth-story { min-height: 0; }
  .story-copy h2 { font-size: clamp(1.45rem,2vw,2.4rem); margin-bottom: 1.15rem; }
}

@media (max-width: 1099px) {
  .auth-view {
    grid-template-columns: 1fr;
    padding: 4.5rem 1rem 2rem;
    gap: 1.5rem;
    background: linear-gradient(#384291,#6553b4);
  }
  .auth-story {
    display: flex;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1.3;
    max-width: 700px;
    justify-self: center;
    background: url('/assets/assets/family-sunset-wide.png') left center / 227% auto no-repeat;
  }
  .auth-story::after { inset: 65% 0 0; border-radius: 0; }
  .auth-story .story-copy { padding: 0 .5rem .6rem; }
  .story-copy h2 { font-size: clamp(1rem,2.5vw,1.5rem); margin-bottom: 0; }
  .story-benefits { display: none; }
  .auth-card { justify-self: center; margin: 0; max-width: 620px; }
}

button:not(:disabled) {
  transition: translate .15s ease, filter .15s ease;
}
@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover {
    translate: 0 -2px;
    filter: brightness(1.06);
  }
}
button:not(:disabled):active {
  translate: 0 2px;
  filter: brightness(.88);
}
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):hover,
  button:not(:disabled):active { translate: none; }
}
.copy-control { position: relative; display: inline-flex; }
.copy-status {
  position: absolute;
  inset: auto auto calc(100% + .45rem) 50%;
  translate: -50% 0;
  padding: .42rem .7rem;
  border-radius: .55rem;
  background: #302175;
  color: white;
  font-size: .85rem;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 4px 14px #20164e44;
  pointer-events: none;
  z-index: 2;
}
.copy-status:empty { opacity: 0; }


[data-touch-share] { display: none; }
@media (pointer: coarse) {
  [data-touch-share] { display: inline-flex; }
}

.invite-type-action { margin-bottom: .85rem; }
.invite-timer { font-variant-numeric: tabular-nums; }

.toast[data-kind="success"], .copy-status {
  background: #eee6ff;
  color: #36206d;
  border: 1px solid #cbb9ef;
}

/* My family */
[data-current-route="family"] .main-content { margin-top: 0; padding-top: 1rem; }
.family-page {
  --family-accent: #5225ae;
  --family-line: #b9a3ee;
  --family-surface: #f8f6ff;
  --family-tile: #eee7fa;
  display: grid;
  gap: 1rem;
}
body[data-theme="dark"] .family-page {
  --family-accent: #d5c2ff;
  --family-line: #685691;
  --family-surface: #28263d;
  --family-tile: #372c54;
}
.family-page h2, .family-page h3, .family-page h4 { margin: 0; }
.family-page-header, .family-header-actions, .family-metrics, .family-row-actions, .family-invite-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.family-page-header { justify-content: space-between; align-items: end; }
.family-page-header h2 { margin-bottom: .55rem; }
.family-metric {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 8.5rem;
  padding: .45rem .7rem;
  border: 1px solid #ffffffa1;
  border-radius: .85rem;
  background: var(--family-tile);
}
.family-metric > span, .family-group-icon {
  display: grid;
  flex: none;
  place-items: center;
  border-radius: .65rem;
  color: #fff;
  background: linear-gradient(145deg,#a276f4,#6328db);
}
.family-metric > span { width: 2.55rem; height: 2.55rem; }
.family-metric.good { background: #def4e7; color: #145b36; }
.family-metric.good > span { background: linear-gradient(155deg,#59cf77,#158748); }
.family-metric.bad { background: #f9e2e9; color: #822139; }
.family-metric.bad > span { background: #a93457; }
.family-metric strong, .family-metric small, .family-row-cell strong, .family-row-cell small,
.family-row-person small, .family-role-grid small { display: block; overflow-wrap: anywhere; }
.family-metric small, .family-row-cell small, .family-row-person small, .family-role-grid small { color: var(--muted); }
.family-metric strong, .family-row-cell strong { font-size: .9rem; }
.family-metric small, .family-row-person small, .family-row-cell small, .family-role-grid small { font-size: .8rem; }
.family-page .family-tree { position: relative; display: grid; gap: .85rem; padding-left: 2rem; }
.family-page .family-tree::before {
  content: "";
  position: absolute;
  inset: .85rem auto 1rem .78rem;
  border-left: 1px solid var(--family-line);
}
.family-page .family-group { min-width: 0; }
.family-page .family-group h3 {
  position: relative;
  margin: 0 0 .45rem;
  color: var(--family-accent);
  font-size: 1rem;
}
.family-group-icon {
  position: absolute;
  top: -.15rem;
  left: -2rem;
  width: 1.55rem;
  height: 1.55rem;
  border: 2px solid var(--family-surface);
  border-radius: 50%;
}
.family-group-icon svg { width: .95rem; height: .95rem; }
.family-page .member-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: .5rem; }
.family-card {
  display: grid;
  grid-template-columns: minmax(10rem, 1.15fr) minmax(8.5rem, .8fr) minmax(9rem, 1.05fr) 13rem;
  align-items: center;
  gap: .6rem;
  min-width: 0;
  padding: .55rem .8rem;
  border: 1px solid #ffffffa1;
  border-radius: .95rem;
  background: var(--family-surface);
  box-shadow: 0 5px 12px #38228118;
}
.family-card--adult .family-row-policy { grid-column: 2 / 4; }
.family-row-person, .family-row-cell { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.family-row-person h4 { font-size: 1rem; overflow-wrap: anywhere; }
.family-row-person > div, .family-row-cell > div { min-width: 0; }
.family-row-person .avatar { flex: none; width: 2.6rem; height: 2.6rem; font-size: 1.05rem; }
.family-owner-mark { color: #a55c00; display: inline-block; margin-right: .3rem; }
.family-owner-mark svg { width: .9rem; height: .9rem; }
.family-row-cell { border-left: 1px solid var(--family-line); padding-left: .7rem; min-height: 2.25rem; }
.family-row-cell > svg, .family-bottom-card h3 > svg, .family-role-grid strong > svg { color: var(--family-accent); }
.family-online::before {
  content: "";
  display: inline-block;
  width: .48rem;
  height: .48rem;
  margin-right: .3rem;
  border-radius: 50%;
  background: #737687;
}
.family-online.is-online::before { background: #169952; }
.family-row-policy .pill { white-space: normal; }
.family-row-actions { justify-content: end; }
.family-row-actions button { padding: .45rem .6rem; font-size: .83rem; }
.family-row-actions button svg { width: 1rem; height: 1rem; }
.family-row-actions [data-action="member-menu"] { min-width: 44px; border-radius: 50%; }
.family-bottom { display: flex; flex-wrap: wrap; gap: .75rem; }
.family-bottom-card {
  flex: 2 1 30rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid #ffffffb0;
  border-radius: 1rem;
  background: var(--family-tile);
}
.family-bottom-card:has(.family-invite-actions) { flex: 1 1 17rem; }
.family-bottom-card h3 {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--family-accent);
  font-size: 1rem;
}
.family-bottom-card p { margin: .55rem 0; font-size: .88rem; }
.family-role-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem; margin-top: .55rem; }
.family-role-grid > div { padding: .55rem; background: var(--family-surface); border-radius: .65rem; }
.family-role-grid strong { display: flex; align-items: center; gap: .35rem; font-size: .85rem; overflow-wrap: anywhere; }
.family-role-grid strong > svg { width: 1.1rem; height: 1.1rem; }
.family-role-grid small { margin-top: .25rem; }
.family-member-menu { display: flex; flex-wrap: wrap; gap: .5rem; }
@media(max-width:1050px) {
  .family-card { grid-template-columns: minmax(8rem,1fr) minmax(8rem,1fr) minmax(8rem,1fr); }
  .family-row-actions { grid-column: 1/-1; }
}
@media(max-width:650px) {
    .family-page .family-tree { padding-left: 1.6rem; }
  .family-page .family-tree::before { left: .58rem; }
  .family-group-icon { left: -1.6rem; width: 1.25rem; height: 1.25rem; top: 0; }
  .family-card { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .family-row-person, .family-card--adult .family-row-policy { grid-column: 1/-1; }
  .family-row-cell { border-left: 0; padding-left: 0; align-items: start; }
  .family-row-cell > svg { width: 1rem; height: 1rem; }
  .family-row-actions { justify-content: start; }
  .family-role-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.family-header-actions button {
  gap: .4rem;
  padding: .5rem .75rem;
  font-size: .85rem;
}
.family-header-actions svg { width: 1.15rem; height: 1.15rem; }
.family-row-policy:empty { border: 0; }
.family-row-actions { grid-column: -2/-1; }
@media(min-width:761px) {
}
@media(max-width:1050px) {
  .family-row-actions { grid-column: 1/-1; }
}

[data-modal-form="approve-device"] + .invite-renew-actions {
  margin-block-start: .75rem;
}

/* Звонки */
.calls-page { display: grid; grid-template-columns: minmax(0,1fr) minmax(14rem,19rem); gap: .75rem; }
.calls-main, .calls-content, .calls-aside { display: grid; gap: .75rem; min-width: 0; align-content: start; }
.call-picker h2, .call-settings h2, .call-guide h2 { font-size: 1.05rem; margin: 0 0 .65rem; }
.call-picker > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.call-picker .form-field, .call-filters .form-field { margin-bottom: 0; min-width: 0; }
.call-summary { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: .7rem; }
.call-summary > div { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.call-summary > div + div { padding-left: .65rem; border-left: 1px solid var(--line); }
.call-summary svg, .call-settings h2 svg, .call-guide h2 svg { color: var(--purple); flex: none; }
.call-health.good svg { color: var(--good); }
.call-health.bad svg { color: var(--bad); }
.call-summary strong, .call-summary small { display: block; overflow-wrap: anywhere; }
.call-summary small { color: var(--muted); margin-top: .2rem; }
.call-settings fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.call-settings legend { font-weight: 700; margin-bottom: .5rem; }
.call-mode { display: flex; gap: .5rem; align-items: start; padding: .45rem 0; cursor: pointer; }
.call-mode input { accent-color: var(--purple); }
.call-mode small { display: block; color: var(--muted); margin-top: .18rem; }
.call-settings .form-field { margin-top: .7rem; }
.call-guide ul { margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.call-guide li { position: relative; padding-left: 1.15rem; margin-bottom: .5rem; }
.call-guide li::before { content: '✓'; position: absolute; left: 0; font-weight: 750; color: var(--good); }
.calls-tabs, .call-filters, .call-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.calls-tabs button { flex: 1 1 auto; font-size: .9rem; }
.call-filters { align-items: flex-end; margin-bottom: .8rem; }
.call-filters .form-field { flex: 1 1 11rem; }
.call-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.call-table th, .call-table td { padding: .45rem .35rem; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.call-table th { color: var(--muted); background: var(--panel); }
.call-table td:first-child .avatar { width: 1.85rem; height: 1.85rem; display: inline-grid; vertical-align: middle; margin-right: .3rem; font-size: .8rem; }
.call-category { display: inline-block; border-radius: 2rem; padding: .2rem .5rem; background: #eee7fa; color: #592bab; }
.call-actions button { min-height: 44px; min-width: 44px; padding: .42rem .55rem; font-size: .8rem; }
.call-actions svg { width: 1rem; height: 1rem; }
.call-sr { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media(max-width:1140px) {
  .calls-page { grid-template-columns: minmax(0,1fr); }
  .calls-aside { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:650px) {
  .call-picker > div, .calls-aside, .call-summary { grid-template-columns: minmax(0,1fr); }
  .call-summary > div + div { padding: .55rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .call-table, .call-table tbody { display: block; }
  .call-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .call-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .25rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
  .call-table td { border: 0; min-width: 0; }
  .call-table td:last-child { grid-column: 1/-1; }
}

@media (min-width: 1051px) {
  .family-row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    justify-items: end;
  }
  .family-row-actions > button { grid-column: 1; }
  .family-row-actions > [data-action="member-menu"] { grid-column: 2; }
}

/* Allowed number editor */
.call-entry-options {
  display: grid;
  gap: .5rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.call-entry-options legend {
  padding: 0;
  margin-bottom: .45rem;
  font-weight: 650;
  color: var(--ink);
}
.call-entry-options .check {
  display: flex;
  gap: .65rem;
  min-height: 44px;
  padding: .5rem .65rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--panel);
  cursor: pointer;
}
.call-entry-options input {
  flex: none;
  margin: 0;
}
.call-entry-options .check span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
[data-modal-form="call-entry"] .call-entry-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}
@media(max-width:480px) {
  [data-modal-form="call-entry"] .call-entry-actions > button {
    width: 100%;
  }
}

.pill.blocked { background: #fbe1e6; color: #96213a; }
body[data-theme="dark"] .pill.blocked { background: #562433; color: #ffd2da; }

.startup-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}
.startup-menu { display: grid; gap: 1rem; padding: 1rem .65rem; }
.startup-menu span { width: 68%; height: .8rem; border-radius: .4rem; background: #fff2; }
.startup-cards { display: grid; gap: 1rem; }
.startup-cards .card { min-height: 5.25rem; }
.startup-cards .card + .card { min-height: 10rem; }

.restriction-actions { flex-wrap: wrap; justify-content: flex-end; }
@media(max-width:380px) {
  .card-head:has(> .restriction-actions) { flex-wrap: wrap; }
  .restriction-actions { justify-content: flex-start; max-width: 100%; }
}
.restriction-emojis { border: 0; margin: 0; padding: 0; min-width: 0; }
.restriction-emojis legend { padding: 0; font-weight: 700; margin-bottom: .75rem; }
.restriction-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.restriction-choices label {
  min-width: 0; display: grid; place-items: center; gap: .35rem; padding: .55rem .15rem;
  border: 1px solid var(--line); border-radius: .85rem; background: var(--panel);
  text-align: center; cursor: pointer; font-size: .85rem; overflow-wrap: anywhere;
}
.restriction-choices label:has(:checked) { outline: 2px solid #8658e9; outline-offset: -2px; }
.restriction-choices input { margin: 0; }
.restriction-choices img { width: min(100%, 80px); height: 66px; object-fit: contain; }

/* Device sections keep a stable scrollbar gutter while their content loads. */
html:has(.app-view:is([data-current-route="devices"],[data-current-route="apps"],[data-current-route="calls"],[data-current-route="internet"],[data-current-route="location"],[data-current-route="schedules"],[data-current-route="reports"]):not([hidden])) {
  scrollbar-gutter: stable;
}
.device-page-content { min-width: 0; }
.device-dashboard { min-width: 0; }
.device-dashboard,.device-selector { --device-surface: #faf9ff; }
body[data-theme="dark"] :is(.device-dashboard,.device-selector) { --device-surface: #1e1f41; }
.device-selector .device-choice,.device-dashboard .device-overview-head {
  background: var(--device-surface);
  backdrop-filter: none;
}
.device-selector {
  display: grid; grid-template-columns: max-content minmax(0,1fr) auto;
  align-items: center; gap: .9rem; margin-bottom: 1rem; min-width: 0;
}
.device-selector h2 { margin: 0; font-size: 1.03rem; }
.device-selector:not(:has(> button)) { grid-template-columns: max-content minmax(0,1fr); }
.apps-controls label { grid-column: 1/-1; }
.device-selector > button { grid-column: 3; white-space: nowrap; }
.device-strip {
  position: relative; display: flex; gap: .75rem; min-width: 0;
  overflow-x: auto; overscroll-behavior-x: contain; padding: .15rem .15rem .45rem;
}
.device-choice {
  flex: 1 0 13rem; max-width: 18rem; display: flex; align-items: center; gap: .6rem;
  min-width: 0; padding: .5rem .65rem; border: 2px solid transparent; text-align: left;
  border-radius: 1rem; background: var(--panel); color: inherit; text-decoration: none;
  box-shadow: 0 .22rem .5rem #21135216;
}
.device-selector .device-choice[aria-current="true"] {
  --device-selected-border: #6532d5;
  background: #e9ddff;
  border-color: var(--device-selected-border);
  box-shadow: inset 0 0 0 1px var(--device-selected-border), 0 .22rem .55rem #4222872b;
}
body[data-theme="dark"] .device-selector .device-choice[aria-current="true"] {
  --device-selected-border: #b89aff;
  background: #392a62;
}
.device-choice-check {
  position: absolute; right: -.28rem; bottom: -.16rem; width: 1rem; height: 1rem;
  display: grid; place-items: center; border-radius: 50%; color: #fff; background: #602dcd;
}
.device-choice-check svg { width: .7rem; height: .7rem; }
.device-choice:focus-visible { outline: 2px solid var(--purple); outline-offset: -2px; }
.device-choice .phone-shape { width: 1.4rem; height: 2.45rem; flex: none; border-width: 2px; }
.device-choice .phone-shape::before { width: 45%; height: 3px; left: 50%; transform: translateX(-50%); }
.device-choice-name { flex: 1; display: grid; gap: .12rem; min-width: 0; overflow-wrap: anywhere; }
.device-choice-name > span { color: var(--muted); font-size: .83rem; }
.device-online { display: inline-flex; align-items: center; gap: .35rem; flex: none; white-space: nowrap; }
.device-online::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.device-online.offline { color: var(--muted); background: var(--line); }
.device-tabs svg { width: 1.15rem; height: 1.15rem; }
.device-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .64rem .86rem; text-align: center; }
.device-overview-head {
  display: grid; grid-template-columns: minmax(13rem,1fr) minmax(0,2fr) auto;
  align-items: center; gap: 1rem; padding: .9rem 1.15rem;
}
.device-identity,.device-owner,.device-head-actions { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.device-identity .phone-shape { width: 3.35rem; height: 5.9rem; flex: none; }
.device-identity h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0 0 .7rem; overflow-wrap: anywhere; }
.device-owner strong,.device-owner small,.device-status-banner small { display: block; overflow-wrap: anywhere; }
.device-owner small { color: var(--muted); margin-top: .15rem; }
.device-head-actions { align-items: stretch; flex-direction: column; }
.device-telemetry { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin: 0; }
.device-telemetry div { border-inline-start: 1px solid var(--line); padding: .4rem .65rem; overflow-wrap: anywhere; }
.device-telemetry dt { color: var(--muted); font-size: .79rem; }
.device-telemetry dd { margin: .35rem 0 0; font-size: .89rem; font-weight: 700; }
.device-telemetry dd .pill { white-space: normal; }
.device-tabs { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: .45rem; margin: 1.1rem 0; }
.device-tabs .device-button { padding-inline: .25rem; min-width: 0; font-size: .88rem; }
.device-tabs [aria-disabled="true"] { opacity: .55; cursor: default; }
.device-dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 1.23fr; gap: .9rem; }
.device-dashboard-grid > div { display: grid; gap: .85rem; align-content: start; min-width: 0; }
.device-dashboard-grid .card { min-width: 0; }
.device-page-content > .card + .card { margin-top: .9rem; }
.device-status-banner { display: flex; align-items: center; gap: .65rem; padding: .85rem; border-radius: .8rem; background: var(--line); }
.device-status-banner.good { background: #209a491a; }
.device-status-banner.bad { background: #bd29451a; }
.device-status-banner svg { flex: none; width: 1.9rem; height: 1.9rem; color: var(--purple); }
.device-status-banner.good svg { color: var(--good); }
.device-status-banner small { color: var(--muted); margin-top: .18rem; }
.device-status-rows { margin: .5rem 0 0; }
.device-status-rows > div { display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: .38rem 0; border-bottom: 1px solid var(--line); }
.device-status-rows dd { margin: 0; text-align: end; }
.device-status-rows .pill { white-space: normal; overflow-wrap: anywhere; }
.device-time strong { font-size: 1.35rem; }
.device-progress { display: flex; align-items: center; gap: .6rem; }
.device-progress progress { width: 100%; min-width: 0; accent-color: var(--purple); }
.device-schedules { padding: 0; margin: 0; list-style: none; }
.device-schedules li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  align-items: center;
  gap: .45rem;
  padding: .65rem;
  margin-top: .35rem;
  background: var(--line);
  border-radius: .6rem;
}
.device-schedules li > :first-child { overflow-wrap: anywhere; }
.device-schedules li > :nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.device-schedules li > :last-child { justify-self: end; max-width: 100%; text-align: end; overflow-wrap: anywhere; }
.device-location { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .65rem; align-items: center; }
.device-location-map { display: grid; min-height: 5.5rem; padding: .4rem; text-align: center; border-radius: .65rem;
  background: repeating-linear-gradient(90deg,transparent 0 1.5rem,var(--line) 1.5rem calc(1.5rem + 1px)),
    repeating-linear-gradient(0deg,transparent 0 1.5rem,var(--line) 1.5rem calc(1.5rem + 1px)); }
.device-location-map svg { color: var(--purple); width: 1.65rem; height: 1.65rem; }
@media(max-width:1240px) {
  .device-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .device-overview-head { grid-template-columns: minmax(12rem,1fr) minmax(0,2fr); }
  .device-head-actions { grid-column: 1/-1; flex-direction: row; flex-wrap: wrap; }
  .device-dashboard-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .device-selector { grid-template-columns: minmax(0,1fr) auto; gap: .45rem .55rem; }
  .device-selector > button { grid-column: 2; grid-row: 1; white-space: normal; }
  .device-selector:not(:has(> button)) { grid-template-columns: minmax(0,1fr); }
  .device-strip { grid-column: 1/-1; grid-row: 2; }
  .device-choice { flex-basis: 12rem; }
  .device-dashboard-grid,.device-overview-head { grid-template-columns: minmax(0,1fr); }
  .device-tabs,.device-telemetry { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .device-head-actions { grid-column: auto; }
  .device-tabs .device-button { padding-inline: .4rem; }
}

.guardian-update { display:grid; gap:1rem; }
.guardian-update p, .guardian-update form, .guardian-update dl, .guardian-update dd { margin:0; }
.guardian-update-target { color:var(--muted); font-weight:600; overflow-wrap:anywhere; }
.guardian-update-versions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; }
.guardian-update-versions > div { min-width:0; padding:.75rem .9rem; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.guardian-update-versions dt { color:var(--muted); font-size:.83rem; }
.guardian-update-versions dd { font-size:1.25rem; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.guardian-update-state p { margin-top:.2rem; color:var(--muted); font-size:.9rem; line-height:1.5; }
.guardian-update-actions { display:flex; flex-wrap:wrap; gap:.625rem; align-items:center; }
.guardian-update-actions button { min-height:44px; }
#modal:has(.guardian-update) #modalMessage:empty { display:none; }
@media (max-width:520px) {
  .guardian-update { gap:.8rem; }
  .guardian-update-actions { align-items:stretch; flex-direction:column; }
  .guardian-update-actions .copy-control > button { width:100%; }
}

.device-map-plot { position: relative; width: min(100%,12rem); aspect-ratio: 1; margin: auto; }
.device-map-zone { position: absolute; aspect-ratio: 1; transform: translate(-50%,-50%); border: 1px solid #459861; border-radius: 50%; background: #56bc6a32; }
.device-map-point { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-88%); }
.device-location-map small { overflow-wrap: anywhere; }

.device-dashboard .card-head { flex-wrap: wrap; }

/* Мобильные правила */
#modal[data-kind="mobile-rules"][open] {
  width: min(94vw, 760px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#modal[data-kind="mobile-rules"] .modal-head {
  margin: 0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg,#7240db21,#7240db08);
}
#modal[data-kind="mobile-rules"] .modal-head h2 { display: flex; align-items: center; gap: .65rem; margin: 0; }
#modal[data-kind="mobile-rules"] .modal-head h2::before {
  display: block; content: ""; flex: none; width: 2rem; height: 2.35rem;
  background: url('/assets/assets/guardian-shield.png') center / contain no-repeat;
}
#modal[data-kind="mobile-rules"] #modalBody { overflow-y: auto; overscroll-behavior: contain; padding: .85rem 1.25rem 0; }
#modal[data-kind="mobile-rules"] #modalMessage { margin: 0; padding: .55rem 1.25rem; }
#modal[data-kind="mobile-rules"] #modalMessage:empty { display: none; }
.mobile-rules-intro { color: var(--muted); margin: 0 0 .8rem; }
.mobile-rule-section { padding: .85rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.mobile-rule-section h3 { display: flex; align-items: center; gap: .55rem; margin: 0 0 .65rem; font-size: 1rem; }
.mobile-rule-section h3 svg,.mobile-accordion summary svg { width: 1.3rem; height: 1.3rem; color: var(--purple); flex: none; }
.mobile-editor-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; align-items: end; }
.mobile-presets,.mobile-inline-actions,.mobile-selected { display: flex; flex-wrap: wrap; gap: .4rem; }
.mobile-accordion,.mobile-item,.mobile-request {
  margin: .65rem 0; border: 1px solid var(--line); border-radius: .75rem;
  background: linear-gradient(125deg,#8354d812,#8354d806);
}
.mobile-accordion summary,.mobile-item summary { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .72rem; cursor: pointer; list-style: none; }
.mobile-accordion summary::-webkit-details-marker,.mobile-item summary::-webkit-details-marker { display: none; }
.mobile-accordion summary span { flex: 1; }
.mobile-accordion summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .16s; margin: 0 .2rem .2rem; flex: none; }
.mobile-accordion[open] summary::after { transform: rotate(225deg); }
.mobile-accordion-body,.mobile-item-body,.mobile-request { padding: .2rem .75rem .75rem; }
.mobile-accordion[open] .mobile-accordion-body { animation: mobile-expand .16s ease-out; }
@keyframes mobile-expand { from {opacity:0;transform:translateY(-.25rem)} to {opacity:1;transform:translateY(0)} }
@media(prefers-reduced-motion:reduce) { .mobile-accordion[open] .mobile-accordion-body { animation:none; } }
.mobile-item summary small,.mobile-app-row small,.mobile-request small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.mobile-app-list { max-height: 17rem; overflow-y: auto; }
.mobile-app-row { display: grid; grid-template-columns: auto auto minmax(0,1fr) auto; align-items: center; gap: .5rem; padding: .45rem .15rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mobile-app-row input,.mobile-switch input,.mobile-days input { width: auto; margin: 0; accent-color: var(--purple); }
.mobile-selected { margin: .4rem 0; }
.mobile-app-chip { border: 1px solid var(--line); border-radius: .55rem; background: var(--panel); color: var(--ink); padding: .32rem .48rem; overflow-wrap: anywhere; }
.mobile-days { display: flex; flex-wrap: wrap; gap: .4rem; border: 0; padding: .3rem 0 .6rem; min-width: 0; }
.mobile-days label { display: flex; align-items: center; gap: .28rem; padding: .27rem .37rem; border-radius: .4rem; background: var(--panel); }
.mobile-switch { display: flex; align-items: center; justify-content: space-between; gap: .6rem; cursor: pointer; }
.mobile-switch input { appearance: none; width: 2.65rem; height: 1.4rem; padding: 0; background: #797b97; border-radius: 1rem; flex: none; }
.mobile-switch input::before { content: ""; display: block; width: 1.02rem; height: 1.02rem; margin: .125rem; border-radius: 50%; background: white; transition: transform .16s; }
.mobile-switch input:checked { background: #168647; }
.mobile-switch input:checked::before { transform: translateX(1.15rem); }
.mobile-zones-map {
  display: block; position: relative; width: min(100%,22rem); aspect-ratio: 1.65; overflow: hidden; border: 1px solid var(--line);
  border-radius: .7rem; background-color: var(--panel); cursor: crosshair;
  background-image: linear-gradient(90deg,var(--line) 1px,transparent 1px),linear-gradient(var(--line) 1px,transparent 1px);
  background-size: 20% 20%;
}
.mobile-zones-map .device-map-zone { aspect-ratio: 1.65; }
.mobile-map-pin { position: absolute; transform: translate(-50%,-80%); color: var(--purple); pointer-events: none; }
.mobile-map-pin svg { width: 1.4rem; height: 1.4rem; }
.mobile-domain-add { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .65rem; align-items: end; }
.mobile-domain { display: flex; align-items: center; justify-content: space-between; gap: .45rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mobile-request { display: grid; padding-top: .7rem; gap: .25rem; justify-items: start; }
.mobile-request form { width: 100%; }
.mobile-request button[value="approved"] { background: #168647; color: white; }
.mobile-request button[value="denied"] { color: var(--bad); }
.mobile-rules-footer {
  position: sticky; bottom: 0; display: flex; gap: .55rem; justify-content: flex-end; flex-wrap: wrap;
  padding: .8rem 0; background: #f8f7ff; border-top: 1px solid var(--line); z-index: 1;
}
body[data-theme="dark"] .mobile-rules-footer { background: #292942; }
.mobile-rules-footer button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.mobile-rules-footer svg { width: 1.1rem; height: 1.1rem; }
@media(max-width:500px) {
  #modal[data-kind="mobile-rules"][open] { width: calc(100vw - 16px); }
  #modal[data-kind="mobile-rules"] .modal-head,#modal[data-kind="mobile-rules"] #modalBody { padding-inline: .75rem; }
  .mobile-editor-columns { gap: .45rem; }
  .mobile-app-row { grid-template-columns: auto auto minmax(0,1fr); }
  .mobile-app-row > small { grid-column: 3; }
  .mobile-rules-footer button:first-child { flex: 1; }
}

.mobile-rules-footer .modal-toast {
  position: absolute;
  inset: auto 0 calc(100% + .35rem) auto;
  transform: none;
  max-width: 100%;
  margin: 0;
  pointer-events: none;
}

.app-category-select{width:100%;max-width:16rem;min-height:42px;padding:.45rem .55rem;font-size:inherit}
.app-category-mobile{display:none}
@media(max-width:760px){
  .app-category-mobile{display:block;max-width:min(100%,10rem);margin-top:.35rem;font-size:.85rem}
  .app-table td .app-meta{min-width:0}
  .app-table td .app-meta small{overflow-wrap:anywhere}
}

#modal[data-kind="device-editor"][open] {
  display: flex;
  flex-direction: column;
  width: min(94vw, 830px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}
#modal[data-kind="device-editor"] .modal-head {
  align-items: flex-start;
  margin: 0;
  padding: 1rem clamp(.85rem, 3vw, 1.8rem);
  background: linear-gradient(110deg, #9754e40c, #9754e43b);
  border-bottom: 1px solid var(--line);
}
#modal[data-kind="device-editor"] #modalTitle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .35rem 1.1rem;
  align-items: center;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
#modal[data-kind="device-editor"] .phone-shape {
  grid-row: span 2;
  width: 2.75rem;
  height: 4.65rem;
  transform: rotate(7deg);
}
.device-editor-status {
  justify-self: start;
  border-radius: .5rem;
  padding: .27rem .65rem;
  font-size: .85rem;
  color: var(--ink);
  background: #8065be23;
}
.device-editor-status {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  font-weight: 750;
}
.device-editor-status::before {
  content: "";
  height: .62rem;
  width: .62rem;
  border-radius: 50%;
  background: #736d93;
}
.device-editor-status.online { color: #08732a; background: #d9f6d9; }
.device-editor-status.online::before { background: #1bad35; }
#modal[data-kind="device-editor"] #modalBody {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 clamp(.85rem, 3vw, 1.8rem) 1.15rem;
}
#modal[data-kind="device-editor"] #modalMessage { margin: 0; padding: .55rem 1.2rem; }
#modal[data-kind="device-editor"] #modalMessage:empty { display: none; }
.device-editor-section, .device-editor-histories { padding: .9rem 0; }
.device-editor-section + .device-editor-section, .device-editor-section + .device-editor-histories {
  border-top: 1px solid var(--line);
}
.device-editor-section h3, .device-editor-history h3 { margin: 0 0 .65rem; }
.device-editor-grid, .device-editor-histories { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.device-editor-grid { align-items: stretch; }
.device-editor-owner { display: flex; flex-direction: column; }
.device-editor-owner > [data-owner-avatar] { flex: 1; display: grid; place-items: center; }
.device-editor-owner:has(> [data-owner-avatar]:not([hidden])) > .form-field { margin-bottom: 0; }
.device-editor-owner-details, .device-editor-section [data-new-owner] { margin: 0; min-width: 0; }
.device-editor-owner-details { padding: 0; border: 0; }
.device-editor-new-owner-fields { display: flex; flex-wrap: wrap; column-gap: .85rem; }
.device-editor-new-owner-fields > .form-field { flex: 1 1 8rem; min-width: 0; }
.device-editor-new-owner-fields > .form-field:has(select) { flex: 1.4 1 15rem; }
.device-birthday-field { position: relative; }
.device-birthday-field .toast {
  position: absolute;
  inset: auto 0 calc(100% + .35rem);
  transform: none;
  max-width: none;
  padding: .65rem .8rem;
  background: #fff0f3;
  color: #871f3c;
  border: 1px solid #edb5c2;
  pointer-events: none;
}
.device-editor-section [data-new-owner] { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: .8rem; }
.device-editor-owner.needs-owner select {
  border: 2px solid #763eed;
  box-shadow: 0 0 0 3px #9b69f629;
}
.device-editor-save { justify-content: flex-end; }
#modal[data-kind="device-editor"] h3 { display: flex; gap: .55rem; align-items: center; }
#modal[data-kind="device-editor"] svg { width: 1.35rem; height: 1.35rem; flex: none; }
#modal[data-kind="device-editor"] h3 svg, .device-editor-facts svg { color: #713aff; }
#modal .device-editor-facts svg {
  width: 1.5rem;
  height: 1.5rem;
  filter: drop-shadow(0 2px 3px #8d55f733);
}
#modal .device-fact-android dt svg { color: #16a638; filter: drop-shadow(0 2px 3px #36ab3933); }
.device-editor-save .primary { display: inline-flex; align-items: center; gap: .5rem; }
.device-editor-actions { align-items: stretch; }
.device-action-control {
  position: relative;
  display: flex;
  flex: 1 1 11rem;
  min-width: 0;
}
.device-action-control > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: .65rem;
  min-height: 3.85rem;
  padding: .5rem .65rem;
  line-height: 1.2;
  border: 1px solid #9c80ff;
  background: linear-gradient(180deg, #8455ee07, #8455ee13);
}
.device-action-control > button.danger {
  color: #b31527;
  border-color: #f1a5ae;
  background: linear-gradient(180deg, #fbe8eb, #f9d6dc);
}
.device-editor-facts {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  margin: 0;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .95rem;
  background: var(--panel);
  text-align: center;
}
.device-editor-facts > div { min-width: 0; padding: .3rem; }
.device-editor-facts > div + div { border-inline-start: 1px solid var(--line); }
.device-editor-facts dt { display: grid; justify-items: center; gap: .25rem; }
.device-fact-family dd span { display: inline-block; padding: .1rem .55rem; border-radius: 1rem; background: #a080f432; }
.device-editor-facts dt, .device-editor-history time { color: var(--muted); font-size: .85rem; }
.device-editor-facts dd { margin: .2rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.device-editor-history .device-history-entry {
  margin-bottom: .4rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--panel);
  overflow-wrap: anywhere;
}
#modal .device-editor-history h3 {
  display: flex;
  align-items: center;
  gap: .55rem;
}
#modal .device-editor-history svg { width: 1.3rem; height: 1.3rem; flex: none; }
#modal .device-editor-history h3 svg { color: #773ff4; }
.device-editor-history summary, .device-history-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .72rem;
  align-items: center;
  padding: .55rem .75rem;
  list-style: none;
}
.device-editor-history summary { cursor: pointer; }
.device-editor-history summary::-webkit-details-marker { display: none; }
.device-editor-history summary > svg { color: var(--muted); transition: transform .15s; }
.device-editor-history details[open] > summary > svg { transform: rotate(90deg); }
.device-history-marker {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #773ff4;
  background: #8c60ea10;
}
.device-history-marker.check { color: #1f8c44; background: #dff4e3; }
.device-history-marker.alert { color: #b31527; background: #fbe8eb; }
.device-editor-history time { display: block; }
.device-editor-history .device-history-entry p { margin: 0; padding: 0 .75rem .65rem 3.45rem; }
@media (min-width: 581px) {
  .device-editor-history + .device-editor-history { border-inline-start: 1px solid var(--line); padding-inline-start: .85rem; }
}

@media (max-width: 580px) {
  .device-editor-grid, .device-editor-histories { grid-template-columns: minmax(0,1fr); }
  .device-editor-facts { grid-template-columns: repeat(2,minmax(0,1fr)); text-align: start; }
  .device-editor-facts > div + div { border: 0; }
  .device-editor-facts dt { justify-items: start; }
}

.profile-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  flex: none;
  margin: 0;
  border: 1px solid #bca9ef;
  border-radius: .7rem;
  color: #6233bf;
  background: #e7dbfb;
  overflow: hidden;
}
.profile-avatar-picker { cursor: pointer; }
.profile-avatar-picker:focus-within { outline: 2px solid #773ff4; outline-offset: 2px; }
.profile-avatar-picker:has(input:disabled) { opacity: .65; cursor: progress; }
.profile-avatar [data-owner-avatar-preview] { display: grid; place-items: center; width: 100%; height: 100%; }
.profile-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: inherit;
}
.device-owner-upload {
  display: grid;
  justify-items: center;
  gap: .5rem;
  margin-block: .55rem;
}
.device-owner-upload .profile-avatar {
  width: clamp(5.25rem, 16vw, 8.5rem);
  height: auto;
  aspect-ratio: 1;
  border-radius: 1rem;
}
#modal .device-owner-upload .profile-avatar svg { width: 2rem; height: 2rem; }
.device-owner-upload [data-avatar-message] { grid-column: 1 / -1; margin: 0; }
.device-owner-upload [data-avatar-message]:empty { display: none; }

#modalClose { display: grid; flex: none; place-items: center; padding: 0; }
#modalClose svg { display: block; width: 1.125rem; height: 1.125rem; }

.device-action-control .device-action-toast {
  position: absolute;
  inset: auto auto calc(100% + .4rem) 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
  padding: .55rem .7rem;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}
.device-history-more > summary {
  display: flex;
  gap: .35rem;
  width: fit-content;
  padding: .4rem 0;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
}
.device-history-more > summary span:last-child,
.device-history-more[open] > summary span:nth-child(2) { display: none; }
.device-history-more[open] > summary span:last-child { display: inline; }

.device-editor-main {
  grid-template-areas: "owner details" "owner new" "owner consent" "owner save";
  row-gap: 0;
}
.device-editor-main > .device-editor-owner { grid-area: owner; }
.device-editor-main > [data-owner-details] { grid-area: details; }
.device-editor-main > [data-new-owner] { grid-area: new; }
.device-editor-main > [data-owner-consent] { grid-area: consent; }
.device-editor-main > .device-editor-save { grid-area: save; }
@media (min-width: 581px) {
  .device-editor-main { grid-template-columns: clamp(11rem, 28%, 14rem) minmax(0, 1fr); }
  .device-editor-main > .device-editor-owner { margin-bottom: -.9rem; }
}
@media (max-width: 580px) {
  .device-editor-main { grid-template-areas: "owner" "new" "details" "consent" "save"; }
}

@media (max-width: 420px) {
  #modal[data-kind="device-editor"] { max-width: none; }
  #modal[data-kind="device-editor"] #modalBody { padding-inline: .65rem; }
  .device-editor-section [data-new-owner] { padding-inline: .55rem; }
  .device-editor-new-owner-fields select { padding-inline: .55rem 1.4rem; font-size: .9rem; }
}


/* Device scheduling tab */
.schedule-page { padding: 1.35rem 1.65rem 1.35rem; }
.schedule-page-head, .schedule-page-title, .schedule-master, .schedule-modes,
.schedule-graph-head, .schedule-graph-head h3, .schedule-table-name, .schedule-table-clock,
.schedule-table-days, .schedule-effect, .schedule-tools, .schedule-add, .schedule-legend li {
  display: flex;
  align-items: center;
}
.schedule-page-head, .schedule-graph-head { justify-content: space-between; gap: 1rem; }
.schedule-page-title { gap: 1.35rem; }
.schedule-page-title > svg, .schedule-graph-head h3 > svg { color: #6627e0; width: 2.35rem; height: 2.35rem; }
.schedule-page-title h2 { margin: 0 0 .13rem; font-size: 1.25rem; }
.schedule-page-title p { margin: 0; font-size: .84rem; color: var(--muted); }
.schedule-page-title .schedule-delivery { margin-top: .23rem; font-size: .76rem; }
.schedule-master { gap: .85rem; justify-content: flex-end; font-size: .9rem; font-weight: 600; }
.schedule-switch { position: relative; display: inline-flex; align-items: center; flex: none; cursor: pointer; }
.schedule-switch input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit;
}
.schedule-switch > span {
  width: 2.8rem; height: 1.47rem; border-radius: 2rem; background: #bdb8d1;
  position: relative; pointer-events: none;
}
.schedule-switch > span::before {
  content: ""; position: absolute; width: 1.13rem; height: 1.13rem; inset: .17rem auto auto .17rem;
  border-radius: 50%; background: white; box-shadow: 0 1px 3px #392c5a44;
}
.schedule-switch input:checked + span { background: linear-gradient(108deg,#963ffe,#5424d3); }
.schedule-switch input:checked + span::before { left: 1.5rem; }
.schedule-switch input:focus-visible + span { outline: 2px solid #7836ee; outline-offset: 3px; }
.schedule-switch input:disabled + span { opacity: .55; }
.schedule-modes { gap: .75rem; margin: 1rem 0 1.15rem; align-items: stretch; flex-wrap: wrap; }
.schedule-modes button {
  min-height: 3.8rem; min-width: 19.6rem; display: flex; align-items: center; gap: 1rem;
  padding: .5rem 1.55rem; text-align: left; line-height: 1.25;
}
.schedule-modes .primary { background: linear-gradient(110deg,#8847f2,#7840e9); }
.schedule-modes .secondary { background: #8172b008; border-color: #d5cde8; color: var(--ink); }
.schedule-modes button:nth-child(2) { min-width: 25.7rem; }
.schedule-modes .secondary svg { color: #6928dd; }
.schedule-modes small { display: block; color: inherit; font-weight: 500; }
.schedule-page h3 { margin: 0 0 .55rem; font-size: 1.06rem; }
.schedule-table-scroll, .schedule-graph-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.schedule-table { width: 100%; min-width: 48rem; border-collapse: separate; border-spacing: 0; text-align: left; }
.schedule-table th { height: 2.45rem; padding: .42rem .8rem; font-size: .88rem; font-weight: 650; background: #8171bb24; }
.schedule-table th:first-child { border-radius: .55rem 0 0 .55rem; }
.schedule-table th:last-child { border-radius: 0 .55rem .55rem 0; }
.schedule-table td { height: 3.37rem; padding: .35rem .8rem; border-bottom: 1px solid var(--line); background: #ffffff26; }
.schedule-table td:first-child { border-radius: .6rem 0 0 .6rem; }
.schedule-table td:last-child { border-radius: 0 .6rem .6rem 0; }
.schedule-table td:first-child { width: 20%; }
.schedule-table td:nth-child(2) { width: 17.5%; }
.schedule-table td:nth-child(3) { width: 22%; }
.schedule-table td:nth-child(4) { width: 27%; }
.schedule-table td:nth-child(5) { width: 5%; }
.schedule-table-name, .schedule-table-clock, .schedule-effect { gap: .55rem; }
.schedule-table-name i {
  display: grid; place-items: center; width: 4.12rem; height: 2.45rem; border-radius: .55rem;
  background: #e9d7fb; color: #582ab8; flex: none;
}
.schedule-table-name i svg, .schedule-table-clock svg, .schedule-effect svg, .schedule-tools svg {
  width: 1.2rem; height: 1.2rem;
}
.schedule-table-name .schedule-kind-sleep { background: #faeddd; color: #dd3f21; }
.schedule-table-name .schedule-kind-wake { background: #fff0d8; color: #d87900; }
.schedule-table-name .schedule-kind-rest { background: #e3d5fb; }
.schedule-table-clock { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 650; }
.schedule-table-clock svg, .schedule-tools svg { color: var(--muted); }
.schedule-table-days { flex-wrap: wrap; gap: .25rem; }
.schedule-table-days span {
  min-width: 1.95rem; text-align: center; padding: .12rem .35rem; border-radius: .85rem;
  background: #8171bb24; font-size: .8rem;
}
.schedule-effect {
  width: max-content; padding: .3rem .7rem; border-radius: 1rem; color: #38206c;
  background: #eae0fc; font-size: .83rem; font-weight: 650;
}
.schedule-tools { justify-content: flex-end; gap: .4rem; }
.schedule-tools .schedule-icon { display: grid; place-items: center; min-width: 2rem; padding: .25rem; background: transparent; }
.schedule-tools .schedule-icon:hover { background: #dbcaf56b; }
.schedule-tools .schedule-icon:focus-visible { outline: 2px solid #7836ee; }
.schedule-exceptions-table { min-width: 36rem; }
.schedule-add { gap: .5rem; min-height: 3.05rem; margin-top: .7rem; }
.schedule-page-actions .primary { min-width: 15rem; }
.schedule-visual { margin-top: .65rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.schedule-graph-head h3 { gap: .65rem; margin: 0; }
.schedule-graph-head select {
  border-radius: .65rem; border: 1px solid #ad92f7; padding: .35rem .7rem;
  color: var(--ink); background: var(--panel); font-weight: 650;
}
.schedule-graph {
  display: grid; grid-template-columns: 9.3rem minmax(40rem,1fr); gap: .72rem;
  min-width: 50.1rem; margin: .8rem 0 .25rem;
}
.schedule-ticks { display: flex; justify-content: space-between; position: relative; font-size: .78rem; font-variant-numeric: tabular-nums; }
.schedule-ticks span { position: absolute; left: 0; transform: translateX(-50%); }
.schedule-ticks span:first-child { transform: translateX(-35%); }
.schedule-ticks span:last-child { transform: translateX(-100%); }
.schedule-ticks { padding-bottom: 1.18rem; min-height: 1.8rem; }
.schedule-ticks span::after { content: ""; display: block; width: 1px; height: .45rem; margin: .12rem auto 0; background: #b9abd8; }
.schedule-ticks span:nth-child(2){left:8.333%}
.schedule-ticks span:nth-child(3){left:16.666%}
.schedule-ticks span:nth-child(4){left:25%}
.schedule-ticks span:nth-child(5){left:33.333%}
.schedule-ticks span:nth-child(6){left:41.666%}
.schedule-ticks span:nth-child(7){left:50%}
.schedule-ticks span:nth-child(8){left:58.333%}
.schedule-ticks span:nth-child(9){left:66.666%}
.schedule-ticks span:nth-child(10){left:75%}
.schedule-ticks span:nth-child(11){left:83.333%}
.schedule-ticks span:nth-child(12){left:91.666%}
.schedule-ticks span:nth-child(13){left:100%}
.schedule-graph-day, .schedule-track { height: 2.65rem; border-radius: .6rem; background: #8174b629; }
.schedule-graph-day { display: grid; place-items: center; font-weight: 650; }
.schedule-track { position: relative; }
.schedule-segment {
  height: 100%; position: absolute; top: 0; border-radius: .55rem; color: #271650;
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  padding: 0 .25rem; min-width: 0; overflow: hidden; font-size: .88rem; font-weight: 700;
}
.schedule-segment span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-segment svg { width: 1.3rem; height: 1.3rem; }
.schedule-legend {
  display: flex; list-style: none; flex-wrap: wrap; gap: .7rem 3.2rem; padding: 0; margin: 1.15rem 0 .05rem;
  font-size: .87rem; font-weight: 600;
}
.schedule-legend li { gap: .55rem; }
.schedule-legend i { width: 1.45rem; height: 1.35rem; border-radius: .32rem; background: #8174b629; }
.schedule-legend .schedule-color-study { background: #b8e3f7; }
.schedule-legend .schedule-color-sleep { background: #d9c4f8; }
.schedule-legend .schedule-color-wake { background: #d0ebce; }
.schedule-legend .schedule-color-rest { background: #e4cafa; }
.schedule-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.schedule-rule-editor { margin: 0 0 .8rem; padding: .8rem; border: 1px solid var(--line); border-radius: .65rem; }
.schedule-pick { margin: .7rem 0; }
.schedule-pick summary { cursor: pointer; font-weight: 650; }
.schedule-pick .form-field { margin-top: .6rem; }
.schedule-category-choices { border: 0; padding: .4rem 0; }
.schedule-category-choices, .schedule-app-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem .65rem; }
.schedule-app-choices { max-height: 12rem; overflow-y: auto; }
.schedule-enabled-input, .schedule-app-choices label, .schedule-category-choices label { display: flex; align-items: center; gap: .4rem; overflow-wrap: anywhere; }
@media(max-width:580px){
  .schedule-page { padding: .85rem; }
  .schedule-page-head, .schedule-graph-head { flex-wrap: wrap; }
  .schedule-modes button, .schedule-modes button:nth-child(2) { width: 100%; min-width: 0; }
  .schedule-category-choices, .schedule-app-choices { grid-template-columns: 1fr; }
}

.schedule-page-actions { display: flex; flex-wrap: wrap; gap: 0 .55rem; }
.schedule-page-actions .secondary { color: #46228f; }
.schedule-page-actions .secondary svg { width: 1.12rem; height: 1.12rem; }
.schedule-enabled-input + .actions { margin-top: .85rem; }


/* Application catalogue */
.apps-catalog { padding: 1.5rem; overflow: visible; }
.catalog-header,.catalog-title,.catalog-header-actions,.catalog-controls,.catalog-status,.catalog-batch,
.catalog-views,.catalog-filters,.catalog-category-trigger,.catalog-lock,.catalog-row-tools,
.catalog-uninstall,.catalog-application > div,.catalog-search { display: flex; align-items: center; }
.catalog-header { justify-content: space-between; gap: .9rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.catalog-title { gap: 1.1rem; }
.catalog-title > svg { color: #7940ff; width: 2.1rem; height: 2.1rem; }
.catalog-title h2 { margin: 0 0 .16rem; font-size: 1.45rem; }
.catalog-title p { margin: 0; color: var(--muted); font-size: .9rem; }
.catalog-header-actions { gap: .45rem; flex-wrap: wrap; }
.catalog-header-button,.catalog-batch button { display: inline-flex; align-items: center; justify-content: center; gap: .52rem; }
.catalog-header-button { padding: .57rem .82rem; border-radius: .75rem; box-shadow: 0 2px 4px #5a32c323; }
.catalog-header-button svg,.catalog-batch svg { width: 1.24rem; height: 1.24rem; }
.catalog-controls { gap: .75rem; flex-wrap: wrap; }
.catalog-search {
  min-width: 0; gap: .7rem; min-height: 2.5rem; border: 1px solid #b6abd5;
  border-radius: 1.55rem; padding: 0 .85rem; color: #625990; background: #fff5;
}
.catalog-controls > .catalog-search { flex: 1 1 18rem; max-width: 31rem; }
.catalog-search:focus-within { border-color: #8857f6; box-shadow: 0 0 0 2px #8955fe32; }
.catalog-search input { min-width: 0; width: 100%; padding: .48rem 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.catalog-search input:focus { outline: none; box-shadow: none; }
.catalog-search svg { width: 1.15rem; height: 1.15rem; }
.catalog-filters { gap: .55rem; flex-wrap: wrap; flex: 1 1 auto; }
.catalog-filters .tab { padding: .53rem 1rem; white-space: nowrap; }
.catalog-filters .tab.active { color: white; background: linear-gradient(140deg,#925dff,#5524c6); }
.catalog-views { margin-left: auto; flex: none; }
.catalog-views button { padding: .4rem .85rem; min-height: 2.35rem; }
.catalog-views button:first-child { border-radius: .9rem 0 0 .9rem; }
.catalog-views button:last-child { border-radius: 0 .9rem .9rem 0; }
.catalog-views svg { width: 1.2rem; height: 1.2rem; }
.catalog-status { margin: .65rem 0; gap: .45rem; flex-wrap: wrap; }
.catalog-status small { color: var(--ink); }
.catalog-batch { gap: .55rem; flex-wrap: wrap; padding: .45rem .65rem; background: #e9defa80; border-radius: .85rem; }
.catalog-batch .catalog-hide-batch { margin-left: auto; color: #a3172a; background: #fff0f2; border: 1px solid #fb9ba6; }
.catalog-batch button:disabled { opacity: .55; cursor: default; }
.catalog-select-all { display: grid; place-items: center; margin-right: .4rem; }
.catalog-select-all input,.catalog-table input[type=checkbox] { width: 1.22rem; height: 1.22rem; accent-color: #723af0; flex: none; }
.catalog-table-wrap { min-width: 0; }
.catalog-table { table-layout: fixed; }
.catalog-table thead th { padding: .55rem .45rem; color: var(--ink); }
.catalog-table thead th:nth-child(1) { width: 4.5%; }
.catalog-table thead th:nth-child(2) { width: 23%; padding-left: 4.2rem; }
.catalog-table thead th:nth-child(3) { width: 23%; }
.catalog-table thead th:nth-child(4) { width: 13%; }
.catalog-table td { padding: .48rem .45rem; }
.catalog-table td.catalog-check { width: 4.5%; }
.catalog-table td.catalog-application { width: 23%; }
.catalog-table td.catalog-category-cell { width: 23%; }
.catalog-table td.catalog-rule { width: 13%; }
.catalog-table td.catalog-command { width: 15%; }
.catalog-table td.catalog-removal { width: 15.5%; }
.catalog-table td.catalog-row-tools { width: 6%; }
.catalog-table tr.catalog-selected { background: #875cd107; }
.catalog-application > div { gap: .85rem; }
.catalog-application span:last-child { min-width: 0; }
.catalog-application strong,.catalog-application small { display: block; overflow-wrap: anywhere; }
.catalog-application small { color: var(--ink); font-size: .79rem; margin-top: .12rem; }
.catalog-app-icon {
  position: relative; display: grid; place-items: center; width: 2.7rem; height: 2.7rem; flex: none;
  border-radius: .65rem; color: #5731c3; background: #e6dcfc; overflow: hidden;
}
.catalog-app-icon.guardian { background: linear-gradient(145deg,#978cff,#5029e8); color: white; }
.catalog-app-icon img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; background: #f6f1fd; }
.catalog-app-icon.guardian img { object-fit: cover; background: #15132e; }
.catalog-category-trigger {
  width: 100%; max-width: 17rem; min-height: 2.4rem; gap: .65rem; padding: .4rem .72rem;
  border: 1px solid #b8a3ef; border-radius: .7rem; color: var(--ink); text-align: left;
  background: linear-gradient(180deg,#fff8,#e7ddf647); box-shadow: 0 2px 3px #6a40c019;
}
.catalog-category-trigger[aria-expanded=true] { border-color: #895af7; box-shadow: 0 0 0 1px #895af744; }
.catalog-category-trigger svg { width: 1.2rem; height: 1.2rem; color: #5e23cf; }
.catalog-category-trigger span { flex: 1; overflow-wrap: anywhere; }
.catalog-rule .pill { margin: .1rem 0; padding: .38rem .8rem; }
.catalog-table .catalog-lock { justify-content: center; gap: .5rem; width: 100%; max-width: 13.6rem; }
.catalog-lock svg { width: 1.2rem; height: 1.2rem; }
.catalog-uninstall { gap: .3rem; line-height: 1.15; font-size: .82rem; }
.catalog-uninstall small { display: block; color: var(--muted); }
.catalog-table td.catalog-row-tools { display: table-cell; white-space: nowrap; text-align: right; }
.catalog-icon-button { display: inline-grid; place-items: center; background: none; padding: .32rem; color: #504386; }
.catalog-icon-button:hover { background: #e2d4fc; }
.catalog-icon-button svg { width: 1.24rem; height: 1.24rem; }
.catalog-category-menu {
  position: fixed; z-index: 90; display: flex; flex-direction: column; gap: .3rem; overflow: hidden;
  padding: .6rem; background: #faf8ff; color: #18163e; border: 1px solid #ddd1fc;
  border-radius: .9rem; box-shadow: 0 .55rem 1.35rem #2c235b40;
}
.catalog-category-menu .catalog-search { flex: none; min-height: 2.2rem; }
.catalog-category-options { overflow: auto; overscroll-behavior: contain; min-height: 0; }
.catalog-category-options button,.catalog-new-category {
  width: 100%; display: flex; align-items: center; gap: .65rem; padding: .47rem .56rem;
  color: #1b1741; background: transparent; text-align: left; border-radius: .55rem;
}
.catalog-category-options button span { flex: 1; }
.catalog-category-menu button svg { width: 1.25rem; height: 1.25rem; color: #6322db; }
.catalog-category-menu button:hover,.catalog-category-options button[aria-selected=true] { background: #e9dcfb; }
.catalog-category-options button:disabled { opacity: .65; }
.catalog-category-menu button:focus-visible { outline: 2px solid #8551f7; outline-offset: -2px; }
.catalog-new-category { flex: none; border-radius: 0; border-top: 1px solid #ded1f1; margin-top: .25rem; color: #6322db; }
.catalog-icon-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .4rem; margin: 0 0 .8rem; }
.catalog-icon-options label { display: flex; align-items: center; gap: .45rem; }
.catalog-icon-options label > span { display: inline-flex; align-items: center; gap: .35rem; }
.catalog-icon-options svg { width: 1.15rem; height: 1.15rem; color: #6322db; }
.apps-catalog--cards .catalog-table thead { display: none; }
.apps-catalog--cards .catalog-table tbody { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,25rem),1fr)); gap: .6rem; }
.apps-catalog--cards .catalog-table tr { display: grid; grid-template-columns: auto 1fr; gap: .4rem; padding: .7rem; border: 1px solid var(--line); border-radius: .75rem; }
.apps-catalog--cards .catalog-table td { display: block; width: auto; padding: .15rem; border: 0; }
.apps-catalog--cards .catalog-table .catalog-category-cell,.apps-catalog--cards .catalog-table .catalog-removal { grid-column: 1/-1; }
.apps-catalog--cards .catalog-table .catalog-row-tools { display: block; text-align: left; }
@media(max-width:1140px){
  .apps-catalog .catalog-table thead { display: none; }
  .apps-catalog .catalog-table tbody { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,24rem),1fr)); gap: .6rem; padding-top: .5rem; }
  .apps-catalog .catalog-table tr { display: grid; grid-template-columns: auto 1fr; gap: .4rem; padding: .7rem; border: 1px solid var(--line); border-radius: .75rem; }
  .apps-catalog .catalog-table td { display: block; width: auto; padding: .16rem; border: 0; }
  .apps-catalog .catalog-table .catalog-category-cell,.apps-catalog .catalog-table .catalog-removal { grid-column: 1/-1; }
  .apps-catalog .catalog-table .catalog-row-tools { display: block; text-align: left; }
}
@media(max-width:580px){
  .apps-catalog { padding: .8rem; }
  .catalog-controls > .catalog-search { flex-basis: 100%; max-width: none; }
  .catalog-filters { gap: .35rem; }
  .catalog-batch .catalog-hide-batch { margin-left: 0; }
}

@media (min-width: 1251px) {
  .apps-catalog { min-height: 48rem; }
}


.subscription-summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1rem;padding:1.2rem;border-radius:1rem;background:linear-gradient(115deg,#f1e8ff,#e1defd);color:#261447;margin-bottom:1rem}
.subscription-summary h3,.subscription-plan h3{margin:0 0 .35rem}
.subscription-summary strong,.subscription-summary small{display:block}
.subscription-summary strong{font-size:1.35rem}
.subscription-block{margin:1rem 0;padding:1rem;border:1px solid #dcd0f4;border-radius:1rem}
.subscription-block .check{display:flex;margin-bottom:.65rem}
.subscription-features,.subscription-plans{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:.75rem;margin:1rem 0}
.subscription-features ul{padding-inline-start:1.25rem}
.subscription-plan{padding:1rem;border:1px solid #dfd4f6;border-radius:1rem;background:var(--card,#fff)}
.subscription-plan.current{border-color:#713bd7;box-shadow:0 4px 12px #5121ad1a}
.subscription-price{font-weight:800;font-size:1.2rem;margin:.35rem 0}
.subscription-price small{font-size:.78rem;font-weight:400}
.subscription-matrix{overflow-x:auto;max-width:100%;border:1px solid #e2d9f5;border-radius:.9rem}
.subscription-matrix table{width:100%;min-width:26rem}
.subscription-matrix th,.subscription-matrix td{padding:.55rem;text-align:center}
.subscription-matrix th:first-child{text-align:left}
.subscription-matrix svg,.subscription-lock svg{width:1rem;height:1rem;vertical-align:middle}
.subscription-lock{display:flex;gap:.5rem;align-items:center}
.subscription-plan-note{font-size:.8rem}


/* Shared avatar shape: photos and empty camera placeholders. */
.avatar > svg { width: 22px; height: 22px; flex: none; }
