/* The simple shell: Apple-quiet. One light gray desk, white surfaces with no
   outlines, one blue, a frosted top bar with three places. Everything is
   scoped under body.sx so the old shell still works without simple.js. */
body.sx{--bg:#f5f5f7;--card:#fff;--card2:#f2f2f5;--fg:#1d1d1f;--dim:#6e6e73;--line:#e6e6eb;--accent:#0a66d8;--accent-soft:#eaf2fd;--radius:14px;--shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.04);background:var(--bg);color:var(--fg)}
body.sx ::selection{background:#cfe2fb;color:var(--fg)}

/* The old rail, top bar, footer and page button give way to the glass bar */
body.sx .app-shell{display:block;min-height:100vh}
body.sx .sidebar,body.sx .topbar,body.sx .page-footer,body.sx #new{display:none!important}
body.sx[data-sx-tab="ideas"] #section-tabs,body.sx[data-sx-tab="calendar"] #section-tabs,body.sx[data-sx-tab="production"] #section-tabs{display:none}

/* ---- Glass bar ---- */
.sx-bar{position:sticky;top:0;z-index:40;background:rgba(245,245,247,.78);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid rgba(0,0,0,.06)}
.sx-bar__in{max-width:1240px;margin:auto;height:56px;padding:0 24px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px}
.sx-word{justify-self:start;font-weight:800;font-size:14px;color:var(--fg);text-decoration:none;letter-spacing:-.01em}
.sx-seg{display:flex;flex-direction:row;gap:2px;padding:3px;border-radius:12px;background:rgba(0,0,0,.05)}
.sx-seg button{border:0;background:transparent;color:var(--fg);font-size:13px;font-weight:600;padding:6px 18px;border-radius:9px;line-height:1.6}
.sx-seg button:hover{background:rgba(0,0,0,.04)}
.sx-seg button.on{color:var(--fg);background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.08),0 2px 8px rgba(0,0,0,.04)}
.sx-tools{justify-self:end;display:flex;align-items:center;gap:8px}
.sx-new{display:inline-flex;align-items:center;gap:6px;border:0;background:var(--accent);color:#fff;font-size:13px;font-weight:600;padding:7px 14px 7px 16px;border-radius:9px;line-height:1.6}
.sx-new:hover{background:#0858bd}
.sx-new .icon{width:16px;height:16px;stroke-width:2}
.sx-bar .notification-bell{color:var(--dim)}
.sx-more{position:relative}
.sx-me{border:0;background:transparent;padding:4px;border-radius:50%;display:grid;place-items:center}
.sx-avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(160deg,#8e9aaf,#6b778c);color:#fff;font-size:13px;font-weight:700}
.sx-menu{position:absolute;top:calc(100% + 8px);left:0;min-width:220px;padding:6px;background:rgba(255,255,255,.98);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-radius:12px;box-shadow:0 0 0 1px rgba(0,0,0,.06),0 12px 32px rgba(0,0,0,.14);display:flex;flex-direction:column;animation:sx-pop .14s ease-out}
.sx-menu[hidden]{display:none}
.sx-menu__who{padding:8px 10px 10px;display:flex;flex-direction:column;line-height:1.5}
.sx-menu__who b{font-size:13px}.sx-menu__who small{font-size:12px;color:var(--dim)}
.sx-menu button,.sx-menu a{border:0;background:transparent;text-align:right;font-size:13px;color:var(--fg);padding:7px 10px;border-radius:8px;text-decoration:none;line-height:1.6}
.sx-menu button:hover,.sx-menu a:hover{background:var(--accent);color:#fff}
.sx-menu hr{border:0;border-top:1px solid var(--line);margin:5px 6px}
@keyframes sx-pop{from{opacity:0;transform:translateY(-4px) scale(.98)}}

/* ---- Page ---- */
body.sx .page-content{max-width:1240px;padding:36px 24px 64px}
body.sx .page-heading{margin-bottom:28px}
body.sx #page-title{font-size:27px;font-weight:800;letter-spacing:-.02em;line-height:1.4;margin:0 0 2px}
body.sx #page-description{font-size:14px;color:var(--dim);margin:0}
body.sx .panel,body.sx .bl-group{border-radius:14px;box-shadow:var(--shadow)}
body.sx .primary{background:var(--accent);border-radius:9px}
body.sx .primary:hover{background:#0858bd}
body.sx .secondary{box-shadow:none;background:var(--card2);border-radius:9px}
body.sx .secondary:hover{background:#e8e8ed}
body.sx input,body.sx select,body.sx textarea{border-radius:8px}
body.sx .section-tabs{border-bottom:0;gap:4px;margin-bottom:24px}
body.sx .detail-panel{border-radius:14px 0 0 14px;box-shadow:0 0 0 1px rgba(0,0,0,.05),0 24px 64px rgba(0,0,0,.16)}

/* My tasks: the backlog's own heading repeats the page title */
body.sx[data-sx-tab="production"] .bl-head h2{display:none}
body.sx .bl-group{padding:6px 20px}
body.sx .bl-owner{border-radius:8px}

/* Calendar: the week and the idea tray read as one surface */
body.sx .pn-idea{background:#fff;border-color:transparent;box-shadow:0 0 0 1px var(--line)}
body.sx .pn-idea:hover{box-shadow:0 0 0 1.5px var(--accent);border-color:transparent}

@media(max-width:720px){
 .sx-bar__in{grid-template-columns:auto 1fr auto;padding:0 12px;gap:8px}
 .sx-word{display:none}
 .sx-seg{justify-self:center}
 .sx-seg button{padding:6px 12px}
 .sx-new span{display:none}
 .sx-new{padding:8px}
 body.sx .page-content{padding:24px 16px 48px}
 body.sx .workspace{padding-bottom:0}
}

/* ---- Calendar, simplified: the week and the ideas, nothing else up front ---- */
body.sx .pl-summary,body.sx .pl-tools label,body.sx .pn-tray header p,body.sx .pl-meta .tag{display:none}
body.sx .pl{gap:20px}
body.sx .pl-tools{align-items:center;gap:14px}
body.sx .pl-range{font-size:14px;font-weight:700}
body.sx .ib-seg{background:rgba(0,0,0,.05);box-shadow:none;padding:3px;gap:2px;border-radius:12px}
body.sx .ib-seg button{min-height:32px;border-radius:9px;color:var(--fg);font-weight:600}
body.sx .ib-seg button.on{background:#fff;color:var(--fg);box-shadow:0 1px 2px rgba(0,0,0,.08),0 2px 8px rgba(0,0,0,.04)}
body.sx .pn-layout{grid-template-columns:240px minmax(0,1fr);gap:20px}
body.sx .pl-week{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;overflow:visible}
body.sx .pl-day{background:#fff;border-radius:14px;padding:12px;gap:10px;min-height:420px;box-shadow:var(--shadow)}
body.sx .pl-day.past{background:transparent;box-shadow:inset 0 0 0 1px var(--line)}
body.sx .pl-day.today{box-shadow:inset 0 0 0 2px var(--accent),var(--shadow)}
body.sx .pl-day header{flex-direction:column;gap:0;font-size:13px;line-height:1.5;padding-bottom:4px}
body.sx .pl-day header span{font-size:12px}
body.sx .pl-day.today header b{color:var(--accent)}
body.sx .pl-day .tag.blue{display:none}
body.sx .pl-item{padding:8px 10px;border-radius:9px;background:var(--card2);grid-template-columns:6px minmax(0,1fr);gap:8px}
body.sx .pl-item .dot{width:6px;height:6px;margin-top:9px}
body.sx .pl-title{font-size:12px;line-height:1.7}
body.sx .pl-meta .muted{font-size:12px;color:var(--dim)}
body.sx .pn-tray{background:#fff;border-radius:14px;padding:14px;box-shadow:var(--shadow);align-self:start;position:sticky;top:76px}
body.sx .pn-tray h3{font-size:14px;margin:0 0 10px}
body.sx .pn-search{border:0;background:var(--card2)}
body.sx .pl-late,body.sx .pl-all{box-shadow:var(--shadow)}

/* ---- Ideas, simplified: search, one list, filters folded away ---- */
body.sx .ib-pipe{display:none}
body.sx .ib{gap:16px}
body.sx .ib-search input{border:0;background:#fff;box-shadow:var(--shadow);min-height:44px;border-radius:12px;padding:0 16px}
body.sx .ib-more summary{display:flex;width:max-content;background:transparent;box-shadow:none;color:var(--accent);padding:0 4px;min-height:32px}
body.sx .ib-more summary::after{border-color:var(--accent)}
body.sx .ib-count{font-size:12px;color:var(--dim)}
body.sx .ib-group{box-shadow:var(--shadow)}
body.sx .ib-group header{border-bottom:0;padding:16px 20px 6px}
body.sx .ib-row{grid-template-columns:46px minmax(0,1fr) max-content auto;padding:14px 20px;border-bottom:0;border-top:1px solid var(--line);margin:0}
body.sx .ib-row:hover{background:#fafafc}
body.sx .ib-row .ib-score.none:last-child{display:none}
body.sx .ib-score{width:40px;height:30px;border-radius:9px;font-size:13px;box-shadow:none}
body.sx .ib-score.top{box-shadow:none}
body.sx .ib-stage{border-radius:8px}

/* ---- My tasks: the day groups are the page ---- */
body.sx[data-sx-tab="production"] .filters,body.sx[data-sx-tab="production"] .bl-head p{display:none}
body.sx .bl-head{margin-bottom:16px}
body.sx .bl-group h3{font-size:13px}
body.sx .bl-check input{width:20px;height:20px;border-radius:50%}

@media(max-width:720px){
 .sx-seg button{padding:6px 10px}
 .sx-tools{gap:4px}
 .sx-bar .notification-bell{width:32px;height:32px}
 body.sx .pn-layout{grid-template-columns:minmax(0,1fr)}
 body.sx .pn-tray{position:static}
 body.sx .pl-week{grid-template-columns:minmax(0,1fr)}
 body.sx .pl-day{min-height:0}
 body.sx .pl-day header{flex-direction:row;gap:8px;align-items:baseline}
 body.sx .pl-tools{flex-wrap:wrap}
 body.sx .ib-row{grid-template-columns:40px minmax(0,1fr);row-gap:8px}
 body.sx .ib-row .ib-stage,body.sx .ib-row .ib-act{grid-column:2}
}

/* ---- Detail: a floating sheet under the bar, its close button always in view ---- */
body.sx .detail-panel{top:68px;bottom:12px;left:12px;width:500px;max-width:calc(100vw - 24px);border-radius:14px}
body.sx .detail-top{position:sticky;top:0;z-index:2;background:rgba(255,255,255,.92);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}
body.sx #detail-content h2{font-size:20px;font-weight:800;letter-spacing:-.01em}
body.sx .content-journey,body.sx .journey-next{border-radius:12px}
@media(max-width:720px){body.sx .detail-panel{top:60px;left:8px;bottom:8px;max-width:calc(100vw - 16px)}}

/* ---- Detail fields: grouped rows, label beside value, like Settings ---- */
body.sx *{scrollbar-color:#c7c7cc transparent}
body.sx #detail-content{padding:24px}
body.sx #detail-content h2{margin-bottom:8px;line-height:1.6}
body.sx #detail-content .row-meta{margin:0 0 20px;font-size:12px;flex-direction:row;align-items:center}
body.sx #detail-content .pill{font-size:12px;border-radius:8px}
body.sx .sx-next{background:var(--accent-soft);border-radius:12px;padding:14px 16px;margin:0 0 20px}
body.sx .sx-next h3{font-size:13px;margin:0 0 4px}
body.sx .sx-next p{font-size:13px;margin:0 0 10px;color:var(--fg)}
body.sx #detail-content .form-grid{display:block;max-width:none;margin:0;background:var(--bg);border-radius:12px}
body.sx #detail-content .field{display:grid;grid-template-columns:104px minmax(0,1fr);align-items:center;column-gap:12px;margin:0;padding:6px 14px;min-height:48px;font-size:13px;font-weight:500;color:var(--dim);border-bottom:1px solid var(--line)}
body.sx #detail-content .field:last-child{border-bottom:0}
body.sx #detail-content .field:focus-within{box-shadow:inset 0 0 0 2px var(--accent);border-radius:12px;border-bottom-color:transparent}
body.sx #detail-content .field input:not([type=checkbox]),body.sx #detail-content .field select,body.sx #detail-content .field textarea{margin:0;border:0;background:transparent;box-shadow:none;outline:0;padding:6px 0;font-size:14px;color:var(--fg);min-height:36px;min-width:0}
body.sx #detail-content .field input[type=date]{direction:ltr;text-align:right}
body.sx #detail-content .field input[type=checkbox]{justify-self:end;width:20px;height:20px;margin:0;accent-color:var(--accent)}
body.sx #detail-content .field>small{grid-column:1/-1;font-size:12px;color:var(--dim);font-weight:400;padding-bottom:6px}
body.sx #detail-content .field:has(textarea),body.sx #detail-content .field:has(select[multiple]){grid-template-columns:minmax(0,1fr);row-gap:2px;padding-top:12px}
body.sx #detail-content .field textarea{min-height:88px}
body.sx #detail-content .field select[multiple]{height:120px;padding:4px;background:#fff;border-radius:8px}
body.sx #detail-content .form-more{margin:0;border-top:0}
body.sx #detail-content .form-more>summary,body.sx .sx-path>summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:0 14px;font-size:13px;font-weight:600;color:var(--fg);cursor:pointer;list-style:none}
body.sx #detail-content .form-more>summary::-webkit-details-marker,body.sx .sx-path>summary::-webkit-details-marker{display:none}
body.sx #detail-content .form-more>summary::after,body.sx .sx-path>summary::after{content:'';width:7px;height:7px;border-inline-start:1.5px solid var(--dim);border-bottom:1.5px solid var(--dim);transform:rotate(45deg);transition:transform .15s}
body.sx #detail-content .form-more[open]>summary::after,body.sx .sx-path[open]>summary::after{transform:rotate(-45deg)}
body.sx #detail-content .form-more>.form-grid{border-top:1px solid var(--line);border-radius:0 0 12px 12px}
body.sx .sx-path{margin-top:20px;background:var(--bg);border-radius:12px}
body.sx .sx-path[open]{padding-bottom:14px}
body.sx .sx-path .journey-steps{margin:6px 14px 10px}
body.sx .sx-path .journey-links,body.sx .sx-path .journey-origin{margin:0 14px}
body.sx #detail-content .form-actions{margin-top:14px}
body.sx #detail-content .form-actions .primary{min-width:140px}
body.sx #detail-content .bl-add{background:var(--bg)}
body.sx #detail-content .bl-add .field{display:block;min-height:0;padding:0;border:0;margin-bottom:10px}
body.sx #detail-content .bl-add .field select,body.sx #detail-content .bl-add .field input:not([type=checkbox]){background:#fff;border-radius:8px;padding:6px 10px;margin-top:4px}

/* Day columns keep whole words: the week scrolls sideways before a word breaks */
body.sx .pl-week{grid-template-columns:repeat(7,minmax(128px,1fr));overflow-x:auto;padding-bottom:6px}
body.sx .pl-title{overflow-wrap:break-word}
@media(max-width:720px){
 body.sx .pl-week{grid-template-columns:minmax(0,1fr);overflow-x:visible}
 body.sx #detail-content{padding:18px}
 body.sx #detail-content .field{grid-template-columns:88px minmax(0,1fr)}
}
