/* {
    outline: 1px solid rgba(156, 13, 13, 0.5);
}*/

body {
    background: rgb(42 42 46);
    display: flex;
    justify-content: center;
    padding: 40px;
    font-family: Arial, sans-serif;
    color: #000;
    line-height: 0.99982;
}

body, body * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.materialbank {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 9999;
    background: #ff850a;
    border-radius: 0 0 8px 0;
    padding: 0;
    margin: 0;
    box-shadow: 0 4px 0 #CC4B00;
}

.bankbtn {
    display: block;
    color: white;
    padding: 8px 20px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: inherit;
}

.bankbtn:hover {
    background: #d86e05;
    color: #e6e6e6;
}

.toc-container {
    position: fixed;
    height: auto;
    max-height: 60%;
    width: 30%;
    max-width: 300px;
    left: 0;
    top: 17%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 9998;
}

.toc-container.open {
    transform: translateX(0);
}

.toc-button {
    position: absolute;
    top: 0;
    right: -36px;
    height: 30%;
    width: width: 36px;
    min-height: 150px;
    background: #ff850a;
    color: white;
    padding: 0 8px;
    border-style: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 1100;
    font-size: 18px;
    font-weight: bold;
    writing-mode: vertical-rl;
    box-shadow: 0 4px 0 #CC4B00;
}

.toc-button:hover {
    background: #d86e05;
    color: #e6e6e6;
}

.toc-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    border-style: solid;
    border-color: #ff850a;
    border-width: 3px 3px 3px 0;
    border-bottom-right-radius: 8px;
    background: #2E2E2E;
    padding: 2px 4px 2px 4px;
}

.toc-sidebar ul {
    padding: 0;
    margin: 3px 0;
    list-style-type: circle;
}

.toc-sidebar li {
    font-size: 18px;
    margin: 5px 0;
}

.toc-sidebar li:first-child {
    margin: 0;
}

.toc-sidebar li:last-child {
    margin: 0;
}

.toc-sidebar a {
    display: block;
    text-decoration: none;
    padding: 10px;
    color: #E3E3E3;
    border: solid 1px #ff850a;
    border-radius: 6px;
    background: #454545;
}

.toc-sidebar a:hover {
    background: #ff850a;
    color: white;
}

.chat-container {
    position: fixed;
    bottom: calc(24px + 45px); /* top of the button */
    left: 50%;
    transform: translateX(-50%) scaleY(0);  /* closed */
    transform-origin: bottom center;
    width: 80%;          /* fixed width */
    max-width: 1000px;
    height: 65%;         /* fixed height */
    max-height: 80%;       /* optional for small screens */
    background: #2E2E2E;
    border-radius: 25px 25px 0 0;
    transition: transform 0.25s ease;
    z-index: 9998;
    display: flex;
    flex-direction: column;
}

.chat-container.open {
    transform: translateX(-50%) scaleY(1);
}

.widget-active {
    z-index: 9998;
}

.pull-up-button {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;  /* safe zone */
    transition: border-radius 0.02s ease;
    width: 80%;
    max-width: 1000px;
    height: 45px;
    background: #ff850a;
    color: white;
    border-radius: 25px;
    z-index: 9999;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 0 #DB5202;
}

.pull-up-button.open {
    transition-delay: 0s;
    border-radius: 0 0 25px 25px;
}

.pull-up-button:not(.open) {
    transition: border-radius 0.10s ease 0.22s;
}

.pull-up-button:hover {
    background: #d86e05;
    color: #e6e6e6;
}

button.pull-up-button {
    border: none !important;
}

.chat-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    box-sizing: border-box;
    border-style: solid;
    border-color: #ff850a;
    border-width: 3px 3px 0 3px;
    border-radius: 25px 25px 0 0;
}

.messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 12px 6px 12px;
}

.message {
    margin-bottom: 10px;
    padding: 10px 16px;
    max-width: 75%;
    word-wrap: break-word;
    line-height: 1.4;
}

.user {
    background: #ff850a;
    color: white;
    align-self: flex-end;
    border-radius: 12px;
}

.bot {
    background: #f1f1f1;
    color: black;
    align-self: flex-start;
    border-radius: 12px;
}

.bot p {
    margin: 0 0 6px 0;
    line-height: 1.4;
    font-size: inherit;
}

.bot p:last-child {
    margin-bottom: 0;
}

.bot ul,
.bot ol {
    margin: 6px 0;
    padding-left: 18px;
}

.bot li {
    margin: 2px 0;
    font-size: inherit;
}

.bot h1,
.bot h2,
.bot h3 {
    margin: 6px 0;
    font-size: 1em;
    font-weight: 600;
}

.input-area {
    display: flex;
    padding: 6px;
    flex-shrink: 0;
}

