/* Cliptica — app shell: left sidebar rail, top bar, page grid.
   Depends on tokens.css + components.css. */

body.shell-body{display:grid;grid-template-columns:232px 1fr;min-height:100dvh;margin:0;}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.shell-side{position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;
  background:var(--s1);border-right:1px solid var(--border);z-index:120;}
.shell-brand{display:flex;align-items:center;gap:9px;padding:18px 18px 16px;
  color:var(--text);text-decoration:none;font-weight:600;font-size:17px;letter-spacing:-.015em;}
.shell-brand svg{height:22px;width:auto;display:block;}
.shell-brand .cut{transition:transform 240ms var(--snap);}
.shell-brand:hover .cut{transform:translateX(4px);}

.shell-new{margin:2px 14px 18px;}
.shell-new .btn{width:100%;}

.shell-nav{flex:1;overflow-y:auto;padding:0 10px;}
.shell-nav-group{font-family:var(--font);font-size:11px;font-weight:600;letter-spacing:.01em;
  text-transform:none;color:var(--muted);padding:14px 10px 7px;}
.shell-nav a{display:flex;align-items:center;gap:11px;min-height:38px;padding:0 10px;
  border-radius:var(--radius);color:var(--muted);text-decoration:none;font-size:13.5px;
  font-weight:500;transition:color 120ms,background 120ms;}
/* display:flex above outranks the UA's [hidden]{display:none}, so a
   feature-flagged nav entry stays visible without this. */
.shell-nav a[hidden]{display:none;}
.shell-nav a:hover{color:var(--text);background:var(--s2);}
.shell-nav a[aria-current="page"]{color:var(--text);background:var(--s2);
  box-shadow:inset 2px 0 0 var(--accent);}
.shell-nav a svg{width:16px;height:16px;flex-shrink:0;opacity:.85;}

.shell-foot{border-top:1px solid var(--border);padding:12px 14px;display:flex;
  flex-direction:column;gap:10px;flex-shrink:0;}
.shell-usage{display:block;background:var(--s2);border:1px solid var(--border);
  border-radius:var(--radius);padding:10px 12px;text-decoration:none;color:inherit;
  transition:border-color 120ms;}
.shell-usage:hover{border-color:var(--border2);}
.shell-usage-row{display:flex;justify-content:space-between;align-items:baseline;
  font-family:var(--font);font-size:11.5px;color:var(--muted);margin-bottom:7px;
  letter-spacing:0;text-transform:none;}
.shell-usage-row strong{color:var(--text);font-weight:500;font-size:11.5px;}
.shell-user{display:flex;align-items:center;gap:10px;width:100%;background:none;
  border:none;border-radius:var(--radius);padding:7px 8px;cursor:pointer;color:inherit;
  font:inherit;text-align:left;transition:background 120ms;}
.shell-user:hover{background:var(--s2);}
.shell-avatar{width:28px;height:28px;border-radius:50%;background:var(--s3);
  border:1px solid var(--border2);display:flex;align-items:center;justify-content:center;
  font-size:11.5px;font-weight:600;color:var(--accent2);flex-shrink:0;text-transform:uppercase;}
.shell-user-mail{flex:1;min-width:0;font-size:12.5px;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* ── Main column ───────────────────────────────────────────────────────── */
.shell-main{display:flex;flex-direction:column;min-width:0;}
.shell-top{position:sticky;top:0;z-index:100;display:flex;align-items:center;gap:14px;
  height:60px;padding:0 28px;background:var(--top-bg);backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);}
.shell-top h1{font-size:15.5px;font-weight:600;letter-spacing:-.015em;margin:0;}
.shell-top .top-sub{font-family:var(--font);font-size:12px;font-weight:500;letter-spacing:0;
  text-transform:none;color:var(--muted);}
.shell-top-actions{margin-left:auto;display:flex;align-items:center;gap:10px;}
.shell-burger{display:none;background:none;border:1px solid var(--border);color:var(--muted);
  width:34px;height:34px;border-radius:var(--radius);cursor:pointer;font-size:15px;
  align-items:center;justify-content:center;}
.shell-burger:hover{color:var(--text);border-color:var(--border2);}

.shell-content{flex:1;width:100%;max-width:1200px;margin:0 auto;padding:28px;}

/* ── Mobile ────────────────────────────────────────────────────────────── */
.shell-scrim{display:none;position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:115;}
@media (max-width:900px){
  body.shell-body{grid-template-columns:1fr;}
  .shell-side{position:fixed;left:0;top:0;width:260px;max-width:85vw;height:100dvh;
    transform:translateX(-100%);transition:transform 220ms var(--snap);
    box-shadow:0 0 60px rgba(0,0,0,.5);}
  body.shell-side-open .shell-side{transform:translateX(0);}
  body.shell-side-open .shell-scrim{display:block;}
  .shell-burger{display:inline-flex;}
  .shell-top{padding:0 16px;}
  .shell-content{padding:20px 16px;}
  /* Comfortable tap targets for the burger + top actions on touch. */
  .shell-burger{width:38px;height:38px;font-size:17px;}
}
/* iOS Safari zooms the page when focusing an input whose font-size is < 16px.
   Force 16px on the shared form controls at phone widths so focusing a field
   (search, settings selects, modal inputs) never triggers that jarring zoom.
   Desktop keeps its denser 13.5px sizing above the breakpoint. */
@media (max-width:640px){
  .input,.select,.textarea{font-size:16px;}
}
@media (prefers-reduced-motion:reduce){.shell-side{transition:none;}}
