.tmviz,
.tmviz * {
    box-sizing: border-box;
}

.tmviz {
    --tmviz-black: #111214;
    --tmviz-line: #dedede;
    --tmviz-soft: #f5f5f3;
    --tmviz-muted: #707070;
    width: min(1500px, calc(100% - 32px));
    margin: 32px auto 64px;
    color: var(--tmviz-black);
    background: #fff;
    border: 1px solid #d8d8d5;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .09);
    font-family: Inter, Helvetica Neue, Arial, sans-serif;
}

.tmviz button,
.tmviz input {
    font: inherit;
}

.tmviz button {
    color: inherit;
}

.tmviz__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    padding: 38px 42px 30px;
    border-bottom: 1px solid var(--tmviz-line);
}

.tmviz__eyebrow {
    margin: 0 0 9px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .22em;
}

.tmviz__header h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 56px);
    font-weight: 560;
    letter-spacing: -.045em;
    line-height: .98;
}

.tmviz__header p:last-child {
    margin: 15px 0 0;
    color: var(--tmviz-muted);
    font-size: 15px;
}

.tmviz__version {
    flex: none;
    padding: 7px 10px;
    color: #777;
    border: 1px solid var(--tmviz-line);
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: .08em;
}

.tmviz__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    min-height: 680px;
}

.tmviz__stage-panel {
    min-width: 0;
    padding: 24px;
    border-right: 1px solid var(--tmviz-line);
}

.tmviz__stage-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tmviz__file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

.tmviz__button,
.tmviz__download {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #cfcfcb;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.tmviz__button:hover:not(:disabled),
.tmviz__download:hover:not(:disabled) {
    transform: translateY(-1px);
}

.tmviz__button--primary,
.tmviz__download {
    color: #fff !important;
    background: var(--tmviz-black);
    border-color: var(--tmviz-black);
}

.tmviz__button--quiet {
    margin-left: auto;
    border-color: transparent;
    color: #777;
}

.tmviz__button:disabled,
.tmviz__download:disabled {
    opacity: .38;
    cursor: not-allowed;
}

.tmviz__canvas-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 540px;
    overflow: hidden;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #efefed 25%, transparent 25%),
        linear-gradient(-45deg, #efefed 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #efefed 75%),
        linear-gradient(-45deg, transparent 75%, #efefed 75%), #f6f6f4;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    background-size: 18px 18px;
    outline: 1px solid #e2e2df;
    outline-offset: -1px;
}

.tmviz__canvas-wrap.is-dragover {
    outline: 2px solid #111;
    outline-offset: -2px;
}

.tmviz__canvas {
    display: none;
    max-width: 100%;
    max-height: 72vh;
    width: auto;
    height: auto;
    cursor: crosshair;
    touch-action: none;
}

.tmviz__canvas.is-visible {
    display: block;
}

.tmviz__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: min(460px, calc(100% - 48px));
    min-height: 200px;
    padding: 32px;
    color: #171717;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #d7d7d3;
    border-radius: 14px;
    cursor: pointer;
}

.tmviz__placeholder[hidden] {
    display: none;
}

.tmviz__placeholder-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: #fff;
    background: #111;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 300;
}

.tmviz__placeholder strong {
    font-size: 17px;
}

.tmviz__placeholder small {
    color: var(--tmviz-muted);
    text-align: center;
}

.tmviz__status {
    min-height: 20px;
    margin: 13px 2px 0;
    color: #686868;
    font-size: 12px;
}

.tmviz__status.is-error {
    color: #a32929;
}

.tmviz__sidebar {
    padding: 28px 26px;
    background: #fbfbfa;
}

.tmviz__step {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid #e6e6e3;
    opacity: .48;
}

.tmviz__step--active {
    opacity: 1;
}

.tmviz__step > span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.tmviz__step strong,
.tmviz__step small {
    display: block;
}

.tmviz__step strong {
    font-size: 13px;
}

.tmviz__step small {
    margin-top: 3px;
    color: var(--tmviz-muted);
    font-size: 11px;
    line-height: 1.35;
}

.tmviz__sidebar h2 {
    margin: 28px 0 13px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.tmviz__materials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tmviz__material {
    display: grid;
    grid-template-columns: 45px 1fr;
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 6px;
    text-align: left;
    background: #fff;
    border: 1px solid #dfdfdc;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.tmviz__material:hover {
    border-color: #8f8f8c;
    transform: translateY(-1px);
}

.tmviz__material.is-active {
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

.tmviz__swatch {
    width: 45px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 5px;
    background-position: center;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}

.tmviz__material-copy,
.tmviz__material-copy strong,
.tmviz__material-copy small {
    display: block;
    min-width: 0;
}

.tmviz__material-copy strong {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.tmviz__material-copy small {
    margin-top: 3px;
    color: var(--tmviz-muted);
    font-size: 9px;
    letter-spacing: .08em;
}

.tmviz__settings {
    margin-top: 22px;
    padding: 17px;
    background: #fff;
    border: 1px solid #e0e0dd;
    border-radius: 10px;
}

.tmviz__settings > label:first-child {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 11px;
    font-weight: 750;
}

.tmviz__settings input[type="range"] {
    width: 100%;
    accent-color: #111;
    margin: 14px 0 13px;
}

.tmviz__check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 11px;
}

.tmviz__check input {
    accent-color: #111;
}

.tmviz__download {
    width: 100%;
    margin-top: 14px;
}

.tmviz__privacy {
    margin: 10px 0 0;
    color: #858585;
    text-align: center;
    font-size: 9px;
}

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

    .tmviz__stage-panel {
        border-right: 0;
        border-bottom: 1px solid var(--tmviz-line);
    }

    .tmviz__sidebar {
        padding: 26px 22px 34px;
    }

    .tmviz__materials {
        grid-template-columns: repeat(4, 1fr);
    }

    .tmviz__material {
        grid-template-columns: 1fr;
    }

    .tmviz__swatch {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .tmviz {
        width: calc(100% - 16px);
        margin: 12px auto 32px;
        border-radius: 14px;
    }

    .tmviz__header {
        padding: 26px 20px 22px;
    }

    .tmviz__version {
        display: none;
    }

    .tmviz__stage-panel {
        padding: 12px;
    }

    .tmviz__button {
        flex: 1 1 calc(50% - 8px);
        padding: 0 9px;
    }

    .tmviz__button--quiet {
        margin-left: 0;
    }

    .tmviz__canvas-wrap {
        min-height: 360px;
    }

    .tmviz__materials {
        grid-template-columns: 1fr 1fr;
    }
}