.text-input {
    flex: 1;
    padding: 0 12px;
    background: #454545;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px 0 0 10px;
    border-style: solid;
    border-color: #ff850a;
    border-width: 2px 0 2px 2px;
    color: white;
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.text-input:focus {
    outline: none;
}

.send_button {
    display: flex;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    background: #ff850a;
    color: white;
    border: none;
    border-radius: 0 10px 10px 0;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.send_button:hover {
    background:#d86e05;
    color: #e6e6e6;
}

.send_icon {
    width: 100%;
    height: auto;
    pointer-events: none;
}

.pdf-like {
    width: 794px;
    padding: 40px 40px 40px 60px;
    background: #fff;
    box-sizing: border-box;
}

.right {
    text-align: right;
}

.center {
    text-align: center;
}

.bullet-list {
    list-style-type: disc;
    margin: 0 0 12px 40px;
    padding: 0;
}

.number-list {
    list-style-type: decimal;
    margin: 0 0 12px 40px;
    padding: 0;
}

.lower-alpha-list {
    list-style-type: lower-alpha;
    margin: 0 0 12px 40px;
    padding: 0;
}

.highlighted {
    background-color: #ff850a;
    color: white;
    transition: none;
    padding: 8px;
    border-radius: 6px;
}

li {
    margin-bottom: 6px;
    font-size: 14.72px;
}

h1, h2, h3 {
    margin-top: 20px;
    margin-bottom: 12px;
    transition: background-color 2s ease, color 2s ease, padding 2s ease, border-radius 2s ease;
}

h3 {
    font-weight: normal;
}

p {
    margin: 24px 12px;
    line-height: 14.7167px;
    font-size: 14.72px;
    text-align: left;
}

img {
    max-width: 100%;
    margin: 12px 0;
}

.header {
    display: flex;
    align-items: center;
    padding: 12px 24px;
}

.header .logo {
    height: 90px;
    width: auto;
    margin-right: 12px;
}

.header-info {
    margin-left: auto;
}

.header-info p {
    margin: 0 0 6px 0;
    text-align: right;
    font-size: 15px;
}

.kaava {
    display: block;
    margin: 2rem auto;
    max-width: 100%;
    height: auto;
}

.CC {
    position: relative;
    width: 100%;
    height: 70px;
    padding: 0;
    margin-top: 100px;

}

.gadolin-logo {
    height: 100%;
    display: block;
}

.CC-SVG {
    position: absolute;
    bottom: 0;
    right: 0;
    width: auto;
    height: 100%;
    display: block;
}

.CC-SVG img {
    height: 100%;
    max-height: 40px;
    width: auto;
    display: block;
}

.viewer-wrapper {
    display: flex;
    justify-content: center;
    margin: 60px 0;
}

#viewer {
    position: relative;
    width: 600px;          /* or 100% if responsive */
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border: 4px solid #ff850a;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#viewer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 8px;
}

#viewer-controls {
    position: absolute;
    z-index: 10;
}

#style-select {
    margin: 10px;
    border: 2px solid #ff850a;
    border-radius: 4px;
    font-weight: bold;
}

#style-select:focus {
    outline: none;
}

@media (max-width: 600px) {

    .chat-container {
        width: 90%;
        max-width: 1600px;
    }

    .pull-up-button {
        width: 90%;
        max-width: 1600px;
    }

    .CC {
        height: 60px;
    }

    .CC-SVG img {
        height: 100%;
    }

    .pull-up-button {
        padding: 6px 0;
        font-size: 15px;
    }

    .body {
        padding: 10px;
    }

    .pdf-like {
        width: 100%;
        max-width: 950px;
        padding: 20px;
    }

    .bullet-list {
        list-style-type: disc;
        margin: 0 0 6px 20px;
        padding: 0;
    }

    .number-list {
        list-style-type: decimal;
        margin: 0 0 6px 20px;
        padding: 0;
    }

    .highlighted {
        background-color: #ff850a;
        color: white;
        transition: none;
        padding: 8px;
        border-radius: 6px;
    }

    li {
        margin-bottom: 6px;
        font-size: 12px;
    }

    h1, h2, h3 {
        margin-top: 20px;
        margin-bottom: 12px;
        transition: background-color 2s ease, color 2s ease, padding 2s ease, border-radius 2s ease;
    }

    h1 {
        font-size: 22px;
        line-height: 1.2;
        margin-top: 16px;
        margin-bottom: 10px;
    }

    h3 {
        font-size: 14px;
    }

    p {
        margin: 12px 6px;
        line-height: 14.7167px;
        font-size: 12px;
        text-align: left;
    }

    img {
        max-width: 100%;
        margin: 12px 0;
    }

    .header {
        display: flex;
        align-items: center;
        padding: 6px 12px;
    }

    .header .logo {
        height: auto;
        max-height: 48px;
        width: auto;
        margin-right: 8px;
    }

    .header-info {
        margin-left: auto;
    }

    .header-info p {
        margin: 0 0 3px 0;
        text-align: right;
        font-size: 10px;
        line-height: 1.1;
    }


    .toc-container {
        width: 60%;
        top: 10%;
    }

    .messages {
        font-size: 16px;
        gap: 8px;
    }

    .message {
        padding: 12px 18px;
        max-width: 85%;
        line-height: 1.6;
    }

    .text-input {
        font-size: 16px;
        padding: 0 14px;
    }

    .text-input::placeholder {
        font-size: 16px;
    }

    .send_button {
        font-size: 18px;
    }
}
