/* ---------- File Explorer ---------- */
.explorer { flex-direction: row; }
.ex-side {
  width: 220px; flex: none; padding: 10px 8px; overflow-y: auto; border-right: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.ex-nav { display: flex; gap: 4px; padding: 0 8px; }
.ex-crumb {
  flex: 1; display: flex; align-items: center; gap: 2px; padding: 5px 10px;
  background: var(--control); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12.5px; overflow: hidden; min-width: 0;
}
.ex-crumb .crumb { padding: 2px 5px; border-radius: var(--radius-sm); white-space: nowrap; }
.ex-crumb .crumb:hover { background: var(--hover); }
.ex-crumb .sep { color: var(--text-3); font-size: 10px; }
.ex-search { width: 190px; }
.ex-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius);
  font-size: 12.5px; color: var(--text-2); width: 100%; text-align: left;
}
.ex-item:hover { background: var(--hover); color: var(--text); }
.ex-item.active { background: var(--active); color: var(--text); }
.ex-item .i { width: 18px; height: 18px; display: grid; place-items: center; flex: none; color: var(--accent-2); }
.ex-item .i svg, .ex-item .i img { width: 18px; height: 18px; }
.ex-item .cnt { margin-left: auto; font-size: 11px; color: var(--text-3); }
.ex-group { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); padding: 14px 10px 6px; }

.ex-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-status {
  flex: none; height: 28px; display: flex; align-items: center; gap: 16px; padding: 0 12px;
  border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3);
}
.ex-files { flex: 1; overflow: auto; padding: 8px; position: relative; }
.ex-files.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 4px; align-content: start;
}
.ex-files.tiles { display: flex; flex-direction: column; gap: 2px; }
.file {
  border-radius: var(--radius); padding: 12px 8px; display: flex; flex-direction: column;
  align-items: center; gap: 8px; text-align: center; cursor: default; border: 1px solid transparent;
  transition: background .1s;
}
.file:hover { background: var(--hover); }
.file.sel { background: rgba(0,120,212,.28); border-color: rgba(76,194,255,.5); }
.file .fi { width: 48px; height: 48px; display: grid; place-items: center; }
.file .fi svg, .file .fi img { width: 48px; height: 48px; }
.file .fi img.thumb { object-fit: cover; border-radius: 4px; }
.file .fn {
  font-size: 12px; color: var(--text); max-width: 100%; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ex-files.tiles .file { flex-direction: row; align-items: center; text-align: left; padding: 8px 12px; gap: 12px; }
.ex-files.tiles .file .fi { width: 24px; height: 24px; }
.ex-files.tiles .file .fi svg, .ex-files.tiles .file .fi img { width: 24px; height: 24px; }
.ex-files.tiles .file .fn { -webkit-line-clamp: 1; }
.ex-files.tiles .file .fmeta { margin-left: auto; font-size: 11px; color: var(--text-3); display: flex; gap: 20px; }
.ex-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }
.ex-drop { outline: 2px dashed var(--accent-2); outline-offset: -6px; }

