body {
    margin: 0;
    overflow: hidden;
    background: #111;
}

:root {
    --thinking-cloud-fill: rgba(247, 248, 250, 0.96);
    --thinking-cloud-shadow: 0 18px 32px rgba(10, 12, 16, 0.16);
    --thinking-cloud-tail: rgba(241, 243, 246, 0.92);
    --thinking-cloud-outline: rgba(121, 129, 141, 0.14);
    --thinking-dot-color: #6e7683;
}

:root[data-thinking-theme='black'] {
    --thinking-cloud-fill: rgba(238, 241, 245, 0.94);
    --thinking-cloud-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
    --thinking-cloud-tail: rgba(230, 234, 239, 0.88);
    --thinking-cloud-outline: rgba(255, 255, 255, 0.08);
    --thinking-dot-color: #4b5563;
}

#botonera {
    position: absolute;
    top: 10px;
    left: 10px;
}

#botonera button {
    font-size: 16px;
    margin-right: 10px;
}

#loading {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    margin-left: -32px;
    margin-top: -32px;
    border: 6px solid rgba(255, 255, 255, 0.18);
    border-top-color: #ffffff;
    border-radius: 50%;
    background: transparent;
    animation: naro-spin 0.8s linear infinite;
    z-index: 20;
}

#model-placeholder {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 4;
    opacity: 1;
    transition: opacity 280ms ease;
}

#model-placeholder img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#model-placeholder.is-hidden {
    opacity: 0;
}

#model-swap-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.08), transparent 38%),
        rgba(8, 10, 14, 0.42);
    pointer-events: none;
    z-index: 12;
    opacity: 0;
    transition: opacity 180ms ease;
}

#model-swap-overlay.is-visible {
    opacity: 1;
}

@keyframes naro-spin {
    to {
        transform: rotate(360deg);
    }
}

#bottom-controls-overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: max(1.1rem, env(safe-area-inset-bottom));
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    padding: 0 1.4rem;
}

#bottom-controls-overlay.is-layer-open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#primary-voice-action {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding-right: 2.4rem;
    pointer-events: none;
}

#secondary-actions-slot {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

#panel {
    position: relative;
    display: inline-grid;
    justify-items: center;
    align-items: start;
    gap: 0.55rem;
    width: 15rem;
    grid-template-rows: 5.1rem 3.5rem;
    min-height: 0;
    padding: 0;
    pointer-events: auto;
    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

#panel:hover {
    transform: translateY(-1px);
}

#panel.is-disabled {
    opacity: 0.76;
}

#panel label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    margin: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    font-family:
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 0.91rem;
    font-weight: 600;
    line-height: 1.16;
    letter-spacing: 0.01em;
    color: rgba(247, 250, 255, 0.94);
    background: rgba(12, 16, 22, 0.72);
    padding: 0.74rem 0.92rem;
    border-radius: 1.1rem;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
    vertical-align: middle;
    height: 3.5rem;
    overflow: hidden;
    overflow-wrap: normal;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    text-align: center;
}

#panel label.help-label-compact {
    width: 100%;
    max-width: none;
    line-height: 1.1;
}

#panel label.help-label-long {
    display: -webkit-box;
    height: 3.5rem;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}

.mic-hit-target {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 180ms ease,
        opacity 180ms ease,
        box-shadow 180ms ease;
}

.mic-hit-target:hover {
    transform: scale(1.02);
}

.mic-hit-target:active {
    transform: scale(0.98);
}

.mic-hit-target:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(149, 218, 255, 0.92);
}

.mic-hit-target.is-disabled {
    cursor: not-allowed;
}

.mic-button {
    display: block;
    width: 5.1rem;
    vertical-align: middle;
    cursor: inherit;
}

#waiting {
    width: 126px;
    height: 92px;
    position: absolute;
    left: 50%;
    top: 10%;
    transform: translate(-50%, -100%);
    display: none;
    pointer-events: none;
    z-index: 18;
    transition: opacity 160ms ease-out;
}

.thinking-cloud {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    animation: thinking-cloud-float 2.8s ease-in-out infinite;
}

.thinking-cloud-shape {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    filter: drop-shadow(var(--thinking-cloud-shadow));
}

.thinking-cloud-shape::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--thinking-cloud-fill);
    border: 1px solid var(--thinking-cloud-outline);
    -webkit-mask: url('../img/cloud.svg') center / contain no-repeat;
    mask: url('../img/cloud.svg') center / contain no-repeat;
}

#waiting::before,
#waiting::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: var(--thinking-cloud-tail);
    border: 1px solid var(--thinking-cloud-outline);
    box-shadow: 0 10px 18px rgba(17, 24, 39, 0.08);
}

