/* ═══════════════════════════════════
   WIN98.CSS — Shared Design System
═══════════════════════════════════ */

:root {
  --win: #c0c0c0;
  --desktop: #008080;
  --text: #000000;
  --white: #ffffff;
  --shadow: #808080;
  --black: #000000;
  --inset: #dfdfdf;
  --highlight: #000080;
  --hl-text: #ffffff;
  --font: 'Tahoma', 'Arial', sans-serif;
  --title-from: #000080;
  --title-to: #1084d0;
  --title-inactive-from: #7b7b7b;
  --title-inactive-to: #b0b0b0;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  background: var(--desktop);
  min-height: 100vh;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--win); }
::-webkit-scrollbar-thumb {
  background: var(--win);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
}
::-webkit-scrollbar-button {
  background: var(--win);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
  height: 16px; width: 16px;
  display: block;
}

/* ── WINDOW ── */
.win {
  background: var(--win);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
  box-shadow: 1px 1px 0 var(--black);
}

.win-title {
  background: linear-gradient(to right, var(--title-from), var(--title-to));
  padding: 3px 4px 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  user-select: none;
}
.win.inactive .win-title {
  background: linear-gradient(to right, var(--title-inactive-from), var(--title-inactive-to));
}
.win-title-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
  font-size: 11px;
  font-weight: bold;
  flex: 1;
  min-width: 0;
}
.win-title-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-title-text img { width: 14px; height: 14px; flex-shrink: 0; }

.win-controls { display: flex; gap: 2px; flex-shrink: 0; }
.wc {
  width: 16px; height: 14px;
  background: var(--win);
  border-top: 1px solid var(--white);
  border-left: 1px solid var(--white);
  border-right: 1px solid var(--shadow);
  border-bottom: 1px solid var(--shadow);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: bold; color: var(--text);
  text-decoration: none; line-height: 1; flex-shrink: 0;
}
.wc:active {
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
}

/* ── MENU BAR ── */
.win-menu {
  display: flex;
  background: var(--win);
  padding: 1px 2px;
  border-bottom: 1px solid var(--shadow);
}
.wm-item {
  font-size: 11px; padding: 2px 8px;
  cursor: pointer; color: var(--text);
  text-decoration: none; display: block; white-space: nowrap;
}
.wm-item:hover, .wm-item.active { background: var(--highlight); color: var(--hl-text); }
.wm-item.disabled { color: var(--shadow); pointer-events: none; }

/* ── ADDRESS BAR ── */
.win-address {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 4px; border-bottom: 1px solid var(--shadow);
}
.address-label { font-size: 11px; white-space: nowrap; }
.address-val {
  flex: 1;
  background: var(--white);
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
  padding: 1px 4px; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── TOOLBAR ── */
.win-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 2px 4px; border-bottom: 1px solid var(--shadow); flex-wrap: wrap;
}
.tb-sep-v {
  width: 6px; height: 20px;
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  flex-shrink: 0;
}

