/* =========================================================
   SAIGONSCIENCE — ứng dụng: Notepad, Explorer, Thuộc tính,
   MS-DOS, Run, cuộc gọi, âm lượng, lịch, kiểu chữ, tìm kiếm,
   trình bảo vệ màn hình, BIOS, tắt máy
   ========================================================= */

/* ---------- Notepad ---------- */
.notepad-win .win__body { display: flex; overflow: hidden; padding: 0 2px 2px; }
.notepad__area {
  flex: 1; width: 100%; min-height: 0; resize: none; border: 0; outline: 0;
  padding: 6px 8px; background: #fff; color: #000; box-shadow: var(--sunken);
  font: 13.5px/1.55 var(--font-mono); white-space: pre-wrap;
}
.notepad__area.is-nowrap { white-space: pre; overflow-x: auto; }
.notepad__area[data-font="pixel"] { font: 20px/1.15 var(--font-pixel); }
.notepad__area[data-font="sans"] { font: 14px/1.6 var(--font-ui); }

/* ---------- Explorer ---------- */
.explorer { display: flex; flex-direction: column; height: 100%; padding: 0 2px 2px; gap: 3px; }
.explorer__addr { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 1px 2px; }
.explorer__path { flex: 1; display: flex; align-items: center; gap: 6px; padding: 2px 6px; min-width: 0; }
.explorer__path .pixel { width: 16px; height: 16px; }
.explorer__path-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.explorer__view { flex: 1; min-height: 0; overflow: auto; padding: 8px; display: grid; align-content: start; gap: 4px; outline: 0; }
.explorer__view.is-icons { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.explorer__view.is-list { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px 10px; }
.explorer__view.is-details { grid-template-columns: 1fr; gap: 0; }
.ex-item {
  display: grid; justify-items: center; align-content: start; gap: 4px;
  padding: 4px 2px; border: 0; background: transparent; color: #000; text-align: center; cursor: default;
}
.ex-item .pixel { width: 32px; height: 32px; }
.ex-item__name { font-size: 12px; line-height: 1.25; padding: 1px 3px; word-break: break-word; }
.ex-item__desc { display: none; }
.is-list .ex-item, .is-details .ex-item { grid-template-columns: 16px minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; gap: 6px; padding: 2px 4px; }
.is-list .ex-item .pixel, .is-details .ex-item .pixel { width: 16px; height: 16px; }
.is-details .ex-item { grid-template-columns: 16px minmax(140px, 220px) minmax(0, 1fr); }
.is-details .ex-item__desc { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-item[aria-selected="true"] .ex-item__name { background: var(--navy); color: #fff; outline: 1px dotted #ff0; }
.ex-item[aria-selected="true"] .pixel { filter: brightness(.7) sepia(1) hue-rotate(190deg) saturate(3); }
.ex-item:focus-visible { outline: 1px dotted #000; }
.explorer__empty { margin: 30px auto; color: var(--muted); font-size: 13px; }
.dialup__step { margin: 0 0 10px; }

/* ---------- Thuộc tính (System / Display) ---------- */
.props { display: flex; flex-direction: column; height: 100%; padding: 8px 10px 10px; font-size: 13px; }
.tabs { display: flex; gap: 0; padding-left: 2px; position: relative; z-index: 1; }
.tab {
  border: 0; background: var(--face); padding: 4px 12px 3px; margin-right: -2px; font-size: 13px; color: #000;
  box-shadow: inset 1px 1px var(--hilite), inset -1px 0 var(--dark), inset -2px 0 var(--shadow), inset 2px 2px var(--face-light);
  position: relative; top: 2px;
}
.tab[aria-selected="true"] { top: 0; padding-bottom: 5px; z-index: 2; font-weight: 600; }
.tab:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.tab-panel, .tab-body { flex: 1; min-height: 0; }
.props > .tab-panel, .tab-body {
  padding: 12px; box-shadow: var(--window-edge); overflow: auto;
}
.tab-body > .tab-panel { padding: 8px 0 0; box-shadow: none; }
.props__actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.props__actions .btn { min-width: 76px; }
.sys-general { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: start; }
.sys-general__art { padding: 8px; background: #fff; box-shadow: var(--sunken); }
.sys-general__art .pixel { width: 92px; height: 92px; }
.sys-general__info { margin: 0; }
.sys-general__info dt { font-weight: 600; margin-top: 10px; }
.sys-general__info dt:first-child { margin-top: 0; }
.sys-general__info dd { margin: 2px 0 0 16px; line-height: 1.5; }
.tree { list-style: none; margin: 8px 0 0; padding: 8px; max-height: 260px; overflow: auto; }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dotted var(--shadow); margin-left: 6px; }
.tree__node { display: block; padding: 2px 0; font-weight: 600; }
.tree__leaf { display: flex; align-items: center; gap: 6px; width: 100%; padding: 2px 4px; border: 0; background: transparent; text-align: left; font-size: 13px; }
.tree__leaf .pixel { width: 16px; height: 16px; }
.tree__leaf .role { margin-left: auto; }
.tree__leaf:hover, .tree__leaf:focus-visible { background: var(--navy); color: #fff; outline: 0; }
.perf { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; margin: 0; }
.perf dt { font-weight: 600; }
.perf dd { margin: 0; display: grid; gap: 4px; }
.perf__ok { margin: 16px 0 0; }

/* monitor xem trước */
.monitor { width: 196px; margin: 0 auto 10px; }
.monitor__screen {
  position: relative; height: 128px; margin: 0; overflow: hidden;
  border: 10px solid #c9c3b6; border-bottom-width: 16px; border-radius: 4px;
  box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #6f6a5e;
}
.monitor__win { position: absolute; left: 22px; top: 18px; width: 110px; background: var(--face); box-shadow: var(--window-edge); padding: 2px; }
.monitor__title { background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff; font: 13px/1.2 var(--font-pixel); padding: 1px 3px; white-space: nowrap; overflow: hidden; }
.monitor__face { padding: 8px; display: grid; place-items: center; }
.monitor__btn { font-size: 10px; padding: 1px 10px; background: var(--face); box-shadow: var(--raised); }
.monitor__saver { display: none; position: absolute; inset: 0; background: #000; color: #ffd23f; font: 18px/1 var(--font-pixel); white-space: nowrap; }
.monitor__screen[data-saver="marquee"] .monitor__saver, .monitor__screen[data-saver="stars"] .monitor__saver, .monitor__screen[data-saver="logos"] .monitor__saver { display: block; }
.monitor__screen[data-saver="marquee"] .monitor__saver { padding-top: 50px; animation: mini-marquee 6s linear infinite; }
.monitor__screen[data-saver="stars"] .monitor__saver, .monitor__screen[data-saver="logos"] .monitor__saver {
  background: radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent), radial-gradient(1px 1px at 70% 60%, #fff 50%, transparent),
    radial-gradient(2px 2px at 45% 80%, #fff 50%, transparent), radial-gradient(1px 1px at 85% 20%, #fff 50%, transparent), #000;
}
@keyframes mini-marquee { from { transform: translateX(100%); } to { transform: translateX(-160%); } }
.monitor__stand { width: 70px; height: 12px; margin: 0 auto; background: #c9c3b6; box-shadow: inset 0 -2px #6f6a5e; }
.props label { display: grid; gap: 4px; }
.props select.field { width: 100%; border: 0; padding: 2px; font: 13px var(--font-ui); }
.display__row { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.display__row label { display: flex; align-items: center; gap: 6px; }
.display__row input { width: 64px; border: 0; padding: 3px 4px; font: 13px var(--font-ui); }

/* ---------- MS-DOS ---------- */
.dos-win .win__body { background: #000; padding: 0; }
.dos {
  height: 100%; overflow-y: auto; padding: 6px 10px 10px;
  background: #000; color: #c0c0c0; font: 20px/1.12 var(--font-pixel);
  white-space: pre-wrap; word-break: break-word; cursor: text;
}
.dos[data-color="green"] { color: #39ff6a; }
.dos[data-color="amber"] { color: #ffb000; }
.dos__line { display: flex; }
.dos__prompt { white-space: pre; }
.dos__in { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0; background: transparent; color: inherit; font: inherit; caret-color: currentColor; }
.dos.is-buzz { animation: buzz .5s linear; }
.dos-screen { position: fixed; inset: 0; z-index: 650; background: #000; display: flex; }
.dos-screen .dos { flex: 1; font-size: clamp(18px, 2.6vw, 26px); padding: 20px 24px; }

/* ---------- Run ---------- */
.run { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; font-size: 13px; }
.run__top { display: flex; gap: 12px; align-items: flex-start; }
.run__top .pixel { width: 32px; height: 32px; }
.run__top p { margin: 0; }
.run__row { display: flex; align-items: center; gap: 8px; }
.run__row input { flex: 1; border: 0; padding: 4px 6px; font: 13px var(--font-ui); }
.run .props__actions { margin-top: 2px; }

/* ---------- Cuộc gọi ---------- */
.call { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px; text-align: center; font-size: 13.5px; }
.call__av { padding: 4px; background: #fff; box-shadow: var(--sunken); }
.call__av .pixel { width: 64px; height: 64px; }
.call__name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.call__wave { display: flex; gap: 4px; height: 18px; align-items: end; }
.call__wave i { width: 5px; background: var(--navy); animation: wave .9s steps(3) infinite; }
.call__wave i:nth-child(2) { animation-delay: .15s; } .call__wave i:nth-child(3) { animation-delay: .3s; }
.call__wave i:nth-child(4) { animation-delay: .45s; } .call__wave i:nth-child(5) { animation-delay: .6s; }
@keyframes wave { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.call.is-done .call__wave { display: none; }
.call__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* ---------- popup nổi: âm lượng, lịch, kiểu chữ ---------- */
.float-pop { position: fixed; z-index: 460; animation: menu-in .1s steps(2) both; }
.vol-pop { width: 104px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 6px 10px; font-size: 12.5px; }
.vol-pop__title { font-weight: 600; }
.vol-pop__slider { writing-mode: vertical-lr; direction: rtl; width: 26px; height: 120px; accent-color: var(--navy); }
.vol-pop__mute { display: flex; align-items: center; gap: 4px; }
.clock-pop { width: min(430px, calc(100vw - 8px)); }
.clock-pop__body { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; padding: 8px 8px 0; }
.clock-pop .groupbox { margin: 0; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.cal__head .btn { min-height: 22px; padding: 0 8px; font-size: 11px; }
.cal__title { font-weight: 600; font-size: 13px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; padding: 4px; font-size: 12px; text-align: center; }
.cal__dow { font-weight: 700; color: var(--navy); padding: 2px 0; }
.cal__day { padding: 3px 0; }
.cal__day.is-today { background: var(--navy); color: #fff; font-weight: 700; }
.analog { display: block; width: 110px; height: 110px; margin: 0 auto 6px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--shadow), 0 0 0 3px var(--hilite); }
.clock-pop__digital { text-align: center; font: 22px/1.2 var(--font-pixel); padding: 2px; }
.clock-pop__tz { margin: 6px 10px 10px; font-size: 12px; color: var(--muted); }
.style-pop { width: 262px; padding: 8px; display: grid; gap: 8px; font-size: 12.5px; }
.style-pop__title { font-weight: 600; }
.style-pop__row { display: flex; gap: 4px; }
.style-pop__row .btn--tool { min-height: 30px; width: 34px; padding: 0; }
.style-pop__row .btn--tool.is-pressed { box-shadow: var(--pressed); background: var(--dither); }
.style-pop__row select { flex: 1; border: 0; padding: 2px; font: 12.5px var(--font-ui); }
.style-pop__colors { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.swatch { height: 24px; border: 0; background: var(--sw); box-shadow: var(--sunken); }
.swatch[aria-pressed="true"] { outline: 2px solid #000; outline-offset: 1px; }
.style-pop__sample { padding: 10px; display: grid; justify-items: end; background: #fffef9; box-shadow: var(--sunken); }
.style-pop__foot { display: flex; justify-content: space-between; }
.btn--style { font-family: Georgia, "Times New Roman", serif; font-size: 15px; letter-spacing: -.5px; }
.msg-style[data-font="pixel"] { font-family: var(--font-pixel); font-size: 20px; line-height: 1.2; }
.msg-style[data-font="mono"] { font-family: var(--font-mono); font-size: 13.5px; }

/* ---------- tìm trong chat ---------- */
.findbar { display: flex; align-items: center; gap: 4px; padding: 3px 4px; margin-bottom: 4px; box-shadow: var(--thin-sunken); font-size: 13px; }
.findbar[hidden] { display: none; }
.findbar__field { flex: 1; min-width: 80px; max-width: 280px; padding: 1px 6px; }
.findbar__field input { width: 100%; height: 24px; border: 0; outline: 0; background: transparent; font-size: 13px; }
.findbar__count { min-width: 64px; color: var(--muted); font-size: 12px; }
.findbar .btn { min-height: 26px; padding: 0 8px; font-size: 11px; }
mark.hit { background: #ffe45c; color: #000; padding: 0; }
mark.hit.is-current { background: #ff9632; outline: 2px solid #000; }

/* ---------- thẻ trong chat: thu gọn / Notepad ---------- */
.card.is-collapsed .card__body, .card.is-collapsed pre, .card.is-collapsed .notepad__menu { display: none; }
.card .tb-btn { cursor: pointer; }
.notepad__menu button { border: 0; background: transparent; padding: 1px 6px; font: 12px var(--font-ui); color: #000; }
.notepad__menu button:hover, .notepad__menu button:focus-visible { background: var(--navy); color: #fff; outline: 0; }

/* ---------- ô "tôi" trong danh bạ ---------- */
.me__btn { display: grid; justify-items: start; gap: 1px; padding: 2px 4px; border: 0; background: transparent; text-align: left; color: inherit; cursor: pointer; min-width: 0; }
.me__btn:hover .me__name { text-decoration: underline; }
.me__btn:focus-visible { outline: 1px dotted #000; }
.me__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.me__status .dot { margin-right: 5px; }
.dot--away.me__invisible { background: #c0c0c0; }

/* ---------- ẩn/hiện danh bạ ---------- */
.app-body.no-sidebar { grid-template-columns: minmax(0, 1fr) 300px; }
.app-body.no-sidebar.no-profile { grid-template-columns: minmax(0, 1fr); }
.app-body.no-sidebar .sidebar { display: none; }
#app[data-font="s"] .bubble { font-size: 13px; }
#app[data-font="l"] .bubble { font-size: 16.5px; }
#app[data-font="l"] .bubble--quote { font-size: 34px; }
@media (max-width: 1180px) {
  .app-body.no-sidebar, .app-body.no-sidebar.no-profile { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app-body.no-sidebar[data-view="list"] .sidebar { display: flex; }
  .clock-pop__body { grid-template-columns: 1fr; }
  .findbar__count { min-width: 0; }
}

/* ---------- trình bảo vệ màn hình, chờ, BIOS, tắt máy ---------- */
.saver, .standby { position: fixed; inset: 0; z-index: 700; background: #000; cursor: none; overflow: hidden; }
.saver canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.saver__marquee { position: absolute; left: 0; width: 100%; white-space: nowrap; animation: marquee 14s linear infinite; }
.saver__marquee span { display: inline-block; font: clamp(40px, 7vw, 84px)/1 var(--font-pixel); color: #ffd23f; text-shadow: 4px 4px 0 #b8352a; }
@keyframes marquee { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }
.bios { position: fixed; inset: 0; z-index: 640; background: #000; color: #c0c0c0; }
.bios pre { margin: 0; padding: 28px 32px; font: clamp(18px, 2.4vw, 24px)/1.25 var(--font-pixel); white-space: pre-wrap; }
.bios__star { position: absolute; right: 28px; top: 24px; color: #39ff6a; font: 22px/1 var(--font-pixel); text-align: center; border: 2px solid #39ff6a; padding: 6px 10px; }
.shutdown__closing { display: none; text-align: center; color: #fff; }
.shutdown__closing p { margin: 16px 0 0; font: 24px var(--font-pixel); color: #cfe0ff; }
.shutdown.is-closing { background: linear-gradient(#0b2a6f, #1d63c7 60%, #87b8ff); }
.shutdown.is-closing .shutdown__closing { display: block; }
.shutdown.is-closing .shutdown__safe { display: none; }
.shutdown__safe { display: grid; gap: 12px; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }

/* ---------- nút ⋮ menu trên điện thoại ---------- */
.chat__more { display: none; }
@media (max-width: 760px) { .chat__more { display: inline-flex; } .chat__actions [data-action="find"] { display: none; } }
.explorer__empty { grid-column: 1 / -1; text-align: center; }
[data-wall="tiles"] .desk-icon__label, [data-wall="saigon"] .desk-icon__label { background: rgba(0, 0, 0, .55); text-shadow: none; }

/* ---------- thông báo bảo vệ (bản sao / iframe) ---------- */
.guard { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: var(--teal); }
.guard__box { width: min(420px, 100%); }
.guard__body { padding: 16px 18px 18px; font-size: 14px; }
.guard__body p { margin: 0 0 8px; }

/* ---------- chỉ báo ngôn ngữ kiểu Win98 ở khay đồng hồ (VI / EN) ---------- */
.tray__lang {
  display: grid; place-items: center;
  min-width: 24px; height: 18px; padding: 0 3px;
  border: 0; background: var(--navy); color: #fff;
  font: 700 11px/1 var(--font-ui); letter-spacing: .5px;
  cursor: pointer;
}
.tray__lang:hover, .tray__lang[aria-expanded="true"] { background: var(--blue); }
.tray__lang:focus-visible { outline: 1px dotted #000; outline-offset: 1px; }