#waiting::before {
    width: 12px;
    height: 12px;
    left: 42px;
    bottom: 13px;
    animation: thinking-tail-pop 1.5s ease-in-out infinite;
}

#waiting::after {
    width: 7px;
    height: 7px;
    left: 31px;
    bottom: 4px;
    animation: thinking-tail-pop 1.5s ease-in-out infinite 0.18s;
}

.thinking-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--thinking-dot-color);
    opacity: 0.32;
    animation: thinking-dot-bounce 1.15s ease-in-out infinite;
    z-index: 1;
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes thinking-dot-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0) scale(0.92);
        opacity: 0.26;
    }

    40% {
        transform: translateY(-6px) scale(1);
        opacity: 1;
    }
}

@keyframes thinking-tail-pop {
    0%,
    100% {
        transform: scale(0.9);
        opacity: 0.84;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes thinking-cloud-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

#title {
    font-family: arial;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    position: absolute;
    top: calc(5% - 10px);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

@media (max-width: 768px) {
    #primary-voice-action {
        justify-content: center;
        padding-right: 0;
    }

    #bottom-controls-overlay {
        bottom: max(0.95rem, env(safe-area-inset-bottom));
        padding: 0 0.9rem;
    }

    #panel {
        align-items: start;
        gap: 0.5rem;
        width: min(calc(100vw - 1.8rem), 16rem);
        max-width: calc(100vw - 1.8rem);
        grid-template-rows: 4.7rem 3rem;
        min-height: 0;
        padding: 0;
        border-radius: 0;
    }

    #panel label {
        width: 100%;
        max-width: calc(100vw - 1.8rem);
        font-size: 0.84rem;
        line-height: 1.16;
        height: 3rem;
    }

    #panel label.help-label-compact {
        width: 100%;
        max-width: calc(100vw - 1.8rem);
        font-size: 0.84rem;
        line-height: 1.1;
    }

    #panel label.help-label-long,
    #panel label.help-label-compact.help-label-long {
        width: 100%;
        max-width: calc(100vw - 1.8rem);
        height: 3rem;
        line-height: 1.18;
    }

    .mic-hit-target {
        width: 4.7rem;
        height: 4.7rem;
        border-radius: 1.15rem;
    }

    .mic-button {
        width: 4.15rem;
        flex: 0 0 4.15rem;
    }

    #title {
        top: 1.2rem;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        font-size: 1.72rem;
        line-height: 1.05;
        width: calc(100vw - 2rem);
        max-width: none;
        white-space: nowrap;
    }

    #waiting {
        width: 110px;
        height: 80px;
        top: 11%;
    }
}

@media (max-width: 420px) {
    #bottom-controls-overlay {
        padding: 0 0.8rem;
    }

    #panel {
        gap: 0.42rem;
        width: min(calc(100vw - 1.4rem), 15rem);
        max-width: calc(100vw - 1.4rem);
        grid-template-rows: 4.2rem 2.8rem;
        min-height: 0;
        padding: 0;
    }

    #panel label {
        width: 100%;
        max-width: calc(100vw - 1.4rem);
        font-size: 0.78rem;
        height: 2.8rem;
    }

    #panel label.help-label-compact {
        width: 100%;
        max-width: calc(100vw - 1.4rem);
        font-size: 0.78rem;
    }

    #panel label.help-label-long,
    #panel label.help-label-compact.help-label-long {
        width: 100%;
        max-width: calc(100vw - 1.4rem);
        height: 2.8rem;
        line-height: 1.18;
    }

    .mic-hit-target {
        width: 4.2rem;
        height: 4.2rem;
        border-radius: 1rem;
    }

    .mic-button {
        width: 3.7rem;
        flex-basis: 3.7rem;
    }

    #title {
        font-size: 1.56rem;
    }
}

#naro-ui-root {
    position: relative;
    z-index: 40;
}

.naro-floating-actions {
    position: absolute;
    right: 1.8rem;
    top: 5rem;
    bottom: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 2;
    pointer-events: auto;
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 180ms ease;
}

.naro-floating-actions.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
}

.naro-floating-button,
.naro-icon-button,
.naro-pill-button,
.naro-choice-button,
.naro-disabled-select {
    font-family:
        "Segoe UI",
        Arial,
        sans-serif;
}

