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

body {
    font-family: 'IBM Plex Sans', sans-serif;
    overflow: hidden;
    background: linear-gradient(180deg, #7B8FA1 0%, #5A6F82 100%);
    min-height: 100vh;
}

/* Desktop Layout */
.sgi-desktop {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #7B8FA1 0%, #5A6F82 50%, #4A5F72 100%);
    position: relative;
    overflow: hidden;
}

/* Toolchest */
.toolchest {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: linear-gradient(180deg, #C8C8C8 0%, #A0A0A0 100%);
    border-bottom: 2px solid #888;
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toolchest-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    padding: 2px 12px;
    background: linear-gradient(180deg, #E0E0E0 0%, #B0B0B0 100%);
    border: 1px solid #888;
    border-radius: 2px;
    margin-right: 16px;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #666;
}

.toolchest-menus {
    display: flex;
    gap: 4px;
}

.toolchest-menu {
    position: relative;
}

.menu-label {
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    color: #222;
}

.menu-label:hover {
    background: rgba(0,0,0,0.1);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #C0C0C0;
    border: 2px outset #ddd;
    min-width: 150px;
    z-index: 1001;
    box-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

.dropdown-item {
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    color: #222;
}

.dropdown-item:hover {
    background: #008080;
    color: white;
}

/* Windows */
.sgi-window {
    position: absolute;
    background: #C0C0C0;
    border: 3px outset #ddd;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

.window-titlebar {
    background: linear-gradient(90deg, #5A6F82 0%, #7B8FA1 50%, #5A6F82 100%);
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 2px solid #4A5F72;
}

.window-title {
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.window-controls {
    display: flex;
    gap: 4px;
}

.win-btn {
    width: 14px;
    height: 14px;
    border: 2px outset #888;
    cursor: pointer;
}

.win-btn.minimize {
    background: linear-gradient(180deg, #E8D44D 0%, #C4B030 100%);
}

.win-btn.maximize {
    background: linear-gradient(180deg, #4DE84D 0%, #30C430 100%);
}

.win-btn.close {
    background: linear-gradient(180deg, #E84D4D 0%, #C43030 100%);
}

.win-btn:active {
    border-style: inset;
}

.window-menubar {
    background: #D0D0D0;
    padding: 2px 8px;
    border-bottom: 1px solid #888;
    display: flex;
    gap: 16px;
    font-size: 11px;
}

.window-content {
    flex: 1;
    overflow: auto;
    background: #C8C8C8;
    padding: 8px;
}

/* Icon Catalog */
.icon-catalog {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #5A6F82;
    border: 2px inset #444;
}

.catalog-header {
    background: linear-gradient(90deg, #4A5F72 0%, #6B8095 50%, #4A5F72 100%);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
}

.catalog-menubar {
    background: #D0D0D0;
    padding: 4px 8px;
    display: flex;
    gap: 20px;
    font-size: 11px;
    border-bottom: 1px solid #888;
    color: #222;
}

.catalog-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    background: linear-gradient(180deg, #5A6F82 0%, #4A5F72 100%);
    overflow-y: auto;
}

.catalog-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.catalog-icon:hover {
    background: rgba(255,255,255,0.1);
}

.icon-shape {
    width: 32px;
    height: 32px;
    transform: perspective(100px) rotateX(-10deg) rotateY(15deg);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    border-radius: 4px;
}

.icon-label {
    color: white;
    font-size: 10px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.catalog-tabs {
    display: flex;
    background: #B0B0B0;
    border-top: 2px solid #888;
}

.tab-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 10px;
    border: none;
    background: #C0C0C0;
    cursor: pointer;
    border-right: 1px solid #888;
}

.tab-btn.active {
    background: #D8D8D8;
    border-bottom: 2px solid #008080;
}

.catalog-footer {
    background: #D0D0D0;
    padding: 4px 8px;
    font-size: 10px;
    color: #444;
    text-align: center;
}

/* Audio Panel */
.audio-panel {
    display: flex;
    gap: 20px;
    padding: 8px;
}

.audio-section {
    flex: 1;
    background: #D8D8D8;
    border: 2px inset #aaa;
    padding: 8px;
}

.audio-header {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #999;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.audio-label {
    font-size: 10px;
    color: #444;
    margin-bottom: 8px;
}

.slider-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.slider-labels {
    display: flex;
    flex-direction: column;
    gap: 40px;
    font-size: 10px;
    color: #444;
}

.slider-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sgi-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 100px;
    background: linear-gradient(180deg, #333 0%, #666 100%);
    border: 2px inset #444;
    writing-mode: bt-lr;
    -webkit-appearance: slider-vertical;
}

.sgi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 10px;
    background: linear-gradient(180deg, #E0E0E0 0%, #A0A0A0 100%);
    border: 2px outset #ccc;
    cursor: pointer;
}

.db-scale {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 8px;
    color: #666;
}

.audio-rate {
    font-size: 10px;
    color: #444;
    margin: 8px 0;
}

.audio-buttons {
    display: flex;
    gap: 4px;
}

.sgi-btn {
    padding: 4px 12px;
    font-size: 10px;
    background: linear-gradient(180deg, #D8D8D8 0%, #B0B0B0 100%);
    border: 2px outset #ccc;
    cursor: pointer;
}

.sgi-btn:active, .sgi-btn.active {
    border-style: inset;
    background: linear-gradient(180deg, #A0A0A0 0%, #C0C0C0 100%);
}

/* Confidence Tests */
.confidence-tests {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
}

.device-icons {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: #D8D8D8;
    border-bottom: 2px solid #999;
}

.device-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: #333;
}

.device-shape {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6B4C9A 0%, #4A3670 100%);
    border: 2px outset #8B6CBA;
    border-radius: 4px;
}

.probe-output {
    padding: 8px;
    background: #1a1a2e;
    color: #00ff88;
    min-height: 80px;
}

.probe-line {
    margin: 2px 0;
}

/* gr_osview */
.gr-osview {
    background: #1a1a2e;
    padding: 4px;
}

.osview-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    padding: 4px;
    font-family: 'IBM Plex Mono', monospace;
}

.usage-values {
    color: #666;
}

.usage-numbers {
    color: #00ff88;
}

.osview-canvas {
    width: 100%;
    border: 1px solid #333;
}

/* Terminal */
.terminal {
    background: #1a1a2e;
    color: #00ff88;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    padding: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 8px;
}

.terminal-input {
    display: flex;
    align-items: center;
}

.terminal-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff88;
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* About Dialog */
.about-dialog {
    text-align: center;
    padding: 20px;
}

.sgi-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.sgi-cube {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #E86850 0%, #6B4C9A 50%, #008080 100%);
    transform: perspective(100px) rotateX(-15deg) rotateY(25deg);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4);
}

.sgi-logo span {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.about-text h2 {
    font-size: 16px;
    color: #444;
    margin-bottom: 12px;
}

.about-text p {
    font-size: 12px;
    color: #555;
    margin: 8px 0;
}

.powered-by {
    margin-top: 20px;
    font-size: 11px;
    color: #008080;
    font-weight: 500;
}

/* Desktop Icons */
.desktop-icons-container {
    position: fixed;
    right: 20px;
    top: 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}

.desktop-icon:hover {
    background: rgba(255,255,255,0.15);
}

.icon-3d {
    width: 40px;
    height: 40px;
    transform: perspective(100px) rotateX(-10deg) rotateY(15deg);
    box-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    border-radius: 4px;
    border: 2px outset rgba(255,255,255,0.3);
}

.icon-name {
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(180deg, #C8C8C8 0%, #A0A0A0 100%);
    border-top: 2px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 8px;
    z-index: 999;
}

.taskbar-btn {
    padding: 4px 12px;
    font-size: 11px;
    background: linear-gradient(180deg, #D8D8D8 0%, #B0B0B0 100%);
    border: 2px outset #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.desk-icon {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #008080 0%, #006666 100%);
    border: 1px solid #004444;
}

.taskbar-windows {
    flex: 1;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.taskbar-window {
    padding: 4px 12px;
    font-size: 10px;
    background: linear-gradient(180deg, #C0C0C0 0%, #A0A0A0 100%);
    border: 2px outset #bbb;
    cursor: pointer;
    white-space: nowrap;
}

.taskbar-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: #444;
    padding: 0 8px;
    border-left: 1px solid #888;
}

.tray-item {
    color: #008080;
}

.desk-indicator {
    background: #D8D8D8;
    padding: 2px 8px;
    border: 1px inset #aaa;
}

/* Footer Credit */
.footer-credit {
    position: fixed;
    bottom: 36px;
    right: 8px;
    font-size: 9px;
    color: rgba(255,255,255,0.5);
    z-index: 998;
}

/* Mobile Layout */
.sgi-mobile {
    min-height: 100vh;
    background: linear-gradient(180deg, #7B8FA1 0%, #5A6F82 100%);
    padding: 16px;
    padding-bottom: 60px;
}

.mobile-header {
    text-align: center;
    padding: 16px;
    margin-bottom: 16px;
}

.sgi-logo-small {
    font-size: 20px;
    font-weight: 600;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.mobile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.mobile-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
}

.mobile-icon .icon-3d {
    width: 48px;
    height: 48px;
}

.mobile-icon span {
    color: white;
    font-size: 11px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.mobile-demo {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.demo-section {
    background: #C0C0C0;
    border: 3px outset #ddd;
    padding: 8px;
}

.demo-section h3 {
    font-size: 12px;
    color: #333;
    padding: 4px 8px;
    background: linear-gradient(90deg, #5A6F82 0%, #7B8FA1 100%);
    color: white;
    margin: -8px -8px 8px -8px;
}

.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #C8C8C8 0%, #A0A0A0 100%);
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: #444;
    border-top: 2px solid #ddd;
}