body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    overflow: hidden;
    background: #e2e2e2;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

[contenteditable="true"],
input,
textarea {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.top-bar {
    height: 42px;
    background: #eeeeee;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 14px;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 20px;
    align-self: stretch;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.home-btn {
    cursor: pointer;
    color: #555;
    padding-top: 5px;
}

.tab-wrapper {
    display: flex;
    align-items: flex-end;
    align-self: stretch;
}

.tab {
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 8px 16px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.02);
    margin-bottom: -1px;
    z-index: 2;
}

.close-tab {
    margin-left: 8px;
    color: #999;
    cursor: pointer;
    font-size: 16px;
}

.create-btn {
    background: #f4f4f4;
    border: 1px solid #464646;
    color: #333333;
    padding: 4px 8px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 7px;
    margin-left: -15px;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sub-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;

}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    font-size: 15px;
    font-weight: 400;
    color: #444;
    cursor: pointer;
}

.sub-divider {
    width: 1px;
    height: 20px;
    background-color: #ddd;
}

.print-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.print-btn:hover {
    background-color: #f0f0f0;
}

.icon-btn {
    cursor: pointer;
    color: #555;
}

.share-btn {
    background: transparent;
    color: #666;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 550;
    font-family: 'Adobe Clean', 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    font-size: 18px;
}

.sub-bar {
    height: 36px;
    background: #fff;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.sub-tools {
    display: flex;
    gap: 24px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.main-content {
    display: flex;
    height: calc(100vh - 80px);
    position: relative;
}

.left-toolbar-floating {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 44px;
    background: #f7f7f7;
    border: 1px solid #d2d2d2;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    z-index: 10;
}

.drag-handle {
    width: 20px;
    height: 4px;
    background: #d0d0d0;
    border-radius: 2px;
    margin-bottom: 8px;
    cursor: grab;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    align-items: center;
}

.tool-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    color: #444;
    position: relative;
    transition: background 0.1s ease;
}

.tool-btn:hover {
    background: #f0f0f0;
}

.active-tool {
    background: #005ce6 !important;
    color: white !important;
}

.active-icon {
    color: white;
}

.tool-triangle {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 5px 5px;
    border-color: transparent transparent currentColor transparent;
}

.left-tool-divider {
    width: 24px;
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

.stealth-progress-inline {
    width: 36px;
    color: #888;
    font-size: 11px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 8px;
}

.document-viewer {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    background: #d6d6d6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 40px 20px;
    gap: 20px;
}

.pdf-page {
    width: 850px;
    min-height: 1350px;
    background: #FFFCDF;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 60px 80px;
    font-family: 'Century Schoolbook', Times, serif;
    margin: 0 auto;
}

.test-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    font-family: Arial, sans-serif;
    border-bottom: 6px solid #000;
}

.header-timer {
    font-size: 73px;
    font-weight: 500;
    color: #000000;
    background: #ffffff;
    letter-spacing: -1px;
    width: 210.5px;
    height: 210.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.header-photo {
    width: 130px;
    height: 180px;
    border: 10px solid #8B45B5;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
}

.header-photo div {
    font-size: 22px;
    color: #8c3b3b;
    font-weight: 500;
    line-height: 1.5;
}

.header-info {
    margin-left: 32px;
    display: grid;
    grid-template-columns: 100px max-content;
    font-size: 24px;
    line-height: 1.25;
}

.info-label {
    color: #555;
    padding: 0px 0;
    font-family: 'Arial Narrow', 'Helvetica Condensed', 'Roboto Condensed', sans-serif-condensed, sans-serif;
}

.info-val {
    color: #222;
    background: #ffffff;
    padding: 0px 55px 0px 8px;
}

.divider {
    display: none;
}

.question-block {
    margin-bottom: 40px;
    font-size: 18px;
    line-height: 1.6;
}

.question-title {
    font-weight: normal;
    margin-bottom: 16px;
}

.option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding-left: 20px;
}

.checkbox {
    font-size: 16px;
    min-width: 16px;
}

.checkbox-selected {
    font-weight: bold;
}

.marked-star {
    font-weight: bold;
    font-size: 14px;
}

.option-text {
    flex: 1;
}

.expected-tag {
    font-family: monospace;
}

.points {
    margin-top: 20px;
    font-size: 14px;
}

.right-toolbar {
    width: 50px;
    background: #fdfdfd;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
    gap: 16px;
}

.rt-tool {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    cursor: pointer;
    background: transparent;
}

.rt-tool:hover {
    background: #f0f0f0;
}

.rt-text {
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    font-weight: 500;
}

.rt-divider {
    width: 32px;
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1473E6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.checkbox-img {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 4px;
}

.editable-name,
.editable-srn {
    outline: none;
    cursor: text;
    caret-color: #000;
}