.tce {
    --tce-panel: rgba(18, 18, 19, 0.94);
    --tce-panel-2: #1c1c1f;
    --tce-panel-3: #26262a;
    --tce-line: rgba(120, 120, 124, 0.3);
    --tce-line-soft: rgba(120, 120, 124, 0.16);
    --tce-text: #dcdcdc;
    --tce-muted: #8f9599;
    --tce-accent: #d4a76a;
    --tce-red: #9a0712;

    max-width: none;
    padding-bottom: 40px;
}

.tce .arc-notice {
    margin-bottom: 14px;
}

.tce-label {
    display: block;
    margin: 0 0 6px;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--tce-muted);
}

.tce-hint {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--tce-line);
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--tce-muted);
}

.tce-fieldhint {
    display: block;
    margin-top: 5px;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--tce-muted);
}

.tce-empty {
    padding: 18px;
    font-size: 0.86rem;
    text-align: center;
    color: var(--tce-muted);
}

.tce-input,
.tce-select,
.tce-area {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: #121214;
    border: 1px solid var(--tce-line);
    border-radius: 0;
    color: var(--tce-text);
    font: 500 0.88rem 'Manrope', sans-serif;
}

.tce-input,
.tce-select {
    height: 38px;
}

.tce-area {
    min-height: 64px;
    line-height: 1.55;
    resize: vertical;
}

.tce-area.is-mono {
    font-family: 'Share Tech Mono', monospace;
}

.tce-input:focus,
.tce-select:focus,
.tce-area:focus {
    outline: none;
    border-color: var(--tce-accent);
}

.tce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--tce-line);
    color: var(--tce-text);
    font: 500 0.86rem 'Manrope', sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.tce-btn:hover:not(:disabled) {
    border-color: var(--tce-accent);
}

.tce-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.tce-btn--primary {
    background: #7d0817;
    border-color: var(--tce-red);
    color: #fff;
}

.tce-btn--primary:hover {
    background: #9a0712;
    border-color: #c22a35;
}

.tce-btn--accent {
    border-color: #7a5b32;
    color: var(--tce-accent);
}

.tce-btn--ghost {
    background: none;
}

.tce-btn--bad {
    border-color: rgba(201, 115, 95, 0.5);
    color: #e5a796;
}

.tce-wide {
    width: 100%;
}

.tce-seg {
    display: grid;
    grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
    gap: 2px;
    padding: 2px;
    background: #121214;
    border: 1px solid var(--tce-line);
}

.tce-seg__btn,
.tce-seg > .tce-btn {
    min-height: 32px;
    padding: 0 8px;
    background: none;
    border: 0;
    color: #a9adb1;
    font: 500 0.8rem 'Manrope', sans-serif;
    cursor: pointer;
}

.tce-seg__btn:hover,
.tce-seg > .tce-btn:hover {
    color: #fff;
}

.tce-seg__btn.is-on,
.tce-seg > .tce-btn.is-on {
    background: #2c2c31;
    color: #fff;
    box-shadow: inset 0 -2px 0 #c22a35;
}

.tce-top {
    position: sticky;
    top: 70px;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 10px 16px;
    background: var(--tce-panel);
    border: 1px solid var(--tce-line);
    backdrop-filter: blur(4px);
}

.tce-top__title {
    flex: 1 1 280px;
    min-width: 0;
}

.tce-top__input {
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    color: #fff;
    font: 800 1.25rem 'Manrope', sans-serif;
}

.tce-top__input:focus {
    outline: none;
}

.tce-top__input::placeholder {
    color: #6b7074;
}

.tce-top__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tce-muted);
}

.tce-count.is-bad {
    color: #e5a796;
}

.tce-top__modes {
    width: 240px;
}

.tce-top__transfer {
    display: flex;
    gap: 6px;
}

.tce-main {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 360px;
    align-items: start;
    border: 1px solid var(--tce-line);
    border-top: 0;
}

