html, body {
    height: 100%;
    min-height: 100%;
}

body {
    background: #14151e;
    margin: 0;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Malgun Gothic', '맑은 고딕', monospace;
    height: 100vh;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.layout-root {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.side-menu {
    width: 210px;
    background: #181926;
    border-right: 2px solid #23263a;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-width: 160px;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Malgun Gothic', '맑은 고딕', monospace;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,1.2,.4,1);
}

.side-menu.open {
    transform: translateX(0);
    box-shadow: 2px 0 16px 0 rgba(0,0,0,0.18);
}

.menu-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    margin-left: -8px;
    padding: 0;
    outline: none;
}

.menu-bar {
    display: block;
    width: 24px;
    height: 3px;
    background: #bfc6e0;
    margin: 3px 0;
    border-radius: 2px;
    transition: background 0.18s;
}

.menu-toggle-btn:hover .menu-bar {
    background: #4e73fa;
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    margin-left: 0;
    transition: margin-left 0.28s cubic-bezier(.4,1.2,.4,1);
}

.side-menu.open ~ .editor-area {
    margin-left: 210px;
}

.menu-title {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    padding: 28px 0 18px 32px;
    letter-spacing: 2px;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Malgun Gothic', '맑은 고딕', monospace;
}

.menu-list {
    list-style: none;
    padding: 0 0 0 18px;
    margin: 0;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Malgun Gothic', '맑은 고딕', monospace;
}

.menu-list li {
    color: #fff !important;
    transition: color 0.2s, background 0.2s;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
}

.menu-list li:hover {
    color: #fbbf24 !important;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    background: #161829;
    border-bottom: 2px solid #24273a;
    height: 44px;
    min-height: 44px;
    z-index: 2;
    gap: 0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
}

.editor-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    margin-left: 8px;
}

.filename-input {
    display: none !important;
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #121212;
    border-radius: 0 0 18px 18px;
    border-top: none;
}

.editor-linenum-wrap {
    display: flex;
    height: 100%;
    min-height: 0;
    background: #121212;
    border-radius: 0 0 18px 18px;
}

.editor-linenum {
    background: #181926;
    color: #6c738a;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
    font-size: 14px;
    text-align: right;
    padding: 28px 8px 28px 0;
    user-select: none;
    min-width: 36px;
    border-radius: 0 0 0 18px;
    line-height: 1.6;
    white-space: pre;
    height: 100%;
}

.editor-linenum .active-linenum {
    color: #fff;
    background: none;
}

.code-input {
    width: 100%;
    height: 100%;
    min-height: 0;
    resize: none;
    border: none;
    outline: none;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 28px 30px;
    background: #121212 !important;
    color: #f5f5fa;
    box-sizing: border-box;
    border-radius: 0 0 18px 0;
    flex: 1;
    margin-left: 0;
}

.editor-linenum-wrap:focus-within .editor-linenum {
    background: #23263a;
}

.lang-badge {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 2px;
    padding: 3px 12px;
    background: #1e2130;
    border-radius: 8px;
    border: 1.2px solid #393a55;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
    user-select: none;
    height: 26px;
    display: flex;
    align-items: center;
}

.editor-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.icon-btn {
    background: #1e2130;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: box-shadow 0.18s, transform 0.13s;
    position: relative;
    box-shadow: 0 2px 8px 0 rgba(40,80,255,0.14);
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    z-index: 20;
}

