/* ════════════════════════════════════════════════════════════════
   SandboxEverything OS — cream terminal desktop
   ════════════════════════════════════════════════════════════════ */

:root{
  --cream:      #f4eee0;
  --cream-2:    #f9f4e9;
  --card:       #fbf7ee;
  --ink:        #35312a;
  --ink-soft:   #6d6759;
  --ink-dim:    #938d7e;
  --accent:     #ff5722;
  --accent-deep:#e64a19;
  --amber:      #f0a028;
  --teal:       #45b0a2;
  --teal-line:  #93d8ce;
  --green:      #27a844;
  --border:     rgba(53,49,42,.4);
  --border-soft:rgba(53,49,42,.16);
  --focus:      #4a90d9;
  --term-bg:    #28241e;
  --mono: ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
}

*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}
html,body{height:100%}
body{
  font-family:var(--mono);
  font-size:14px;
  color:var(--ink);
  background:var(--cream);
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
::selection{background:rgba(255,87,34,.28)}

#os{display:flex;flex-direction:column;height:100dvh}

/* ════════════════ MENU BAR ════════════════ */

#menubar{
  display:flex;align-items:center;gap:26px;
  height:46px;padding:0 14px;flex:none;
  background:var(--cream);
  border-bottom:1px solid var(--border-soft);
  position:relative;z-index:3000;
  user-select:none;
}
.mtrig{padding:6px 12px;border-radius:7px;font-size:13.5px;white-space:nowrap}
.mtrig:hover,.mtrig.open{background:rgba(53,49,42,.08)}
.brand{
  display:flex;align-items:center;gap:8px;
  background:var(--accent);color:#fff;font-weight:700;
  padding:7px 13px;
}
.brand:hover,.brand.open{background:var(--accent-deep)}
.brand svg{width:15px;height:15px;fill:none;stroke:#fff;stroke-width:2}
#menubar-nav{display:flex;gap:10px}
#clock{margin-left:auto;font-weight:700;font-size:14.5px;letter-spacing:.04em;white-space:nowrap}

/* ════════════════ DESKTOP ════════════════ */

#desktop{position:relative;flex:1;overflow:hidden;background:#8fa0b4}
#wallpaper{position:absolute;inset:0;width:100%;height:100%;display:block}

/* ════════════════ WINDOWS ════════════════ */

.window{
  position:absolute;
  display:flex;flex-direction:column;
  background:var(--cream-2);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:0 14px 34px -14px rgba(35,26,16,.4);
  overflow:hidden;
  min-width:320px;min-height:180px;
  transition:box-shadow .18s ease,opacity .18s ease;
}
.window.focused{box-shadow:0 30px 70px -18px rgba(35,26,16,.55)}
.window.dragging,.window.resizing{transition:none}
.window.dragging{cursor:grabbing}
.window.geometry{transition:left .22s cubic-bezier(.3,.9,.3,1),top .22s cubic-bezier(.3,.9,.3,1),width .22s cubic-bezier(.3,.9,.3,1),height .22s cubic-bezier(.3,.9,.3,1),box-shadow .18s ease}

/* open / close / minimize choreography */
.window.opening{transform:scale(.92) translateY(14px);opacity:0}
.window.shown{transform:none;opacity:1;transition:transform .24s cubic-bezier(.2,.9,.27,1.18),opacity .2s ease,box-shadow .18s ease}
.window.closing{transform:scale(.94) translateY(8px)!important;opacity:0!important;transition:transform .16s ease-in,opacity .14s ease-in;pointer-events:none}
.window.zooming{transition:transform .3s cubic-bezier(.5,.06,.6,.9),opacity .3s ease;pointer-events:none}

.titlebar{
  display:flex;align-items:center;gap:12px;
  padding:11px 16px;flex:none;
  border-bottom:1px solid var(--border-soft);
  user-select:none;cursor:grab;
}
.window.maxed .titlebar{cursor:default}
.titlebar:active{cursor:grabbing}
.lights{display:flex;gap:8px;flex:none}
.light{
  width:13px;height:13px;border-radius:50%;padding:0;
  border:1px solid rgba(0,0,0,.18);
  display:grid;place-items:center;
  color:transparent;font-size:9px;line-height:1;font-weight:700;
}
.light.red{background:#ff5f57}.light.yellow{background:#febc2e}.light.green{background:#28c840}
.lights:hover .light{color:rgba(0,0,0,.55)}
.window:not(.focused) .light{background:#d6cfc0}
.tb-icon{width:20px;height:20px;border-radius:5px;display:grid;place-items:center;flex:none;color:#fff}
.tb-icon svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tb-icon svg .f{fill:currentColor;stroke:none}
.tb-title{
  font-size:14px;font-weight:700;letter-spacing:.02em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.window:not(.focused) .tb-title{color:var(--ink-dim)}
.tb-extra{margin-left:auto;flex:none;font-size:12.5px;color:var(--accent);font-weight:600}

.win-body{flex:1;display:flex;flex-direction:column;min-height:0;position:relative}

/* resize handles */
.rs{position:absolute;z-index:40}
.rs-n{top:-3px;left:8px;right:8px;height:7px;cursor:ns-resize}
.rs-s{bottom:-3px;left:8px;right:8px;height:7px;cursor:ns-resize}
.rs-e{right:-3px;top:8px;bottom:8px;width:7px;cursor:ew-resize}
.rs-w{left:-3px;top:8px;bottom:8px;width:7px;cursor:ew-resize}
.rs-ne{top:-3px;right:-3px;width:14px;height:14px;cursor:nesw-resize}
.rs-nw{top:-3px;left:-3px;width:14px;height:14px;cursor:nwse-resize}
.rs-se{bottom:-3px;right:-3px;width:14px;height:14px;cursor:nwse-resize}
.rs-sw{bottom:-3px;left:-3px;width:14px;height:14px;cursor:nesw-resize}

/* service-not-ready overlay inside app windows */
.svc-wait{
  position:absolute;inset:0;z-index:30;
  display:flex;flex-direction:column;gap:14px;align-items:center;justify-content:center;
  background:var(--cream-2);
  font-size:13px;color:var(--ink-soft);
  transition:opacity .3s ease;
}
.svc-wait.done{opacity:0;pointer-events:none}
.spinner{
  width:26px;height:26px;border-radius:50%;
  border:3px solid var(--border-soft);border-top-color:var(--accent);
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ════════════════ LAUNCHER ════════════════ */

.search-row{padding:14px 18px 2px;flex:none}
#search{
  width:100%;padding:10px 14px;
  font:inherit;font-size:13.5px;color:var(--ink);
  background:var(--card);
  border:1px solid var(--border);border-radius:8px;
  outline:none;
}
#search::placeholder{color:var(--ink-dim)}
#search:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(255,87,34,.15)}

#grid{
  flex:1;min-height:0;overflow:auto;
  padding:16px 18px;
  display:grid;grid-template-columns:repeat(4,1fr);gap:15px;
  align-content:start;
}
#grid::-webkit-scrollbar{width:10px}
#grid::-webkit-scrollbar-thumb{background:rgba(53,49,42,.22);border-radius:6px;border:2px solid var(--cream-2)}
#grid::-webkit-scrollbar-track{background:transparent}

.card{
  position:relative;
  display:flex;flex-direction:column;align-items:center;gap:9px;
  padding:18px 10px 15px;
  background:var(--card);
  border:1px solid var(--border);border-radius:10px;
  box-shadow:0 4px 10px -5px rgba(48,38,22,.32);
  cursor:pointer;user-select:none;
  transition:transform .14s ease,box-shadow .14s ease;
}
.card:hover{transform:translateY(-2px);box-shadow:0 9px 18px -7px rgba(48,38,22,.38)}
.card:active{transform:translateY(0) scale(.975)}
.card.hidden{display:none}
.card.flash{outline:2px solid var(--accent);outline-offset:3px}
.card.wiggle{animation:wiggle .3s ease}
@keyframes wiggle{25%{transform:translateX(-4px)}50%{transform:translateX(4px)}75%{transform:translateX(-2px)}}

.icon-wrap{position:relative}
.app-icon{
  width:46px;height:46px;border-radius:12px;
  display:grid;place-items:center;color:#fff;
  background-image:linear-gradient(180deg,rgba(255,255,255,.22),rgba(0,0,0,.07));
  box-shadow:0 2px 5px -2px rgba(0,0,0,.35);
}
.app-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.app-icon svg .f{fill:currentColor;stroke:none}
.card:active .app-icon{transform:scale(.92)}

.dot{
  position:absolute;top:-4px;right:-5px;
  width:10px;height:10px;border-radius:50%;
  background:var(--amber);
  border:2px solid var(--card);
  animation:pulse 1.7s ease-out infinite;
}
.dot.up{background:var(--green);animation:none}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(240,160,40,.55)}100%{box-shadow:0 0 0 8px rgba(240,160,40,0)}}

.card .name{
  font-size:12.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.card .exe{font-size:12px;color:var(--teal)}

#grid-empty{
  grid-column:1/-1;padding:40px 0;text-align:center;
  color:var(--ink-dim);font-size:13px;
}

.win-foot{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:10px 18px;flex:none;
  border-top:1px solid var(--teal-line);
  font-size:12.5px;
}
.foot-status{display:flex;align-items:center;gap:8px;color:var(--amber);min-width:0}
.foot-status .sdot{width:8px;height:8px;border-radius:50%;background:var(--amber);flex:none}
.foot-status b{letter-spacing:.05em;flex:none}
#win-msg{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.win-foot.online .foot-status{color:var(--green)}
.win-foot.online .sdot{background:var(--green)}
.foot-copy{flex:none;color:var(--ink-soft);font-size:12px}

/* ════════════════ TASKBAR ════════════════ */

#taskbar{
  display:flex;align-items:center;gap:14px;
  height:62px;padding:0 16px;flex:none;
  background:var(--cream);
  border-top:1px solid var(--border-soft);
  position:relative;z-index:3000;
  user-select:none;
}
#start-btn{
  background:var(--accent);color:#fff;font-weight:700;font-size:14px;
  padding:9px 20px;border-radius:8px;flex:none;
  box-shadow:0 2px 0 var(--accent-deep);
  transition:transform .1s ease,background .12s ease;
}
#start-btn:hover{background:var(--accent-deep)}
#start-btn:active{transform:translateY(1px);box-shadow:none}