/* ---------- Terminal ---------- */
.term-wrap { flex: 1; min-height: 0; background: rgba(12,12,12,.96); padding: 8px 4px 4px 10px; }
body.light .term-wrap { background: rgba(12,12,12,.96); }
.term-wrap .xterm { height: 100%; }
.term-wrap .xterm-viewport::-webkit-scrollbar-thumb { background: rgba(160,160,160,.4); }
.term-tabs-bar { display: flex; align-items: center; padding: 0 8px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.term-tab { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 12px; color: var(--text-2); border-bottom: 2px solid transparent; }
.term-tab.active { color: var(--text); border-bottom-color: var(--accent-2); }

/* ---------- Browser ---------- */
.br-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.urlbar {
  flex: 1; display: flex; align-items: center; gap: 8px; background: var(--control);
  border: 1px solid var(--border-strong); border-radius: 18px; padding: 5px 14px; min-width: 0;
}
.urlbar:focus-within { border-color: var(--accent); background: var(--surface-2); }
.urlbar input { flex: 1; background: none; border: 0; outline: none; font-size: 12.5px; color: var(--text); min-width: 0; }
.urlbar .lock { color: var(--text-3); font-size: 12px; }
.br-frame { flex: 1; min-height: 0; position: relative; background: #fff; }
.br-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.br-home { flex: 1; overflow: auto; padding: 40px; background: var(--bg-2); color: var(--text); }
.br-home h1 { font-weight: 300; font-size: 30px; margin-bottom: 4px; }
.br-home .sub { color: var(--text-3); margin-bottom: 26px; }
.br-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; max-width: 900px; }
.br-tile {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; transition: transform .12s, background .12s;
}
.br-tile:hover { transform: translateY(-2px); background: var(--surface-2); }
.br-tile .ti { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: #fff; }
.br-tile .tn { font-size: 12.5px; }
.br-tile .tu { font-size: 10.5px; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-tile .tdel { position: absolute; }
.br-bm { position: relative; }
.br-bm .del { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.5); color:#fff; font-size: 10px; display: none; place-items: center; }
.br-bm:hover .del { display: grid; }
.br-loading { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: transparent; overflow: hidden; }
.br-loading i { display: block; height: 100%; width: 30%; background: var(--accent-2); animation: brLoad 1s infinite ease-in-out; }
@keyframes brLoad { 0% { transform: translateX(-100%); } 100% { transform: translateX(430%); } }

/* ---------- YouTube ---------- */
.yt-body { flex: 1; display: flex; flex-direction: column; background: #0f0f0f; min-height: 0; }
.yt-frame { flex: 1; min-height: 0; }
.yt-frame iframe { width: 100%; height: 100%; border: 0; }
.yt-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; padding: 16px; overflow-y: auto; }
.yt-card { cursor: pointer; }
.yt-card .th { position: relative; aspect-ratio: 16/9; background: #1f1f1f; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.yt-card .th img { width: 100%; height: 100%; object-fit: cover; }
.yt-card .th .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 34px; opacity: 0; transition: opacity .15s; background: rgba(0,0,0,.3); }
.yt-card:hover .th .play { opacity: 1; }
.yt-card .ttl { font-size: 12.5px; color: #f1f1f1; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Notepad ---------- */
.np-area {
  flex: 1; min-height: 0; resize: none; border: 0; outline: none; background: transparent;
  color: var(--text); font-family: var(--font-mono); font-size: 13px; padding: 16px 18px; line-height: 1.6;
}
.np-wrap { flex: 1; min-height: 0; display: flex; }
.np-gutter {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6; padding: 16px 8px; text-align: right;
  color: var(--text-3); background: rgba(255,255,255,.03); user-select: none; overflow: hidden; min-width: 46px;
}
.np-status { flex: none; height: 26px; display: flex; align-items: center; gap: 18px; padding: 0 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }

/* ---------- Photos / Media ---------- */
.ph-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ph-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: #0d0d0d; overflow: hidden; position: relative; }
.ph-stage img, .ph-stage video { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .15s; }
.ph-tools { display: flex; gap: 6px; }
.ph-strip { flex: none; height: 84px; display: flex; gap: 6px; padding: 8px; overflow-x: auto; border-top: 1px solid var(--border); }
.ph-strip img { height: 68px; width: 100px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: .6; border: 2px solid transparent; }
.ph-strip img.active { opacity: 1; border-color: var(--accent-2); }
.mp-cover { flex: 1; display: grid; place-items: center; background: linear-gradient(150deg,#2b1055,#7597de); }
.mp-cover .art { width: 220px; height: 220px; border-radius: 16px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 80px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.mp-info { text-align: center; color: #fff; margin-top: 20px; }
.mp-bar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
.mp-bar input[type=range] { flex: 1; -webkit-appearance: none; height: 4px; background: var(--border-strong); border-radius: 3px; }
.mp-bar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }

/* ---------- Settings ---------- */
.set-body { flex: 1; display: flex; min-height: 0; }
.set-side { width: 240px; flex: none; padding: 14px 10px; overflow-y: auto; border-right: 1px solid var(--border); }
.set-user { display: flex; align-items: center; gap: 12px; padding: 8px 10px 16px; }
.set-user .avatar.sm { width: 40px; height: 40px; font-size: 17px; }
.set-user .u-n { font-size: 13px; }
.set-user .u-e { font-size: 11px; color: var(--text-3); }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-nav button {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius);
  font-size: 12.5px; color: var(--text-2); text-align: left; width: 100%;
}
.set-nav button:hover { background: var(--hover); }
.set-nav button.active { background: var(--active); color: var(--text); }
.set-nav .ni { width: 18px; text-align: center; }
.set-main { flex: 1; overflow-y: auto; padding: 26px 34px 60px; }
.set-main h2 { font-size: 22px; font-weight: 600; margin-bottom: 22px; }
.set-card {
  background: rgba(255,255,255,.035); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 14px;
}
body.light .set-card { background: rgba(255,255,255,.6); }
.set-card .sc-t { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.set-card .sc-d { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; }
.set-row .r-l { font-size: 12.5px; }
.set-row .r-d { font-size: 11.5px; color: var(--text-3); }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }
.wall-thumb {
  aspect-ratio: 16/10; border-radius: 8px; border: 2px solid transparent; overflow: hidden; position: relative;
  display: grid; place-items: center; font-size: 11px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.wall-thumb.sel { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(76,194,255,.35); }
.wall-thumb small { position: absolute; bottom: 4px; left: 6px; }
.accent-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.accent-dot { width: 34px; height: 34px; border-radius: 6px; border: 2px solid transparent; }
.accent-dot.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.switch { width: 40px; height: 20px; border-radius: 10px; background: var(--border-strong); position: relative; transition: background .18s; flex: none; }
.switch.on { background: var(--accent); }
.switch i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .18s; }
.switch.on i { left: 23px; }
.sc-list { display: flex; flex-direction: column; gap: 8px; }
.sc-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.sc-item .si { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 14px; }
.sc-item .sn { font-size: 12.5px; }
.sc-item .su { font-size: 11px; color: var(--text-3); max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-item .sx { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.port-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; background: var(--control); border: 1px solid var(--border); font-size: 11.5px; margin: 3px; }
.port-chip.on { border-color: #2e8b57; color: #7ee2a8; }
.about-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 12.5px; }
.about-grid dt { color: var(--text-3); }
.about-grid dd { color: var(--text); }

/* ---------- Calculator ---------- */
.calc { padding: 12px; display: flex; flex-direction: column; height: 100%; }
.calc-display { text-align: right; padding: 16px 14px 10px; }
.calc-display .expr { font-size: 12.5px; color: var(--text-3); min-height: 16px; }
.calc-display .val { font-size: 40px; font-weight: 300; overflow: hidden; text-overflow: ellipsis; }
.calc-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.calc-key { border-radius: var(--radius); background: var(--control); font-size: 16px; transition: background .1s; }
.calc-key:hover { background: var(--control-hover); }
.calc-key.op { background: rgba(255,255,255,.05); }
.calc-key.eq { background: var(--accent); color: #fff; }
.calc-key.eq:hover { filter: brightness(1.1); }

/* ---------- Task manager ---------- */
.tm-head { display: grid; grid-template-columns: 1fr 100px 100px 80px; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
.tm-row { display: grid; grid-template-columns: 1fr 100px 100px 80px; gap: 10px; padding: 9px 16px; font-size: 12.5px; border-bottom: 1px solid var(--border); align-items: center; }
.tm-row:hover { background: var(--hover); }
.tm-row .name { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.tm-row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gauges { display: flex; gap: 20px; padding: 16px; border-bottom: 1px solid var(--border); }
.gauge { flex: 1; }
.gauge .g-t { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; display: flex; justify-content: space-between; }
.gauge .g-bar { height: 8px; background: var(--control); border-radius: 5px; overflow: hidden; }
.gauge .g-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Generic empty / misc ---------- */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-3); text-align: center; padding: 40px; }
.empty-state .big { font-size: 46px; opacity: .5; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