.icon-btn svg {
    display: block;
    margin: 0 auto;
    position: relative;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    background: #262a41;
    color: #fff;
    font-size: 14px;
    padding: 7px 18px;
    border-radius: 9px;
    position: absolute;
    left: 50%;
    top: 100%;
    bottom: auto;
    transform: translateX(-50%) translateY(8px);
    pointer-events: none;
    transition: opacity 0.18s;
    white-space: nowrap;
    font-family: 'Segoe UI', 'Fira Mono', monospace;
    z-index: 2147483647;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.icon-btn:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tab-bar {
    display: flex;
    align-items: flex-end;
    background: #181926;
    border-bottom: 1.5px solid #23263a;
    padding: 0 8px 0 16px;
    height: 32px;
    min-height: 32px;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    z-index: 10;
}

.tab-bar::after {
    content: '';
    flex: 1 1 auto;
    background: #181926;
    height: 100%;
    display: block;
}

.tab {
    display: flex;
    align-items: center;
    background: #121212;
    color: #bfc6e0;
    font-size: 13px;
    padding: 0 12px;
    height: 26px;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    cursor: pointer;
    border: 1.5px solid #23263a;
    border-bottom: none;
    outline: none;
    transition: background 0.15s, color 0.15s, border 0.15s;
    position: relative;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Malgun Gothic', '맑은 고딕', monospace;
    opacity: 0.7;
    z-index: 1;
}

.tab.active {
    background: #161829;
    color: #4e73fa;
    font-weight: bold;
    z-index: 2;
    opacity: 1;
    border: 2px solid #4e73fa;
    border-bottom: 2px solid #161829;
}

.tab .close-btn {
    margin-left: 10px;
    color: #bfc6e0;
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s;
}

.tab .close-btn:hover {
    color: #ef4444;
}

.tab-add-btn {
    background: #23263a;
    color: #bfc6e0;
    border: none;
    border-radius: 8px 8px 0 0;
    height: 26px;
    width: 28px;
    font-size: 18px;
    font-weight: bold;
    margin-left: 2px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
    top: 2px;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-add-btn:hover {
    background: #161829;
    color: #4e73fa;
}

.toyotech-logo {
    width: 44px;
    height: 44px;
    margin: 0;
    display: block;
}
.team-toyotech {
    color: #fff;
    font-size: 17px;
    font-weight: bold;
    text-align: left;
    margin: 0;
    letter-spacing: 1.5px;
    font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Malgun Gothic', '맑은 고딕', monospace;
    line-height: 1.2;
}
.logo-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    margin-bottom: 8px;
    margin-top: 18px;
    gap: 12px;
}
.logo-link:hover .team-toyotech {
    color: #4e73fa;
}

.settings-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(20,21,30,0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal-content {
    background: #181926;
    color: #fff;
    border-radius: 14px;
    padding: 32px 38px 24px 38px;
    min-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
}

.settings-modal-content h2 {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: bold;
    color: #4e73fa;
}

.settings-group {
    margin-bottom: 18px;
}

.settings-bg-options label {
    margin-right: 18px;
    font-size: 16px;
    cursor: pointer;
}

.settings-fontsize-options label {
    margin-right: 18px;
    font-size: 16px;
    cursor: pointer;
}

#settingsCloseBtn {
    background: #4e73fa;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 7px 22px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.15s;
}

#settingsCloseBtn:hover {
    background: #23263a;
}

body.bg-white {
    background: #fff !important;
}

body.bg-white .editor-area,
body.bg-white .editor-main,
body.bg-white .editor-linenum-wrap {
    background: #fff !important;
}

body.bg-white .code-input {
    background: #fff !important;
    color: #23263a;
}

body.bg-white .editor-linenum {
    background: #f3f4fa;
    color: #bfc6e0;
}

body.bg-purple {
    background: #2d1e4f !important;
}

body.bg-purple .editor-area,
body.bg-purple .editor-main,
body.bg-purple .editor-linenum-wrap {
    background: #2d1e4f !important;
}

body.bg-purple .code-input {
    background: #2d1e4f !important;
    color: #f5eaff;
}

body.bg-purple .editor-linenum {
    background: #3a2566;
    color: #bfaaff;
}

.tab-bar, .tab, .tab-add-btn {
    z-index: 10;
}

#fontsizeInput, #tabsizeInput {
    width: 60px;
    font-size: 15px;
    padding: 3px 7px;
    border-radius: 5px;
    border: 1px solid #393a55;
    background: #23263a;
    color: #fff;
    margin-right: 6px;
}

#fontsizeToggleBtn, #tabsizeToggleBtn {
    background: #393a55;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

#fontsizeToggleBtn:hover, #tabsizeToggleBtn:hover {
    background: #4e73fa;
}

.editor-area,
.editor-main,
.editor-linenum-wrap {
    background: #181926 !important;
}

.icon-btn#settingsToolbarBtn {
    margin-left: 8px;
}

#runMenu, #stopMenu, #saveMenu {
    cursor: pointer;
    padding: 8px 16px;
    font-size: 1rem;
    color: #fbbf24;
    background: none;
    border: none;
    outline: none;
    transition: background 0.2s, color 0.2s;
}

#runMenu:hover, #stopMenu:hover, #saveMenu:hover {
    background: #232635;
    color: #fff;
    border-radius: 6px;
}

::-webkit-scrollbar {
    width: 16px;
    background: #232323;
    border: none;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 0;
    border: none;
}

::-webkit-scrollbar-thumb:hover {
    background: #111;
}

::-webkit-scrollbar-track {
    background: #232323;
    border-radius: 0;
    border: none;
}

* {
    scrollbar-width: auto;
    scrollbar-color: #444 #232323;
}

.icon-btn#githubButton,
.icon-btn#settingsToolbarBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    border: none;
}