#dock{display:flex;gap:8px;min-width:0;overflow:hidden;flex:1}
.dock-btn{
  display:flex;align-items:center;gap:8px;
  padding:6px 12px 6px 7px;min-width:0;flex:0 1 auto;
  background:var(--cream-2);
  border:1px solid var(--border-soft);border-radius:8px;
  font-size:12.5px;white-space:nowrap;
  transition:background .12s ease,border-color .12s ease,opacity .12s ease;
}
.dock-btn.fresh{animation:dockin .2s ease}
@keyframes dockin{from{opacity:0;transform:translateY(8px)}}
.dock-btn:hover{background:var(--card);border-color:var(--border)}
.dock-btn.active{border-color:var(--accent);background:#fdeee6;box-shadow:inset 0 1px 3px rgba(230,74,25,.18)}
.dock-btn.min{opacity:.55}
.dock-btn .dock-ic{
  width:22px;height:22px;border-radius:6px;flex:none;
  display:grid;place-items:center;color:#fff;
}
.dock-btn .dock-ic svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dock-btn .dock-ic svg .f{fill:currentColor;stroke:none}
.dock-btn span:last-child{overflow:hidden;text-overflow:ellipsis}

.tray{margin-left:auto;display:flex;align-items:center;gap:30px;font-size:12px;line-height:1.55;flex:none}
.tblock.t-right{text-align:right}
.tblock.trow{display:flex;align-items:center;gap:14px}
.t-accent{color:var(--accent)}
.t-dim{color:var(--ink-soft)}
#tray-msg{max-width:320px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tray.online .t-accent{color:var(--green)}

/* ════════════════ MENUS ════════════════ */

#dropdown,#startmenu{
  position:fixed;z-index:4000;
  min-width:232px;
  background:var(--cream-2);
  border:1px solid var(--border);border-radius:10px;
  box-shadow:0 22px 48px -14px rgba(35,26,16,.5);
  padding:6px;
  user-select:none;
}
#dropdown.showing,#startmenu.showing{animation:menuin .13s ease}
@keyframes menuin{from{opacity:0;transform:translateY(-5px)}}
#startmenu.showing{animation:startin .16s ease}
@keyframes startin{from{opacity:0;transform:translateY(8px)}}

