.button {
    padding: 0.75rem 3rem;
    border-radius: 0.313rem;
    border: 0;
    Plex Sans;
    /* font-weight: 700; */
    font-size: 0.875rem;
    line-height: 1.625rem;
    text-transform: uppercase;
    transition: all .2s;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

button.button {
    line-height: 1.5rem;
}

.button.purple {
    background: var(--i2s-purple);
    color: var(--i2s-white) !important;
    border-radius: 30px;
}

.button.purple:hover {
    background: var(--i2s-grape);
}

.button.green {
    background: var(--i2s-green);
    color: var(--color-text);
}

.button.green:hover {
    background: var(--i2s-green-hover)      ;
}

.button.gray {
    color: var(--color-card-content);
    background: var(--color-cancel);
}

.button.gray:hover {
    background: #ECEEF0;
}

.button.red {
    background: var(--i2s-red);
    color: var(--color-text);
}

.button.red:hover {
    background: var(--i2s-red-hover);
}

.button.white {
    background: #FCFDFF;
    border: 1px solid #E1E3E6;
}

.button.white:hover {
    background: #F0F2F5;
}

.button-group {
    display: flex;
    align-items: center;
}

.summary-actions {
    display: none;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-actions .button {
    margin-left: 0;
}

.mobile-fab-shell {
    display: block;
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 1035;
}

.mobile-fab-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: end;
    justify-content: end;
    column-gap: 0.85rem;
}

.mobile-fab-add {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.mobile-fab-button {
    width: 3.9rem;
    height: 3.9rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--i2s-white);
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 18px 32px rgba(34, 45, 68, 0.2);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.mobile-fab-button .material-icons {
    font-size: 1.55rem;
}

.mobile-fab-button:hover,
.mobile-fab-button:focus {
    transform: translateY(-1px);
}

.mobile-voice-fab.voice-entry-trigger {
    padding: 0;
    background: linear-gradient(135deg, #1584ca 0%, #2f6dd4 100%);
    box-shadow: 0 18px 32px rgba(21, 132, 202, 0.24);
}

.mobile-voice-fab.voice-entry-trigger .material-icons {
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    font-size: 1.55rem;
}

.mobile-voice-fab.voice-entry-trigger.is-listening {
    box-shadow: 0 18px 36px rgba(166, 31, 97, 0.3);
}

.mobile-voice-fab.voice-entry-trigger.is-listening::before {
    display: none;
}

.mobile-voice-fab.voice-entry-trigger.is-listening .material-icons {
    background: transparent;
    box-shadow: none;
}

.mobile-fab-toggle {
    position: relative;
    background: linear-gradient(135deg, var(--i2s-purple) 0%, #8a2ea6 100%);
    box-shadow: 0 20px 36px rgba(85, 42, 132, 0.28);
}

.mobile-fab-toggle-icon {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-fab-toggle-icon-close {
    opacity: 0;
    transform: scale(0.7) rotate(-90deg);
}

.mobile-fab-shell.is-open .mobile-fab-toggle-icon-open {
    opacity: 0;
    transform: scale(0.7) rotate(90deg);
}

.mobile-fab-shell.is-open .mobile-fab-toggle-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.mobile-fab-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.9rem);
    display: grid;
    gap: 0.7rem;
    width: max-content;
    min-width: 13.75rem;
    opacity: 0;
    transform: translateY(0.65rem) scale(0.96);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.mobile-fab-shell.is-open .mobile-fab-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mobile-fab-action.button {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin: 0;
    text-transform: none;
    font-size: 0.92rem;
    box-shadow: 0 16px 28px rgba(34, 45, 68, 0.12);
}

.mobile-fab-action .material-icons {
    font-size: 1.2rem;
}

.mobile-fab-action-admin.button {
    background: linear-gradient(135deg, #2b3038 0%, #414752 100%);
    color: var(--i2s-white) !important;
    box-shadow: 0 14px 24px rgba(24, 30, 42, 0.2);
}

.mobile-fab-action-admin.button:hover,
.mobile-fab-action-admin.button:focus {
    background: linear-gradient(135deg, #161a21 0%, #2f3540 100%);
    box-shadow: 0 16px 28px rgba(17, 22, 32, 0.24);
}

.mobile-fab-status.voice-command-status {
    position: fixed;
    right: 1rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    width: min(25rem, calc(100vw - 2rem));
    z-index: 1034;
    margin: 0;
}

.mobile-fab-status.voice-command-status:not(:empty) {
    padding: 0.8rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 28px rgba(34, 45, 68, 0.12);
}

.mobile-fab-status.voice-command-status:empty {
    display: none;
}

main {
    padding-bottom: 6.25rem;
}

.voice-entry-trigger {
    position: relative;
    overflow: visible;
    gap: 0.65rem;
    padding-left: 1rem;
    padding-right: 1.35rem;
    background: linear-gradient(135deg, var(--i2s-purple) 0%, #7a2d8b 100%);
    box-shadow: 0 10px 24px rgba(85, 42, 132, 0.2);
}

.voice-entry-trigger .material-icons {
    margin-right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.voice-entry-trigger::after {
    content: '';
    position: absolute;
    inset: -0.3rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(221, 30, 96, 0.22) 0%, rgba(221, 30, 96, 0.08) 45%, rgba(221, 30, 96, 0) 72%);
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.voice-entry-trigger.is-listening {
    background: linear-gradient(135deg, #dd1e60 0%, #8a2ea6 100%);
    box-shadow: 0 16px 34px rgba(166, 31, 97, 0.28);
    transform: translateY(-1px);
}

.voice-entry-trigger.is-listening::before {
    content: 'A ouvir';
    position: absolute;
    top: -0.7rem;
    right: 0.95rem;
    padding: 0.16rem 0.48rem;
    border-radius: 999px;
    background: var(--i2s-white);
    color: var(--i2s-grape);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(166, 31, 97, 0.18);
}

.voice-entry-trigger.is-listening::after {
    opacity: 1;
    transform: scale(1);
    animation: voice-trigger-halo 1.8s ease-out infinite;
}

.voice-entry-trigger.is-listening .material-icons {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 0 0.35rem rgba(255, 255, 255, 0.1);
    animation: voice-mic-breathe 1.1s ease-in-out infinite;
}

.voice-command-status {
    display: block;
    flex-basis: 100%;
    min-height: 1.5rem;
    margin-top: -0.25rem;
    color: var(--color-card-content);
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease, padding 0.25s ease;
}

.voice-command-status.is-listening {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.9rem;
    margin-top: 0.15rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(166, 31, 97, 0.18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(253, 243, 248, 0.95) 0%, rgba(246, 240, 255, 0.95) 100%);
    box-shadow: 0 14px 30px rgba(85, 42, 132, 0.12);
    color: #7a245a;
}

.voice-command-status.is-listening::before {
    content: '';
    flex: 0 0 0.8rem;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    background: #dd1e60;
    box-shadow: 0 0 0 0 rgba(221, 30, 96, 0.32);
    animation: voice-live-dot 1.5s ease-out infinite;
}

.voice-command-status.is-listening::after {
    content: '';
    flex: 0 0 1rem;
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    background:
        linear-gradient(currentColor 0 0) left bottom/0.16rem 45% no-repeat,
        linear-gradient(currentColor 0 0) center bottom/0.16rem 100% no-repeat,
        linear-gradient(currentColor 0 0) right bottom/0.16rem 62% no-repeat;
    opacity: 0.7;
    animation: voice-equalizer 0.9s ease-in-out infinite alternate;
}

.voice-flow-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e8d6e4;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff8fb 0%, #f7f3ff 100%);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.voice-flow-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(221, 30, 96, 0) 0%, rgba(221, 30, 96, 0.1) 48%, rgba(138, 46, 166, 0.16) 60%, rgba(138, 46, 166, 0) 100%);
    opacity: 0;
    transform: translateX(-35%);
    pointer-events: none;
}

.voice-flow-panel.is-listening {
    border-color: rgba(166, 31, 97, 0.34);
    box-shadow: 0 18px 36px rgba(85, 42, 132, 0.14);
    transform: translateY(-1px);
}

.voice-flow-panel.is-listening::after {
    opacity: 1;
    animation: voice-panel-sweep 1.9s linear infinite;
}

.voice-flow-panel-title {
    color: var(--i2s-grape);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.voice-flow-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.voice-flow-panel-indicator {
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(221, 30, 96, 0.1);
    color: #dd1e60;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.voice-flow-panel-indicator .material-icons {
    font-size: 1rem;
}

.voice-flow-panel-question {
    color: #41414c;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.voice-flow-panel-meta {
    color: var(--color-card-content);
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
}

.voice-flow-panel-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.voice-flow-panel-replay {
    margin-top: 0.6rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--i2s-grape);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.voice-flow-panel-stop {
    margin-top: 0.6rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #7a245a;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.voice-flow-panel-replay:hover,
.voice-flow-panel-replay:focus {
    color: var(--i2s-purple);
    text-decoration: underline;
}

.voice-flow-panel-stop:hover,
.voice-flow-panel-stop:focus {
    color: #dd1e60;
    text-decoration: underline;
}

.voice-flow-panel.is-listening .voice-flow-panel-title {
    color: #dd1e60;
}

.voice-flow-panel.is-listening .voice-flow-panel-indicator {
    display: inline-flex;
    animation: voice-panel-indicator-pulse 1.2s ease-in-out infinite;
}

.voice-flow-panel.is-listening .voice-flow-panel-question {
    color: #7a245a;
}

.button+.button {
    margin-left: 1rem;
}

.actions .button {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
}

.actions .button+button {
    margin-left: 0.5rem;
}

@keyframes voice-trigger-halo {
    0% {
        opacity: 0.9;
        transform: scale(0.96);
    }

    70% {
        opacity: 0;
        transform: scale(1.08);
    }

    100% {
        opacity: 0;
        transform: scale(1.08);
    }
}

@keyframes voice-mic-breathe {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.08);
    }
}

@keyframes voice-live-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(221, 30, 96, 0.34);
    }

    75% {
        box-shadow: 0 0 0 0.55rem rgba(221, 30, 96, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(221, 30, 96, 0);
    }
}

@keyframes voice-equalizer {
    0% {
        transform: scaleY(0.72);
    }

    100% {
        transform: scaleY(1.06);
    }
}

@keyframes voice-panel-sweep {
    0% {
        transform: translateX(-45%);
    }

    100% {
        transform: translateX(45%);
    }
}

@keyframes voice-panel-indicator-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(221, 30, 96, 0.18);
    }

    70% {
        box-shadow: 0 0 0 0.4rem rgba(221, 30, 96, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(221, 30, 96, 0);
    }
}

@media (max-width: 991.98px) {
    .mobile-fab-status.voice-command-status {
        right: 1rem;
        left: 1rem;
        width: auto;
    }

    main {
        padding-bottom: 5.85rem;
    }

    .voice-command-status {
        order: 99;
    }
}

@media (max-width: 767.98px) {
    .mobile-fab-shell {
        right: 0.85rem;
        bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    }

    .mobile-fab-button {
        width: 3.6rem;
        height: 3.6rem;
    }

    .mobile-fab-menu {
        min-width: min(15rem, calc(100vw - 1.7rem));
    }

    .mobile-fab-status.voice-command-status {
        right: 0.85rem;
        left: 0.85rem;
        bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
        width: auto;
    }

    main {
        padding-bottom: 5.15rem;
    }
}