.naro-floating-button {
    width: 3.15rem;
    height: 3.15rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(34, 42, 55, 0.82), rgba(14, 18, 26, 0.86)),
        rgba(14, 18, 25, 0.84);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
    color: rgba(243, 246, 251, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease,
        background 180ms ease;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.naro-floating-button:hover,
.naro-icon-button:hover,
.naro-pill-button:hover {
    transform: translateY(-1px);
}

.naro-floating-button.is-active {
    border-color: rgba(135, 201, 255, 0.44);
    box-shadow: 0 14px 28px rgba(27, 83, 131, 0.28);
}

.naro-floating-button:focus-visible,
.naro-icon-button:focus-visible,
.naro-pill-button:focus-visible,
.naro-choice-button:focus-visible,
.naro-disabled-select:focus-visible {
    outline: 2px solid rgba(149, 218, 255, 0.92);
    outline-offset: 2px;
}

.naro-floating-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.naro-floating-icon.is-menu {
    flex-direction: column;
    gap: 0.32rem;
}

.naro-floating-line {
    width: 1.3rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.naro-floating-log-frame {
    width: 1.32rem;
    height: 1.12rem;
    border: 2px solid currentColor;
    border-radius: 0.35rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.28rem 0.32rem;
    padding: 0.2rem 0.24rem;
    box-sizing: border-box;
}

.naro-floating-log-dot {
    width: 0.22rem;
    height: 0.22rem;
    margin-top: 0.05rem;
    border-radius: 999px;
    background: currentColor;
}

.naro-floating-log-line {
    width: 100%;
    height: 2px;
    margin-top: 0.05rem;
    border-radius: 999px;
    background: currentColor;
}

.naro-settings-layer,
.naro-log-layer {
    position: fixed;
    inset: 0;
    z-index: 65;
    pointer-events: none;
}

.naro-settings-layer.is-open,
.naro-log-layer.is-open {
    pointer-events: auto;
}

.naro-layer-overlay {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(5, 9, 14, 0.56);
    opacity: 0;
    transition: opacity 220ms ease;
    cursor: pointer;
}

.naro-settings-layer.is-open .naro-layer-overlay,
.naro-log-layer.is-open .naro-layer-overlay {
    opacity: 1;
}

.naro-settings-panel,
.naro-log-dialog {
    position: absolute;
    color: #f4f7fb;
    background:
        linear-gradient(180deg, rgba(19, 26, 36, 0.96), rgba(10, 13, 19, 0.98)),
        rgba(8, 11, 16, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.42);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

.naro-settings-panel {
    top: 0;
    right: 0;
    width: min(28vw, 28rem);
    min-width: 21rem;
    max-width: calc(100vw - 1.5rem);
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 260ms ease;
}

.naro-settings-layer.is-open .naro-settings-panel {
    transform: translateX(0);
}

.naro-settings-header,
.naro-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.3rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.naro-settings-title,
.naro-log-title {
    margin: 0;
    font-family:
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.naro-settings-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1rem 1.3rem 1.25rem;
}

.naro-settings-section + .naro-settings-section {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.naro-settings-section-title {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f7fbff;
}

.naro-settings-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(221, 231, 243, 0.76);
}

.naro-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.naro-choice-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.naro-choice-button {
    min-height: 2.85rem;
    padding: 0.72rem 0.9rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(241, 245, 251, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    cursor: not-allowed;
    opacity: 0.72;
}

.naro-choice-button.is-active {
    border-color: rgba(123, 210, 255, 0.44);
    background: rgba(80, 163, 214, 0.14);
    opacity: 1;
}

.naro-choice-group-grid .naro-choice-button {
    width: 100%;
}

.naro-disabled-select {
    width: 100%;
    min-height: 2.95rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(241, 245, 251, 0.76);
    padding: 0.72rem 0.9rem;
    cursor: not-allowed;
    opacity: 0.8;
}

.naro-model-list {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem 0.8rem;
}

.naro-model-list dt {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(159, 178, 198, 0.8);
}

.naro-model-list dd {
    margin: 0;
    font-size: 0.84rem;
    color: rgba(242, 247, 253, 0.92);
    word-break: break-word;
}

.naro-settings-footer {
    padding: 1rem 1.3rem calc(1.35rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.naro-settings-version {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(214, 224, 237, 0.72);
}

.naro-icon-button,
.naro-pill-button {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f7fb;
    padding: 0.62rem 0.85rem;
    cursor: pointer;
}

.naro-log-dialog {
    inset: 1rem;
    display: flex;
    flex-direction: column;
    border-radius: 1.3rem;
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

.naro-log-layer.is-open .naro-log-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.naro-log-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.naro-log-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.3rem 1.3rem;
    background:
        linear-gradient(180deg, rgba(8, 10, 14, 0.14), transparent 16%),
        rgba(6, 8, 12, 0.5);
    display: flex;
    flex-direction: column;
}

.naro-log-body.is-empty {
    justify-content: center;
}

.naro-log-empty {
    color: rgba(208, 219, 232, 0.66);
    text-align: center;
    font-size: 0.92rem;
}

.naro-log-body:not(.is-empty) .naro-log-empty {
    display: none;
}

.naro-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.naro-log-body.is-empty .naro-log-list {
    display: none;
}

.naro-log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.naro-log-entry.is-info {
    border-color: rgba(109, 200, 255, 0.2);
}

.naro-log-entry.is-warn {
    border-color: rgba(255, 209, 102, 0.26);
}

.naro-log-entry.is-error {
    border-color: rgba(255, 130, 130, 0.28);
}

.naro-log-entry.is-debug {
    border-color: rgba(186, 156, 255, 0.2);
}

.naro-log-entry-meta {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 0 auto;
}

.naro-log-time {
    font-size: 0.75rem;
    color: rgba(189, 202, 219, 0.72);
}

.naro-log-level {
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.naro-log-level.is-log,
.naro-log-level.is-info {
    background: rgba(86, 173, 224, 0.16);
    color: #bfe7ff;
}

.naro-log-level.is-warn {
    background: rgba(255, 211, 110, 0.16);
    color: #ffe3a0;
}

.naro-log-level.is-error {
    background: rgba(255, 122, 122, 0.18);
    color: #ffb2b2;
}

.naro-log-level.is-debug {
    background: rgba(183, 154, 255, 0.16);
    color: #dfd1ff;
}

.naro-log-message {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
    min-width: 0;
    font-family:
        "Cascadia Mono",
        Consolas,
        monospace;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #f4f7fb;
}

@media (max-width: 768px) {
    #primary-voice-action {
        justify-content: center;
        padding-right: 0;
    }

    #bottom-controls-overlay {
        bottom: max(3.1rem, calc(env(safe-area-inset-bottom) + 1.95rem));
        padding: 0 1.1rem;
    }

    #panel {
        align-items: start;
        gap: 0.5rem;
        width: min(calc(100vw - 1.8rem), 16rem);
        max-width: calc(100vw - 1.8rem);
        grid-template-rows: 4.25rem 2.85rem;
    }

    #panel label {
        width: 100%;
        max-width: calc(100vw - 1.8rem);
        font-size: 0.84rem;
        line-height: 1.16;
        padding: 0.62rem 0.78rem;
        height: 2.85rem;
    }

    #panel label.help-label-compact {
        width: 100%;
        max-width: calc(100vw - 1.8rem);
    }

    #panel label.help-label-long,
    #panel label.help-label-compact.help-label-long {
        width: 100%;
        max-width: calc(100vw - 1.8rem);
        height: 2.85rem;
        line-height: 1.18;
    }

    .mic-hit-target {
        width: auto;
        height: auto;
        border-radius: 999px;
    }

    .mic-button {
        width: 4.25rem;
        flex: 0 0 auto;
    }

    .naro-floating-actions {
        top: 4.55rem;
        right: 1.35rem;
        bottom: auto;
    }

    .naro-floating-button {
        width: 2.95rem;
        height: 2.95rem;
        border-radius: 0.95rem;
    }

    .naro-settings-panel {
        width: 100vw;
        min-width: 0;
        max-width: none;
    }

    .naro-log-dialog {
        inset: 0;
        border-radius: 0;
    }

    .naro-settings-header,
    .naro-log-header {
        align-items: flex-start;
        padding: 1rem;
    }

    .naro-settings-content,
    .naro-log-body {
        padding: 0.95rem 1rem 1rem;
    }

    .naro-settings-footer {
        padding: 0.95rem 1rem calc(1rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    #bottom-controls-overlay {
        bottom: max(2.6rem, calc(env(safe-area-inset-bottom) + 1.6rem));
        padding: 0 0.85rem;
    }

    #panel {
        gap: 0.4rem;
        width: min(calc(100vw - 1.4rem), 15rem);
        max-width: calc(100vw - 1.4rem);
        grid-template-rows: 4.1rem 2.7rem;
    }

    #panel label {
        width: 100%;
        max-width: calc(100vw - 1.4rem);
        font-size: 0.78rem;
        padding: 0.58rem 0.72rem;
        height: 2.7rem;
    }

    #panel label.help-label-compact {
        width: 100%;
        max-width: calc(100vw - 1.4rem);
    }

    #panel label.help-label-long,
    #panel label.help-label-compact.help-label-long {
        width: 100%;
        max-width: calc(100vw - 1.4rem);
        height: 2.7rem;
        line-height: 1.18;
    }

    .mic-hit-target {
        width: auto;
        height: auto;
        border-radius: 999px;
    }

    .mic-button {
        width: 3.85rem;
        flex-basis: auto;
    }

    .naro-floating-actions {
        top: 4.3rem;
        right: 1.25rem;
    }

    .naro-choice-button {
        padding: 0.68rem 0.78rem;
    }

    .naro-log-entry {
        flex-direction: column;
        gap: 0.45rem;
    }

    .naro-icon-button,
    .naro-pill-button {
        padding: 0.56rem 0.72rem;
    }
}