.menu-item{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:9px 13px;border-radius:7px;
  font-size:13.5px;text-align:left;white-space:nowrap;
}
.menu-item:hover{background:rgba(53,49,42,.08)}
.menu-item:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.menu-item .mi-icon{width:19px;flex:none;text-align:center;font-size:14px;font-family:"Apple Color Emoji","Segoe UI Emoji",var(--mono)}
.menu-item .hint{margin-left:auto;color:var(--accent);font-size:12px;padding-left:22px}
.menu-item .chev{margin-left:auto;color:var(--ink-soft);font-size:15px;padding-left:22px;transition:transform .15s ease}
.menu-item.expanded .chev{transform:rotate(90deg)}

.submenu{overflow:hidden;max-height:0;transition:max-height .22s ease}
.submenu.open{max-height:340px;overflow-y:auto}
.submenu .menu-item{padding:7px 13px 7px 26px;font-size:13px}
.submenu::-webkit-scrollbar{width:8px}
.submenu::-webkit-scrollbar-thumb{background:rgba(53,49,42,.2);border-radius:4px}
.mini-ic{
  width:18px;height:18px;border-radius:5px;flex:none;
  display:grid;place-items:center;color:#fff;
}
.mini-ic svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.mini-ic svg .f{fill:currentColor;stroke:none}

