:root {
  /* 本来の Win95 配色（仕様 U1） */
  --surface: #c0c0c0;
  --desktop: #008080;
  --title-active: #000080;
  --title-active-2: #1084d0;
  --title-inactive: #808080;
  --hi: #ffffff;
  --hi-2: #dfdfdf;
  --sh: #808080;
  --sh-2: #000000;
  --text: #000000;
  --text-disabled: #808080;
  --link: #0000c0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--desktop);
}

body {
  margin: 0;
  min-width: 0;
  /* ページ全体をスクロールし、固定タスクバーの分だけ下を空ける（仕様 U2） */
  padding-bottom: 44px;
  background: var(--desktop);
  color: var(--text);
  font-family: 'MS Sans Serif', Tahoma, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

button,
input,
select {
  max-width: 100%;
  color: var(--text);
  font: inherit;
}

button {
  cursor: default;
}

a {
  color: var(--link);
}

.desktop {
  width: 100%;
  min-width: 0;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.window,
.program-card,
.panel,
.win-button,
.menu-toggle,
.window-controls button,
.taskbar,
.task-button,
.start-button,
.start-menu {
  background: var(--surface);
  border: 2px solid;
  border-color: var(--hi) var(--sh-2) var(--sh-2) var(--hi);
  box-shadow: inset 1px 1px var(--hi-2), inset -1px -1px var(--sh);
}

.window {
  width: min(100%, 1120px);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.title-bar {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: 2px;
  padding: 2px;
  background: linear-gradient(90deg, var(--title-active), var(--title-active-2));
  color: var(--hi);
  font-weight: 700;
}

.title-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: anywhere;
}

.window-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background:
    linear-gradient(90deg, #ff0000 0 35%, #ffffff 35% 42%, #00a000 42% 70%, #ffffff 70% 77%, #0000c0 77%),
    var(--hi);
  border: 1px solid var(--sh-2);
}

.window-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.window-controls button {
  width: 22px;
  height: 20px;
  padding: 0;
  line-height: 16px;
  font-weight: 700;
}

.menu-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 2px 4px 4px;
  border-bottom: 1px solid var(--sh);
}

.menu-toggle {
  display: none;
  width: 28px;
  min-height: 24px;
  padding: 0;
  font-weight: 700;
}

.menu-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
}

.menu-mobile-link {
  display: none;
}

.menu-bar a {
  padding: 2px 8px;
  color: var(--text);
  text-decoration: none;
}

.menu-bar a:hover,
.menu-bar a:focus {
  background: var(--title-active);
  color: var(--hi);
  outline: none;
}

.window-body {
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 8px;
}

.hero {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 8px;
  padding: 8px;
  background: var(--hi-2);
  border: 2px solid;
  border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  box-shadow: inset 1px 1px var(--sh-2), inset -1px -1px var(--hi-2);
}

.eyebrow {
  margin: 0 0 4px;
  font-weight: 700;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 6vw, 36px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.tagline {
  margin: 6px 0 0;
  font-weight: 700;
}

.hero-copy {
  margin: 0;
}

.programs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  min-width: 0;
}

.program-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 7px;
  text-align: center;
  overflow-wrap: anywhere;
}

.program-card:hover {
  outline: 1px dotted var(--sh-2);
  outline-offset: -5px;
}

.program-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.program-icon svg {
  width: 28px;
  height: 28px;
  fill: #ffff80;
  stroke: var(--sh-2);
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.news-icon svg,
.note-icon svg {
  fill: var(--hi);
}

.tool-icon svg {
  fill: #8080ff;
}

.globe-icon svg {
  fill: #80ffff;
}

.disk-icon svg {
  fill: #4040c0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
  gap: 8px;
  min-width: 0;
}

.group-box {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 2px groove var(--hi);
}

.group-box legend {
  padding: 0 5px;
}

.control-row,
.input-action,
.task-buttons,
.link-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.field-line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  margin-top: 7px;
}

.check-line,
.option-stack label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 7px;
}

.option-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  min-width: 0;
}

input[type='text'],
input[type='search'],
select {
  min-width: 0;
  width: 100%;
  height: 26px;
  padding: 3px 5px;
  background: var(--hi);
  border: 2px solid;
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
}

