:root {
    --im-ink: #18233c;
    --im-muted: #616f87;
    --im-line: #e4e9f2;
    --im-accent: #4239c6;
    --im-accent-hover: #352bad;
    --im-accent-soft: #eeedff;

    color-scheme: light;
    font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    color: #172338;
    background: #f3f6fa;
}

body { margin: 0; }

.app-main {
    width: min(100% - 2rem, 48rem);
    margin: clamp(1.5rem, 6vw, 4rem) auto;
}

.home-heading h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(1.75rem, 5vw, 2.4rem);
    line-height: 1.15;
}

.connection-panel {
    padding: clamp(1rem, 4vw, 1.75rem);
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
}

.connection-heading,
.connection-list > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.connection-heading h2 {
    margin: 0;
    font-size: 1.125rem;
}

.connection-list { margin: 1rem 0 0; }

.connection-list > div {
    padding: .85rem 0;
    border-top: 1px solid #e6ebf2;
}

.connection-list dd {
    margin: 0;
    color: #465770;
}

.e-dialog.im-dialog {
    max-width: calc(100vw - 2rem);
    border: 1px solid #e0e5ef;
    border-radius: 1rem;
    box-shadow: 0 20px 65px #16214236;
    color: #18233c;
}
.e-dialog.im-dialog .e-dlg-header-content, .e-dialog.im-dialog .e-dlg-content {
    padding-inline: 1.25rem;
}
.e-dialog.im-dialog .e-dlg-header { font-size: 1.0625rem; font-weight: 700; }

:is(.workspace, .im-dialog) .e-btn.im-action {
    min-height: 2.125rem;
    padding: .3125rem .6875rem;
    border: 1px solid #dde3ee;
    border-radius: .5rem;
    background: #fff;
    color: #35425d;
    font-weight: 600;
    font-size: .8125rem;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: none;
}

:is(.workspace, .im-dialog) .e-btn.im-action:not(:disabled):hover { background: #f0f2f9; }
:is(.workspace, .im-dialog) .e-btn.im-action .e-btn-icon { font-size: .875rem; }
:is(.workspace, .im-dialog) .e-btn.im-accent { background: var(--im-accent-soft); border-color: transparent; color: var(--im-accent); }
:is(.workspace, .im-dialog) .e-btn.im-accent:not(:disabled):hover { background: #e2dfff; }
:is(.workspace, .im-dialog) .e-btn.im-quiet { background: transparent; border-color: transparent; }
:is(.workspace, .im-dialog) .e-btn.im-primary { background: var(--im-accent); border-color: transparent; color: #fff; }
:is(.workspace, .im-dialog) .e-btn.im-primary:not(:disabled):hover { background: var(--im-accent-hover); }
:is(.workspace, .im-dialog) .e-btn.im-primary:disabled { background: #e9e8f4; color: #68667f; opacity: 1; }
:is(.workspace, .im-dialog) .e-btn.im-danger { background: #fff5f5; border-color: #f2dce0; color: #a32c3e; }
:is(.workspace, .im-dialog) .e-btn.im-danger:not(:disabled):hover { background: #fce7eb; }

.e-btn.im-icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    flex: none;
}
:is(.workspace, .im-dialog) .e-btn.im-action.im-icon-button { padding: 0; }
.e-btn.im-icon-button .e-btn-icon { margin: 0; font-size: 1rem; }

.im-icon-picker .e-file-select-wrap .e-btn {
    width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    font-size: 0;
}
.im-icon-picker .e-file-select-wrap .e-btn::before {
    content: "\e940";
    font: 1rem/1 "e-icons";
}
.im-image-picker .e-file-select-wrap .e-btn::before { content: "\e786"; }

@media (max-width: 720px), (hover: none) and (pointer: coarse) {
    :where(body, .workspace, .e-message-wrapper, .im-account, .e-dialog,
           button, a[href], [role="button"], [role="tab"], input, textarea, select, [contenteditable]) {
        touch-action: manipulation;
    }

    /* The theme uses compact text sizes. Keep touch inputs large enough to avoid focus zoom. */
    :is(input:not([type]), input:is([type="text"], [type="password"], [type="search"],
        [type="email"], [type="tel"], [type="url"], [type="number"]), textarea, select,
        [contenteditable="true"][role="textbox"], .e-richtexteditor .e-content[contenteditable="true"]) {
        font-size: max(16px, 1rem) !important;
    }
}
