:root {
    font-family:
        Inter,
        Arial,
        sans-serif;

    color: #282828;
    background: #f3f3f3;

    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body,
#root {
    min-width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.easyconect-app {
    display: flex;
    flex-direction: column;

    min-height: 100vh;

    background:
        linear-gradient(
            180deg,
            #ffffff 0,
            #f5f5f5 18rem,
            #f3f3f3 100%
        );
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;

    min-height: 4.75rem;
    padding: 0.75rem clamp(1rem, 4vw, 3rem);

    border-bottom: 0.25rem solid #ffc800;

    background: #282828;
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;

    min-width: 0;
}

.brand-mark {
    width: 0.7rem;
    height: 2.4rem;

    flex: 0 0 auto;

    border-radius: 999px;

    background: #ffc800;
}

.brand-copy {
    min-width: 0;
}

.brand-title {
    margin: 0;

    font-size: 1.2rem;
    font-weight: 750;
    line-height: 1.1;
}

.brand-subtitle {
    display: block;

    margin-top: 0.2rem;

    color: rgba(255, 255, 255, 0.62);

    font-size: 0.72rem;
    font-weight: 600;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;

    flex: 0 0 auto;
}

.connection-dot,
.connection-dot-busy,
.connection-dot-connected,
.connection-dot-error {
    width: 0.58rem;
    height: 0.58rem;

    flex: 0 0 auto;

    border-radius: 50%;
}

.connection-dot {
    background: #9b9b9b;
}

.connection-dot-busy {
    border: 2px solid rgba(255, 255, 255, 0.32);
    border-top-color: #ffc800;

    background: transparent;

    animation:
        easyconect-connection-spin
        0.8s
        linear
        infinite;
}

.connection-dot-connected {
    background: #43a047;
}

.connection-dot-error {
    background: #d95c4f;
}

@keyframes easyconect-connection-spin {
    to {
        transform: rotate(360deg);
    }
}

.connection-label {
    font-size: 0.78rem;
    font-weight: 650;
}

.connection-button {
    min-height: 2.25rem;
    padding: 0 0.9rem;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.55rem;

    background: #ffc800;
    color: #282828;

    cursor: pointer;

    font-size: 0.76rem;
    font-weight: 750;

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        opacity 0.15s ease;
}

.connection-button:hover:not(:disabled) {
    background: #ffd230;
}

.connection-button:active:not(:disabled) {
    transform: translateY(1px);
}

.connection-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.connection-button:disabled {
    opacity: 0.55;

    cursor: default;
}

.app-main {
    width: min(100%, 72rem);
    margin: 0 auto;

    flex: 1;

    padding:
        clamp(2rem, 5vw, 4.5rem)
        clamp(1rem, 4vw, 3rem)
        3rem;
}

.android-guidance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;

    margin-bottom: 2rem;
    padding: 1rem 1.1rem;

    border: 1px solid rgba(255, 200, 0, 0.58);
    border-radius: 0.85rem;

    background: rgba(255, 200, 0, 0.11);

    box-shadow:
        0 0.15rem 0.45rem
        rgba(0, 0, 0, 0.035);
}

.android-guidance-copy {
    min-width: 0;
}

.android-guidance-title {
    display: block;

    color: #282828;

    font-size: 0.88rem;
    font-weight: 800;
}

.android-guidance-text {
    max-width: 48rem;
    margin: 0.35rem 0 0;

    color: rgba(40, 40, 40, 0.7);

    font-size: 0.78rem;
    line-height: 1.5;
}