input[type='checkbox'],
input[type='radio'] {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  accent-color: var(--title-active);
}

.win-button,
.task-button,
.start-button {
  min-height: 28px;
  padding: 4px 12px;
}

.win-button:active,
.menu-toggle:active,
.window-controls button:active,
.task-button:active,
.start-button:active {
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
  transform: translate(1px, 1px);
}

.win-button:disabled {
  color: var(--text-disabled);
  text-shadow: 1px 1px var(--hi);
}

.panel {
  min-width: 0;
  padding: 8px;
}

.search-form {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.input-action input {
  flex: 1 1 170px;
}

.link-footer {
  margin-top: 8px;
}

.list-section {
  min-width: 0;
}

.sunken-list,
.clock-panel,
.status-bar span {
  background: var(--hi);
  border: 2px solid;
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
}

.sunken-list {
  min-width: 0;
  max-height: 132px;
  overflow: auto;
}

.sunken-list div {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 6px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--hi-2);
}

.sunken-list div:nth-child(2n) {
  background: #f5f5f5;
}

.sunken-list span {
  overflow-wrap: anywhere;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
  padding: 3px;
}

.status-bar span {
  min-width: 0;
  flex: 1 1 130px;
  padding: 3px 6px;
  overflow-wrap: anywhere;
}

.taskbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
}

.start-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.flag {
  width: 18px;
  height: 16px;
  display: inline-block;
  background:
    linear-gradient(90deg, #ff0000 0 48%, transparent 48%) 1px 1px / 8px 7px no-repeat,
    linear-gradient(90deg, #00a000 0 48%, transparent 48%) 9px 1px / 8px 7px no-repeat,
    linear-gradient(90deg, #0000c0 0 48%, transparent 48%) 1px 8px / 8px 7px no-repeat,
    linear-gradient(90deg, #ffff00 0 48%, transparent 48%) 9px 8px / 8px 7px no-repeat;
  border-left: 1px solid var(--sh-2);
}

.task-buttons {
  flex: 1 1 220px;
}

.task-button {
  flex: 1 1 150px;
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
}

.task-button.active {
  border-color: var(--sh-2) var(--hi) var(--hi) var(--sh-2);
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi-2);
  font-weight: 700;
}

.clock-panel {
  flex: 0 0 auto;
  min-width: 76px;
  padding: 5px 10px;
  text-align: center;
}

.start-menu {
  position: fixed;
  left: 4px;
  bottom: 44px;
  z-index: 11;
  display: flex;
  width: min(260px, calc(100vw - 8px));
  min-width: 0;
}

.start-menu[hidden] {
  display: none;
}

.start-rail {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 10px 4px;
  background: linear-gradient(180deg, var(--title-active), var(--title-active-2));
  color: var(--hi);
  font-size: 18px;
  font-weight: 700;
}

.start-items {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px;
}

.start-items a {
  display: block;
  padding: 7px 10px;
  color: var(--text);
  text-decoration: none;
}

.start-items a:hover,
.start-items a:focus {
  background: var(--title-active);
  color: var(--hi);
  outline: none;
}

@media (max-width: 680px) {
  body {
    font-size: 13px;
  }

  .desktop {
    padding: 8px 6px;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .field-line,
  .sunken-list div {
    grid-template-columns: 1fr;
  }

  .programs {
    display: none;
  }

  .menu-toggle {
    display: inline-block;
    flex: 0 0 auto;
  }

  .menu-panel {
    display: none;
    flex: 1 1 100%;
    margin-top: 3px;
    padding: 4px;
    background: var(--surface);
    border: 2px solid;
    border-color: var(--hi) var(--sh-2) var(--sh-2) var(--hi);
    box-shadow: inset 1px 1px var(--hi-2), inset -1px -1px var(--sh);
  }

  .menu-bar.is-open .menu-panel {
    display: flex;
  }

  .menu-mobile-link {
    display: block;
  }

  .menu-panel a {
    flex: 1 1 118px;
    padding: 5px 8px;
  }

  .taskbar {
    align-items: stretch;
  }

  .clock-panel {
    flex: 1 1 76px;
  }
}