/* ── STATUS BAR ── */
.win-status {
  display: flex; align-items: center;
  padding: 1px 3px; border-top: 1px solid var(--shadow); gap: 2px;
}
.ws-panel {
  font-size: 11px; padding: 1px 5px;
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
  color: var(--text); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── BUTTON ── */
.btn98 {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 75px; padding: 3px 14px;
  background: var(--win);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
  box-shadow: 1px 1px 0 var(--black);
  font-family: var(--font); font-size: 11px; color: var(--text);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn98:active {
  border-top: 2px solid var(--shadow);
  border-left: 2px solid var(--shadow);
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  box-shadow: none; padding: 4px 13px 2px 15px;
}
.btn98.small { min-width: auto; padding: 1px 8px; font-size: 11px; }
.btn98.danger { color: #800000; }
.btn98:focus-visible { outline: 1px dotted var(--black); outline-offset: -5px; }

/* ── INPUTS ── */
.input98, .textarea98, .select98 {
  background: var(--white);
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
  font-family: var(--font); font-size: 12px;
  padding: 2px 4px; color: var(--text);
  outline: none; width: 100%;
}
.textarea98 { resize: vertical; line-height: 1.6; }
.select98 { cursor: pointer; }

/* ── INSET PANEL ── */
.inset98 {
  background: var(--white);
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
}

/* ── LIST VIEW ── */
.list98 {
  background: var(--white);
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
}
.list-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px; font-size: 11px; cursor: pointer;
  border-bottom: 1px solid transparent;
  text-decoration: none; color: var(--text);
}
.list-row:hover, .list-row.selected {
  background: var(--highlight); color: var(--hl-text);
}
.list-row:last-child { border-bottom: none; }

/* ── SEP ── */
.sep98 {
  border: none;
  border-top: 1px solid var(--shadow);
  border-bottom: 1px solid var(--white);
  margin: 6px 0;
}

/* ── PROGRESS ── */
.progress98 {
  background: var(--white);
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
  height: 16px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--highlight);
}

/* ── TAG CHIP ── */
.tag98 {
  display: inline-block;
  font-size: 10px; padding: 1px 5px;
  background: var(--win);
  border: 1px solid var(--shadow);
  cursor: pointer; color: var(--text);
  white-space: nowrap;
}
.tag98:hover { background: var(--highlight); color: var(--hl-text); }

/* ── TASKBAR ── */
#taskbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 28px; background: var(--win);
  border-top: 2px solid var(--white);
  display: flex; align-items: center;
  gap: 3px; padding: 0 3px; z-index: 9999;
}
#start-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 1px 8px; height: 22px;
  background: var(--win);
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
  border-right: 2px solid var(--shadow);
  border-bottom: 2px solid var(--shadow);
  box-shadow: 1px 1px 0 var(--black);
  font-family: var(--font); font-size: 11px; font-weight: bold;
  cursor: pointer; color: var(--text); text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
#start-btn:active {
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  box-shadow: none;
}
.tb-div {
  width: 6px; height: 22px;
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  flex-shrink: 0;
}
.tb-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 1px 8px; height: 22px;
  background: var(--win);
  border: 2px solid;
  border-color: var(--white) var(--shadow) var(--shadow) var(--white);
  font-family: var(--font); font-size: 11px;
  cursor: pointer; color: var(--text);
  text-decoration: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0;
}
.tb-btn.active {
  border-color: var(--shadow) var(--white) var(--white) var(--shadow);
  background: var(--inset);
  box-shadow: inset 1px 1px 1px rgba(0,0,0,0.2);
}
.tb-clock {
  margin-left: auto;
  font-family: var(--font); font-size: 11px;
  padding: 2px 6px;
  border-top: 1px solid var(--shadow);
  border-left: 1px solid var(--shadow);
  border-right: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
  min-width: 55px; text-align: center; white-space: nowrap;
  flex-shrink: 0;
}

/* ── DESKTOP ICONS ── */
.di {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  width: 72px; padding: 6px 4px;
  cursor: pointer; text-decoration: none;
}
.di:hover .di-label, .di:focus .di-label {
  background: var(--highlight);
  color: var(--hl-text);
  outline: 1px dotted var(--hl-text);
}
.di-img { width: 32px; height: 32px; }
.di-label {
  font-family: var(--font); font-size: 11px;
  color: var(--white);
  text-align: center;
  text-shadow: 1px 1px 1px var(--black);
  word-break: break-word; padding: 0 2px;
  line-height: 1.4; max-width: 70px;
}

/* ── PAGE LAYOUT ── */
.page-wrap {
  display: flex; justify-content: center;
  padding: 8px 8px 36px;
  min-height: 100vh;
}
.page-win {
  width: 100%; max-width: 900px;
  min-height: calc(100vh - 52px);
  display: flex; flex-direction: column;
}
.win-body {
  flex: 1; overflow-y: auto;
  background: var(--win);
}
.win-content {
  padding: 12px 16px;
}

/* ── TYPOGRAPHY ── */
.win-body h1 { font-size: 16px; font-weight: bold; margin-bottom: 8px; }
.win-body h2 { font-size: 13px; font-weight: bold; margin-bottom: 6px; }
.win-body h3 { font-size: 12px; font-weight: bold; margin-bottom: 4px; }
.win-body p { font-size: 12px; line-height: 1.7; margin-bottom: 8px; }
.win-body a { color: #0000ee; }
.win-body a:visited { color: #551a8b; }
.win-body ul, .win-body ol { padding-left: 20px; margin-bottom: 8px; font-size: 12px; line-height: 1.7; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .page-wrap { padding: 0 0 28px; }
  .page-win { max-width: 100%; min-height: calc(100vh - 28px); }
  .tb-btn { display: none; }
  .win-address { display: none; }
}
