:root {
      --xp-blue: #245edb;
      --xp-blue-dark: #003399;
      --xp-blue-light: #4f8cff;
      --xp-green: #3baa35;
      --xp-green-dark: #1b721d;
      --xp-cream: #ece9d8;
      --xp-border: #0a246a;
      --xp-text: #111;
      --shadow: rgba(0, 0, 0, 0.28);
    }

    * {
      box-sizing: border-box;
    }

    html {
      min-height: 100%;
      font-size: 16px;
    }

    body {
      min-height: 100vh;
      margin: 0;
      color: var(--xp-text);
      font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
      background:
        radial-gradient(circle at 18% 15%, rgba(255, 255, 255, 0.9) 0 7%, transparent 8%),
        linear-gradient(170deg, #5ba7ff 0 38%, transparent 39%),
        linear-gradient(18deg, #2d9f38 0 27%, #64c649 28% 40%, transparent 41%),
        linear-gradient(165deg, transparent 0 45%, #1f7e28 46% 63%, #155d20 64%),
        #5ba7ff;
      background-attachment: fixed;
      overflow-x: hidden;
    }

    button,
    input,
    textarea,
    select {
      font: inherit;
    }

    button {
      color: inherit;
    }

    .desktop {
      min-height: 100vh;
      padding: clamp(14px, 4vw, 42px) clamp(12px, 4vw, 40px) 72px;
      display: grid;
      place-items: start center;
    }

    .window {
      width: min(1120px, 100%);
      border: 2px solid var(--xp-border);
      border-radius: 7px 7px 2px 2px;
      background: var(--xp-cream);
      box-shadow: 8px 12px 26px var(--shadow);
      overflow: hidden;
    }

    .titlebar {
      min-height: 38px;
      color: #fff;
      background:
        linear-gradient(180deg, var(--xp-blue-light), var(--xp-blue) 45%, var(--xp-blue-dark));
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 6px 8px 6px 10px;
      text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.38);
      user-select: none;
    }

    .titlebar-title {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      font-weight: 700;
      line-height: 1.15;
    }

    .titlebar-title span:last-child {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .app-icon {
      width: 22px;
      height: 22px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      border: 1px solid rgba(255, 255, 255, 0.7);
      background: linear-gradient(135deg, #ffea75 0 46%, #e0572f 47% 100%);
      box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.8);
    }

    .app-icon::before {
      content: "?";
      color: #103a8c;
      font-size: 16px;
      font-weight: 700;
      text-shadow: none;
    }

    .window-buttons {
      display: inline-flex;
      gap: 4px;
      flex: 0 0 auto;
    }

    .window-button {
      width: 24px;
      height: 23px;
      border: 1px solid #fff;
      border-radius: 3px;
      color: #fff;
      font-weight: 700;
      line-height: 1;
      background: linear-gradient(180deg, #84a8f4, #2d65d8 55%, #0a3aa8);
      box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.7);
    }

    .window-button.close {
      background: linear-gradient(180deg, #ffb08b, #e65329 50%, #b72513);
    }

    .menubar {
      display: flex;
      flex-wrap: wrap;
      gap: 2px;
      padding: 3px 8px;
      border-bottom: 1px solid #fff;
      background: #efeadb;
      font-size: 0.85rem;
    }

    .menu-item {
      padding: 3px 9px;
      border: 1px solid transparent;
    }

    .menu-item:first-letter {
      text-decoration: underline;
    }

    .menu-item:hover {
      border-color: #aca899;
      background: #fff;
    }

    .content {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 294px;
      gap: 16px;
      padding: clamp(12px, 3vw, 22px);
    }

    .survey-panel,
    .assistant-panel,
    .dialog {
      border: 2px solid;
      border-color: #fff #808080 #808080 #fff;
      background: var(--xp-cream);
      box-shadow: inset -1px -1px 0 #c0c0c0, inset 1px 1px 0 #fff;
    }

    .survey-panel {
      min-width: 0;
    }

    .panel-header {
      padding: 13px 15px 10px;
      border-bottom: 1px solid #b7b3a7;
      background: linear-gradient(180deg, #fffdf2, #eee8d2);
    }

    .panel-header h1 {
      margin: 0 0 5px;
      font-size: clamp(1.15rem, 3vw, 1.65rem);
      line-height: 1.2;
      letter-spacing: 0;
    }

    .panel-header p {
      margin: 0;
      color: #333;
      line-height: 1.4;
      font-size: 0.94rem;
    }

    .progress-wrap {
      padding: 12px 15px;
      display: grid;
      gap: 8px;
      border-bottom: 1px solid #b7b3a7;
      background: #f7f3e4;
    }

    .progress-label {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      font-size: 0.82rem;
      color: #1b1b1b;
    }

    .progress-shell {
      height: 20px;
      border: 2px solid;
      border-color: #808080 #fff #fff #808080;
      background: #fff;
      padding: 2px;
    }

    .progress-bar {
      width: 0%;
      height: 100%;
      background:
        repeating-linear-gradient(90deg, #42aa39 0 11px, #2b8d2e 12px 14px);
      transition: width 180ms ease;
    }

    .tabs {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
      gap: 4px;
      max-height: 174px;
      overflow: auto;
      padding: 10px 12px 0;
      background: var(--xp-cream);
    }

    .tab {
      min-height: 34px;
      padding: 6px 9px;
      border: 2px solid;
      border-color: #fff #808080 #808080 #fff;
      background: #dcd8c9;
      cursor: pointer;
      text-align: left;
      line-height: 1.2;
    }

    .tab[aria-selected="true"] {
      position: relative;
      top: 2px;
      z-index: 1;
      background: #fffdf2;
      border-bottom-color: #fffdf2;
      font-weight: 700;
    }

    form {
      padding: 14px;
      background: #fffdf2;
      border-top: 2px solid #808080;
    }

    .step {
      display: none;
      animation: enter 180ms ease;
    }

    .step.active {
      display: grid;
      gap: 14px;
    }

    @keyframes enter {
      from {
        opacity: 0;
        transform: translateY(4px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    fieldset {
      min-width: 0;
      margin: 0;
      padding: 14px;
      border: 2px solid;
      border-color: #808080 #fff #fff #808080;
      background: #f4f0df;
    }

    legend {
      padding: 0 7px;
      color: #003399;
      font-weight: 700;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 13px;
    }

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

    .field.full,
    .group-note,
    .choice-grid.full {
      grid-column: 1 / -1;
    }

    label,
    .question {
      font-size: 0.93rem;
      line-height: 1.35;
    }

    .group-note {
      margin: 0 0 10px;
      color: #333;
      font-size: 0.88rem;
      line-height: 1.4;
    }

    input[type="text"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
      width: 100%;
      min-height: 38px;
      border: 2px solid;
      border-color: #808080 #fff #fff #808080;
      border-radius: 0;
      background: #fff;
      color: #111;
      padding: 8px;
      outline: none;
    }

    input[type="number"] {
      appearance: textfield;
    }

    textarea {
      min-height: 122px;
      resize: vertical;
    }

    input:focus,
    textarea:focus,
    select:focus {
      box-shadow: 0 0 0 2px #ffdf5b;
    }

    .choice-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .choice {
      min-height: 46px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px;
      border: 2px solid;
      border-color: #fff #808080 #808080 #fff;
      background: #ece9d8;
      cursor: pointer;
    }

    .choice:has(input:checked) {
      background: #d9ecff;
      outline: 2px solid #2d65d8;
      outline-offset: -4px;
    }

    .choice input {
      width: 18px;
      height: 18px;
      flex: 0 0 auto;
      accent-color: #245edb;
    }

    .matrix-wrap {
      overflow-x: auto;
      border: 2px solid;
      border-color: #808080 #fff #fff #808080;
      background: #fff;
    }

    .matrix {
      width: 100%;
      min-width: 680px;
      border-collapse: collapse;
      background: #fff;
    }

    .matrix th,
    .matrix td {
      padding: 8px;
      border: 1px solid #c8c1aa;
      text-align: center;
      font-size: 0.86rem;
      line-height: 1.25;
    }

    .matrix th {
      background: #ece9d8;
      color: #003399;
    }

    .matrix th:first-child,
    .matrix td:first-child {
      text-align: left;
      width: 28%;
    }

    .matrix input {
      width: 18px;
      height: 18px;
      accent-color: #245edb;
    }

    .rank-list {
      display: grid;
      gap: 8px;
    }

    .rank-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 130px;
      gap: 10px;
      align-items: center;
      padding: 9px;
      border: 2px solid;
      border-color: #fff #808080 #808080 #fff;
      background: #ece9d8;
    }

    .actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 10px;
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid #b7b3a7;
    }

    .button-group {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .xp-button {
      min-height: 38px;
      min-width: 92px;
      padding: 7px 14px;
      border: 2px solid;
      border-color: #fff #404040 #404040 #fff;
      background: linear-gradient(180deg, #fffef8, #d8d1bd);
      color: #111;
      cursor: pointer;
      box-shadow: inset -1px -1px 0 #aca899, inset 1px 1px 0 #fff;
    }

    .xp-button:active {
      border-color: #404040 #fff #fff #404040;
      padding: 8px 13px 6px 15px;
    }

    .xp-button.primary {
      color: #fff;
      background: linear-gradient(180deg, #6fb067, #3baa35 45%, #1b721d);
      text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
    }

    .xp-button[disabled] {
      color: #777;
      cursor: not-allowed;
      background: #d8d1bd;
      text-shadow: 1px 1px 0 #fff;
    }

    .assistant-panel {
      align-self: start;
      position: sticky;
      top: 18px;
      padding: 14px;
      background: #fffdf2;
    }

    .bubble {
      position: relative;
      margin-bottom: 18px;
      padding: 13px;
      border: 2px solid #000;
      border-radius: 12px;
      background: #fff;
      line-height: 1.35;
      box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
      font-size: 0.92rem;
    }

    .bubble::after {
      content: "";
      position: absolute;
      right: 30px;
      bottom: -14px;
      width: 22px;
      height: 22px;
      background: #fff;
      border-right: 2px solid #000;
      border-bottom: 2px solid #000;
      transform: rotate(45deg);
    }

    .clippy-wrap {
      min-height: 214px;
      display: grid;
      place-items: center;
      padding: 8px 0 14px;
    }

    .clippy {
      --clippy-scale: 1;
      position: relative;
      width: 132px;
      height: 182px;
      transform-origin: center bottom;
      animation: bob 2.6s ease-in-out infinite;
    }

    @keyframes bob {
      0%, 100% {
        transform: scale(var(--clippy-scale)) translateY(0) rotate(-1deg);
      }
      50% {
        transform: scale(var(--clippy-scale)) translateY(-5px) rotate(1.5deg);
      }
    }

    .clip-outer,
    .clip-inner {
      position: absolute;
      border: 12px solid #b7bcc4;
      border-radius: 66px;
      box-shadow: inset 3px 3px 0 #f6f8ff, inset -3px -3px 0 #7f8791;
    }

    .clip-outer {
      inset: 10px 16px 4px 20px;
      border-left-color: transparent;
      transform: rotate(-13deg);
    }

    .clip-inner {
      inset: 36px 43px 29px 49px;
      border-left-color: transparent;
      border-width: 9px;
      transform: rotate(-13deg);
    }

    .eye {
      position: absolute;
      top: 49px;
      width: 26px;
      height: 34px;
      border: 2px solid #111;
      border-radius: 50%;
      background: #fff;
      z-index: 3;
    }

    .eye.left {
      left: 41px;
    }

    .eye.right {
      left: 69px;
    }

    .eye::after {
      content: "";
      position: absolute;
      width: 9px;
      height: 12px;
      left: 9px;
      top: 12px;
      border-radius: 50%;
      background: #111;
      transition: transform 160ms ease;
    }

    .clippy.thinking .eye::after {
      transform: translate(3px, -2px);
    }

    .brow {
      position: absolute;
      top: 42px;
      width: 24px;
      height: 5px;
      background: #111;
      border-radius: 4px;
      z-index: 4;
    }

    .brow.left {
      left: 42px;
      transform: rotate(-16deg);
    }

    .brow.right {
      left: 70px;
      transform: rotate(16deg);
    }

    .mouth {
      position: absolute;
      left: 58px;
      top: 86px;
      width: 35px;
      height: 18px;
      border-bottom: 4px solid #111;
      border-radius: 0 0 42px 42px;
      z-index: 4;
    }

    .assistant-tools {
      display: grid;
      gap: 8px;
    }

    .assistant-tools .xp-button {
      width: 100%;
      min-width: 0;
    }

    .status-line {
      margin: 12px 0 0;
      padding: 8px;
      border: 1px solid #aca899;
      background: #f4f0df;
      font-size: 0.82rem;
      line-height: 1.35;
    }

    .taskbar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      min-height: 48px;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 8px;
      background: linear-gradient(180deg, #245edb, #0b46c8 48%, #003399);
      box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.24);
      color: #fff;
      z-index: 10;
    }

    .start-button {
      min-height: 36px;
      padding: 6px 16px;
      border: 1px solid #0b5f13;
      border-radius: 18px 8px 8px 18px;
      background: linear-gradient(180deg, #83d66c, #2ea53a 50%, #117822);
      color: #fff;
      font-weight: 700;
      text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
      box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.65);
    }

    .task {
      min-width: 0;
      max-width: 420px;
      height: 34px;
      display: flex;
      align-items: center;
      padding: 0 12px;
      border: 1px solid rgba(255, 255, 255, 0.46);
      background: linear-gradient(180deg, #4d86ee, #1f58d0);
      box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.35);
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-size: 0.86rem;
    }

    .clock {
      margin-left: auto;
      min-width: 82px;
      padding: 7px 10px;
      border-left: 1px solid rgba(255, 255, 255, 0.35);
      text-align: center;
      font-size: 0.85rem;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(0, 0, 0, 0.35);
      z-index: 20;
    }

    .modal-backdrop.show {
      display: flex;
    }

    .dialog {
      width: min(520px, 100%);
      background: var(--xp-cream);
    }

    .dialog-body {
      padding: 18px;
      background: #fffdf2;
      line-height: 1.45;
    }

    .dialog-body h2 {
      margin: 0 0 8px;
      font-size: 1.2rem;
    }

    .dialog-body p {
      margin: 0 0 14px;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    @media (max-width: 860px) {
      .content {
        grid-template-columns: 1fr;
      }

      .assistant-panel {
        position: static;
        order: -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 150px;
        gap: 12px;
        align-items: center;
      }

      .bubble {
        margin: 0;
      }

      .bubble::after {
        right: -13px;
        bottom: 34px;
      }

      .clippy-wrap {
        min-height: 156px;
        padding: 0;
      }

      .clippy {
        --clippy-scale: 0.78;
      }

      .assistant-tools,
      .status-line {
        grid-column: 1 / -1;
      }
    }

    @media (max-width: 620px) {
      .desktop {
        padding-left: 8px;
        padding-right: 8px;
        padding-bottom: 78px;
      }

      .titlebar {
        min-height: 34px;
      }

      .window-button {
        width: 22px;
        height: 21px;
      }

      .content {
        padding: 9px;
        gap: 10px;
      }

      .assistant-panel {
        grid-template-columns: minmax(0, 1fr) 88px;
        gap: 8px;
      }

      .bubble {
        font-size: 0.88rem;
      }

      .bubble::after {
        right: -13px;
        bottom: 30px;
      }

      .clippy-wrap {
        display: grid;
        min-height: 118px;
        overflow: hidden;
      }

      .clippy {
        --clippy-scale: 0.56;
      }

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

      .rank-row {
        grid-template-columns: 1fr;
      }

      .tabs {
        grid-template-columns: 1fr 1fr;
        max-height: 230px;
      }

      .tab {
        width: 100%;
        padding-left: 6px;
        padding-right: 6px;
      }

      form {
        padding: 10px;
      }

      fieldset {
        padding: 10px;
      }

      .actions,
      .button-group {
        display: grid;
        grid-template-columns: 1fr;
      }

      .xp-button {
        width: 100%;
      }

      .task {
        display: none;
      }
    }