.tce-pal,
.tce-side {
    position: sticky;
    top: 140px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 150px);
    background: var(--tce-panel);
}

.tce-pal {
    border-right: 1px solid var(--tce-line);
}

.tce-side {
    gap: 14px;
    padding: 14px;
    overflow-y: auto;
    border-left: 1px solid var(--tce-line);
}

.tce-side__tabs {
    --n: 3;
    flex: none;
}

.tce-pal__head {
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--tce-line-soft);
}

.tce-pal__tip {
    margin: 7px 0 0;
    font-size: 0.76rem;
    color: var(--tce-muted);
}

.tce-pal__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 6px 12px;
}

.tce-pal__group {
    margin: 14px 8px 6px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tce-accent);
}

.tce-pal__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 7px 8px;
    background: none;
    border: 1px solid transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: grab;
}

.tce-pal__item:hover,
.tce-pal__item:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--tce-line);
    outline: none;
}

.tce-pal__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    background: var(--tce-panel-3);
    border: 1px solid var(--tce-line);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    color: var(--tce-accent);
}

.tce-pal__name {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
    color: #ececec;
}

.tce-pal__desc {
    display: block;
    font-size: 0.74rem;
    line-height: 1.35;
    color: var(--tce-muted);
}

.tce-pal__all {
    flex: none;
    margin: 0 14px 14px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tce-canvas {
    min-width: 0;
    padding: 34px clamp(16px, 3vw, 46px) 60px;
    background: rgba(0, 0, 0, 0.32);
}

.tce-canvas .tce-doc {
    max-width: var(--tl-stage, 1240px);
    margin: 0 auto;
    min-height: 420px;
}

.tce-canvas.tl-stage--narrow { --tl-stage: 860px; }
.tce-canvas.tl-stage--wide { --tl-stage: 1100px; }
.tce-canvas.tl-stage--full { --tl-stage: 1600px; }

.tce-b {
    position: relative;
    margin: 0;
    outline: 1px dashed transparent;
    outline-offset: 6px;
    cursor: pointer;
    transition: outline-color 0.15s;
}

.tce-b:hover {
    outline-color: rgba(140, 140, 146, 0.55);
}

.tce-b.is-sel {
    outline: 2px solid var(--tce-accent);
    cursor: default;
}

.tce-b.is-editing {
    clear: both;
}

.tce-b.is-dragging {
    opacity: 0.4;
}

.tce-b__view > .tl-block {
    margin-bottom: 0;
}

.tce-b__view .tl-img--left,
.tce-b__view .tl-img--right {
    margin-bottom: 0.6em;
}

.tce-b__tools {
    position: absolute;
    top: -34px;
    right: -6px;
    z-index: 4;
    display: none;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: #1b1b1e;
    border: 1px solid rgba(120, 120, 124, 0.5);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    font-family: 'Manrope', sans-serif;
    font-size: 0.78rem;
    line-height: 1;
    text-shadow: none;
}

.tce-b:hover > .tce-b__tools,
.tce-b.is-sel > .tce-b__tools {
    display: flex;
}

.tce-b__name {
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tce-accent);
}

.tce-b__tool,
.tce-b__drag {
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    background: none;
    border: 0;
    color: #cfcfcf;
    font: inherit;
    cursor: pointer;
}

.tce-b__drag {
    cursor: grab;
    letter-spacing: -0.2em;
}

.tce-b__tool:hover,
.tce-b__drag:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tce-b__del:hover {
    background: #7d0817;
    color: #fff;
}

.tce-gap {
    position: relative;
    height: 22px;
}

.tce-gap__btn {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: #1b1b1e;
    border: 1px solid rgba(212, 167, 106, 0.6);
    border-radius: 50%;
    color: var(--tce-accent);
    font: 700 0.9rem 'Manrope', sans-serif;
    line-height: 1;
    text-shadow: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: opacity 0.15s;
}