.android-guidance-button {
    min-height: 2.15rem;
    padding: 0 0.85rem;

    flex: 0 0 auto;

    border: 1px solid rgba(40, 40, 40, 0.15);
    border-radius: 0.5rem;

    background: #ffffff;
    color: #282828;

    cursor: pointer;

    font-size: 0.74rem;
    font-weight: 750;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.android-guidance-button:hover {
    border-color: #ffc800;
    background: #fffaf0;
}

.android-guidance-button:focus-visible {
    outline: 2px solid #282828;
    outline-offset: 2px;
}

.hero {
    max-width: 43rem;
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.eyebrow {
    margin: 0 0 0.8rem;

    color: rgba(40, 40, 40, 0.58);

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.hero-title {
    max-width: 38rem;
    margin: 0;

    color: #282828;

    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

.hero-description {
    max-width: 35rem;
    margin: 1rem 0 0;

    color: rgba(40, 40, 40, 0.67);

    font-size: clamp(0.95rem, 2vw, 1.08rem);
    line-height: 1.55;
}

.modules {
    width: 100%;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1.25rem;
}

.section-title {
    margin: 0;

    font-size: 1.25rem;
    font-weight: 800;
}

.section-description {
    margin: 0.3rem 0 0;

    color: rgba(40, 40, 40, 0.6);

    font-size: 0.85rem;
}

.module-grid {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 1rem;
}

.module-card {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;

    min-width: 0;
    min-height: 10.5rem;
    padding: 1.25rem;

    overflow: hidden;

    border: 1px solid rgba(40, 40, 40, 0.1);
    border-radius: 1rem;

    background: #ffffff;
    color: #282828;

    text-align: left;

    box-shadow:
        0 0.15rem 0.45rem
        rgba(0, 0, 0, 0.045);
}

.module-card:not(:disabled) {
    cursor: pointer;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.module-card:not(:disabled):hover {
    transform: translateY(-2px);

    border-color: #ffc800;

    box-shadow:
        0 0.35rem 1rem
        rgba(0, 0, 0, 0.09);
}

.module-card:not(:disabled):focus-visible {
    outline: 2px solid #ffc800;
    outline-offset: 2px;
}

.module-card:disabled {
    opacity: 1;

    cursor: default;
}

.module-card-accent {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;

    width: 2rem;
    height: 0.32rem;

    border-radius: 999px;

    background: #ffc800;
}

.module-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;

    padding-top: 1.75rem;
}

.module-card-title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.module-card-description {
    max-width: 16rem;

    color: rgba(40, 40, 40, 0.62);

    font-size: 0.82rem;
    line-height: 1.45;
}

.module-card-state {
    margin-top: 1.25rem;

    color: rgba(40, 40, 40, 0.42);

    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.module-view {
    width: 100%;
}

.module-view-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;

    margin-bottom: 2.5rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    min-height: 2.4rem;
    padding: 0 0.8rem;

    flex: 0 0 auto;

    border: 1px solid rgba(40, 40, 40, 0.13);
    border-radius: 0.55rem;

    background: #ffffff;
    color: #282828;

    cursor: pointer;

    font-size: 0.78rem;
    font-weight: 700;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.back-button:hover {
    border-color: #ffc800;

    background: rgba(255, 200, 0, 0.08);
}

.back-button:focus-visible {
    outline: 2px solid #ffc800;
    outline-offset: 2px;
}

.back-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.module-view-heading {
    min-width: 0;
}

.module-view-heading .eyebrow {
    margin-bottom: 0.45rem;
}

.module-view-title {
    margin: 0;

    color: #282828;

    font-size: clamp(1.8rem, 4vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
}

.module-view-description {
    max-width: 36rem;
    margin: 0.65rem 0 0;

    color: rgba(40, 40, 40, 0.65);

    font-size: 0.92rem;
    line-height: 1.5;
}

.gamepad-workspace {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;

    min-height: 20rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);

    border: 1px solid rgba(40, 40, 40, 0.1);
    border-radius: 1rem;

    background: #ffffff;

    box-shadow:
        0 0.15rem 0.45rem
        rgba(0, 0, 0, 0.045);
}

.gamepad-unavailable {
    margin: 0;
    padding: 0.7rem 0.85rem;

    border: 1px solid rgba(255, 200, 0, 0.6);
    border-radius: 0.65rem;

    background: rgba(255, 200, 0, 0.12);
    color: #282828;

    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

.gamepad-layout {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    align-items: center;
    gap: clamp(1rem, 5vw, 3rem);

    width: 100%;
    max-width: 34rem;
    margin: 0 auto;
}

.gamepad-cluster {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            3.6rem
        );
    grid-template-rows:
        repeat(
            3,
            3.6rem
        );
    justify-content: center;
    gap: 0.3rem;
}

.gamepad-button {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    padding: 0.2rem;

    border: 2px solid #282828;
    border-radius: 0.75rem;

    background: #282828;
    color: #ffffff;

    box-shadow:
        0 0.16rem 0.3rem
        rgba(40, 40, 40, 0.2);

    cursor: pointer;
    touch-action: none;
    user-select: none;

    transition:
        background 80ms ease,
        color 80ms ease,
        box-shadow 80ms ease,
        transform 80ms ease;
}

.gamepad-button:not(:disabled):hover {
    box-shadow:
        0 0.25rem 0.55rem
        rgba(40, 40, 40, 0.28);
}

.gamepad-button:disabled {
    opacity: 0.28;

    cursor: not-allowed;
}

.gamepad-button-pressed {
    background: #ffc800;
    color: #282828;

    box-shadow:
        0 0.08rem 0.16rem
        rgba(40, 40, 40, 0.24);

    transform: translateY(0.08rem);
}

.gamepad-button-up {
    grid-column: 2;
    grid-row: 1;
}

.gamepad-button-left {
    grid-column: 1;
    grid-row: 2;
}

.gamepad-button-right {
    grid-column: 3;
    grid-row: 2;
}

.gamepad-button-down {
    grid-column: 2;
    grid-row: 3;
}

.gamepad-button-symbol {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
}

.controls-workspace {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;

    min-height: 20rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);

    border: 1px solid rgba(40, 40, 40, 0.1);
    border-radius: 1rem;

    background: #ffffff;

    box-shadow:
        0 0.15rem 0.45rem
        rgba(0, 0, 0, 0.045);
}

.controls-unavailable {
    margin: 0;
    padding: 0.7rem 0.85rem;

    border: 1px solid rgba(255, 200, 0, 0.6);
    border-radius: 0.65rem;

    background: rgba(255, 200, 0, 0.12);
    color: #282828;

    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

.controls-layout {
    display: grid;
    grid-template-columns:
        minmax(8.4rem, 1.2fr)
        minmax(6.8rem, 0.8fr)
        minmax(7.2rem, 0.8fr);
    align-items: stretch;
    gap: 0.75rem;

    width: 100%;
    max-width: 34rem;
    margin: 0 auto;
}

.controls-joystick,
.controls-slider-card,
.controls-actions {
    min-width: 0;
    min-height: 8.2rem;

    border: 1px solid rgba(40, 40, 40, 0.12);
    border-radius: 0.65rem;

    background: #ffffff;
}

.controls-joystick {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;

    padding: 0.65rem;

    color: #282828;

    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

.controls-joystick:disabled,
.controls-action-button:disabled,
.controls-switch:disabled {
    opacity: 0.38;

    cursor: not-allowed;
}

.controls-joystick-track {
    position: relative;

    display: block;

    width: 5.4rem;
    height: 5.4rem;

    overflow: hidden;

    border: 2px solid #282828;
    border-radius: 50%;

    background:
        radial-gradient(
            circle at center,
            rgba(255, 200, 0, 0.12) 0,
            rgba(255, 200, 0, 0.12) 31%,
            transparent 32%
        ),
        rgba(40, 40, 40, 0.035);
}

.controls-joystick-cross-horizontal,
.controls-joystick-cross-vertical {
    position: absolute;
    top: 50%;
    left: 50%;

    display: block;

    background: rgba(40, 40, 40, 0.13);

    transform: translate(-50%, -50%);
}

.controls-joystick-cross-horizontal {
    width: 100%;
    height: 1px;
}

.controls-joystick-cross-vertical {
    width: 1px;
    height: 100%;
}

.controls-joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;

    display: block;

    width: 1.7rem;
    height: 1.7rem;

    border: 2px solid #282828;
    border-radius: 50%;

    background: #ffc800;

    box-shadow:
        0 0.14rem 0.3rem
        rgba(40, 40, 40, 0.22);

    transform: translate(-50%, -50%);

    transition:
        transform
        45ms
        linear;
}

.controls-joystick-values {
    display: flex;
    gap: 0.7rem;

    font-size: 0.7rem;
    font-weight: 700;
}

.controls-slider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;

    padding: 0.75rem;
}

.controls-control-title {
    color: #282828;

    font-size: 0.78rem;
    font-weight: 700;
}

.controls-slider {
    width: 100%;

    accent-color: #ffc800;
}

.controls-slider:disabled {
    opacity: 0.4;

    cursor: not-allowed;
}

.controls-slider-value {
    min-width: 2.6rem;
    padding: 0.22rem 0.5rem;

    border-radius: 1rem;

    background: #282828;
    color: #ffffff;

    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

.controls-actions {
    display: grid;
    grid-template-rows:
        1fr
        1fr;
    gap: 0.55rem;

    padding: 0.65rem;
}

.controls-action-button,
.controls-switch {
    border: 1px solid #282828;
    border-radius: 0.55rem;

    background: #282828;
    color: #ffffff;

    font-size: 0.76rem;
    font-weight: 700;

    cursor: pointer;
    user-select: none;

    transition:
        background 80ms ease,
        color 80ms ease,
        transform 80ms ease;
}

.controls-action-button {
    touch-action: none;
}

.controls-action-button-active {
    background: #ffc800;
    color: #282828;

    transform: translateY(0.06rem);
}

.controls-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.controls-switch-track {
    position: relative;

    display: block;

    width: 2.45rem;
    height: 1.3rem;

    border-radius: 1rem;

    background: rgba(255, 255, 255, 0.25);

    transition:
        background
        100ms
        ease;
}

.controls-switch-track-on {
    background: #ffc800;
}

.controls-switch-knob {
    position: absolute;
    top: 50%;
    left: 0.16rem;

    display: block;

    width: 0.98rem;
    height: 0.98rem;

    border-radius: 50%;

    background: #ffffff;

    transform: translateY(-50%);

    transition:
        left 100ms ease,
        background 100ms ease;
}

.controls-switch-track-on .controls-switch-knob {
    left: 1.31rem;

    background: #282828;
}

.motors-servo-workspace {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;

    min-height: 20rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);

    border: 1px solid rgba(40, 40, 40, 0.1);
    border-radius: 1rem;

    background: #ffffff;

    box-shadow:
        0 0.15rem 0.45rem
        rgba(0, 0, 0, 0.045);
}

.motors-servo-unavailable {
    margin: 0;
    padding: 0.7rem 0.85rem;

    border: 1px solid rgba(255, 200, 0, 0.6);
    border-radius: 0.65rem;

    background: rgba(255, 200, 0, 0.12);
    color: #282828;

    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

.motors-servo-layout {
    display: grid;
    grid-template-columns:
        minmax(10rem, 0.85fr)
        minmax(18rem, 1.35fr);
    align-items: stretch;
    gap: 0.85rem;

    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
}

.motors-servo-group {
    min-width: 0;
    padding: 0.9rem;

    border: 1px solid rgba(40, 40, 40, 0.12);
    border-radius: 0.75rem;

    background: #ffffff;
}

.motors-servo-group-title {
    margin: 0 0 0.8rem;

    color: #282828;

    font-size: 0.85rem;
    font-weight: 800;
}

.motors-servo-motor-list {
    display: grid;
    gap: 0.85rem;
}

.motors-servo-servo-grid {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 0.85rem;
}

.motors-servo-control {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;

    min-width: 0;
}

.motors-servo-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.motors-servo-control-name {
    min-width: 0;

    color: #282828;

    font-size: 0.76rem;
    font-weight: 750;
}

.motors-servo-value {
    flex: 0 0 auto;

    min-width: 3rem;
    padding: 0.22rem 0.5rem;

    border-radius: 1rem;

    background: #282828;
    color: #ffffff;

    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.motors-servo-range {
    width: 100%;

    accent-color: #ffc800;
}

.motors-servo-range:disabled {
    opacity: 0.4;

    cursor: not-allowed;
}

.motors-servo-motor-presets {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 0.3rem;
}

.motors-servo-motor-preset {
    min-width: 0;
    padding: 0.35rem 0.2rem;

    border: 1px solid rgba(40, 40, 40, 0.18);
    border-radius: 0.42rem;

    background: #ffffff;
    color: rgba(40, 40, 40, 0.72);

    cursor: pointer;

    font-size: 0.63rem;
    font-weight: 700;
    line-height: 1;

    transition:
        border-color 80ms ease,
        background 80ms ease,
        color 80ms ease;
}

.motors-servo-motor-preset:not(:disabled):hover {
    border-color: rgba(40, 40, 40, 0.34);

    background: rgba(255, 200, 0, 0.12);
    color: #282828;
}

.motors-servo-motor-preset-active {
    border-color: #ffc800;

    background: #ffc800;
    color: #282828;
}

.motors-servo-motor-preset:disabled {
    opacity: 0.4;

    cursor: not-allowed;
}

.outputs-workspace {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;

    min-height: 20rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);

    border: 1px solid rgba(40, 40, 40, 0.1);
    border-radius: 1rem;

    background: #ffffff;

    box-shadow:
        0 0.15rem 0.45rem
        rgba(0, 0, 0, 0.045);
}

.outputs-unavailable {
    margin: 0;
    padding: 0.7rem 0.85rem;

    border: 1px solid rgba(255, 200, 0, 0.6);
    border-radius: 0.65rem;

    background: rgba(255, 200, 0, 0.12);
    color: #282828;

    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

.outputs-indicator-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.35rem;

    width: 100%;
    max-width: 30rem;
    min-height: 12rem;
    margin: 0 auto;
    padding: 1.5rem;

    border: 1px solid rgba(40, 40, 40, 0.12);
    border-radius: 0.85rem;

    background: #ffffff;
}

.outputs-indicator-light {
    width: 5rem;
    height: 5rem;

    flex: 0 0 5rem;

    border: 1px solid rgba(40, 40, 40, 0.14);
    border-radius: 50%;

    background: rgba(40, 40, 40, 0.1);

    box-shadow:
        inset 0 0.12rem 0.35rem
        rgba(40, 40, 40, 0.12);

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.outputs-indicator-light-on {
    border-color: rgba(40, 40, 40, 0.18);

    background: #ffc800;

    box-shadow:
        0 0 0 0.4rem
        rgba(255, 200, 0, 0.16),
        0 0.3rem 0.8rem
        rgba(40, 40, 40, 0.16);
}

.outputs-indicator-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;

    min-width: 0;
}

.outputs-indicator-title {
    color: #282828;

    font-size: 1rem;
    font-weight: 800;
}

.outputs-indicator-state {
    color: rgba(40, 40, 40, 0.68);

    font-size: 0.9rem;
    font-weight: 700;
}

.outputs-indicator-description {
    margin-top: 0.3rem;

    color: rgba(40, 40, 40, 0.5);

    font-size: 0.7rem;
    line-height: 1.4;
}

.terminal-workspace {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;

    min-height: 20rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);

    border: 1px solid rgba(40, 40, 40, 0.1);
    border-radius: 1rem;

    background: #ffffff;

    box-shadow:
        0 0.15rem 0.45rem
        rgba(0, 0, 0, 0.045);
}

.terminal-unavailable {
    margin: 0;
    padding: 0.7rem 0.85rem;

    border: 1px solid rgba(255, 200, 0, 0.6);
    border-radius: 0.65rem;

    background: rgba(255, 200, 0, 0.12);
    color: #282828;

    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
}

.terminal-panel {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 0.9rem;

    border: 1px solid rgba(40, 40, 40, 0.12);
    border-radius: 0.75rem;

    background: #ffffff;
}

.terminal-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 0.85rem;
}

.terminal-history-title {
    margin: 0;

    color: #282828;

    font-size: 0.85rem;
    font-weight: 800;
}

.terminal-history-description {
    margin: 0.2rem 0 0;

    color: rgba(40, 40, 40, 0.58);

    font-size: 0.7rem;
    line-height: 1.4;
}

.terminal-clear-button {
    flex: 0 0 auto;

    min-height: 2rem;
    padding: 0 0.7rem;

    border: 1px solid rgba(40, 40, 40, 0.18);
    border-radius: 0.45rem;

    background: #ffffff;
    color: #282828;

    cursor: pointer;

    font-size: 0.68rem;
    font-weight: 700;
}

.terminal-clear-button:not(:disabled):hover {
    border-color: #ffc800;

    background: rgba(255, 200, 0, 0.1);
}

.terminal-clear-button:disabled {
    opacity: 0.38;

    cursor: not-allowed;
}

.terminal-history {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;

    min-height: 14rem;
    max-height: 20rem;
    padding: 0.85rem;

    overflow-x: hidden;
    overflow-y: auto;

    border: 1px solid rgba(40, 40, 40, 0.1);
    border-radius: 0.6rem;

    background: rgba(40, 40, 40, 0.025);
}

.terminal-history-empty {
    margin: auto;

    color: rgba(40, 40, 40, 0.45);

    font-size: 0.76rem;
    text-align: center;
}

.terminal-history-entry {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;

    max-width: 85%;
}

.terminal-history-entry-incoming {
    align-self: flex-start;
}

.terminal-history-entry-outgoing {
    align-self: flex-end;
}

.terminal-history-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.terminal-history-entry-outgoing .terminal-history-meta {
    justify-content: flex-end;
}

.terminal-history-direction {
    color: rgba(40, 40, 40, 0.55);

    font-size: 0.62rem;
    font-weight: 700;
}

.terminal-history-type {
    padding: 0.12rem 0.35rem;

    border-radius: 1rem;

    background: rgba(40, 40, 40, 0.08);
    color: rgba(40, 40, 40, 0.68);

    font-size: 0.58rem;
    font-weight: 750;
    text-transform: uppercase;
}

.terminal-history-message {
    padding: 0.55rem 0.7rem;

    border-radius: 0.6rem;

    overflow-wrap: anywhere;

    font-size: 0.76rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.terminal-history-entry-incoming .terminal-history-message {
    background: #282828;
    color: #ffffff;
}

.terminal-history-entry-outgoing .terminal-history-message {
    background: #ffc800;
    color: #282828;
}

.terminal-composer {
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;
    gap: 0.55rem;

    margin-top: 0.85rem;
}

.terminal-type-selector {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    overflow: hidden;

    border: 1px solid rgba(40, 40, 40, 0.18);
    border-radius: 0.5rem;
}

.terminal-type-button {
    min-width: 4.2rem;
    padding: 0 0.55rem;

    border: 0;

    background: #ffffff;
    color: rgba(40, 40, 40, 0.65);

    cursor: pointer;

    font-size: 0.68rem;
    font-weight: 700;
}

.terminal-type-button + .terminal-type-button {
    border-left: 1px solid rgba(40, 40, 40, 0.12);
}

.terminal-type-button-active {
    background: #ffc800;
    color: #282828;
}

.terminal-type-button:disabled {
    opacity: 0.38;

    cursor: not-allowed;
}

.terminal-input {
    min-width: 0;
    min-height: 2.5rem;
    padding: 0 0.75rem;

    border: 1px solid rgba(40, 40, 40, 0.18);
    border-radius: 0.5rem;

    background: #ffffff;
    color: #282828;

    font: inherit;
    font-size: 0.76rem;
}

.terminal-input:focus {
    border-color: #ffc800;
    outline: 2px solid rgba(255, 200, 0, 0.18);
}

.terminal-input:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}

.terminal-send-button {
    min-height: 2.5rem;
    padding: 0 1rem;

    border: 1px solid #282828;
    border-radius: 0.5rem;

    background: #282828;
    color: #ffffff;

    cursor: pointer;

    font-size: 0.72rem;
    font-weight: 750;
}

.terminal-send-button:not(:disabled):hover {
    border-color: #ffc800;

    background: #ffc800;
    color: #282828;
}

.terminal-send-button:disabled {
    opacity: 0.38;

    cursor: not-allowed;
}

.terminal-error {
    grid-column:
        1 /
        -1;

    margin: 0;

    color: #9b2c2c;

    font-size: 0.68rem;
    line-height: 1.4;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    min-height: 3.5rem;
    padding: 1rem;

    color: rgba(40, 40, 40, 0.48);

    font-size: 0.7rem;
}

@media (max-width: 760px) {
    .app-header {
        align-items: flex-start;

        padding:
            0.8rem
            1rem;
    }

    .connection-label {
        display: none;
    }

    .module-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .controls-layout {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        max-width: 25rem;
    }

    .controls-actions {
        grid-column:
            1 /
            -1;

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
        grid-template-rows:
            1fr;

        min-height: 4.5rem;
    }

    .motors-servo-layout {
        grid-template-columns: 1fr;

        max-width: 30rem;
    }
}

@media (max-width: 520px) {
    .app-header {
        min-height: 4.4rem;
    }

    .module-view-header {
        flex-direction: column;

        gap: 1rem;

        margin-bottom: 1.5rem;
    }

    .gamepad-workspace {
        min-height: 17rem;
        padding: 1rem 0.65rem;
    }

    .controls-workspace {
        min-height: 17rem;
        padding: 1rem 0.65rem;
    }

    .motors-servo-workspace {
        min-height: 17rem;
        padding: 1rem 0.65rem;
    }

    .outputs-workspace {
        min-height: 17rem;
        padding: 1rem 0.65rem;
    }

    .outputs-indicator-card {
        gap: 1rem;

        min-height: 10rem;
        padding: 1rem;
    }

    .outputs-indicator-light {
        width: 4rem;
        height: 4rem;

        flex-basis: 4rem;
    }

    .motors-servo-layout {
        gap: 0.65rem;
    }

    .motors-servo-group {
        padding: 0.75rem;
    }

    .motors-servo-servo-grid {
        gap: 0.65rem;
    }

    .controls-layout {
        gap: 0.65rem;
    }

    .controls-joystick,
    .controls-slider-card {
        min-height: 8rem;
    }

    .gamepad-layout {
        gap: 0.75rem;
    }

    .gamepad-cluster {
        grid-template-columns:
            repeat(
                3,
                2.85rem
            );
        grid-template-rows:
            repeat(
                3,
                2.85rem
            );
        gap: 0.2rem;
    }

    .gamepad-button {
        border-radius: 0.65rem;
    }

    .gamepad-button-symbol {
        font-size: 1.2rem;
    }

    .android-guidance {
        align-items: stretch;

        flex-direction: column;

        gap: 0.85rem;

        margin-bottom: 1.5rem;
    }

    .android-guidance-button {
        align-self: flex-start;
    }

    .brand-mark {
        height: 2rem;
    }

    .brand-title {
        font-size: 1.05rem;
    }

    .connection-button {
        min-height: 2.1rem;
        padding: 0 0.7rem;
    }

    .app-main {
        padding:
            2.25rem
            1rem
            2rem;
    }

    .hero {
        margin-bottom: 2.5rem;
    }

    .hero-title {
        font-size: clamp(
            2rem,
            11vw,
            2.7rem
        );
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 8.8rem;
    }

    .app-footer {
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .terminal-composer {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .terminal-type-selector {
        grid-column:
            1 /
            -1;
    }
}

@media (max-width: 520px) {
    .terminal-workspace {
        min-height: 17rem;
        padding: 1rem 0.65rem;
    }

    .terminal-panel {
        padding: 0.75rem;
    }

    .terminal-history {
        min-height: 12rem;
        max-height: 17rem;
        padding: 0.7rem;
    }

    .terminal-history-entry {
        max-width: 95%;
    }

    .terminal-composer {
        grid-template-columns: 1fr;
    }

    .terminal-type-selector,
    .terminal-input,
    .terminal-send-button {
        grid-column:
            1 /
            -1;
    }

    .terminal-send-button {
        width: 100%;
    }
}