/* ════════════════ FAB ════════════════ */

#fab{
  position:absolute;right:26px;bottom:24px;z-index:2500;
  width:62px;height:62px;border-radius:50%;
  background:var(--accent);color:#fff;
  display:grid;place-items:center;
  box-shadow:0 12px 26px -8px rgba(230,74,25,.65);
  transition:transform .15s ease,box-shadow .15s ease;
}
#fab::before{
  content:"";position:absolute;z-index:-1;
  width:36px;height:36px;top:-7px;left:-7px;border-radius:50%;
  background:var(--cream-2);border:1px solid var(--border-soft);
}
#fab:hover{transform:translateY(-3px);box-shadow:0 18px 32px -10px rgba(230,74,25,.7)}
#fab:active{transform:scale(.94)}
#fab svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#fab svg .f{fill:currentColor;stroke:none}

/* ════════════════ APP CONTENT: TERMINAL ════════════════ */

.term{
  flex:1;min-height:0;overflow-y:auto;
  background:#28241e;color:#efe7d3;
  padding:13px 15px;font-size:12.5px;line-height:1.65;
  cursor:text;
}
.term::-webkit-scrollbar{width:9px}
.term::-webkit-scrollbar-thumb{background:rgba(239,231,211,.2);border-radius:5px}
.term-line{white-space:pre-wrap;word-break:break-word}
.term-line.sys{color:#9d967f}
.term-line.ok{color:#7fd4a0}
.term-line.echo{color:#efe7d3}
.term-line .tp,.term-inrow .tp{color:var(--accent);font-weight:700}
.term-inrow{display:flex;gap:8px;align-items:baseline}
.term-in{
  flex:1;background:none;border:none;outline:none;
  font:inherit;color:inherit;caret-color:var(--accent);
}

/* ════════════════ APP CONTENT: LIVE PTY (real sandbox) ════════════════ */

.pty-root{flex:1;min-height:0;display:flex;flex-direction:column;background:#28241e}
.pty-bar{
  display:flex;align-items:center;gap:8px;flex:none;
  padding:6px 13px;font-size:11.5px;color:var(--ink-soft);
  background:var(--cream-2);border-bottom:1px solid var(--border-soft);
  user-select:none;
}
.pty-dot{width:8px;height:8px;border-radius:50%;background:var(--amber);flex:none;animation:pulse 1.7s ease-out infinite}
.pty-bar.ok .pty-dot{background:var(--green);animation:none}
.pty-bar.bad .pty-dot{background:#d64545;animation:none}
.pty-bar.bad{cursor:pointer}
.pty-bar.bad:hover .pty-status{color:var(--accent)}
.pty-sess{margin-left:auto;color:var(--ink-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pty-host{flex:1;min-height:0;padding:6px 0 6px 8px}
.pty-host .xterm{height:100%}
.pty-wait{
  height:100%;display:flex;flex-direction:column;gap:14px;
  align-items:center;justify-content:center;
  color:#9d967f;font-size:12.5px;
}

.wv-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}
.wv-open{
  flex:none;font-size:11.5px;color:var(--accent);text-decoration:none;
  padding:4px 10px;border:1px solid rgba(255,87,34,.4);border-radius:99px;
}
.wv-open:hover{background:#fdeee6}

.live-tag{font-size:10px;letter-spacing:.05em;color:var(--ink-dim);margin-top:-3px}
.live-tag.on{color:var(--green)}
.live-tag.busy{color:var(--amber)}
.live-tag.off{color:var(--ink-dim)}

.sb-real{background:rgba(103,196,186,.1);border-color:rgba(69,176,162,.35)!important}

/* ════════════════ APP CONTENT: WEB VIEW ════════════════ */

.webview{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--card)}
.wv-bar{
  display:flex;align-items:center;gap:9px;
  padding:9px 13px;flex:none;
  border-bottom:1px solid var(--border-soft);
  background:var(--cream-2);
}
.wv-dot{width:9px;height:9px;border-radius:50%;background:#ddd5c4;border:1px solid var(--border-soft);flex:none}
.wv-url{
  flex:1;padding:6px 12px;min-width:0;
  background:var(--cream);border:1px solid var(--border-soft);border-radius:99px;
  font-size:12px;color:var(--ink-soft);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.wv-page{
  flex:1;min-height:0;overflow:auto;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;
  padding:26px;text-align:center;
}
.wv-app-ic{
  width:64px;height:64px;border-radius:16px;
  display:grid;place-items:center;color:#fff;margin-bottom:6px;
  background-image:linear-gradient(180deg,rgba(255,255,255,.22),rgba(0,0,0,.07));
  box-shadow:0 6px 14px -5px rgba(0,0,0,.4);
}
.wv-app-ic svg{width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.wv-app-ic svg .f{fill:currentColor;stroke:none}
.wv-page h3{font-size:17px;letter-spacing:.03em}
.wv-sub{font-size:12.5px;color:var(--ink-soft)}
.wv-chips{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap;justify-content:center}
.wv-chips span{
  font-size:11.5px;padding:4px 11px;border-radius:99px;
  border:1px solid var(--border-soft);background:var(--cream-2);color:var(--ink-soft);
}
.wv-chips span:first-child{color:var(--green);border-color:rgba(39,168,68,.4)}

/* ════════════════ APP CONTENT: FILES ════════════════ */

.fb{flex:1;min-height:0;display:flex}
.fb aside{
  width:150px;flex:none;overflow:auto;
  border-right:1px solid var(--border-soft);
  padding:10px 8px;background:var(--cream-2);
}
.fb-side{
  width:100%;text-align:left;padding:7px 10px;border-radius:6px;
  font-size:12.5px;color:var(--ink-soft);white-space:nowrap;
}
.fb-side:hover{background:rgba(53,49,42,.07)}
.fb-side.sel{background:#fdeee6;color:var(--accent-deep);font-weight:600}
.fb-main{
  flex:1;min-height:0;overflow:auto;
  display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:6px;
  padding:14px;align-content:start;background:var(--card);
}
.fb-item{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:11px 4px 9px;border-radius:8px;border:1px solid transparent;
  font-size:11.5px;text-align:center;word-break:break-all;
}
.fb-item:hover{background:var(--cream-2)}
.fb-item.sel{background:#fdeee6;border-color:rgba(255,87,34,.4)}
.fb-item svg{width:34px;height:34px;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.fb-item .folder{stroke:#d99e3c;fill:#f2c368}
.fb-item .file{stroke:var(--ink-soft);fill:#fff}
.fb-status{
  flex:none;padding:6px 14px;font-size:11.5px;color:var(--ink-soft);
  border-top:1px solid var(--border-soft);background:var(--cream-2);
}

/* ════════════════ APP CONTENT: EDITOR ════════════════ */

.ed{flex:1;min-height:0;display:flex;flex-direction:column;background:#28241e;color:#efe7d3}
.ed-tabs{display:flex;flex:none;background:#211d18;border-bottom:1px solid rgba(239,231,211,.12)}
.ed-tab{padding:8px 16px;font-size:12px;color:#9d967f;border-right:1px solid rgba(239,231,211,.08)}
.ed-tab.on{background:#28241e;color:#efe7d3;box-shadow:inset 0 2px 0 var(--accent)}
.ed-scroll{flex:1;min-height:0;overflow:auto;display:flex}
.ed-gutter{
  flex:none;padding:12px 10px 12px 16px;text-align:right;
  color:#5d574a;font-size:12.5px;line-height:1.7;user-select:none;
}
.ed-code{padding:12px 16px 12px 0;font-size:12.5px;line-height:1.7;white-space:pre;flex:1}
.ed-code .c{color:#8a8371}
.ed-code .k{color:#ff8a5c}
.ed-code .s{color:#7fd4c4}
.ed-code .n{color:#f0c060}
.ed-code .fn{color:#a5c4f2}
.ed-status{
  flex:none;display:flex;gap:18px;padding:5px 14px;
  background:var(--accent);color:#fff;font-size:11.5px;
}

/* ════════════════ APP CONTENT: FLOW (n8n) ════════════════ */

.flow{flex:1;min-height:0;background:var(--card);position:relative;overflow:hidden}
.flow svg{width:100%;height:100%;display:block}
.flow-node{cursor:grab}
.flow-node rect.body{fill:var(--cream-2);stroke:var(--border);}
.flow-node:hover rect.body{stroke:var(--accent)}
.flow-node text{font-family:var(--mono)}
.flow-wire{fill:none;stroke:var(--teal);stroke-width:2;stroke-dasharray:6 5;animation:wire 1.2s linear infinite}
@keyframes wire{to{stroke-dashoffset:-11}}

/* ════════════════ APP CONTENT: TENKI CLOUD ════════════════ */

.rv{flex:1;min-height:0;display:flex;flex-direction:column;background:#28241e;color:#efe7d3}
.rv-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 15px;flex:none;font-size:12.5px;
  border-bottom:1px solid rgba(239,231,211,.12);
}
.rv-pr{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rv-verdict{color:#7fd4a0;font-weight:700;flex:none;letter-spacing:.04em}
.rv-diff{
  flex:1;min-height:0;overflow:auto;
  padding:13px 16px;font-size:12.5px;line-height:1.75;font-family:var(--mono);
}
.rv-diff .h{color:#9d967f}
.rv-diff .a{color:#7fd4a0;background:rgba(127,212,160,.08);display:inline-block;width:100%}
.rv-diff .d{color:#f2917e;background:rgba(242,145,126,.08);display:inline-block;width:100%;text-decoration:line-through;text-decoration-color:rgba(242,145,126,.5)}
.rv-diff .ctx{color:#8a8371}
.rv-bar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:9px 15px;flex:none;font-size:12px;color:#9d967f;
  border-top:1px solid rgba(239,231,211,.12);
}
.rv-approve{
  background:var(--green);color:#fff;font-weight:700;font-size:12px;
  padding:7px 14px;border-radius:7px;flex:none;
  transition:transform .1s ease,filter .12s ease;
}
.rv-approve:hover{filter:brightness(1.1)}
.rv-approve:active{transform:scale(.96)}

.rn,.sb{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--card)}
.rn-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 16px;flex:none;font-size:12.5px;color:var(--ink-soft);
  border-bottom:1px solid var(--border-soft);background:var(--cream-2);
}
.rn-head b{color:var(--ink)}
.rn-add,.sb-new{
  background:var(--accent);color:#fff;font-weight:700;font-size:12px;
  padding:7px 13px;border-radius:7px;flex:none;
  transition:transform .1s ease,background .12s ease;
}
.rn-add:hover,.sb-new:hover{background:var(--accent-deep)}
.rn-add:active,.sb-new:active{transform:scale(.96)}
.rn-rows,.sb-rows{flex:1;min-height:0;overflow:auto;padding:8px 10px}
.rn-row,.sb-row{
  display:flex;align-items:center;gap:12px;
  padding:9px 10px;border-radius:8px;font-size:12.5px;
  border:1px solid transparent;
}
.rn-row:hover,.sb-row:hover{background:var(--cream-2);border-color:var(--border-soft)}
.sb-row{animation:dockin .25s ease}
.rn-dot{width:9px;height:9px;border-radius:50%;flex:none}
.rn-dot.idle{background:var(--green)}
.rn-dot.busy{background:var(--amber);animation:pulse 1.7s ease-out infinite}
.rn-dot.busy-green{background:var(--green)}
.rn-dot.offline{background:#c9c2b2}
.rn-name{font-weight:700;flex:none;min-width:128px}
.rn-labels{color:var(--ink-dim);font-size:11.5px;flex:none;min-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rn-state{color:var(--ink-soft);flex:none;min-width:58px}
.rn-job{color:var(--teal);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.rn-foot{
  flex:none;padding:7px 16px;font-size:11.5px;color:var(--ink-dim);
  border-top:1px solid var(--border-soft);background:var(--cream-2);
}
.sb-act{
  flex:none;font-size:11.5px;padding:4px 12px;border-radius:6px;
  border:1px solid var(--border);color:var(--ink-soft);
  transition:all .12s ease;
}
.sb-act:hover{border-color:var(--accent);color:var(--accent)}

/* ════════════════ TOAST / SHADE / ABOUT ════════════════ */

#toast{
  position:fixed;left:50%;bottom:82px;transform:translateX(-50%);
  z-index:6000;max-width:min(560px,90vw);
  background:#2c2822;color:#f4eee0;
  padding:10px 18px;border-radius:9px;
  font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  box-shadow:0 12px 30px -10px rgba(0,0,0,.5);
  animation:toastin .18s ease;
  pointer-events:none;
}
@keyframes toastin{from{opacity:0;transform:translate(-50%,10px)}}
#toast.bye{opacity:0;transition:opacity .3s ease}

#shade{
  position:fixed;inset:0;z-index:7000;
  background:#0b0a09;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:26px;
  animation:shadein .45s ease;
}
@keyframes shadein{from{opacity:0}}
#shade.waking{opacity:0;transition:opacity .4s ease}
#power-btn{
  width:84px;height:84px;border-radius:50%;
  border:2px solid rgba(255,87,34,.7);color:var(--accent);
  display:grid;place-items:center;
  transition:transform .15s ease,background .15s ease,box-shadow .15s ease;
}
#power-btn:hover{background:rgba(255,87,34,.12);box-shadow:0 0 42px rgba(255,87,34,.35);transform:scale(1.05)}
#power-btn svg{width:38px;height:38px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
#shade-hint{color:#6b655a;font-size:12.5px;animation:hintin 1s ease 1.2s backwards}
@keyframes hintin{from{opacity:0}}

#about{
  position:fixed;inset:0;z-index:6500;
  background:rgba(43,36,28,.35);
  display:grid;place-items:center;
  animation:shadein .2s ease;
}
.about-card{
  width:330px;padding:0 26px 24px;text-align:center;
  background:var(--cream-2);
  border:1px solid var(--border);border-radius:13px;
  box-shadow:0 34px 80px -20px rgba(35,26,16,.6);
  animation:aboutin .22s cubic-bezier(.2,.9,.27,1.18);
}
@keyframes aboutin{from{opacity:0;transform:scale(.92) translateY(12px)}}
.about-lights{display:flex;padding:13px 0}
.about-logo{
  width:58px;height:58px;padding:13px;margin:4px auto 14px;
  background:var(--accent);border-radius:15px;
  fill:none;stroke:#fff;stroke-width:1.8;
  box-shadow:0 8px 18px -6px rgba(230,74,25,.6);
}
.about-card h2{font-size:16.5px;letter-spacing:.02em}
.about-ver{color:var(--accent);font-size:12.5px;margin:5px 0 13px}
.about-sub{font-size:12.5px;color:var(--ink-soft);line-height:1.7}
.about-copy{margin-top:15px;font-size:11.5px;color:var(--ink-dim)}

/* ════════════════ RESPONSIVE / MOTION ════════════════ */

@media (max-width:1000px){
  .tblock.trow .t-dim{display:none}
  #tray-msg{max-width:190px}
}
@media (max-width:820px){
  #grid{grid-template-columns:repeat(3,1fr)}
  .tray .tblock:not(.trow){display:none}
}
@media (max-width:600px){
  #grid{grid-template-columns:repeat(2,1fr)}
  #clock{font-size:12px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}