.tce-gap:hover .tce-gap__btn,
.tce-gap__btn:focus-visible {
    opacity: 1;
}

.tce-gap::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed transparent;
}

.tce-gap:hover::before {
    border-top-color: rgba(212, 167, 106, 0.4);
}

.tce-gap.is-target::before {
    border-top: 3px solid #c22a35;
}

.tce-addbig {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    background: none;
    border: 1px dashed currentColor;
    color: inherit;
    font: 600 0.9rem 'Manrope', sans-serif;
    opacity: 0.55;
    cursor: pointer;
    text-shadow: none;
}

.tce-addbig:hover {
    opacity: 0.9;
}

.tce-ph {
    padding: 14px 16px;
    border: 1px dashed currentColor;
    font: 500 0.86rem 'Manrope', sans-serif;
    opacity: 0.55;
    text-shadow: none;
}

.tce-notes:empty {
    display: none;
}

.tce-undo {
    position: sticky;
    bottom: 16px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: max-content;
    max-width: 100%;
    margin: 18px auto 0;
    padding: 8px 8px 8px 16px;
    background: #1b1b1e;
    border: 1px solid var(--tce-line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font: 500 0.86rem 'Manrope', sans-serif;
    color: var(--tce-text);
    text-shadow: none;
}

.tce-inline {
    position: relative;
}

.tce-inline__area,
.tce-inline__h {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: rgba(212, 167, 106, 0.06);
    border: 1px dashed rgba(212, 167, 106, 0.7);
    color: inherit;
    font: inherit;
    line-height: inherit;
}

.tce-inline__area {
    min-height: 140px;
    resize: none;
    overflow: hidden;
}

.tce-inline__h {
    margin: 0;
}

.tce-inline__area:focus,
.tce-inline__h:focus {
    outline: none;
    border-style: solid;
}

.tce-fmt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: #1b1b1e;
    border: 1px solid rgba(120, 120, 124, 0.5);
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    line-height: 1;
    color: #dcdcdc;
    text-shadow: none;
}

.tce-inline .tce-fmt {
    position: sticky;
    top: 138px;
    z-index: 5;
    margin-bottom: 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.tce-field .tce-fmt {
    margin-bottom: 4px;
    border-bottom: 0;
}

.tce-fmt__btn,
.tce-fmt__select {
    min-height: 28px;
    padding: 0 8px;
    background: none;
    border: 0;
    color: #dcdcdc;
    font: 600 0.78rem 'Manrope', sans-serif;
    white-space: nowrap;
    cursor: pointer;
}

.tce-fmt__select {
    max-width: 150px;
    background: #121214;
    border: 1px solid rgba(120, 120, 124, 0.35);
    font-weight: 500;
}

.tce-fmt__btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tce-fmt__b { font-weight: 800; }
.tce-fmt__i { font-style: italic; }
.tce-fmt__u { text-decoration: underline; }
.tce-fmt__s { text-decoration: line-through; }

.tce-fmt__sep {
    width: 1px;
    height: 18px;
    margin: 0 3px;
    background: rgba(120, 120, 124, 0.4);
}

.tce-fmt__colors {
    position: relative;
}

.tce-fmt__colors .tce-fmt__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tce-fmt__swatch {
    width: 12px;
    height: 12px;
    background: conic-gradient(#9a0712, #b8960c, #2d6b33, #23458f, #5b2d8f, #9a0712);
    border: 1px solid #fff;
}

.tce-fmt__pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, 26px);
    gap: 6px;
    padding: 8px;
    background: #1b1b1e;
    border: 1px solid rgba(120, 120, 124, 0.5);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

.tce-fmt__pop[hidden] {
    display: none;
}

.tce-fmt__sw {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.tce-fmt--compact .tce-fmt__select {
    max-width: 92px;
}

.tce-pane {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tce-pane[hidden] {
    display: none;
}

.tce-pane__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tce-line-soft);
}

.tce-pane__title {
    font-weight: 800;
    color: #fff;
}

.tce-pane__desc {
    font-size: 0.78rem;
    color: var(--tce-muted);
}

.tce-field {
    min-width: 0;
}

.tce-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    cursor: pointer;
}

.tce-check input {
    width: 18px;
    height: 18px;
    accent-color: #9a0712;
}

.tce-range {
    width: 100%;
    accent-color: var(--tce-accent);
}

.tce-imgfield {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tce-imgfield__thumb {
    display: grid;
    place-items: center;
    width: 82px;
    height: 58px;
    overflow: hidden;
    background: #121214 repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px);
    border: 1px solid var(--tce-line);
    font-size: 0.72rem;
    color: var(--tce-muted);
}

.tce-imgfield__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tce-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tce-list__item {
    background: var(--tce-panel-2);
    border: 1px solid var(--tce-line);
}

.tce-list__item > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    list-style: none;
    cursor: pointer;
}

.tce-list__item > summary::-webkit-details-marker {
    display: none;
}

.tce-list__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tce-list__actions {
    display: flex;
}

.tce-list__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid var(--tce-line-soft);
}

.tce-list__add {
    align-self: flex-start;
}

.tce-themes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tce-theme {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    background: var(--tce-panel-2);
    border: 1px solid var(--tce-line);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tce-theme:hover {
    border-color: rgba(212, 167, 106, 0.6);
}

.tce-theme.is-on {
    border-color: var(--tce-accent);
    box-shadow: 0 0 0 1px var(--tce-accent);
}

.tce-theme__sw {
    height: 42px;
    margin-bottom: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tce-theme__sw--foundation { background: #fff; border-top: 4px solid #901; }
.tce-theme__sw--document { background: #f1ede4; border-top: 4px solid #7d0817; }
.tce-theme__sw--night { background: #1b1b1d; border-top: 4px solid #9a0712; }
.tce-theme__sw--site { background: rgba(30, 30, 33, 0.9); border: 1px solid rgba(212, 167, 106, 0.5); }
.tce-theme__sw--terminal { background: #0b0f0b; border: 1px solid #2e5a32; }
.tce-theme__sw--diary { background: #f4efe1 repeating-linear-gradient(0deg, transparent 0 9px, rgba(60, 90, 150, 0.3) 9px 10px); }
.tce-theme__sw--letter { background: #fbfaf7; border-left: 6px double #cdbf9f; }

.tce-theme__name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #eee;
}

.tce-theme__desc {
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--tce-muted);
}

.tce-snapform {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.tce-snaps {
    margin-top: -6px;
    border: 1px solid var(--tce-line-soft);
}

.tce-danger {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--tce-line-soft);
}

.tce-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
}

.tce-modal__box {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    max-height: 88vh;
    background: #18181a;
    border: 1px solid rgba(120, 120, 124, 0.45);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    color: var(--tce-text, #dcdcdc);
    font-family: 'Manrope', sans-serif;
}

.tce-modal__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(120, 120, 124, 0.25);
}

.tce-modal__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.tce-modal__head .tce-input {
    flex: 1 1 240px;
    max-width: 460px;
    margin-left: auto;
}

.tce-modal__head .tce-seg {
    --n: 2;
    width: 260px;
}

.tce-cat__body {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: 0;
    flex: 1;
}

.tce-cat__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 8px;
    border-right: 1px solid rgba(120, 120, 124, 0.2);
    overflow-y: auto;
}

.tce-cat__group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    background: none;
    border: 0;
    color: #b9bcbf;
    font: 500 0.86rem 'Manrope', sans-serif;
    text-align: left;
    cursor: pointer;
}

.tce-cat__group b {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 0.74rem;
    color: #8f9599;
}

.tce-cat__group:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tce-cat__group.is-on {
    background: #2a2a2f;
    color: #fff;
    box-shadow: inset 3px 0 0 #c22a35;
}

.tce-cat__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    grid-auto-rows: min-content;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
}

.tce-cat__card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #1f1f23;
    border: 1px solid rgba(120, 120, 124, 0.3);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tce-cat__card:hover,
.tce-cat__card:focus-visible {
    border-color: #d4a76a;
    outline: none;
}

.tce-cat__prev {
    position: relative;
    height: 130px;
    overflow: hidden;
    border-bottom: 1px solid rgba(120, 120, 124, 0.2);
    pointer-events: none;
}

.tce-cat__page.tl {
    width: 200%;
    min-height: 200%;
    padding: 22px 26px;
    box-shadow: none;
    transform: scale(0.5);
    transform-origin: top left;
}

.tce-cat__name {
    padding: 10px 12px 2px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #f0f0f0;
}

.tce-cat__desc {
    padding: 0 12px 12px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #9a9fa3;
}

.tce-picker {
    width: min(920px, 100%);
}

.tce-picker.is-drop {
    border-color: #d4a76a;
    box-shadow: 0 0 0 3px rgba(212, 167, 106, 0.35);
}

.tce-picker__status {
    padding: 8px 18px;
    background: rgba(63, 126, 224, 0.15);
    font-size: 0.82rem;
}

.tce-picker__hint {
    padding: 9px 18px;
    border-top: 1px solid rgba(120, 120, 124, 0.2);
    font-size: 0.74rem;
    color: #8f9599;
}

.tce.is-preview .tce-pal,
.tce.is-preview .tce-side {
    display: none;
}

.tce.is-preview .tce-main {
    grid-template-columns: minmax(0, 1fr);
}

.tce.is-preview .tce-b {
    margin-bottom: 1.1em;
    cursor: default;
}

.tce.is-preview .tce-b:hover {
    outline-color: transparent;
}

@media (max-width: 1320px) {
    .tce-main {
        grid-template-columns: 230px minmax(0, 1fr) 320px;
    }
}

@media (max-width: 1080px) {
    .tce-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .tce-pal {
        display: none;
    }

    .tce-side {
        position: static;
        max-height: none;
        border-left: 0;
        border-top: 1px solid var(--tce-line);
    }

    .tce-top {
        top: 60px;
    }

    .tce-pal,
    .tce-inline .tce-fmt {
        top: 120px;
    }

    .tce-cat__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .tce-cat__nav {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(120, 120, 124, 0.2);
    }

    .tce-cat__group {
        flex: none;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .tce-top__modes {
        width: 100%;
    }

    .tce-top .tl-bar__sep {
        display: none;
    }

    .tce-canvas {
        padding: 22px 6px 40px;
    }

    .tce-b__tools {
        right: 0;
    }

    .tce-b__name {
        display: none;
    }

    .tce-modal {
        padding: 8px;
    }
}

.tce-link {
    width: min(560px, 100%);
}

.tce-link__close {
    margin-left: auto;
}

.tce-link__body {
    display: grid;
    gap: 14px;
    padding: 16px 18px;
    overflow-y: auto;
}

.tce-link__field .tce-input.is-bad {
    border-color: #c9735f;
}

.tce-link__styles .tce-seg__btn {
    font-size: 0.74rem;
}

.tce-link__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tce-link__color {
    width: 46px;
    height: 30px;
    padding: 2px;
    background: #121214;
    border: 1px solid var(--tce-line);
    cursor: pointer;
}

.tce-link__color:disabled {
    opacity: 0.35;
    cursor: default;
}

.tce-link__page {
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tce-link__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid rgba(120, 120, 124, 0.25);
}

.tce-link__foot .tce-btn:first-child {
    margin-right: auto;
}

.tce-link__foot .tce-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.tce-kids__add {
    margin-top: 6px;
}

.tce-kids__add .tce-select {
    width: 100%;
}

.tce-kid > summary .tce-list__title {
    font-weight: 600;
}
